/** * Usage example: * * @Inject * lateinit var mFactory: VMInjectionFactory */ class VMInjectionFactory @Inject constructor(val vm: Lazy): ViewModelProvider.Factory { @Suppress("UNCHECKED_CAST") override fun create(p0: Class): T { return vm.get() as T } }