Merge "Revert "feat(MultiFingerMultiTap): Add tutorial for two finger triple tap"" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
db99e6027c
@@ -4635,8 +4635,6 @@
|
|||||||
<string name="accessibility_tutorial_dialog_title_volume">Hold volume keys to open</string>
|
<string name="accessibility_tutorial_dialog_title_volume">Hold volume keys to open</string>
|
||||||
<!-- Title for the accessibility tutorial dialog in accessibility service with triple tap. [CHAR LIMIT=100] -->
|
<!-- Title for the accessibility tutorial dialog in accessibility service with triple tap. [CHAR LIMIT=100] -->
|
||||||
<string name="accessibility_tutorial_dialog_title_triple">Triple tap screen to open</string>
|
<string name="accessibility_tutorial_dialog_title_triple">Triple tap screen to open</string>
|
||||||
<!-- Title for the accessibility tutorial dialog in accessibility service with two finger triple tap. [CHAR LIMIT=100] -->
|
|
||||||
<string name="accessibility_tutorial_dialog_title_two_finger_triple">Two finger triple tap screen to open</string>
|
|
||||||
<!-- Title for the accessibility tutorial dialog in accessibility service with gesture. [CHAR LIMIT=50] -->
|
<!-- Title for the accessibility tutorial dialog in accessibility service with gesture. [CHAR LIMIT=50] -->
|
||||||
<string name="accessibility_tutorial_dialog_title_gesture">Use gesture to open</string>
|
<string name="accessibility_tutorial_dialog_title_gesture">Use gesture to open</string>
|
||||||
<!-- Title for the accessibility tutorial dialog in gesture navigation settings. [CHAR LIMIT=50] -->
|
<!-- Title for the accessibility tutorial dialog in gesture navigation settings. [CHAR LIMIT=50] -->
|
||||||
@@ -4649,8 +4647,6 @@
|
|||||||
<string name="accessibility_tutorial_dialog_message_volume">To use this feature, press & hold both volume keys.</string>
|
<string name="accessibility_tutorial_dialog_message_volume">To use this feature, press & hold both volume keys.</string>
|
||||||
<!-- Instruction for the accessibility tutorial dialog in accessibility service with triple tap. [CHAR LIMIT=100] -->
|
<!-- Instruction for the accessibility tutorial dialog in accessibility service with triple tap. [CHAR LIMIT=100] -->
|
||||||
<string name="accessibility_tutorial_dialog_message_triple">To start and stop magnification, triple-tap anywhere on your screen.</string>
|
<string name="accessibility_tutorial_dialog_message_triple">To start and stop magnification, triple-tap anywhere on your screen.</string>
|
||||||
<!-- Instruction for the accessibility tutorial dialog in accessibility service with two finger triple tap. [CHAR LIMIT=100] -->
|
|
||||||
<string name="accessibility_tutorial_dialog_message_two_finger_triple">To start and stop magnification, triple-tap anywhere on your screen with two fingers.</string>
|
|
||||||
<!-- Message for the accessibility tutorial dialog when user enables an accessibility service while using gesture navigation and touch exploration is not enabled. [CHAR LIMIT=NONE] -->
|
<!-- Message for the accessibility tutorial dialog when user enables an accessibility service while using gesture navigation and touch exploration is not enabled. [CHAR LIMIT=NONE] -->
|
||||||
<string name="accessibility_tutorial_dialog_message_gesture">To use this feature, swipe up from the bottom of the screen with 2 fingers.\n\nTo switch between features, swipe up with 2 fingers and hold.</string>
|
<string name="accessibility_tutorial_dialog_message_gesture">To use this feature, swipe up from the bottom of the screen with 2 fingers.\n\nTo switch between features, swipe up with 2 fingers and hold.</string>
|
||||||
<!-- Message for the accessibility tutorial dialog when user enables an accessibility service while using gesture navigation and touch exploration is enabled. [CHAR LIMIT=NONE] -->
|
<!-- Message for the accessibility tutorial dialog when user enables an accessibility service while using gesture navigation and touch exploration is enabled. [CHAR LIMIT=NONE] -->
|
||||||
|
@@ -54,7 +54,6 @@ import androidx.core.widget.TextViewCompat;
|
|||||||
import androidx.viewpager.widget.PagerAdapter;
|
import androidx.viewpager.widget.PagerAdapter;
|
||||||
import androidx.viewpager.widget.ViewPager;
|
import androidx.viewpager.widget.ViewPager;
|
||||||
|
|
||||||
import com.android.server.accessibility.Flags;
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.core.SubSettingLauncher;
|
import com.android.settings.core.SubSettingLauncher;
|
||||||
import com.android.settingslib.widget.LottieColorUtils;
|
import com.android.settingslib.widget.LottieColorUtils;
|
||||||
@@ -412,23 +411,6 @@ public final class AccessibilityGestureNavigationTutorial {
|
|||||||
return new TutorialPage(type, title, image, indicatorIcon, instruction);
|
return new TutorialPage(type, title, image, indicatorIcon, instruction);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static TutorialPage createTwoFingerTripleTapTutorialPage(@NonNull Context context) {
|
|
||||||
// TODO(b/308088945): Update tutorial string and image when UX provides them
|
|
||||||
final int type = UserShortcutType.TWOFINGERTRIPLETAP;
|
|
||||||
final CharSequence title =
|
|
||||||
context.getText(R.string.accessibility_tutorial_dialog_title_two_finger_triple);
|
|
||||||
final View image =
|
|
||||||
createIllustrationViewWithImageRawResource(context,
|
|
||||||
R.raw.a11y_shortcut_type_triple_tap);
|
|
||||||
final CharSequence instruction =
|
|
||||||
context.getText(R.string.accessibility_tutorial_dialog_message_two_finger_triple);
|
|
||||||
final ImageView indicatorIcon =
|
|
||||||
createImageView(context, R.drawable.ic_accessibility_page_indicator);
|
|
||||||
indicatorIcon.setEnabled(false);
|
|
||||||
|
|
||||||
return new TutorialPage(type, title, image, indicatorIcon, instruction);
|
|
||||||
}
|
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
static List<TutorialPage> createShortcutTutorialPages(@NonNull Context context,
|
static List<TutorialPage> createShortcutTutorialPages(@NonNull Context context,
|
||||||
int shortcutTypes) {
|
int shortcutTypes) {
|
||||||
@@ -445,13 +427,6 @@ public final class AccessibilityGestureNavigationTutorial {
|
|||||||
tutorialPages.add(createTripleTapTutorialPage(context));
|
tutorialPages.add(createTripleTapTutorialPage(context));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Flags.enableMagnificationMultipleFingerMultipleTapGesture()) {
|
|
||||||
if ((shortcutTypes & UserShortcutType.TWOFINGERTRIPLETAP)
|
|
||||||
== UserShortcutType.TWOFINGERTRIPLETAP) {
|
|
||||||
tutorialPages.add(createTwoFingerTripleTapTutorialPage(context));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return tutorialPages;
|
return tutorialPages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -32,15 +32,11 @@ import android.app.settings.SettingsEnums;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.platform.test.annotations.RequiresFlagsEnabled;
|
|
||||||
import android.platform.test.flag.junit.CheckFlagsRule;
|
|
||||||
import android.platform.test.flag.junit.DeviceFlagsValueProvider;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.test.core.app.ApplicationProvider;
|
import androidx.test.core.app.ApplicationProvider;
|
||||||
|
|
||||||
import com.android.server.accessibility.Flags;
|
|
||||||
import com.android.settings.SettingsActivity;
|
import com.android.settings.SettingsActivity;
|
||||||
import com.android.settings.SubSettings;
|
import com.android.settings.SubSettings;
|
||||||
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
|
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
|
||||||
@@ -63,8 +59,6 @@ public final class AccessibilityGestureNavigationTutorialTest {
|
|||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
public final MockitoRule mMockitoRule = MockitoJUnit.rule();
|
public final MockitoRule mMockitoRule = MockitoJUnit.rule();
|
||||||
@Rule
|
|
||||||
public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule();
|
|
||||||
@Mock
|
@Mock
|
||||||
private DialogInterface.OnClickListener mOnClickListener;
|
private DialogInterface.OnClickListener mOnClickListener;
|
||||||
@Mock
|
@Mock
|
||||||
@@ -95,19 +89,6 @@ public final class AccessibilityGestureNavigationTutorialTest {
|
|||||||
assertThat(alertDialog).isNotNull();
|
assertThat(alertDialog).isNotNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@RequiresFlagsEnabled(Flags.FLAG_ENABLE_MAGNIFICATION_MULTIPLE_FINGER_MULTIPLE_TAP_GESTURE)
|
|
||||||
public void createTutorialPages_turnOnTwoFingerTripleTapShortcut_hasOnePage() {
|
|
||||||
mShortcutTypes |= UserShortcutType.TWOFINGERTRIPLETAP;
|
|
||||||
|
|
||||||
final AlertDialog alertDialog =
|
|
||||||
createAccessibilityTutorialDialog(mContext, mShortcutTypes);
|
|
||||||
|
|
||||||
assertThat(createShortcutTutorialPages(mContext,
|
|
||||||
mShortcutTypes)).hasSize(/* expectedSize= */ 1);
|
|
||||||
assertThat(alertDialog).isNotNull();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void createTutorialPages_turnOnSoftwareShortcut_hasOnePage() {
|
public void createTutorialPages_turnOnSoftwareShortcut_hasOnePage() {
|
||||||
mShortcutTypes |= UserShortcutType.SOFTWARE;
|
mShortcutTypes |= UserShortcutType.SOFTWARE;
|
||||||
|
Reference in New Issue
Block a user