diff options
| author | 2021-11-02 15:23:32 +0000 | |
|---|---|---|
| committer | 2021-11-02 15:23:32 +0000 | |
| commit | 820b49488dafa8e3b989eb009508727654e4ee0d (patch) | |
| tree | 4710df9badc4867f66cce8dc454c03ed8a1a0a9e | |
| parent | 2d213c397a16844cb6311d15fc2eaf73d694e61d (diff) | |
| parent | 7a78a80162ee8729a9180aa83025c7d430645fda (diff) | |
Merge "Set background for ripple feedback on network items" into sc-v2-dev
3 files changed, 17 insertions, 2 deletions
diff --git a/packages/SystemUI/res/layout/internet_connectivity_dialog.xml b/packages/SystemUI/res/layout/internet_connectivity_dialog.xml index f4faa62430db..86e2661f9534 100644 --- a/packages/SystemUI/res/layout/internet_connectivity_dialog.xml +++ b/packages/SystemUI/res/layout/internet_connectivity_dialog.xml @@ -329,7 +329,8 @@ android:layout_height="wrap_content" android:paddingBottom="4dp" android:clickable="false" - android:focusable="false"> + android:focusable="false" + android:visibility="gone"> <LinearLayout android:layout_width="wrap_content" diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml index 0994a5846f27..3f855c762273 100644 --- a/packages/SystemUI/res/values/styles.xml +++ b/packages/SystemUI/res/values/styles.xml @@ -983,12 +983,15 @@ <style name="InternetDialog.Network"> <item name="android:layout_width">match_parent</item> <item name="android:layout_height">88dp</item> + <item name="android:layout_marginStart">@dimen/internet_dialog_network_layout_margin</item> <item name="android:layout_marginEnd">@dimen/internet_dialog_network_layout_margin</item> + <item name="android:layout_gravity">center_vertical|start</item> <item name="android:paddingStart">22dp</item> <item name="android:paddingEnd">22dp</item> <item name="android:orientation">horizontal</item> <item name="android:focusable">true</item> <item name="android:clickable">true</item> + <item name="android:background">?android:attr/selectableItemBackground</item> </style> <style name="InternetDialog.NetworkTitle"> diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialog.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialog.java index 1dab26352fc6..f6dbb0b95ecd 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialog.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialog.java @@ -19,6 +19,7 @@ import static com.android.systemui.Prefs.Key.QS_HAS_TURNED_OFF_MOBILE_DATA; import android.app.AlertDialog; import android.content.Context; +import android.content.res.TypedArray; import android.graphics.drawable.Drawable; import android.net.Network; import android.net.NetworkCapabilities; @@ -122,6 +123,7 @@ public class InternetDialog extends SystemUIDialog implements private Switch mWiFiToggle; private FrameLayout mDoneLayout; private Drawable mBackgroundOn; + private Drawable mBackgroundOff = null; private int mDefaultDataSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; private boolean mCanConfigMobileData; @@ -209,6 +211,14 @@ public class InternetDialog extends SystemUIDialog implements mInternetDialogTitle.setText(getDialogTitleText()); mInternetDialogTitle.setGravity(Gravity.START | Gravity.CENTER_VERTICAL); + TypedArray typedArray = mContext.obtainStyledAttributes( + new int[]{android.R.attr.selectableItemBackground}); + try { + mBackgroundOff = typedArray.getDrawable(0 /* index */); + } finally { + typedArray.recycle(); + } + setOnClickListener(); mTurnWifiOnLayout.setBackground(null); mWifiRecyclerView.setLayoutManager(new LinearLayoutManager(mContext)); @@ -364,7 +374,8 @@ public class InternetDialog extends SystemUIDialog implements mMobileSummaryText.setTextAppearance(isCarrierNetworkConnected ? R.style.TextAppearance_InternetDialog_Secondary_Active : R.style.TextAppearance_InternetDialog_Secondary); - mMobileNetworkLayout.setBackground(isCarrierNetworkConnected ? mBackgroundOn : null); + mMobileNetworkLayout.setBackground( + isCarrierNetworkConnected ? mBackgroundOn : mBackgroundOff); mMobileDataToggle.setVisibility(mCanConfigMobileData ? View.VISIBLE : View.INVISIBLE); } |