No Issue - Always complete motionLayout transition on restore
parent
41e5d5cf28
commit
479c00bc5f
|
@ -186,7 +186,8 @@ class HomeFragment : Fragment(), CoroutineScope {
|
|||
override fun onViewStateRestored(savedInstanceState: Bundle?) {
|
||||
savedInstanceState?.apply {
|
||||
layoutManagerSate = getParcelable(KEY_LAYOUT_MANAGER_STATE)
|
||||
homeLayout.progress = getFloat(KEY_MOTION_LAYOUT_PROGRESS)
|
||||
val progress = getFloat(KEY_MOTION_LAYOUT_PROGRESS)
|
||||
homeLayout.progress = if (progress > MOTION_LAYOUT_PROGRESS_ROUND_POINT) 1.0f else 0f
|
||||
}
|
||||
|
||||
super.onViewStateRestored(savedInstanceState)
|
||||
|
@ -544,5 +545,6 @@ class HomeFragment : Fragment(), CoroutineScope {
|
|||
private const val toolbarPaddingDp = 12f
|
||||
private const val KEY_MOTION_LAYOUT_PROGRESS = "motionLayout.progress"
|
||||
private const val KEY_LAYOUT_MANAGER_STATE = "layoutManager.state"
|
||||
private const val MOTION_LAYOUT_PROGRESS_ROUND_POINT = 0.25f
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ package org.mozilla.fenix.onboarding
|
|||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import org.mozilla.fenix.BuildConfig
|
||||
|
||||
class FenixOnboarding(private val context: Context) {
|
||||
private val onboardingPrefs = context.applicationContext.getSharedPreferences(
|
||||
|
|
Loading…
Reference in New Issue