Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit addb7f3d authored by chihhangchuang's avatar chihhangchuang
Browse files

Bind BottomActionBar#cancel button to backkey

So that the behavior of cancel button and backkey would be same.

Test: Manually
Bug: 151287994
Change-Id: I3634a6e8dc2cb9b818e5aaebb8cd359a641e619e
parent d2f4ba2b
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -291,17 +291,17 @@ public class CustomizationPickerActivity extends FragmentActivity implements Wal

    @Override
    public void onBackPressed() {
        // For wallpaper tab, since it had child fragment.
        if (mWallpaperCategoryFragment != null && mWallpaperCategoryFragment.popChildFragment()) {
            return;
        }

        Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragment_container);
        if (fragment instanceof BottomActionBarFragment
                && ((BottomActionBarFragment) fragment).onBackPressed()) {
            return;
        }

        // For wallpaper tab, since it had child fragment.
        if (mWallpaperCategoryFragment != null && mWallpaperCategoryFragment.popChildFragment()) {
            return;
        }

        if (getSupportFragmentManager().popBackStackImmediate()) {
            return;
        }
+0 −1
Original line number Diff line number Diff line
@@ -209,7 +209,6 @@ public class GridFragment extends AppbarFragment {
    protected void onBottomActionBarReady(BottomActionBar bottomActionBar) {
        mBottomActionBar = bottomActionBar;
        mBottomActionBar.showActionsOnly(CANCEL, APPLY);
        mBottomActionBar.setActionClickListener(CANCEL, unused -> getActivity().onBackPressed());
        mBottomActionBar.setActionClickListener(APPLY, unused -> {
            mBottomActionBar.disableActions();
            mGridManager.apply(mSelectedOption, mApplyGridCallback);