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
| @Singleton | |
| @Component(modules = [AssistedInjectionModule::class]) | |
| interface ApplicationComponent { | |
| fun mySavedStateViewModelFactory(): MySavedStateViewModel.Factory | |
| } |
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
| import kotlinx.coroutines.CoroutineScope | |
| import kotlinx.coroutines.ExperimentalCoroutinesApi | |
| import kotlinx.coroutines.flow.MutableStateFlow | |
| import kotlinx.coroutines.flow.collect | |
| import kotlinx.coroutines.flow.filterNotNull | |
| import kotlinx.coroutines.flow.launchIn | |
| import kotlinx.coroutines.flow.onEach | |
| @ExperimentalCoroutinesApi | |
| class FeedViewModel @AssistedInject constructor( |
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
| query stakerCheckpointData { | |
| stakerBalanceCheckpoints(where: {stakerId: "SOME_WALLET_ADDRESS"} orderBy: blockTime orderDirection: desc){ | |
| ethBalance | |
| rETHBalance | |
| totalETHRewards | |
| block | |
| blockTime | |
| } | |
| } |
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
| import com.squareup.inject.assisted.dagger2.AssistedModule | |
| import dagger.Module | |
| @AssistedModule | |
| @Module(includes = [AssistedInject_AssistedInjectModule::class]) | |
| class AssistedInjectModule |
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
| <!--File path: app > src > main > res > values--> | |
| <resources xmlns:tools="http://schemas.android.com/tools"> | |
| <!--Default screen margins, per the Android Design guidelines--> | |
| <dimen name="margin_tiniest">2dp</dimen> | |
| <dimen name="margin_tiny">4dp</dimen> | |
| <dimen name="margin_small">8dp</dimen> | |
| <dimen name="margin_medium">16dp</dimen> | |
| <dimen name="margin_large">24dp</dimen> |
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
| // Handle input length | |
| private void handleInputLength(){ | |
| editTextViewName.addTextChangedListener(new TextWatcher() { | |
| @Override | |
| public void beforeTextChanged(CharSequence s, int start, int count, int after) {} | |
| @Override | |
| public void onTextChanged(CharSequence s, int start, int before, int count) { | |
| if (s.length() > 6){animateMethod();} |
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
| /* | |
| * Copyright (C) 2017 The Android Open Source Project | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
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
| fun <T> Observable<T>.IOAndMainSchedulers() = | |
| this.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) | |
| fun <T> Observable<T>.IOAndIOSchedulers() = | |
| this.subscribeOn(Schedulers.io()).observeOn(Schedulers.io()) |
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
| // See sample: https://www.codexpedia.com/android/rxjava-2-zip-operator-example-in-android/ | |
| Observable.zip( | |
| Observable.just("A"), | |
| Observable.just("B"), | |
| // First observable output, Second observable output, Combined result | |
| BiFunction<String, String, String> { a, b -> | |
| println("Zip build: " + a + b) | |
| a + b | |
| } | |
| ).subscribe { it -> |
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
| // See sample: https://www.codexpedia.com/android/rxjava-2-zip-operator-example-in-android/ | |
| import io.reactivex.functions.Function3 | |
| fun someMethod(){ | |
| val function3: Function3<String, String, String, String> = Function3 { | |
| strings, strings2, strings3 -> | |
| strings + strings2 + strings3 | |
| } |
NewerOlder