mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
maybe fix small glitch when back is progressing
This commit is contained in:
parent
3128bea6bc
commit
51fcfc70e6
2 changed files with 2 additions and 1 deletions
|
@ -555,6 +555,7 @@ open class MainActivity : BaseActivity<MainActivityBinding>() {
|
||||||
container: ViewGroup,
|
container: ViewGroup,
|
||||||
handler: ControllerChangeHandler,
|
handler: ControllerChangeHandler,
|
||||||
) {
|
) {
|
||||||
|
to?.view?.x = 0f
|
||||||
nav.translationY = 0f
|
nav.translationY = 0f
|
||||||
showDLQueueTutorial()
|
showDLQueueTutorial()
|
||||||
if (!(from is DialogController || to is DialogController) && from != null) {
|
if (!(from is DialogController || to is DialogController) && from != null) {
|
||||||
|
|
|
@ -882,7 +882,7 @@ interface BackHandlerControllerInterface {
|
||||||
@CallSuper
|
@CallSuper
|
||||||
fun handleOnBackProgressed(backEvent: BackEventCompat) {
|
fun handleOnBackProgressed(backEvent: BackEventCompat) {
|
||||||
if (this !is Controller) return
|
if (this !is Controller) return
|
||||||
if (router.backstackSize > 1) {
|
if (router.backstackSize > 1 && isControllerVisible) {
|
||||||
val progress = ((backEvent.progress.takeIf { it > 0.001f } ?: 0f) * 0.5f).pow(0.6f)
|
val progress = ((backEvent.progress.takeIf { it > 0.001f } ?: 0f) * 0.5f).pow(0.6f)
|
||||||
view?.let { view ->
|
view?.let { view ->
|
||||||
view.alpha = 1f - progress
|
view.alpha = 1f - progress
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue