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

Commit cd2d0aad authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Update wallet tile secondary label." into tm-dev am: 8ec931fd

parents 755c4c5f 8ec931fd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1211,7 +1211,7 @@
    <string name="wallet_app_button_label">Show all</string>
    <!-- Label of the button underneath the card carousel prompting user unlock device. [CHAR LIMIT=NONE] -->
    <!-- Secondary label of the quick access wallet tile if no card. [CHAR LIMIT=NONE] -->
    <string name="wallet_secondary_label_no_card">Add a card</string>
    <string name="wallet_secondary_label_no_card">Tap to open</string>
    <!-- Secondary label of the quick access wallet tile if wallet is still updating. [CHAR LIMIT=NONE] -->
    <string name="wallet_secondary_label_updating">Updating</string>
    <!-- Secondary label of the quick access wallet tile if device locked. [CHAR LIMIT=NONE] -->
+3 −10
Original line number Diff line number Diff line
@@ -147,16 +147,9 @@ public class QuickAccessWalletTile extends QSTileImpl<QSTile.State> {
        if (mController.getWalletClient().isWalletServiceAvailable()
                && mController.getWalletClient().isWalletFeatureAvailable()) {
            if (mSelectedCard != null) {
                if (isDeviceLocked) {
                    state.state = Tile.STATE_INACTIVE;
                    state.secondaryLabel =
                            mContext.getString(R.string.wallet_secondary_label_device_locked);
                    state.sideViewCustomDrawable = null;
                } else {
                    state.state = Tile.STATE_ACTIVE;
                state.state = isDeviceLocked ? Tile.STATE_INACTIVE : Tile.STATE_ACTIVE;
                state.secondaryLabel = mSelectedCard.getContentDescription();
                state.sideViewCustomDrawable = mCardViewDrawable;
                }
            } else {
                state.state = Tile.STATE_INACTIVE;
                state.secondaryLabel =
+6 −11
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@ public class QuickAccessWalletTileTest extends SysuiTestCase {

    private static final String CARD_ID = "card_id";
    private static final String LABEL = "QAW";
    private static final String CARD_DESCRIPTION = "•••• 1234";
    private static final Icon CARD_IMAGE =
            Icon.createWithBitmap(Bitmap.createBitmap(70, 50, Bitmap.Config.ARGB_8888));

@@ -282,9 +283,7 @@ public class QuickAccessWalletTileTest extends SysuiTestCase {
        mTile.handleUpdateState(state, null);

        assertEquals(Tile.STATE_ACTIVE, state.state);
        assertEquals(
                "•••• 1234",
                state.secondaryLabel);
        assertEquals(CARD_DESCRIPTION, state.secondaryLabel);
        assertNotNull(state.stateDescription);
        assertNotNull(state.sideViewCustomDrawable);
    }
@@ -298,11 +297,9 @@ public class QuickAccessWalletTileTest extends SysuiTestCase {
        mTile.handleUpdateState(state, null);

        assertEquals(Tile.STATE_INACTIVE, state.state);
        assertEquals(
                mContext.getString(R.string.wallet_secondary_label_device_locked),
                state.secondaryLabel);
        assertEquals(CARD_DESCRIPTION, state.secondaryLabel);
        assertNotNull(state.stateDescription);
        assertNull(state.sideViewCustomDrawable);
        assertNotNull(state.sideViewCustomDrawable);
    }

    @Test
@@ -314,9 +311,7 @@ public class QuickAccessWalletTileTest extends SysuiTestCase {
        mTile.handleUpdateState(state, null);

        assertEquals(Tile.STATE_ACTIVE, state.state);
        assertEquals(
                "•••• 1234",
                state.secondaryLabel);
        assertEquals(CARD_DESCRIPTION, state.secondaryLabel);
        assertNotNull(state.stateDescription);
        assertNotNull(state.sideViewCustomDrawable);
    }
@@ -426,6 +421,6 @@ public class QuickAccessWalletTileTest extends SysuiTestCase {
    private WalletCard createWalletCard(Context context) {
        PendingIntent pendingIntent =
                PendingIntent.getActivity(context, 0, mWalletIntent, PendingIntent.FLAG_IMMUTABLE);
        return new WalletCard.Builder(CARD_ID, CARD_IMAGE, "•••• 1234", pendingIntent).build();
        return new WalletCard.Builder(CARD_ID, CARD_IMAGE, CARD_DESCRIPTION, pendingIntent).build();
    }
}