avd_name=my_avd
api_level=23
abi=x86_64
tag=google_apis
device="Nexus 5" # list of available devices see below
${ANDROID_HOME}/tools/bin/avdmanager --verbose create avd --name ${avd_name} \
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
KClass 157782037 class myapp.ui.model.MyAppiewModel (Kotlin reflection is not available) | |
Class 157782037 class myapp.ui.model.MyAppViewModel |
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
Log.d("CVM", "KClass ${MyAppViewModel::class.hashCode()} ${MyAppViewModel::class}") | |
Log.d("CVM", "Class ${MyAppViewModel::class.java.hashCode()} ${MyAppViewModel::class.java}") |
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
KClass class myapp.ui.model.MyAppViewModel (Kotlin reflection is not available) | |
Class class myapp.ui.model.MyAppViewModel |
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
Log.d("MyApp", "KClass ${MyAppViewModel::class}") | |
Log.d("MyAPp", "Class ${MyAppViewModel::class.java}") |
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
ViewModelProviders.of(myFragment, viewModelFactory)[MyAppViewModel::class.java] |
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
package myapp.di | |
import androidx.lifecycle.ViewModel | |
import dagger.Binds | |
import dagger.Module | |
import dagger.multibindings.IntoMap | |
import myapp.di.MyAppViewModel | |
import myapp.di.annotations.ViewModelKey | |
@Module |
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
package myapp.di.annotations | |
import androidx.lifecycle.ViewModel | |
import dagger.MapKey | |
import kotlin.reflect.KClass | |
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER) | |
@kotlin.annotation.Retention(AnnotationRetention.RUNTIME) | |
@MapKey | |
internal annotation class ViewModelKey(val value: KClass<out ViewModel>) |
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 2018 Herman Cheung | |
* | |
* 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
/* | |
* Find the AndroidManifest.xml at | |
* 1. Java resource, or | |
* 2. build/intermediates/manifests/[full or fast-start]/[build-type], | |
* which is generated by merging the AndroidManifest.xml files in | |
* src/main or source folder of other build variants. | |
*/ | |
@Runner(RobolectricTestRunner.class) | |
@Config(manifest="AndroidManifest.xml") |
NewerOlder