a11y: Add cursor following mode dialog

This a pure UI change that adds a new magnification cursor following
mode dialog behind a flag. The framework support will be added
separately later.

There are 3 modes as the following:
  - continuous mode
  - center mode
  - edge mode

It also renames magnification mode dialog xml file for general purpose
within accessibility.

NO_IFTTT=linter not working

Bug: b/388335935
Flag: com.android.settings.accessibility.enable_magnification_cursor_following_dialog
Test: SettingsRoboTests:com.android.settings.accessibility.ToggleScreenMagnificationPreferenceFragmentTest &&
      SettingsRoboTests:com.android.settings.accessibility.MagnificationModePreferenceControllerTest &&
      SettingsRoboTests:com.android.settings.accessibility.MagnificationCursorFollowingModePreferenceControllerTest
Change-Id: If2672186faf7443cc210d79630b1ea4f3808d7e4
This commit is contained in:
Yongshun Liu
2025-02-12 10:28:11 +00:00
parent 43e0a04580
commit 20d1a7d1b6
8 changed files with 520 additions and 4 deletions

View File

@@ -176,8 +176,12 @@ public class MagnificationModePreferenceController extends BasePreferenceControl
mContext, mModeInfos, this::onMagnificationModeSelected);
final View headerView = LayoutInflater.from(mContext).inflate(
R.layout.accessibility_magnification_mode_header,
getMagnificationModesListView(), /* attachToRoot= */false);
R.layout.accessibility_dialog_header, getMagnificationModesListView(),
/* attachToRoot= */false);
final TextView textView = Preconditions.checkNotNull(headerView.findViewById(
R.id.accessibility_dialog_header_text_view));
textView.setText(
mContext.getString(R.string.accessibility_magnification_area_settings_message));
getMagnificationModesListView().addHeaderView(headerView, /* data= */null,
/* isSelectable= */false);