Merge pull request #6 from TouchInstinct/thanks

roboswab winter update fix
This commit is contained in:
PilotOfSparrow 2019-01-09 12:28:57 +03:00 committed by GitHub
commit 4e7beb7731
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -98,14 +98,16 @@ class ViewControllerFragment<TActivity : FragmentActivity, TState : Parcelable>
private var viewController: ViewController<out TActivity, out TState>? = null
private var pendingActivityResult: ActivityResult? = null
private var appeared: Boolean = false
private val viewControllerClass: Class<ViewController<TActivity, TState>> = arguments?.getSerializable(VIEW_CONTROLLER_CLASS_EXTRA)
as? Class<ViewController<TActivity, TState>> ?: throw IllegalArgumentException("View controller class must be not-null")
private lateinit var viewControllerClass: Class<ViewController<TActivity, TState>>
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setHasOptionsMenu(true)
viewControllerClass = arguments?.getSerializable(VIEW_CONTROLLER_CLASS_EXTRA) as? Class<ViewController<TActivity, TState>>
?: throw IllegalArgumentException("View controller class must be not-null")
state = savedInstanceState?.getParcelable<TState>(VIEW_CONTROLLER_STATE_EXTRA)
?: arguments?.getParcelable(VIEW_CONTROLLER_STATE_EXTRA)
?: throw IllegalStateException("State is required and null")

View File

@ -165,7 +165,7 @@ open class ViewController<TActivity : FragmentActivity, TState : Parcelable>(
* Happens at [ViewControllerFragment.onActivityCreated].
*/
@CallSuper
fun onCreate() {
open fun onCreate() {
LcGroup.UI_LIFECYCLE.i(Lc.getCodePoint(this))
lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_CREATE)
}
@ -226,7 +226,7 @@ open class ViewController<TActivity : FragmentActivity, TState : Parcelable>(
* Called when fragment is moved in started state and it's [.getFragment] sets to true.
* Usually it is indicating that user can't see fragment on screen and useful to track analytics events.
*/
fun onAppear() {
open fun onAppear() {
LcGroup.UI_LIFECYCLE.i(Lc.getCodePoint(this))
}
@ -245,14 +245,14 @@ open class ViewController<TActivity : FragmentActivity, TState : Parcelable>(
* Happens at [ViewControllerFragment.onLowMemory].
*/
@CallSuper
fun onLowMemory() = Unit
open fun onLowMemory() = Unit
/**
* Calls when [ViewController] have paused.
* Happens at [ViewControllerFragment.onPause].
*/
@CallSuper
fun onPause() {
open fun onPause() {
LcGroup.UI_LIFECYCLE.i(Lc.getCodePoint(this))
lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_PAUSE)
}