Fixed log not displaying back button when alternative view is shown

This commit is contained in:
Viktor De Pasquale 2020-03-24 15:52:02 +01:00 committed by John Wu
parent 1b8813228b
commit 51402e68d2
2 changed files with 5 additions and 2 deletions

View File

@ -137,7 +137,7 @@ open class MainActivity : BaseUIActivity<MainViewModel, ActivityMainMd2Binding>(
viewModel.insets.value = insets
}
private fun setDisplayHomeAsUpEnabled(isEnabled: Boolean) {
fun setDisplayHomeAsUpEnabled(isEnabled: Boolean) {
binding.mainToolbar.startAnimations()
when {
isEnabled -> binding.mainToolbar.setNavigationIcon(R.drawable.ic_back_md2)

View File

@ -24,7 +24,10 @@ class LogFragment : BaseUIFragment<LogViewModel, FragmentLogMd2Binding>() {
set(value) {
MotionRevealHelper.withViews(binding.logFilter, binding.logFilterToggle, value)
actionSave?.isVisible = !value
(activity as MainActivity).invalidateToolbar()
with(activity as MainActivity) {
invalidateToolbar()
setDisplayHomeAsUpEnabled(value)
}
}
override fun onStart() {