Package-level declarations

Functions

Link copied to clipboard
fun BaseFragment.acquireShareChatEntryViewModel(assumerId: String, chatTypes: List<Int>?, increaseCounter: Boolean = true): KChatEntryViewModel

优先获取共享VM,没有就新建

Link copied to clipboard
fun chatEntryViewModelRefCounter(shareViewModelKey: String): Int
Link copied to clipboard

KChatEntryViewModel 共享引用计数 -1

Link copied to clipboard

KChatEntryViewModel 共享引用计数 +1

Link copied to clipboard
fun getShareChatEntryViewModelKey(assumerId: String, chatTypes: List<Int>?): String
Link copied to clipboard
fun BaseFragment.newChatEntryViewModel(assumerId: String, chatTypes: List<Int>?): KChatEntryViewModel

注:同一个fragment连续调用newChatEntryViewModel创建KChatEntryViewModel,实际会获取到同一个实例, 因为第一次创建时已经记录在ViewModelStore了,所以,如果预期是在同一个Fragment创建多个KChatEntryViewModel实例, 需要单独建个类继承一下KChatEntryViewModel,类名不同,用于ViewModelStore匹配的Key也会不同,就不会匹配到相同对象了;

Link copied to clipboard
fun BaseFragment.releaseSharedChatEntryViewModel(assumerId: String, chatTypes: List<Int>?)

destroy时回收