From 0f6e4f5bdf741a594a14eb968a8d82da09cb6c2b Mon Sep 17 00:00:00 2001 From: Silin Huang Date: Thu, 14 Apr 2022 14:42:54 -0700 Subject: [PATCH] Add onClickListener to "show all" button on the QAW empty state view. Test: manual, atest Fixes: 228595457 Change-Id: Ic5b417ebc9b1f9ac84a0a7d5a2ad3a12100141a5 --- .../src/com/android/systemui/wallet/ui/WalletView.java | 6 ++++++ .../systemui/wallet/ui/WalletScreenControllerTest.java | 2 ++ 2 files changed, 8 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletView.java b/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletView.java index 9b2702ff7bf27..1243c47182296 100644 --- a/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletView.java +++ b/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletView.java @@ -215,6 +215,7 @@ public class WalletView extends FrameLayout implements WalletCardCarousel.OnCard logoView.setImageDrawable(mContext.getDrawable(R.drawable.ic_qs_plus)); mEmptyStateView.requireViewById(R.id.empty_state_title).setText(label); mEmptyStateView.setOnClickListener(clickListener); + mAppButton.setOnClickListener(clickListener); } void showErrorMessage(@Nullable CharSequence message) { @@ -255,6 +256,11 @@ public class WalletView extends FrameLayout implements WalletCardCarousel.OnCard return mActionButton; } + @VisibleForTesting + Button getAppButton() { + return mAppButton; + } + @VisibleForTesting TextView getErrorView() { return mErrorView; diff --git a/packages/SystemUI/tests/src/com/android/systemui/wallet/ui/WalletScreenControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/wallet/ui/WalletScreenControllerTest.java index 01769e52c8d39..b1950eac9846c 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/wallet/ui/WalletScreenControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/wallet/ui/WalletScreenControllerTest.java @@ -20,6 +20,7 @@ import static android.view.View.GONE; import static android.view.View.VISIBLE; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -323,6 +324,7 @@ public class WalletScreenControllerTest extends SysuiTestCase { assertEquals(GONE, mWalletView.getCardCarousel().getVisibility()); assertEquals(VISIBLE, mWalletView.getEmptyStateView().getVisibility()); assertEquals(GONE, mWalletView.getErrorView().getVisibility()); + assertTrue(mWalletView.getAppButton().hasOnClickListeners()); } @Test