This file contains 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
// declare view model | |
class MyViewModel(private val gson: Gson) : ViewModel() { | |
//... | |
} | |
// modify corresponding module | |
val viewModelsModule = module { | |
viewModel { MyViewModel(get()) } | |
} |
This file contains 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
// declare view model | |
class MyViewModelWithState( | |
private val handle: SavedStateHandle, //always first param btw | |
private val gson: Gson | |
) : ViewModel() { | |
// make use of state bundle as usual | |
} | |
// modify corresponding module | |
val viewModelsModule = module { |
This file contains 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
@Test | |
fun withCombineLatest() { | |
val testScheduler = TestScheduler() | |
val observable1 = Single.defer { | |
Single.just(1) | |
.delay(1, TimeUnit.SECONDS, testScheduler) | |
}.toObservable() | |
val observable2 = Single.defer { | |
Single.just(2) |
This file contains 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
1. ./adb shell pm list packages | |
2. ./adb shell pm path com.your.package | |
3. ./adb exec-out run-as com.your.package cat /data/data/com.your.package/shared_prefs/Login.xml |
This file contains 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
#!/bin/bash | |
# The greatest value Google Play allows for versionCode is 2100000000 and is not checked here for simplicity :) | |
RES=$(git show-ref --tags) | |
if [ -z "$RES" ]; then | |
NEW_TAG="1.0.0-1" | |
else | |
LATEST_TAG=$(git describe --tags --abbrev=0 --match *.*.*-*) | |
echo "Latest detected tag is $LATEST_TAG" |
OlderNewer