Add up arrow for action bar
- Add AppbarFragmentHost for activity to implement up back behavior.
- Hide BottomActionBar's back button once up arrow exists.
- Show up arrow by launch condition for main entry page.
- Hide up arrow when launches from Photo app.
- Screenshot:
https://drive.google.com/drive/folders/1b0O4ZacRvDYxn4mC4s1PRG0-4XtD_Bzg
Bug: 177638480
Test: Manual
Change-Id: Ieebb97d7b38a1ccbcf177b725b23345c0e409aa4
diff --git a/src/com/android/wallpaper/picker/TopLevelPickerActivity.java b/src/com/android/wallpaper/picker/TopLevelPickerActivity.java
index e8f1ab6..f58bec2 100755
--- a/src/com/android/wallpaper/picker/TopLevelPickerActivity.java
+++ b/src/com/android/wallpaper/picker/TopLevelPickerActivity.java
@@ -73,6 +73,7 @@
import com.android.wallpaper.module.WallpaperPreferences.PresentationMode;
import com.android.wallpaper.module.WallpaperRotationRefresher;
import com.android.wallpaper.module.WallpaperRotationRefresher.Listener;
+import com.android.wallpaper.picker.AppbarFragment.AppbarFragmentHost;
import com.android.wallpaper.picker.CategoryFragment.CategoryFragmentHost;
import com.android.wallpaper.picker.WallpaperDisabledFragment.WallpaperSupportLevel;
import com.android.wallpaper.picker.individual.IndividualPickerFragment;
@@ -94,7 +95,7 @@
*/
public class TopLevelPickerActivity extends BaseActivity implements WallpapersUiContainer,
CurrentWallpaperBottomSheetPresenter, SetWallpaperErrorDialogFragment.Listener,
- MyPhotosStarter, CategoryFragmentHost, BottomActionBarHost {
+ MyPhotosStarter, AppbarFragmentHost, CategoryFragmentHost, BottomActionBarHost {
private static final String TAG_SET_WALLPAPER_ERROR_DIALOG_FRAGMENT =
"toplevel_set_wallpaper_error_dialog";
@@ -1131,6 +1132,16 @@
return findViewById(R.id.bottom_actionbar);
}
+ @Override
+ public void onUpArrowPressed() {
+ onBackPressed();
+ }
+
+ @Override
+ public boolean isUpArrowSupported() {
+ return true;
+ }
+
private interface AssetReceiver {
void onAssetReceived(Asset asset);
}