Adds dummy HomeGestureTutorialFragment.

- Adds a new launch target in Dev options
 - Moves Back handling to the parent TutorialFragment
   (so all Tutorials can handle it as necessary)
 - Currently uses a dummy translating rectangle in
   place of a proper hand animation
 - No actual home gesture recognition is in place yet

Test: Manual
Bug: 148542211
Change-Id: Ic5a545eb9f5003914803272c8ffe367220d63336
This commit is contained in:
Andy Wickham
2020-04-15 20:25:32 +00:00
parent 86932724e7
commit 4f66dc3bef
10 changed files with 260 additions and 58 deletions

View File

@@ -216,17 +216,27 @@ public class DeveloperOptionsFragment extends PreferenceFragmentCompat {
if (launchSandboxIntent.resolveActivity(context.getPackageManager()) == null) {
return;
}
PreferenceCategory sandboxCategory = newCategory("Sandbox");
Preference launchSandboxPreference = new Preference(context);
launchSandboxPreference.setKey("launchSandbox");
launchSandboxPreference.setTitle("Launch Gesture Navigation Sandbox");
launchSandboxPreference.setSummary(
"This provides tutorials and a place to practice navigation gestures.");
launchSandboxPreference.setOnPreferenceClickListener(preference -> {
startActivity(launchSandboxIntent);
PreferenceCategory sandboxCategory = newCategory("Gesture Navigation Sandbox");
sandboxCategory.setSummary("Learn and practice navigation gestures");
Preference launchBackTutorialPreference = new Preference(context);
launchBackTutorialPreference.setKey("launchBackTutorial");
launchBackTutorialPreference.setTitle("Launch Back Tutorial");
launchBackTutorialPreference.setSummary("Learn how to use the Back gesture");
launchBackTutorialPreference.setOnPreferenceClickListener(preference -> {
startActivity(launchSandboxIntent.putExtra(
"tutorial_type", "RIGHT_EDGE_BACK_NAVIGATION"));
return true;
});
sandboxCategory.addPreference(launchSandboxPreference);
sandboxCategory.addPreference(launchBackTutorialPreference);
Preference launchHomeTutorialPreference = new Preference(context);
launchHomeTutorialPreference.setKey("launchHomeTutorial");
launchHomeTutorialPreference.setTitle("Launch Home Tutorial");
launchHomeTutorialPreference.setSummary("Learn how to use the Home gesture");
launchHomeTutorialPreference.setOnPreferenceClickListener(preference -> {
startActivity(launchSandboxIntent.putExtra("tutorial_type", "HOME_NAVIGATION"));
return true;
});
sandboxCategory.addPreference(launchHomeTutorialPreference);
}
private String toName(String action) {