mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Update menu visibility logic to reflect Map tab selection
This commit is contained in:
parent
7ae72f1e92
commit
772f1028df
1 changed files with 2 additions and 4 deletions
|
|
@ -177,6 +177,7 @@ class ExploreFragment : CommonsDaggerSupportFragment() {
|
||||||
override fun onPageScrollStateChanged(state: Int) = Unit
|
override fun onPageScrollStateChanged(state: Int) = Unit
|
||||||
override fun onPageSelected(position: Int) {
|
override fun onPageSelected(position: Int) {
|
||||||
binding!!.viewPager.canScroll = position != 2
|
binding!!.viewPager.canScroll = position != 2
|
||||||
|
others.setVisible(position == 2)
|
||||||
if (position == 2) {
|
if (position == 2) {
|
||||||
mapRootFragment?.requestLocationIfNeeded()
|
mapRootFragment?.requestLocationIfNeeded()
|
||||||
}
|
}
|
||||||
|
|
@ -194,7 +195,6 @@ class ExploreFragment : CommonsDaggerSupportFragment() {
|
||||||
*/
|
*/
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
// Handle item selection
|
// Handle item selection
|
||||||
|
|
||||||
when (item.itemId) {
|
when (item.itemId) {
|
||||||
R.id.action_search -> {
|
R.id.action_search -> {
|
||||||
startActivityWithFlags(requireActivity(), SearchActivity::class.java)
|
startActivityWithFlags(requireActivity(), SearchActivity::class.java)
|
||||||
|
|
@ -224,6 +224,4 @@ class ExploreFragment : CommonsDaggerSupportFragment() {
|
||||||
retainInstance = true
|
retainInstance = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue