workaround(expressive): Fix padding issues Setup > Vision settings

- Works around issue where Setup and Settings libraries are clashing
  when applying their new expressive themes at the same time.
- Updates illustration prefs to match parent width. Otherwise this new
  padding workaround causes the images to get clipped.

Fix: 390545391
Bug: 400479388
Test: manual only; see screenshots
Flag: EXEMPT using custom flagging from Setup ThemeHelper lib
Change-Id: Ie00cdf3e68a2ff7c40aedd04eb5bed0adaa9cf84
This commit is contained in:
Chun-Ku Lin
2025-03-13 17:26:47 +00:00
committed by Daniel Norman
parent f257978cee
commit f5cc0119ee
9 changed files with 125 additions and 2 deletions

View File

@@ -25,12 +25,14 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.preference.PreferenceScreen;
import androidx.recyclerview.widget.RecyclerView;
import com.android.settings.R;
import com.google.android.setupcompat.template.FooterBarMixin;
import com.google.android.setupdesign.GlifPreferenceLayout;
import com.google.android.setupdesign.util.ThemeHelper;
public class ToggleScreenReaderPreferenceFragmentForSetupWizard
extends ToggleAccessibilityServicePreferenceFragment {
@@ -74,6 +76,14 @@ public class ToggleScreenReaderPreferenceFragmentForSetupWizard
return super.onCreateRecyclerView(inflater, parent, savedInstanceState);
}
@Override
protected RecyclerView.Adapter onCreateAdapter(PreferenceScreen preferenceScreen) {
if (ThemeHelper.shouldApplyGlifExpressiveStyle(getContext())) {
return new PreferenceAdapterInSuw(preferenceScreen);
}
return super.onCreateAdapter(preferenceScreen);
}
@Override
public int getMetricsCategory() {
return SettingsEnums.SUW_ACCESSIBILITY_TOGGLE_SCREEN_READER;