mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-19 08:09:12 +01:00
Add rendering and handling for various disabled input states in CFv2.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
package org.thoughtcrime.securesms.util
|
||||
|
||||
import androidx.annotation.MainThread
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
|
||||
@@ -23,3 +26,12 @@ class ViewModelFactory<MODEL : ViewModel>(private val create: () -> MODEL) : Vie
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@MainThread
|
||||
inline fun <reified VM : ViewModel> Fragment.viewModel(
|
||||
noinline create: () -> VM
|
||||
): Lazy<VM> {
|
||||
return viewModels(
|
||||
factoryProducer = ViewModelFactory.factoryProducer(create)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user