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

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

Merge "Bug fix for wallet screen and lockscreen icon." into sc-dev am: 2e14d6d5 am: a980bae1

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14516202

Change-Id: I02f7891d2e6a414a167fe5b3467a4235975c4551
parents 885beea2 a980bae1
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();