Fix #2212: Fix back button behaviour in explore views (#2650)

This commit is contained in:
Shubham Pinjwani 2019-03-19 05:29:58 +05:30 committed by Adam Jones
parent 04d29fe5f2
commit 3ceaaa9bb4
3 changed files with 4 additions and 29 deletions

View file

@ -101,7 +101,8 @@
<activity
android:name=".category.CategoryImagesActivity"
android:label="@string/title_activity_featured_images"
android:parentActivityName=".contributions.MainActivity" />
android:parentActivityName=".contributions.MainActivity"
android:configChanges="orientation|screenSize|keyboard"/>
<activity
android:name=".category.CategoryDetailsActivity"
@ -111,7 +112,8 @@
<activity
android:name=".explore.categories.ExploreActivity"
android:label="@string/title_activity_explore"
android:parentActivityName=".contributions.MainActivity" />
android:parentActivityName=".contributions.MainActivity"
android:configChanges="orientation|screenSize|keyboard" />
<activity
android:name=".explore.SearchActivity"

View file

@ -127,19 +127,6 @@ public class CategoryImagesActivity
forceInitBackButton();
}
/**
* This method is called on backPressed when mediaDetailFragment is opened in the activity.
*/
@Override
protected void onResume() {
if (supportFragmentManager.getBackStackEntryCount()==1){
//FIXME: Temporary fix for screen rotation inside media details. If we don't call onBackPressed then fragment stack is increasing every time.
//FIXME: Similar issue like this https://github.com/commons-app/apps-android-commons/issues/894
onBackPressed();
}
super.onResume();
}
/**
* Consumers should be simply using this method to use this activity.
* @param context A Context of the application package implementing this class.

View file

@ -177,20 +177,6 @@ public class ExploreActivity
}
/**
* This method is called on Screen Rotation
*/
@Override
protected void onResume() {
if (supportFragmentManager.getBackStackEntryCount() == 1) {
//FIXME: Temporary fix for screen rotation inside media details. If we don't call onBackPressed then fragment stack is increasing every time.
//FIXME: Similar issue like this https://github.com/commons-app/apps-android-commons/issues/894
//
onBackPressed();
}
super.onResume();
}
/**
* This method is called on backPressed of anyFragment in the activity.
* If condition is called when mediaDetailFragment is opened.