Skip to content
Snippets Groups Projects
Commit 4b20c3db authored by Nicolas Pomepuy's avatar Nicolas Pomepuy Committed by Duncan McNamara
Browse files

Show the FAB on tablet for non main activities

Fixes #2743
parent 572bed25
No related branches found
No related tags found
No related merge requests found
......@@ -73,7 +73,7 @@ abstract class BaseFragment : Fragment(), ActionMode.Callback {
it.setProgressBackgroundColorSchemeColor(bColor)
}
val fab = requireActivity().findViewById<FloatingActionButton?>(R.id.fab)
((fab?.layoutParams as? CoordinatorLayout.LayoutParams)?.behavior as? FloatingActionButtonBehavior)?.shouldNeverShow = !hasFAB()
((fab?.layoutParams as? CoordinatorLayout.LayoutParams)?.behavior as? FloatingActionButtonBehavior)?.shouldNeverShow = !hasFAB() && requireActivity() is MainActivity
if (hasFAB()) updateFabPlayView()
}
......@@ -90,7 +90,7 @@ abstract class BaseFragment : Fragment(), ActionMode.Callback {
val fabLarge = requireActivity().findViewById<FloatingActionButton>(R.id.fab_large)
fab.setGone()
fabLarge.setGone()
fabPlay = if (requireActivity().isTablet()) fabLarge else fab
fabPlay = if (requireActivity().isTablet() && requireActivity() is MainActivity) fabLarge else fab
visibility?.let { fabPlay?.visibility = it }
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment