Merge "add accessibility string for location quicksetting" into klp-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
5eb3e07c5d
@ -382,6 +382,8 @@
|
|||||||
<string name="accessibility_quick_settings_airplane">Airplane Mode <xliff:g id="state" example="Off">%s</xliff:g>.</string>
|
<string name="accessibility_quick_settings_airplane">Airplane Mode <xliff:g id="state" example="Off">%s</xliff:g>.</string>
|
||||||
<!-- Content description of the bluetooth tile in quick settings (not shown on the screen). [CHAR LIMIT=NONE] -->
|
<!-- Content description of the bluetooth tile in quick settings (not shown on the screen). [CHAR LIMIT=NONE] -->
|
||||||
<string name="accessibility_quick_settings_bluetooth">Bluetooth <xliff:g id="state" example="Off">%s</xliff:g>.</string>
|
<string name="accessibility_quick_settings_bluetooth">Bluetooth <xliff:g id="state" example="Off">%s</xliff:g>.</string>
|
||||||
|
<!-- Content description of the location tile in quick settings (not shown on the screen). [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="accessibility_quick_settings_location">Location <xliff:g id="state" example="Off">%s</xliff:g>.</string>
|
||||||
<!-- Content description of the alarm tile in quick settings (not shown on the screen). [CHAR LIMIT=NONE] -->
|
<!-- Content description of the alarm tile in quick settings (not shown on the screen). [CHAR LIMIT=NONE] -->
|
||||||
<string name="accessibility_quick_settings_alarm">Alarm set for <xliff:g id="time" example="Wed 3:30 PM">%s</xliff:g>.</string>
|
<string name="accessibility_quick_settings_alarm">Alarm set for <xliff:g id="time" example="Wed 3:30 PM">%s</xliff:g>.</string>
|
||||||
|
|
||||||
|
@ -630,8 +630,19 @@ class QuickSettings {
|
|||||||
return true; // Consume click
|
return true; // Consume click
|
||||||
}} );
|
}} );
|
||||||
}
|
}
|
||||||
mModel.addLocationTile(locationTile,
|
mModel.addLocationTile(locationTile, new QuickSettingsModel.RefreshCallback() {
|
||||||
new QuickSettingsModel.BasicRefreshCallback(locationTile));
|
@Override
|
||||||
|
public void refreshView(QuickSettingsTileView unused, State state) {
|
||||||
|
locationTile.setImageResource(state.iconId);
|
||||||
|
String locationState = mContext.getString(
|
||||||
|
(state.enabled) ? R.string.accessibility_desc_on
|
||||||
|
: R.string.accessibility_desc_off);
|
||||||
|
locationTile.setContentDescription(mContext.getString(
|
||||||
|
R.string.accessibility_quick_settings_location,
|
||||||
|
locationState));
|
||||||
|
locationTile.setText(state.label);
|
||||||
|
}
|
||||||
|
});
|
||||||
parent.addView(locationTile);
|
parent.addView(locationTile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user