mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Merge 976e2112e7 into 28fa7b1a20
This commit is contained in:
commit
7e48c3ca40
2 changed files with 18 additions and 7 deletions
|
|
@ -381,6 +381,7 @@ after opening the app.
|
||||||
if (contributionsFragment?.backButtonClicked() != true) { //If this one does not want to handle
|
if (contributionsFragment?.backButtonClicked() != true) { //If this one does not want to handle
|
||||||
// the back press, let the activity do so
|
// the back press, let the activity do so
|
||||||
super.onBackPressed()
|
super.onBackPressed()
|
||||||
|
showTabs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ActiveFragment.NEARBY -> {
|
ActiveFragment.NEARBY -> {
|
||||||
|
|
@ -390,6 +391,7 @@ after opening the app.
|
||||||
supportFragmentManager.beginTransaction().remove(it).commit()
|
supportFragmentManager.beginTransaction().remove(it).commit()
|
||||||
}
|
}
|
||||||
setSelectedItemId(NavTab.CONTRIBUTIONS.code())
|
setSelectedItemId(NavTab.CONTRIBUTIONS.code())
|
||||||
|
showTabs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ActiveFragment.EXPLORE -> {
|
ActiveFragment.EXPLORE -> {
|
||||||
|
|
@ -400,14 +402,17 @@ after opening the app.
|
||||||
} else {
|
} else {
|
||||||
setSelectedItemId(NavTab.CONTRIBUTIONS.code())
|
setSelectedItemId(NavTab.CONTRIBUTIONS.code())
|
||||||
}
|
}
|
||||||
|
showTabs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ActiveFragment.BOOKMARK -> {
|
ActiveFragment.BOOKMARK -> {
|
||||||
// Means that bookmark fragment is visible
|
// Means that bookmark fragment is visible
|
||||||
bookmarkFragment?.onBackPressed()
|
bookmarkFragment?.onBackPressed()
|
||||||
|
showTabs()
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
super.onBackPressed()
|
super.onBackPressed()
|
||||||
|
showTabs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -109,8 +109,6 @@ class MediaDetailPagerFragment : CommonsDaggerSupportFragment(), OnPageChangeLis
|
||||||
// If fragment is associated with ProfileActivity, then hide the tabLayout
|
// If fragment is associated with ProfileActivity, then hide the tabLayout
|
||||||
if (activity is ProfileActivity) {
|
if (activity is ProfileActivity) {
|
||||||
(activity as ProfileActivity).setTabLayoutVisibility(false)
|
(activity as ProfileActivity).setTabLayoutVisibility(false)
|
||||||
} else if (activity is MainActivity) {
|
|
||||||
(activity as MainActivity).hideTabs()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
binding!!.mediaDetailsPager.adapter = adapter
|
binding!!.mediaDetailsPager.adapter = adapter
|
||||||
|
|
@ -142,6 +140,14 @@ class MediaDetailPagerFragment : CommonsDaggerSupportFragment(), OnPageChangeLis
|
||||||
initProvider()
|
initProvider()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onDestroyView() {
|
||||||
|
super.onDestroyView()
|
||||||
|
if (activity is MainActivity) {
|
||||||
|
(activity as MainActivity).showTabs()
|
||||||
|
}
|
||||||
|
binding = null
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* initialise the provider, based on from where the fragment was started, as in from an activity
|
* initialise the provider, based on from where the fragment was started, as in from an activity
|
||||||
* or a fragment
|
* or a fragment
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue