Apply transition on the back arrow on NotificationHistory page

When clicking on the back arrow from the action bar in the Notification
History page, the shared x-axis transition won't work.

The onOptionsItemSelected() overriden in the parent activity was
removed, so onNavigateUp() will get called. In the
NotificationHistoryActivity, onNavigateUp() has been overriden, and so
it will just call finish without any transition applied.

Hence, remove the override and just use the one define in
CollapsingToolbarBaseActivity where finishAfterTransition() is called.

Test: rebuild and click on the back arrow to see the transition
Fixes: 188126675
Change-Id: I34ff38ffcfb37d0471d325f2c31b726809fbd91f
This commit is contained in:
Yi-Ling Chuang
2021-05-14 16:11:03 +08:00
parent e01099b245
commit 3e9c576bb8

View File

@@ -306,12 +306,6 @@ public class NotificationHistoryActivity extends CollapsingToolbarBaseActivity {
super.onDestroy(); super.onDestroy();
} }
@Override
public boolean onNavigateUp() {
finish();
return true;
}
private @ColorInt int obtainThemeColor(@AttrRes int attrRes) { private @ColorInt int obtainThemeColor(@AttrRes int attrRes) {
Resources.Theme theme = new ContextThemeWrapper(this, Resources.Theme theme = new ContextThemeWrapper(this,
android.R.style.Theme_DeviceDefault_DayNight).getTheme(); android.R.style.Theme_DeviceDefault_DayNight).getTheme();