Apply Setup styles to the a11y edit shortcut full screen.

Bug: 300302098

Test: atest AccessibilitySetupWizardUtilsTest
Test: atest EditShortcutsPreferenceFragmentTest (Unable to make
Robolectric inflate the view of the edit shortcut fragment with the Setup wizard
theme)
Test: manual (Launch the setup wizard and check the screen)

Change-Id: I2995e914d622e9865101ef16e3b280c65371a252
This commit is contained in:
Chun-Ku Lin
2023-12-05 23:09:04 +00:00
parent 64e946c7fa
commit 9d6bf1b784
4 changed files with 75 additions and 6 deletions

View File

@@ -15,7 +15,9 @@
*/
package com.android.settings.accessibility;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import android.content.Context;
@@ -50,4 +52,14 @@ public class AccessibilitySetupWizardUtilsTest {
verify(layout).setIcon(icon);
verify(layout).setHeaderText(title);
}
@Test
public void setupGlifPreferenceLayout_descriptionIsNull_doesNotCallSetDescriptionText() {
GlifPreferenceLayout layout = mock(GlifPreferenceLayout.class);
AccessibilitySetupWizardUtils.updateGlifPreferenceLayout(mContext, layout, "title",
/* description= */ null, /* icon= */ null);
verify(layout, times(0)).setDescriptionText(any());
}
}

View File

@@ -16,7 +16,6 @@
package com.android.settings.accessibility.shortcuts;
import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL;
import static com.android.internal.accessibility.AccessibilityShortcutController.MAGNIFICATION_COMPONENT_NAME;
@@ -416,6 +415,7 @@ public class EditShortcutsPreferenceFragmentTest {
/* themeResId= */ 0, Lifecycle.State.INITIALIZED);
scenario.onFragment(fragment -> {
Intent intent = fragment.requireActivity().getIntent();
intent.putExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT_TITLE, SCREEN_TITLE);
fragment.requireActivity().setIntent(createSuwIntent(intent, isInSuw));
// Since the fragment is attached before we have a chance
// to modify the activity's intent; initialize controllers again