Package-level declarations

Types

Functions

Link copied to clipboard

添加事件监听

Link copied to clipboard

用于构造简单的ViewModel的工厂

Link copied to clipboard
inline fun <T : Any> getKClassForGenericType(): KClass<T>

包装获取泛型类型

Link copied to clipboard
inline fun <VM : ViewModel> viewModel(noinline block: () -> VM, key: String? = null): VM

用于构造具有空构造函数的ViewModel,如果需要更加强大的构造方式可以使用其他第三方库,比如koin

inline fun <VM : ViewModel> viewModel(noinline block: (SavedStateHandle) -> VM, key: String? = null): VM

用于构造有且只有SavedStateHandle作为参数的构造函数的ViewModel

Link copied to clipboard
fun <T : ViewModel> viewModelImpl(modelClass: KClass<T>, emptyBlock: EmptyConstructor? = null, block: SSHConstructor? = null, key: String? = null): T

实际构造ViewModel的方法