Merge "Fix accessibility button footer preference did not announced correct by TalkBack" into sc-dev am: bf6af8ac92
am: 336cfe271f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15204641 Change-Id: I6a7e5b327e3931bef3af2a51cceb1003ef7758fb
This commit is contained in:
@@ -18,6 +18,8 @@ package com.android.settings.accessibility;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.R;
|
||||
|
||||
/**
|
||||
@@ -36,9 +38,16 @@ public class AccessibilityButtonFooterPreferenceController extends
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getSummary() {
|
||||
return AccessibilityUtil.isGestureNavigateEnabled(mContext)
|
||||
? mContext.getString(R.string.accessibility_button_gesture_description)
|
||||
: mContext.getString(R.string.accessibility_button_description);
|
||||
public void displayPreference(PreferenceScreen screen) {
|
||||
// Need to update footerPreference's data before super.displayPreference(), then it will use
|
||||
// data to update related property of footerPreference.
|
||||
if (AccessibilityUtil.isGestureNavigateEnabled(mContext)) {
|
||||
final AccessibilityFooterPreference footerPreference =
|
||||
screen.findPreference(getPreferenceKey());
|
||||
footerPreference.setTitle(
|
||||
mContext.getString(R.string.accessibility_button_gesture_description));
|
||||
}
|
||||
|
||||
super.displayPreference(screen);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user