Loading res/raw/lottie_system_nav_fully_gestural_with_nav.json 0 → 100644 +1 −0 File added.Preview size limit exceeded, changes collapsed. Show changes src/com/android/settings/gestures/SystemNavigationGestureSettings.java +45 −2 Original line number Diff line number Diff line Loading @@ -75,6 +75,13 @@ public class SystemNavigationGestureSettings extends RadioButtonPickerFragment i private static final String KEY_SHOW_A11Y_TUTORIAL_DIALOG = "show_a11y_tutorial_dialog_bool"; static final String LAUNCHER_PACKAGE_NAME = "com.google.android.apps.nexuslauncher"; static final String ACTION_GESTURE_SANDBOX = "com.android.quickstep.action.GESTURE_SANDBOX"; final Intent mLaunchSandboxIntent = new Intent(ACTION_GESTURE_SANDBOX) .setPackage(LAUNCHER_PACKAGE_NAME); private static final int MIN_LARGESCREEN_WIDTH_DP = 600; private boolean mA11yTutorialDialogShown = false; Loading Loading @@ -121,6 +128,7 @@ public class SystemNavigationGestureSettings extends RadioButtonPickerFragment i mVideoPreference.applyDynamicColor(); } setIllustrationVideo(mVideoPreference, getDefaultKey()); setIllustrationClickListener(mVideoPreference, getDefaultKey()); migrateOverlaySensitivityToSettings(context, mOverlayManager); } Loading Loading @@ -221,7 +229,37 @@ public class SystemNavigationGestureSettings extends RadioButtonPickerFragment i setCurrentSystemNavigationMode(mOverlayManager, key); setIllustrationVideo(mVideoPreference, key); setGestureNavigationTutorialDialog(key); setIllustrationClickListener(mVideoPreference, key); return true; } private boolean isGestureTutorialAvailable() { Context context = getContext(); return context != null && mLaunchSandboxIntent.resolveActivity(context.getPackageManager()) != null; } private void setIllustrationClickListener(IllustrationPreference videoPref, String systemNavKey) { switch (systemNavKey) { case KEY_SYSTEM_NAV_GESTURAL: if (isGestureTutorialAvailable()){ videoPref.setOnPreferenceClickListener(preference -> { startActivity(mLaunchSandboxIntent.putExtra("use_tutorial_menu", true)); return true; }); } else { videoPref.setOnPreferenceClickListener(null); } break; case KEY_SYSTEM_NAV_2BUTTONS: case KEY_SYSTEM_NAV_3BUTTONS: default: videoPref.setOnPreferenceClickListener(null); break; } } static void migrateOverlaySensitivityToSettings(Context context, Loading Loading @@ -278,11 +316,16 @@ public class SystemNavigationGestureSettings extends RadioButtonPickerFragment i } } private static void setIllustrationVideo(IllustrationPreference videoPref, private void setIllustrationVideo(IllustrationPreference videoPref, String systemNavKey) { switch (systemNavKey) { case KEY_SYSTEM_NAV_GESTURAL: if (isGestureTutorialAvailable()) { videoPref.setLottieAnimationResId( R.raw.lottie_system_nav_fully_gestural_with_nav); } else { videoPref.setLottieAnimationResId(R.raw.lottie_system_nav_fully_gestural); } break; case KEY_SYSTEM_NAV_2BUTTONS: videoPref.setLottieAnimationResId(R.raw.lottie_system_nav_2_button); Loading Loading
res/raw/lottie_system_nav_fully_gestural_with_nav.json 0 → 100644 +1 −0 File added.Preview size limit exceeded, changes collapsed. Show changes
src/com/android/settings/gestures/SystemNavigationGestureSettings.java +45 −2 Original line number Diff line number Diff line Loading @@ -75,6 +75,13 @@ public class SystemNavigationGestureSettings extends RadioButtonPickerFragment i private static final String KEY_SHOW_A11Y_TUTORIAL_DIALOG = "show_a11y_tutorial_dialog_bool"; static final String LAUNCHER_PACKAGE_NAME = "com.google.android.apps.nexuslauncher"; static final String ACTION_GESTURE_SANDBOX = "com.android.quickstep.action.GESTURE_SANDBOX"; final Intent mLaunchSandboxIntent = new Intent(ACTION_GESTURE_SANDBOX) .setPackage(LAUNCHER_PACKAGE_NAME); private static final int MIN_LARGESCREEN_WIDTH_DP = 600; private boolean mA11yTutorialDialogShown = false; Loading Loading @@ -121,6 +128,7 @@ public class SystemNavigationGestureSettings extends RadioButtonPickerFragment i mVideoPreference.applyDynamicColor(); } setIllustrationVideo(mVideoPreference, getDefaultKey()); setIllustrationClickListener(mVideoPreference, getDefaultKey()); migrateOverlaySensitivityToSettings(context, mOverlayManager); } Loading Loading @@ -221,7 +229,37 @@ public class SystemNavigationGestureSettings extends RadioButtonPickerFragment i setCurrentSystemNavigationMode(mOverlayManager, key); setIllustrationVideo(mVideoPreference, key); setGestureNavigationTutorialDialog(key); setIllustrationClickListener(mVideoPreference, key); return true; } private boolean isGestureTutorialAvailable() { Context context = getContext(); return context != null && mLaunchSandboxIntent.resolveActivity(context.getPackageManager()) != null; } private void setIllustrationClickListener(IllustrationPreference videoPref, String systemNavKey) { switch (systemNavKey) { case KEY_SYSTEM_NAV_GESTURAL: if (isGestureTutorialAvailable()){ videoPref.setOnPreferenceClickListener(preference -> { startActivity(mLaunchSandboxIntent.putExtra("use_tutorial_menu", true)); return true; }); } else { videoPref.setOnPreferenceClickListener(null); } break; case KEY_SYSTEM_NAV_2BUTTONS: case KEY_SYSTEM_NAV_3BUTTONS: default: videoPref.setOnPreferenceClickListener(null); break; } } static void migrateOverlaySensitivityToSettings(Context context, Loading Loading @@ -278,11 +316,16 @@ public class SystemNavigationGestureSettings extends RadioButtonPickerFragment i } } private static void setIllustrationVideo(IllustrationPreference videoPref, private void setIllustrationVideo(IllustrationPreference videoPref, String systemNavKey) { switch (systemNavKey) { case KEY_SYSTEM_NAV_GESTURAL: if (isGestureTutorialAvailable()) { videoPref.setLottieAnimationResId( R.raw.lottie_system_nav_fully_gestural_with_nav); } else { videoPref.setLottieAnimationResId(R.raw.lottie_system_nav_fully_gestural); } break; case KEY_SYSTEM_NAV_2BUTTONS: videoPref.setLottieAnimationResId(R.raw.lottie_system_nav_2_button); Loading