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

Commit 2e14d6d5 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Bug fix for wallet screen and lockscreen icon." into sc-dev

parents bf2fa2a8 e8ed11dd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -36,8 +36,8 @@
        android:orientation="vertical">
        <ImageView
            android:id="@+id/icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_width="@dimen/wallet_screen_header_view_size"
            android:layout_height="@dimen/wallet_screen_header_view_size"
            android:layout_gravity="center_horizontal"
            android:layout_marginVertical="10dp"
            android:scaleType="center"
+2 −1
Original line number Diff line number Diff line
@@ -1492,7 +1492,8 @@

    <!-- Wallet activity screen specs -->
    <dimen name="wallet_icon_size">36sp</dimen>
    <dimen name="wallet_view_header_icon_size">56dp</dimen>
    <dimen name="wallet_screen_header_icon_size">56dp</dimen>
    <dimen name="wallet_screen_header_view_size">80dp</dimen>
    <dimen name="card_margin">16dp</dimen>
    <dimen name="card_carousel_dot_offset">24dp</dimen>
    <dimen name="card_carousel_dot_unselected_radius">2dp</dimen>
+1 −1
Original line number Diff line number Diff line
@@ -929,7 +929,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
        }
        GetWalletCardsRequest request =
                new GetWalletCardsRequest(1 /* cardWidth */, 1 /* cardHeight */,
                        1 /* iconSizePx */, 2 /* maxCards */);
                        1 /* iconSizePx */, 1 /* maxCards */);
        mQuickAccessWalletClient.getWalletCards(mUiExecutor, request, mCardRetriever);
    }

+8 −2
Original line number Diff line number Diff line
@@ -234,7 +234,9 @@ public class WalletScreenController implements
        mWalletView.show();
        mWalletView.hideErrorMessage();
        int iconSizePx =
                mContext.getResources().getDimensionPixelSize(R.dimen.wallet_view_header_icon_size);
                mContext
                        .getResources()
                        .getDimensionPixelSize(R.dimen.wallet_screen_header_icon_size);
        GetWalletCardsRequest request =
                new GetWalletCardsRequest(cardWidthPx, cardHeightPx, iconSizePx, MAX_CARDS);
        mWalletClient.getWalletCards(mExecutor, request, this);
@@ -340,7 +342,11 @@ public class WalletScreenController implements

        @Override
        public CharSequence getLabel() {
            return mWalletCard.getCardLabel();
            CharSequence label = mWalletCard.getCardLabel();
            if (label == null) {
                return "";
            }
            return label;
        }

        @Override
+2 −12
Original line number Diff line number Diff line
@@ -134,7 +134,8 @@ public class WalletView extends FrameLayout implements WalletCardCarousel.OnCard
        mCardCarouselContainer.setVisibility(VISIBLE);
        mErrorView.setVisibility(GONE);
        mEmptyStateView.setVisibility(GONE);
        renderHeaderIconAndActionButton(data.get(selectedIndex), isDeviceLocked);
        mIcon.setImageDrawable(getHeaderIcon(mContext, data.get(selectedIndex)));
        renderActionButton(data.get(selectedIndex), isDeviceLocked);
        if (shouldAnimate) {
            animateViewsShown(mIcon, mCardLabel, mActionButton);
        }
@@ -221,17 +222,6 @@ public class WalletView extends FrameLayout implements WalletCardCarousel.OnCard
        return mCardLabel;
    }

    private void renderHeaderIconAndActionButton(WalletCardViewInfo walletCard, boolean isLocked) {
        Drawable icon = getHeaderIcon(mContext, walletCard);
        if (icon != null) {
            mIcon.setImageDrawable(walletCard.getIcon());
            mIcon.setVisibility(VISIBLE);
        } else {
            mIcon.setVisibility(INVISIBLE);
        }
        renderActionButton(walletCard, isLocked);
    }

    @Nullable
    private static Drawable getHeaderIcon(Context context, WalletCardViewInfo walletCard) {
        Drawable icon = walletCard.getIcon();