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" |
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
/** | |
* Quick and hacky way, tested under SDK19 and newer. | |
* How to use (key: in conjunction with CircleCrop): | |
* <code>transform(new CircleCrop(), new CircleShadowTransformation())</code> | |
*/ | |
public class CircleShadowTransformation extends BitmapTransformation { | |
private static final int SHADOW_RADIUS = 10; | |
private static final String ID = "a.b.c.transformations.CircleShadowTransformation"; | |
private static final byte[] ID_BYTES = ID.getBytes(Charset.forName(STRING_CHARSET_NAME)); |
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
@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
// 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
// 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
val appModule = module { | |
single<Gson> { GsonBuilder().setPrettyPrinting().create() } | |
} |
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
//typically in a separate file | |
val appModule = module { } | |
//in a separate file as well | |
val viewModelsModule = module { } | |
//called in onCreate of your application class | |
startKoin { | |
androidLogger() | |
androidContext(applicationContext) |
NewerOlder