Tweak behavior on Browse screen (#8121)
* Tweak behavior on Browse screen - Fix system back popping controller - Add behavior to system back to cancel search toolbar before clearing current search or popping controller * Review changes
This commit is contained in:
@@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.ui.base.controller
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.activity.OnBackPressedDispatcherOwner
|
||||
import androidx.compose.runtime.Composable
|
||||
import eu.kanade.tachiyomi.databinding.ComposeControllerBinding
|
||||
import eu.kanade.tachiyomi.util.view.setComposeContent
|
||||
@@ -24,6 +25,16 @@ abstract class FullComposeController<P : Presenter<*>>(bundle: Bundle? = null) :
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun handleBack(): Boolean {
|
||||
val dispatcher = (activity as? OnBackPressedDispatcherOwner)?.onBackPressedDispatcher ?: return false
|
||||
return if (dispatcher.hasEnabledCallbacks()) {
|
||||
dispatcher.onBackPressed()
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user