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

Commit cb639a9e authored by Silin Huang's avatar Silin Huang
Browse files

Polish Wallet empty state view.

Another change is a bug fix that do not use the cached "mWalletEnabled"
on cards querying, because that param is for the wallet preference only.
We use "cardsRetriever"s to handle querying cards on wallet
feature/service not available.
Also register the wallet service event listener to WalletActivity, this
enables the wallet activity finish after the user makes an NFC payment
tap.

Fixes: 189869634
Fixes: 187970986
Fixes: 188972317
Test: manual- see demo:
https: //drive.google.com/file/d/1I-vwffhRqR2HDHR8wQqitOqzH0tWjMEI/view?usp=sharing&resourcekey=0-3BZsJl_c7jzW7muwNG9hmA
Change-Id: If907cb5d6c89878d2a5a6a282284e3bf77f7188f
parent e0fa7da5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
        android:id="@+id/wallet_empty_state"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginHorizontal="16dp"
        android:layout_marginHorizontal="48dp"
        android:layout_marginTop="48dp"
        android:background="@drawable/wallet_empty_state_bg"
        android:orientation="vertical"
+4 −3
Original line number Diff line number Diff line
@@ -54,9 +54,12 @@
                    android:id="@+id/label"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    style="@style/Wallet.TextAppearance"
                    android:layout_marginHorizontal="48dp"
                    android:textColor="?androidprv:attr/textColorPrimary"
                    android:textAlignment="center"/>

                <include layout="@layout/wallet_empty_state"/>

                <com.android.systemui.wallet.ui.WalletCardCarousel
                    android:id="@+id/card_carousel"
                    android:layout_width="match_parent"
@@ -97,8 +100,6 @@
            android:layout_marginVertical="24dp"/>
    </LinearLayout>

    <include layout="@layout/wallet_empty_state"/>

    <TextView
        android:id="@+id/error_view"
        android:layout_width="match_parent"
+2 −0
Original line number Diff line number Diff line
@@ -1653,6 +1653,8 @@
    <!-- Wallet strings -->
    <!-- Wallet empty state, title [CHAR LIMIT=32] -->
    <string name="wallet_title">Wallet</string>
    <!-- Wallet empty state label. [CHAR LIMIT=NONE] -->
    <string name="wallet_empty_state_label">Get set up to make faster, more secure purchases with your phone</string>
    <!-- Label of the button at the bottom prompting user enter wallet app. [CHAR LIMIT=NONE] -->
    <string name="wallet_app_button_label">Show all</string>
    <!-- Label of the button underneath the card carousel prompting user unlock device. [CHAR LIMIT=NONE] -->
+1 −4
Original line number Diff line number Diff line
@@ -56,7 +56,6 @@ import com.android.systemui.wallet.controller.QuickAccessWalletController;
import com.android.systemui.wallet.ui.WalletActivity;

import java.util.List;
import java.util.concurrent.Executor;

import javax.inject.Inject;

@@ -71,7 +70,6 @@ public class QuickAccessWalletTile extends QSTileImpl<QSTile.State> {
    private final KeyguardStateController mKeyguardStateController;
    private final PackageManager mPackageManager;
    private final SecureSettings mSecureSettings;
    private final Executor mExecutor;
    private final QuickAccessWalletController mController;
    private final FeatureFlags mFeatureFlags;

@@ -91,7 +89,6 @@ public class QuickAccessWalletTile extends QSTileImpl<QSTile.State> {
            KeyguardStateController keyguardStateController,
            PackageManager packageManager,
            SecureSettings secureSettings,
            @Main Executor executor,
            QuickAccessWalletController quickAccessWalletController,
            FeatureFlags featureFlags) {
        super(host, backgroundLooper, mainHandler, falsingManager, metricsLogger,
@@ -100,7 +97,6 @@ public class QuickAccessWalletTile extends QSTileImpl<QSTile.State> {
        mKeyguardStateController = keyguardStateController;
        mPackageManager = packageManager;
        mSecureSettings = secureSettings;
        mExecutor = executor;
        mFeatureFlags = featureFlags;
    }

@@ -118,6 +114,7 @@ public class QuickAccessWalletTile extends QSTileImpl<QSTile.State> {
        if (listening) {
            mController.setupWalletChangeObservers(mCardRetriever, DEFAULT_PAYMENT_APP_CHANGE);
            if (!mController.getWalletClient().isWalletServiceAvailable()) {
                Log.i(TAG, "QAW service is unavailable, recreating the wallet client.");
                mController.reCreateWalletClient();
            }
            mController.queryWalletCards(mCardRetriever);
+0 −5
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import android.provider.Settings;
import android.service.quickaccesswallet.GetWalletCardsRequest;
import android.service.quickaccesswallet.QuickAccessWalletClient;
import android.service.quickaccesswallet.QuickAccessWalletClientImpl;
import android.util.Log;

import com.android.systemui.R;
import com.android.systemui.dagger.SysUISingleton;
@@ -143,10 +142,6 @@ public class QuickAccessWalletController {
     */
    public void queryWalletCards(
            QuickAccessWalletClient.OnWalletCardsRetrievedCallback cardsRetriever) {
        if (!mWalletEnabled) {
            Log.w(TAG, "QuickAccessWallet is unavailable, unable to query cards.");
            return;
        }
        int cardWidth =
                mContext.getResources().getDimensionPixelSize(R.dimen.wallet_tile_card_view_width);
        int cardHeight =
Loading