[InternetDialog] Fix the inconsistent ripple effect in the internet dialog

Current: https://screenshot.googleplex.com/5pGNUnfjG3xxEPh.png
FIx: https://screenshot.googleplex.com/HSsFrU9Xcx6AZMA.png

Bug: 257776790
Test: manual
Change-Id: I3e122275ef3d1f722cfb01b01fd8c0bfcbc8d116
This commit is contained in:
Zoey Chen
2022-11-14 06:56:19 +00:00
parent 30b008595d
commit 2d5107faa7
4 changed files with 31 additions and 20 deletions

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2022 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:attr/colorControlHighlight">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="@android:color/white"/>
<corners android:radius="?android:attr/buttonCornerRadius"/>
</shape>
</item>
</ripple>

View File

@@ -312,22 +312,15 @@
<LinearLayout
android:id="@+id/see_all_layout"
android:layout_width="match_parent"
style="@style/InternetDialog.Network"
android:layout_height="64dp"
android:clickable="true"
android:focusable="true"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical|center_horizontal"
android:orientation="horizontal"
android:paddingStart="22dp"
android:paddingEnd="22dp">
android:paddingStart="20dp">
<FrameLayout
android:layout_width="24dp"
android:layout_height="24dp"
android:clickable="false"
android:layout_gravity="center_vertical|start"
android:layout_marginStart="@dimen/internet_dialog_network_layout_margin">
android:layout_gravity="center_vertical|start">
<ImageView
android:id="@+id/arrow_forward"
android:src="@drawable/ic_arrow_forward"

View File

@@ -1095,7 +1095,7 @@
<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>
<item name="android:background">@drawable/internet_dialog_selected_effect</item>
</style>
<style name="InternetDialog.NetworkTitle">

View File

@@ -249,15 +249,7 @@ public class InternetDialog extends SystemUIDialog implements
mBackgroundOn = mContext.getDrawable(R.drawable.settingslib_switch_bar_bg_on);
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();
}
mBackgroundOff = mContext.getDrawable(R.drawable.internet_dialog_selected_effect);
setOnClickListener();
mTurnWifiOnLayout.setBackground(null);
mAirplaneModeButton.setVisibility(