Fix element doesn't follow transition
This commit is contained in:
parent
489e2e4d5c
commit
773dbacf45
1 changed files with 9 additions and 0 deletions
|
|
@ -1,7 +1,9 @@
|
|||
package cn.super12138.todo.views.welcome.pages
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.google.android.material.color.MaterialColors
|
||||
import com.google.android.material.transition.MaterialSharedAxis
|
||||
|
||||
open class BasePage : Fragment() {
|
||||
|
|
@ -12,4 +14,11 @@ open class BasePage : Fragment() {
|
|||
exitTransition = MaterialSharedAxis(MaterialSharedAxis.X, /* forward= */ true)
|
||||
reenterTransition = MaterialSharedAxis(MaterialSharedAxis.X, /* forward= */ false)
|
||||
}
|
||||
|
||||
// https://github.com/material-components/material-components-android/issues/1984#issuecomment-1089710991
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
// Overlap colors.
|
||||
view.setBackgroundColor(MaterialColors.getColor(view, android.R.attr.colorBackground))
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue