Skip to content

Commit

Permalink
remove back button on large screen only
Browse files Browse the repository at this point in the history
This bug existed for a long time which was unnoticed. Back button is useful on small screen when the fragment appears on a separate screen, and is not useful when the fragment appears near the deck-picker, where there is nowhere to go back to, so we could remove the button
  • Loading branch information
SanjaySargam authored and Arthur-Milchior committed Jun 17, 2024
1 parent ee80873 commit 13189e0
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,10 @@ class StudyOptionsFragment : Fragment(), ChangeManager.Subscriber, Toolbar.OnMen
menu.findItem(R.id.action_undo).title = col?.undoLabel()
}
// Set the back button listener
if (!fragmented) {
if (fragmented) {
// when the fragment is attached to deck picker on large screen, the "back" button had no purpose, so it should be removed
toolbar!!.navigationIcon = null
} else {
val icon = AppCompatResources.getDrawable(requireContext(), R.drawable.ic_arrow_back_white)
icon!!.isAutoMirrored = true
toolbar!!.navigationIcon = icon
Expand Down

0 comments on commit 13189e0

Please sign in to comment.