Skip to content

Commit c161c00

Browse files
author
AnkitDroidGit
committed
added readme for modules
1 parent ceb657d commit c161c00

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+369
-173
lines changed

README.md

+26-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ If you are using RxAndroid also, then add the following
3030

3131
....... and so on
3232

33-
# Operators :
33+
# RxOperators :
34+
3435
* `map()` -> Transform the items emitted by an Observable by applying a function to each item
3536
* `zip()` -> Combine the emissions of multiple Observables together via a specified function and emit single items for each combination based on the results of this function
3637
* `take()` -> Emit only the first n items emitted by an Observable
@@ -97,6 +98,30 @@ Adding more operator examples
9798

9899
* Coming More
99100

101+
102+
103+
104+
105+
# RxBinding
106+
107+
Rx is powerful because we can compose transformations. What that means is that we can have reusable, safe and more functional code that simply plugs into your code.
108+
109+
As an example let’s say we’re making a login screen with an email and a password…
110+
111+
Consider the following rules that we want for our email addresses
112+
113+
- Length should be greater than 6
114+
- Should have a correct email pattern
115+
- Let the user know if any of the above fails
116+
- On each key stroke, verify
117+
118+
119+
## Highlights :
120+
* [RxLoginScreenActivity](https://github.com/AnkitDroidGit/RxKotlinOperators-Android/blob/master/RxBinding/src/main/java/com/freeankit/rxbinding/RxLoginScreenActivity.kt) - Login Screen using RxBinding
121+
122+
123+
124+
100125
### Contact - Let's connect to learn together
101126
- [Twitter](https://twitter.com/KumarAnkitRKE)
102127
- [Github](https://github.com/AnkitDroidGit)

RxBinding/README.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# RxBinding
2+
3+
Rx is powerful because we can compose transformations. What that means is that we can have reusable, safe and more functional code that simply plugs into your code.
4+
5+
As an example let’s say we’re making a login screen with an email and a password…
6+
7+
Consider the following rules that we want for our email addresses
8+
9+
- Length should be greater than 6
10+
- Should have a correct email pattern
11+
- Let the user know if any of the above fails
12+
- On each key stroke, verify
13+
14+
15+
## Highlights :
16+
* [RxLoginScreenActivity](https://github.com/AnkitDroidGit/RxKotlinOperators-Android/blob/master/RxBinding/src/main/java/com/freeankit/rxbinding/RxLoginScreenActivity.kt) - Login Screen using RxBinding
17+
18+
19+
20+
21+
### Contact - Let's connect to learn together
22+
- [Twitter](https://twitter.com/KumarAnkitRKE)
23+
- [Github](https://github.com/AnkitDroidGit)
24+
- [LinkedIn](https://www.linkedin.com/in/kumarankitkumar/)
25+
- [Facebook](https://www.facebook.com/freeankit)
26+
- [Slack](https://ankitdroid.slack.com)
27+
- [Stackoverflow](https://stackoverflow.com/users/3282461/android)
28+
- [Android App](https://play.google.com/store/apps/details?id=com.freeankit.ankitprofile)
29+
30+
31+
### License
32+
33+
Copyright 2017 Ankit Kumar
34+
35+
Licensed under the Apache License, Version 2.0 (the "License");
36+
you may not use this file except in compliance with the License.
37+
You may obtain a copy of the License at
38+
39+
http://www.apache.org/licenses/LICENSE-2.0
40+
41+
Unless required by applicable law or agreed to in writing, software
42+
distributed under the License is distributed on an "AS IS" BASIS,
43+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
44+
See the License for the specific language governing permissions and
45+
limitations under the License.

RxOperators/README.md

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# RxKotlinOperators
2+
3+
Learn RxKotlin with simple coding examples
4+
5+
6+
# Migration from RxKotlin 1.0 to RxKotlin 2.0
7+
8+
To allow having RxKotlin 1 and RxKotlin 2 side-by-side, RxKotlin 2 is under the maven coordinates io.reactivex.rxjava2:rxjava:2.x.y and classes are accessible below io.reactivex.
9+
Users switching from 1.x to 2.x have to re-organize their imports, but carefully.
10+
11+
## Using RxKotlin 2.0 Library in your application
12+
13+
Add this in your build.gradle
14+
15+
`compile 'io.reactivex.rxjava2:rxjava:2.1.1'`
16+
17+
If you are using RxAndroid also, then add the following
18+
19+
`compile 'io.reactivex.rxjava2:rxandroid:2.0.1'`
20+
21+
# Quick Look on few changes done in RxKotlin2 over RxKotlin1
22+
23+
### RxJava1/RxKotlin1 -> RxJava2/RxKotlin2
24+
25+
* `onCompleted` -> `onComplete` - without the trailing d
26+
* `Func1` -> `Function`
27+
* `Func2` -> `BiFunction`
28+
* `CompositeSubscription` -> `CompositeDisposable`
29+
* `limit` operator has been removed - Use `take` in RxKotlin2
30+
31+
....... and so on
32+
33+
# RxOperators :
34+
35+
* `map()` -> Transform the items emitted by an Observable by applying a function to each item
36+
* `zip()` -> Combine the emissions of multiple Observables together via a specified function and emit single items for each combination based on the results of this function
37+
* `take()` -> Emit only the first n items emitted by an Observable
38+
* `timer()` -> Create an Observable that emits a particular item after a given delay
39+
* `flatMap()` -> Transform the items emitted by an Observable into Observables, then flatten the emissions from those into a single Observable
40+
* `interval()` -> Create an Observable that emits a sequence of integers spaced by a given time interval
41+
* `debounce()` -> Only emit an item from an Observable if a particular time span has passed without it emitting another item
42+
* `Single Observer` -> A Single is something like an Observable, but instead of emitting a series of values — anywhere from none at all to an infinite number — it always either emits one value or an error notification.
43+
* `reduce()` -> Apply a function to each item emitted by an Observable, sequentially, and emit the final value
44+
* `buffer()` -> Periodically gather items emitted by an Observable into bundles and emit these bundles rather than emitting the items one at a time
45+
* `filter()` -> Emit only those items from an Observable that pass a predicate test
46+
* `skip()` -> Suppress the first n items emitted by an Observable
47+
* `scan()` -> Apply a function to each item emitted by an Observable, sequentially, and emit each successive value
48+
* `replay()` -> Ensure that all observers see the same sequence of emitted items, even if they subscribe after the Observable has begun emitting items
49+
* `concat()` -> Emit the emissions from two or more Observables without interleaving them
50+
* `merge()` -> Combine multiple Observables into one by merging their emissions
51+
* `defer()` -> The Defer operator waits until an observer subscribes to it, and then it generates an Observable, typically with an Observable factory function. It does this afresh for each subscriber, so although each subscriber may think it is subscribing to the same Observable, in fact each subscriber gets its own individual sequence.
52+
* `distinct()` -> Suppress duplicate items emitted by an Observable
53+
* `Replay Subject` -> Replays events (in a configurable bounded or unbounded manner) to current and late Observers.
54+
* `Publish Subject` -> Subject that, once an Observer has subscribed, emits all subsequently observed items to the subscriber
55+
* `Behaviour Subject` -> Subject that emits the most recent item it has observed and all subsequent observed items to each subscribed Observer.
56+
* `Aync Subject` -> A Subject that emits the very last value followed by a completion event or the received error to Observers.
57+
* `Throttle First` -> Emit the first items emitted by an Observable within periodic time intervals
58+
* `amb()` -> Given two or more source Observables, emits all of the items from the first of these Observables to emit an item
59+
* `Catch` -> Recover from an onError notification by continuing the sequence without error
60+
* `Retry` -> If a source Observable emits an error, resubscribe to it in the hopes that it will complete without error
61+
62+
* Coming More
63+
## TODO
64+
65+
Adding more operator examples
66+
67+
## Highlights :
68+
* [SimpleOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/SimpleOperatorActivity.kt) - Using `Simple` operator
69+
* [MapOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/transformingOperators/MapOperatorActivity.kt) - Using `Map` operator
70+
* [ZipOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/combiningOperators/ZipOperatorActivity.kt) - Using `Zip` observer
71+
* [DisposableOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/DisposableOperatorActivity.kt) - Using `Disposable` operator
72+
* [FlatMapOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/transformingOperators/FlatMapOperatorActivity.kt) - Using `FlatMap` Operator
73+
* [IntervalOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/creatingOperators/IntervalOperatorActivity.kt) - Using `Interval` Operator
74+
* [TakeOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/filteringOperators/TakeOperatorActivity.kt) - Using `Take` Operator
75+
* [TimerOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/TimerOperatorActivity.kt) - Using `Timer` Operator
76+
* [DebounceOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/filteringOperators/DebounceOperatorActivity.kt) - Using `Debounce` Operator
77+
* [SingleObserverOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/SingleObserverOperatorActivity.kt) - Using `Single Observer` Operator
78+
* [FlowableOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/FlowableOperatorActivity.kt) - Using `Flowable`
79+
* [ReduceOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/mathematicalOperators/ReduceOperatorActivity.kt) -Using `Reduce` Operator
80+
* [BufferOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/transformingOperators/BufferOperatorActivity.kt) -Using `Buffer` Operator
81+
* [FilterOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/filteringOperators/FilterOperatorActivity.kt) -Using `Filter` Operator
82+
* [SkipOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/filteringOperators/SkipOperatorActivity.kt) -Using `Skip` Operator
83+
* [ScanOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/transformingOperators/ScanOperatorActivity.kt) -Using `Scan` Operator
84+
* [ReplayOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/connectableOperators/ReplayOperatorActivity.kt) -Using `Replay` Operator
85+
* [ConcatOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/mathematicalOperators/ConcatOperatorActivity.kt) -Using `Concat` Operator
86+
* [MergeOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/combiningOperators/MergeOperatorActivity.kt) -Using `Merge` Operator
87+
* [DeferOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/creatingOperators/DeferOperatorActivity.kt) -Using `Defer` Operator
88+
* [DistinctOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/filteringOperators/DistinctOperatorActivity.kt) -Using `Distinct` Operator
89+
* [ReplaySubjectOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/connectableOperators/ReplaySubjectOperatorActivity.kt) -Using `Replay Subject` Operator
90+
* [PublishSubjectOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/connectableOperators/PublishSubjectOperatorActivity.kt) -Using `Publish Subject` Operator
91+
* [BehaviorSubjectActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/BehaviorSubjectActivity.kt) -Using `Behavior Subject` Operator
92+
* [AsyncSubjectOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/AsyncSubjectOperatorActivity.kt) -Using `Aync Subject` Operator
93+
* [ThrottleFirstOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/ThrottleFirstOperatorActivity.kt) -Using `Throttle First` Operator
94+
* [ThrottleLastOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/ThrottleLastOperatorActivity.kt) -Using `Throttle Last` Operator
95+
* [WindowOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/transformingOperatorsWindowOperatorActivity.kt) -Using `Window` Operator
96+
* [AmbOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/conditionalOperators/AmbOperatorActivity.kt) -Using `Amb` Operator
97+
* [DelayOperatorActivity](https://github.com/AnkitDroidGit/RxJava-RxKotlin-Android/blob/master/app/src/main/java/com/freeankit/rxjava2samples/ui/operators/utilityOperators/DelayOperatorActivity.kt) -Using `Delay` Operator
98+
99+
* Coming More
100+
101+
102+
### Contact - Let's connect to learn together
103+
- [Twitter](https://twitter.com/KumarAnkitRKE)
104+
- [Github](https://github.com/AnkitDroidGit)
105+
- [LinkedIn](https://www.linkedin.com/in/kumarankitkumar/)
106+
- [Facebook](https://www.facebook.com/freeankit)
107+
- [Slack](https://ankitdroid.slack.com)
108+
- [Stackoverflow](https://stackoverflow.com/users/3282461/android)
109+
- [Android App](https://play.google.com/store/apps/details?id=com.freeankit.ankitprofile)
110+
111+
112+
### License
113+
114+
Copyright 2017 Ankit Kumar
115+
116+
Licensed under the Apache License, Version 2.0 (the "License");
117+
you may not use this file except in compliance with the License.
118+
You may obtain a copy of the License at
119+
120+
http://www.apache.org/licenses/LICENSE-2.0
121+
122+
Unless required by applicable law or agreed to in writing, software
123+
distributed under the License is distributed on an "AS IS" BASIS,
124+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
125+
See the License for the specific language governing permissions and
126+
limitations under the License.

RxOperators/src/androidTest/java/com/freeankit/rxjava2samples/ExampleInstrumentedTest.kt renamed to RxOperators/src/androidTest/java/com/freeankit/rxkotlinoperators/ExampleInstrumentedTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.freeankit.rxjava2samples
1+
package com.freeankit.rxkotlinoperators
22

33
import android.support.test.InstrumentationRegistry
44
import android.support.test.runner.AndroidJUnit4

0 commit comments

Comments
 (0)