Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ac54a3a authored by Victoria Lease's avatar Victoria Lease
Browse files

add accessibility string for location quicksetting

This gives the location quick setting the same ability that all the
other quick settings have: the accessibility text can now be
different from the display text.

Bug: 11010329
Change-Id: I0dee7b6f974b4e1dc314a35e39d907e90dc8dc3c
parent ef53fcc3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -382,6 +382,8 @@
    <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] -->
    <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] -->
    <string name="accessibility_quick_settings_alarm">Alarm set for <xliff:g id="time" example="Wed 3:30 PM">%s</xliff:g>.</string>

+13 −2
Original line number Diff line number Diff line
@@ -630,8 +630,19 @@ class QuickSettings {
                    return true; // Consume click
                }} );
        }
        mModel.addLocationTile(locationTile,
                new QuickSettingsModel.BasicRefreshCallback(locationTile));
        mModel.addLocationTile(locationTile, new QuickSettingsModel.RefreshCallback() {
            @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);
    }