This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| android { | |
| compileSdkVersion 23 | |
| buildToolsVersion '23.0.2' | |
| defaultConfig { | |
| applicationId "testing" | |
| minSdkVersion getMinSdk() | |
| targetSdkVersion 23 | |
| versionCode 1 | |
| versionName "1.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| flavorDimensions ("version", "brand") | |
| productFlavors{ | |
| Devoper{ | |
| dimension "version" | |
| minSdkVersion 21 | |
| } | |
| UAT{ | |
| dimension "version" | |
| minSdkVersion 19 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| android { | |
| productFlavors { | |
| // Define separate dev and prod product flavors. | |
| dev { | |
| // dev utilizes minSDKVersion = 21 to allow the Android gradle plugin | |
| // to pre-dex each module and produce an APK that can be tested on | |
| // Android Lollipop without time consuming dex merging processes. | |
| minSdkVersion 21 | |
| } | |
| prod { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| observable.let { | |
| stream -> | |
| if(someState) | |
| stream | |
| else | |
| stream.filter { obj -> condition(obj) } | |
| } | |
| .debounce(3, TimeUnit.SECONDS) | |
| .let{ | |
| stream -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| getObservable() | |
| .filter { s -> someFilter(s) } | |
| .let{ | |
| observable -> | |
| when(exteriorState){ | |
| STATE_1 -> observable.debounce(3, TimeUnit.SECONDS); | |
| else -> observable.skip(3, TimeUnit.SECONDS) | |
| } | |
| } | |
| .subscribe{ v -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var obs = getObservable() | |
| .filter { s -> someFilter(s) }; | |
| when(exteriorState){ | |
| STATE_1 -> obs = obs.debounce(3, TimeUnit.SECONDS) | |
| else -> obs = obs.skip(3, TimeUnit.SECONDS) | |
| } | |
| obs.subscribe{ | |
| //do on sub things | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gitHubService.fetchUsers().enqueue(new Callback<List<GithubUser>>() { | |
| @Override | |
| public void onResponse(Response<List<GithubUser>> response) { | |
| for(GithubUser user : response.body()){ | |
| gitHubService.fetchDetails(user.getId()) | |
| .enqueue(new Callback<GithubUserDescription>() { | |
| @Override | |
| public void onResponse(Response<GithubUserDescription> response) { | |
| //do things | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| +--- com.android.support:appcompat-v7:23.1.1 | |
| | \--- com.android.support:support-v4:23.1.1 | |
| | \--- com.android.support:support-annotations:23.1.1 | |
| +--- com.android.support:design:23.1.1 | |
| | +--- com.android.support:appcompat-v7:23.1.1 (*) | |
| | +--- com.android.support:recyclerview-v7:23.1.1 | |
| | | +--- com.android.support:support-annotations:23.1.1 | |
| | | \--- com.android.support:support-v4:23.1.1 (*) | |
| | \--- com.android.support:support-v4:23.1.1 (*) | |
| +--- com.android.support:cardview-v7:23.1.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void meh(){ | |
| //something | |
| } | |
| void meh() | |
| { | |
| //something | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private void debounceWithRx(EditText text){ | |
| Observable<CharSequence> editTextStream = RxTextView.textChanges(text); | |
| editTextStream.debounce(500, TimeUnit.MILLISECONDS) | |
| .subscribe(input -> { | |
| //... network request, etc...// | |
| }); | |
| } | |
| Handler handler = new Handler(); | |
| Runnable runnable; |