mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Use crossfade push/pop handler only on android 14
This commit is contained in:
parent
7046baaef4
commit
64604905b3
1 changed files with 10 additions and 15 deletions
|
@ -806,22 +806,17 @@ fun Controller.requestFilePermissionsSafe(
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Controller.withFadeTransaction(): RouterTransaction {
|
fun Controller.withFadeTransaction(): RouterTransaction {
|
||||||
val isLowRam by lazy { activity?.getSystemService<ActivityManager>()?.isLowRamDevice == true }
|
val isLowRam = activity?.getSystemService<ActivityManager>()?.isLowRamDevice == true
|
||||||
|
val handler = {
|
||||||
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE || isLowRam) {
|
||||||
|
FadeChangeHandler(isLowRam)
|
||||||
|
} else {
|
||||||
|
CrossFadeChangeHandler(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
return RouterTransaction.with(this)
|
return RouterTransaction.with(this)
|
||||||
.pushChangeHandler(
|
.pushChangeHandler(handler())
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
|
.popChangeHandler(handler())
|
||||||
FadeChangeHandler()
|
|
||||||
} else {
|
|
||||||
CrossFadeChangeHandler(isLowRam)
|
|
||||||
},
|
|
||||||
)
|
|
||||||
.popChangeHandler(
|
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
|
|
||||||
FadeChangeHandler()
|
|
||||||
} else {
|
|
||||||
CrossFadeChangeHandler(isLowRam)
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Controller.withFadeInTransaction(): RouterTransaction {
|
fun Controller.withFadeInTransaction(): RouterTransaction {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue