Update the illustrations to Lottie format.

- Add the fake illustrations to Settings.
- Update the illustrations of the following items.
  Adaptive battery
  Swipe fingerprint for notifications
  Quick open camera
  Flip camera for selfie
  One-hand mode
  Tap to check phone
  Lift to check phone
  Prevent ringing

Bug: 190807662
Test: robotest and see the UI
Change-Id: I39c72570c61b0871ab5949ecca9a99d5404d1811
This commit is contained in:
Stanley Wang
2021-06-11 20:32:03 +08:00
parent 052ae78759
commit 09fd6ca720
19 changed files with 40 additions and 56 deletions

View File

File diff suppressed because one or more lines are too long

View File

View File

View File

View File

View File

View File

View File

@@ -25,6 +25,7 @@
<com.android.settingslib.widget.IllustrationPreference
android:key="bubbles_illustration"
settings:searchable="false"
app:lottie_rawRes="@raw/lottie_bubbles"/>
<com.android.settingslib.widget.MainSwitchPreference

View File

@@ -17,21 +17,20 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:title="@string/double_tap_power_for_camera_title">
<com.android.settings.widget.VideoPreference
<com.android.settingslib.widget.IllustrationPreference
android:key="gesture_double_tap_power_video"
app:animation="@raw/gesture_double_tap"
app:preview="@drawable/gesture_double_tap"
app:controller="com.android.settings.widget.VideoPreferenceController" />
settings:searchable="false"
app:lottie_rawRes="@raw/lottie_quick_open_camera"/>
<SwitchPreference
android:key="gesture_double_tap_power"
android:title="@string/double_tap_power_for_camera_title"
android:summary="@string/double_tap_power_for_camera_summary"
app:keywords="@string/keywords_gesture"
app:controller="com.android.settings.gestures.DoubleTapPowerPreferenceController"
app:allowDividerAbove="true" />
app:controller="com.android.settings.gestures.DoubleTapPowerPreferenceController"/>
</PreferenceScreen>

View File

@@ -17,21 +17,20 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:title="@string/double_twist_for_camera_mode_title">
<com.android.settings.widget.VideoPreference
<com.android.settingslib.widget.IllustrationPreference
android:key="gesture_double_twist_video"
app:animation="@raw/gesture_twist"
app:preview="@drawable/gesture_twist"
app:controller="com.android.settings.widget.VideoPreferenceController" />
settings:searchable="false"
app:lottie_rawRes="@raw/lottie_flip_camera_for_selfie"/>
<SwitchPreference
android:key="gesture_double_twist"
android:title="@string/double_twist_for_camera_mode_title"
android:summary="@string/double_twist_for_camera_mode_summary"
app:keywords="@string/keywords_gesture"
app:controller="com.android.settings.gestures.DoubleTwistPreferenceController"
app:allowDividerAbove="true" />
app:controller="com.android.settings.gestures.DoubleTwistPreferenceController" />
</PreferenceScreen>

View File

@@ -18,16 +18,14 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:persistent="false"
android:title="@string/one_handed_title">
<com.android.settingslib.widget.LayoutPreference
<com.android.settingslib.widget.IllustrationPreference
android:key="one_handed_header"
android:layout="@layout/one_handed_header"
android:persistent="false"
android:selectable="false"
settings:allowDividerBelow="false"
settings:searchable="false"/>
settings:searchable="false"
app:lottie_rawRes="@raw/lottie_one_hand_mode"/>
<com.android.settingslib.widget.MainSwitchPreference
android:key="gesture_one_handed_mode_enabled_main_switch"

View File

@@ -17,21 +17,21 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:title="@string/ambient_display_pickup_title">
<com.android.settings.widget.VideoPreference
<com.android.settingslib.widget.IllustrationPreference
android:key="gesture_pick_up_video"
app:animation="@raw/gesture_ambient_lift"
app:preview="@drawable/gesture_ambient_lift"
app:controller="com.android.settings.widget.VideoPreferenceController" />
settings:searchable="false"
app:lottie_rawRes="@raw/lottie_lift_to_check_phone"/>
<SwitchPreference
android:key="gesture_pick_up"
android:title="@string/ambient_display_pickup_title"
android:summary="@string/ambient_display_pickup_summary"
app:keywords="@string/keywords_gesture"
app:controller="com.android.settings.gestures.PickupGesturePreferenceController"
app:allowDividerAbove="true" />
app:controller="com.android.settings.gestures.PickupGesturePreferenceController" />
</PreferenceScreen>

View File

