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

Commit 82c09c5e authored by Chihhang Chuang's avatar Chihhang Chuang
Browse files

Use APPLY text button for grid picker

Video: https://drive.google.com/file/d/1NotRBY9GDJe8LgEGrA_g_ruN-dtoktb0/view?usp=sharing

Bug: 189384424
Test: Manually
Change-Id: I8896640a0818fa993f87363b4c2975d2e7eee16a
parent c44abebf
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ import static android.app.Activity.RESULT_OK;
import static com.android.customization.picker.ViewOnlyFullPreviewActivity.SECTION_GRID;
import static com.android.customization.picker.grid.GridFullPreviewFragment.EXTRA_GRID_OPTION;
import static com.android.customization.picker.grid.GridFullPreviewFragment.EXTRA_WALLPAPER_INFO;
import static com.android.wallpaper.widget.BottomActionBar.BottomAction.APPLY;
import static com.android.wallpaper.widget.BottomActionBar.BottomAction.APPLY_TEXT;

import android.content.Intent;
import android.os.Bundle;
@@ -189,8 +189,8 @@ public class GridFragment extends AppbarFragment {
    protected void onBottomActionBarReady(BottomActionBar bottomActionBar) {
        super.onBottomActionBarReady(bottomActionBar);
        mBottomActionBar = bottomActionBar;
        mBottomActionBar.showActionsOnly(APPLY);
        mBottomActionBar.setActionClickListener(APPLY, unused -> applyGridOption(mSelectedOption));
        mBottomActionBar.showActionsOnly(APPLY_TEXT);
        mBottomActionBar.setActionClickListener(APPLY_TEXT, v -> applyGridOption(mSelectedOption));
    }

    private void applyGridOption(GridOption gridOption) {
+3 −3
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ package com.android.customization.picker.grid;

import static android.app.Activity.RESULT_OK;

import static com.android.wallpaper.widget.BottomActionBar.BottomAction.APPLY;
import static com.android.wallpaper.widget.BottomActionBar.BottomAction.APPLY_TEXT;

import android.app.Activity;
import android.content.Intent;
@@ -112,8 +112,8 @@ public class GridFullPreviewFragment extends AppbarFragment {
    @Override
    protected void onBottomActionBarReady(BottomActionBar bottomActionBar) {
        super.onBottomActionBarReady(bottomActionBar);
        bottomActionBar.showActionsOnly(APPLY);
        bottomActionBar.setActionClickListener(APPLY, v -> finishActivityWithResultOk());
        bottomActionBar.showActionsOnly(APPLY_TEXT);
        bottomActionBar.setActionClickListener(APPLY_TEXT, v -> finishActivityWithResultOk());
        bottomActionBar.show();
    }