Skip to content

Commit

Permalink
Merge pull request #20175 from wordpress-mobile/fix/menu-visibility-o…
Browse files Browse the repository at this point in the history
…n-stats

Fix the visibility issue with the menu button on the stats
  • Loading branch information
ravishanker authored Feb 12, 2024
2 parents ca3d8d8 + 43f642b commit a8f4a27
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

24.3
-----

* [*] [Jetpack-only] Fix the visibility issue with the menu button on the stats [https://github.com/wordpress-mobile/WordPress-Android/pull/20175]

24.2
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,12 @@ class StatsListFragment : ViewPagerFragment(R.layout.stats_list_fragment) {
}
}

@Suppress("DEPRECATION")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

statsSection = arguments?.getSerializableCompat(LIST_TYPE)
?: activity?.intent?.getSerializableExtraCompat(LIST_TYPE)
?: StatsSection.INSIGHTS

setHasOptionsMenu(statsSection == StatsSection.INSIGHTS)
}

override fun onSaveInstanceState(outState: Bundle) {
Expand Down Expand Up @@ -210,6 +207,12 @@ class StatsListFragment : ViewPagerFragment(R.layout.stats_list_fragment) {
}
}

override fun onResume() {
super.onResume()
@Suppress("DEPRECATION")
setHasOptionsMenu(statsSection == StatsSection.INSIGHTS)
}

override fun onDestroyView() {
super.onDestroyView()
binding = null
Expand Down

0 comments on commit a8f4a27

Please sign in to comment.