From e722fbe277dce58d8bdf933d434a4774a3b93161 Mon Sep 17 00:00:00 2001 From: Stanley Wang Date: Tue, 29 Jun 2021 20:24:01 +0800 Subject: [PATCH] Update Adaptive connectivity page. - Use MainSwitchPreference. - Use the TopIntroPreference to display the summary. - Use the IllustrationPreference to display the stastic illustration. - Add new illustrations for adaptive connectivity. Fix: 178673083 Test: robotest and test the switch preference manually Change-Id: I2376f4433b61ce1d3da287de92660fbeea5dd64e --- .../ic_enhanced_connectivity.xml | 91 +++++++++++++++++++ res/drawable/ic_enhanced_connectivity.xml | 91 +++++++++++++++++++ res/xml/adaptive_connectivity_settings.xml | 20 ++-- ...onnectivityTogglePreferenceController.java | 8 +- 4 files changed, 196 insertions(+), 14 deletions(-) create mode 100644 res/drawable-night/ic_enhanced_connectivity.xml create mode 100644 res/drawable/ic_enhanced_connectivity.xml diff --git a/res/drawable-night/ic_enhanced_connectivity.xml b/res/drawable-night/ic_enhanced_connectivity.xml new file mode 100644 index 00000000000..cd256676316 --- /dev/null +++ b/res/drawable-night/ic_enhanced_connectivity.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/drawable/ic_enhanced_connectivity.xml b/res/drawable/ic_enhanced_connectivity.xml new file mode 100644 index 00000000000..45767bd7d44 --- /dev/null +++ b/res/drawable/ic_enhanced_connectivity.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/xml/adaptive_connectivity_settings.xml b/res/xml/adaptive_connectivity_settings.xml index ff9bdb0443e..d5941ad0507 100644 --- a/res/xml/adaptive_connectivity_settings.xml +++ b/res/xml/adaptive_connectivity_settings.xml @@ -19,20 +19,18 @@ xmlns:settings="http://schemas.android.com/apk/res-auto" android:title="@string/adaptive_connectivity_title"> - + - + + diff --git a/src/com/android/settings/network/AdaptiveConnectivityTogglePreferenceController.java b/src/com/android/settings/network/AdaptiveConnectivityTogglePreferenceController.java index e1e56a8a6fa..e3d779ce938 100644 --- a/src/com/android/settings/network/AdaptiveConnectivityTogglePreferenceController.java +++ b/src/com/android/settings/network/AdaptiveConnectivityTogglePreferenceController.java @@ -22,12 +22,14 @@ import android.provider.Settings; import androidx.preference.PreferenceScreen; -import com.android.settings.core.TogglePreferenceController; +import com.android.settings.widget.SettingsMainSwitchPreferenceController; /** - * {@link TogglePreferenceController} that controls whether Adaptive connectivity option is enabled. + * {@link SettingsMainSwitchPreferenceController} + * that controls whether Adaptive connectivity option is enabled. */ -public class AdaptiveConnectivityTogglePreferenceController extends TogglePreferenceController { +public class AdaptiveConnectivityTogglePreferenceController extends + SettingsMainSwitchPreferenceController { private final WifiManager mWifiManager;