Merge "Adds Settings button back to Back gesture tutorial." into ub-launcher3-rvc-dev

This commit is contained in:
TreeHugger Robot
2020-05-13 18:34:37 +00:00
committed by Android (Google) Code Review
4 changed files with 12 additions and 21 deletions

View File

@@ -129,12 +129,12 @@
<!-- Feedback shown during interactive parts of Home gesture tutorial when the gesture is horizontal instead of vertical. [CHAR LIMIT=100] -->
<string name="home_gesture_feedback_wrong_swipe_direction" translatable="false">Make sure you swipe straight up</string>
<!-- Title shown on the confirmation screen after successful gesture. [CHAR LIMIT=30] -->
<string name="gesture_tutorial_confirm_title" translatable="false">All set</string>
<!-- Button text shown on a button on the confirm screen. [CHAR LIMIT=14] -->
<string name="gesture_tutorial_action_button_label" translatable="false">Done</string>
<!-- Button text shown on a text button on the confirm screen. [CHAR LIMIT=14] -->
<string name="gesture_tutorial_action_text_button_label" translatable="false">Settings</string>
<!-- Title shown on the confirmation screen after successful gesture. [CHAR LIMIT=30] -->
<string name="gesture_tutorial_confirm_title" translatable="false">All set</string>
<!-- Button text shown on a button on the confirm screen to leave the tutorial. [CHAR LIMIT=14] -->
<string name="gesture_tutorial_action_button_label_done" translatable="false">Done</string>
<!-- Button text shown on a button to go to Settings. [CHAR LIMIT=14] -->
<string name="gesture_tutorial_action_button_label_settings" translatable="false">Settings</string>
<!-- ******* Overview ******* -->
<!-- Label for a button that causes the current overview app to be shared. [CHAR_LIMIT=40] -->

View File

@@ -68,13 +68,16 @@ final class BackGestureTutorialController extends TutorialController {
@Override
Integer getActionButtonStringId() {
if (mTutorialType == BACK_NAVIGATION_COMPLETE) {
return R.string.gesture_tutorial_action_button_label;
return R.string.gesture_tutorial_action_button_label_done;
}
return null;
}
@Override
Integer getActionTextButtonStringId() {
if (mTutorialType == BACK_NAVIGATION_COMPLETE) {
return R.string.gesture_tutorial_action_button_label_settings;
}
return null;
}
@@ -86,7 +89,6 @@ final class BackGestureTutorialController extends TutorialController {
@Override
void onActionTextButtonClicked(View button) {
mTutorialFragment.startSystemNavigationSetting();
mTutorialFragment.closeTutorial();
}
@Override

View File

@@ -60,7 +60,7 @@ final class HomeGestureTutorialController extends TutorialController {
@Override
Integer getActionButtonStringId() {
if (mTutorialType == HOME_NAVIGATION_COMPLETE) {
return R.string.gesture_tutorial_action_button_label;
return R.string.gesture_tutorial_action_button_label_done;
}
return null;
}

View File

@@ -15,7 +15,6 @@
*/
package com.android.quickstep.interaction;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.graphics.Insets;
import android.os.Bundle;
@@ -35,8 +34,6 @@ import androidx.fragment.app.FragmentActivity;
import com.android.launcher3.R;
import com.android.quickstep.interaction.TutorialController.TutorialType;
import java.net.URISyntaxException;
abstract class TutorialFragment extends Fragment implements OnTouchListener {
private static final String LOG_TAG = "TutorialFragment";
@@ -182,14 +179,6 @@ abstract class TutorialFragment extends Fragment implements OnTouchListener {
}
void startSystemNavigationSetting() {
try {
startActivityForResult(
Intent.parseUri(SYSTEM_NAVIGATION_SETTING_INTENT, /* flags= */ 0),
/* requestCode= */ 0);
} catch (URISyntaxException e) {
Log.e(LOG_TAG, "The launch Intent Uri is wrong syntax: " + e);
} catch (ActivityNotFoundException e) {
Log.e(LOG_TAG, "The launch Activity not found: " + e);
}
startActivity(new Intent("com.android.settings.GESTURE_NAVIGATION_SETTINGS"));
}
}