mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-26 00:47:43 +00:00
Added back press closing filters in hide and module screens
This commit is contained in:
parent
8e34baa59f
commit
784a7a7f24
@ -55,6 +55,18 @@ class HideFragment : CompatFragment<HideViewModel, FragmentHideMd2Binding>() {
|
||||
lama.isAutoMeasureEnabled = false
|
||||
}
|
||||
|
||||
override fun onPreBind(binding: FragmentHideMd2Binding) = Unit
|
||||
|
||||
override fun onBackPressed(): Boolean {
|
||||
if (binding.hideFilter.isVisible) {
|
||||
binding.hideFilterInclude.hideFilterDone.performClick()
|
||||
return true
|
||||
}
|
||||
return super.onBackPressed()
|
||||
}
|
||||
|
||||
// ---
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
|
||||
inflater.inflate(R.menu.menu_hide_md2, menu)
|
||||
}
|
||||
@ -70,8 +82,6 @@ class HideFragment : CompatFragment<HideViewModel, FragmentHideMd2Binding>() {
|
||||
return super.onOptionsItemSelected(item)
|
||||
}
|
||||
|
||||
override fun onPreBind(binding: FragmentHideMd2Binding) = Unit
|
||||
|
||||
}
|
||||
|
||||
object MotionRevealHelper {
|
||||
|
@ -7,6 +7,7 @@ import android.view.Menu
|
||||
import android.view.MenuInflater
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.StaggeredGridLayoutManager
|
||||
import com.topjohnwu.magisk.R
|
||||
import com.topjohnwu.magisk.databinding.FragmentModuleMd2Binding
|
||||
@ -64,6 +65,14 @@ class ModuleFragment : CompatFragment<ModuleViewModel, FragmentModuleMd2Binding>
|
||||
super.onDestroyView()
|
||||
}
|
||||
|
||||
override fun onBackPressed(): Boolean {
|
||||
if (binding.moduleFilter.isVisible) {
|
||||
binding.moduleFilterInclude.moduleFilterDone.performClick()
|
||||
return true
|
||||
}
|
||||
return super.onBackPressed()
|
||||
}
|
||||
|
||||
// ---
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user