@@ -17,14 +17,14 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:title="@string/gesture_prevent_ringing_screen_title">
<com.android.settings.widget.VideoPreference
<com.android.settingslib.widget.IllustrationPreference
android:key="gesture_prevent_ringing_video"
app:animation="@raw/gesture_prevent_ringing"
app:preview="@drawable/gesture_prevent_ringing"
app:controller="com.android.settings.widget.VideoPreferenceController" />
settings:searchable="false"
app:lottie_rawRes="@raw/lottie_prevent_ringing"/>
<com.android.settingslib.widget.MainSwitchPreference
android:key="gesture_prevent_ringing_switch" />

View File

@@ -16,22 +16,21 @@
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:key="gesture_swipe_down_fingerprint_screen"
android:title="@string/fingerprint_gesture_screen_title">
<com.android.settings.widget.VideoPreference
<com.android.settingslib.widget.IllustrationPreference
android:key="gesture_swipe_down_fingerprint_video"
app:animation="@raw/gesture_fingerprint_swipe"
app:preview="@drawable/gesture_fingerprint_swipe"
app:controller="com.android.settings.widget.VideoPreferenceController" />
settings:searchable="false"
app:lottie_rawRes="@raw/lottie_swipe_fingerprint"/>
<SwitchPreference
android:key="gesture_swipe_down_fingerprint"
android:title="@string/fingerprint_swipe_for_notifications_title"
android:summary="@string/fingerprint_swipe_for_notifications_summary"
app:keywords="@string/keywords_gesture"
app:controller="com.android.settings.gestures.SwipeToNotificationPreferenceController"
app:allowDividerAbove="true" />
app:controller="com.android.settings.gestures.SwipeToNotificationPreferenceController" />
</PreferenceScreen>
</PreferenceScreen>

View File

@@ -17,21 +17,20 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:title="@string/ambient_display_tap_screen_title">
<com.android.settings.widget.VideoPreference
<com.android.settingslib.widget.IllustrationPreference
android:key="gesture_tap_screen_video"
app:animation="@raw/gesture_ambient_tap_screen"
app:preview="@drawable/gesture_ambient_tap_screen"
app:controller="com.android.settings.widget.VideoPreferenceController" />
settings:searchable="false"
app:lottie_rawRes="@raw/lottie_tap_to_check_phone"/>
<SwitchPreference
android:key="gesture_tap"
android:title="@string/ambient_display_tap_screen_title"
android:summary="@string/ambient_display_tap_screen_summary"
app:keywords="@string/keywords_gesture"
app:controller="com.android.settings.gestures.TapScreenGesturePreferenceController"
app:allowDividerAbove="true" />
app:controller="com.android.settings.gestures.TapScreenGesturePreferenceController" />
</PreferenceScreen>

View File

@@ -42,7 +42,10 @@ public abstract class GesturePreferenceController extends TogglePreferenceContro
public void displayPreference(PreferenceScreen screen) {
super.displayPreference(screen);
if (isAvailable()) {
mVideoPreference = screen.findPreference(getVideoPrefKey());
final Preference pref = screen.findPreference(getVideoPrefKey());
if (pref instanceof VideoPreference) {
mVideoPreference = screen.findPreference(getVideoPrefKey());
}
}
}

View File

@@ -30,7 +30,6 @@ import androidx.preference.PreferenceScreen;
import com.android.internal.annotations.VisibleForTesting;
import com.android.settings.R;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settings.widget.VideoPreference;
import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.core.lifecycle.Lifecycle;
import com.android.settingslib.core.lifecycle.LifecycleObserver;
@@ -52,8 +51,6 @@ public class PreventRingingGesturePreferenceController extends AbstractPreferenc
private final String KEY = "gesture_prevent_ringing_category";
private final Context mContext;
private VideoPreference mVideoPreference;
@VisibleForTesting
PreferenceCategory mPreferenceCategory;
@VisibleForTesting
@@ -85,8 +82,6 @@ public class PreventRingingGesturePreferenceController extends AbstractPreferenc
if (mPreferenceCategory != null) {
mSettingObserver = new SettingObserver(mPreferenceCategory);
}
mVideoPreference = screen.findPreference(getVideoPrefKey());
}
@Override
@@ -142,10 +137,6 @@ public class PreventRingingGesturePreferenceController extends AbstractPreferenc
mSettingObserver.register(mContext.getContentResolver());
mSettingObserver.onChange(false, null);
}
if (mVideoPreference != null) {
mVideoPreference.onViewVisible();
}
}
@Override
@@ -153,10 +144,6 @@ public class PreventRingingGesturePreferenceController extends AbstractPreferenc
if (mSettingObserver != null) {
mSettingObserver.unregister(mContext.getContentResolver());
}
if (mVideoPreference != null) {
mVideoPreference.onViewInvisible();
}
}
private int keyToSetting(String key) {