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

Commit cf757af3 authored by Jason Hsu's avatar Jason Hsu Committed by Android (Google) Code Review
Browse files

Merge "Remove the unused variables and @deprecated function in Color Inversion quick settings"

parents b3ae0fbf 940e92ab
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -465,10 +465,6 @@
    <string name="accessibility_quick_settings_flashlight_changed_off">Flashlight turned off.</string>
    <!-- Announcement made when the flashlight state changes to on (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_flashlight_changed_on">Flashlight turned on.</string>
    <!-- Announcement made when the color inversion state changes to off (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_color_inversion_changed_off">Color inversion turned off.</string>
    <!-- Announcement made when the color inversion state changes to on (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_color_inversion_changed_on">Color inversion turned on.</string>
    <!-- Announcement made when the hotspot state changes to off (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_hotspot_changed_off">Mobile hotspot turned off.</string>
    <!-- Announcement made when the hotspot state changes to on (not shown on the screen). [CHAR LIMIT=NONE] -->
+0 −21
Original line number Diff line number Diff line
@@ -49,15 +49,9 @@ import javax.inject.Inject;
/** Quick settings tile: Invert colors **/
public class ColorInversionTile extends QSTileImpl<BooleanState> {

    private static final String EXTRA_FRAGMENT_ARGS_KEY = ":settings:fragment_args_key";
    private static final String EXTRA_SHOW_FRAGMENT_ARGS_KEY = ":settings:show_fragment_args";
    private static final String COLOR_INVERSION_PREFERENCE_KEY = "toggle_inversion_preference";

    private final Icon mIcon = ResourceIcon.get(drawable.ic_invert_colors);
    private final SettingObserver mSetting;

    private boolean mListening;

    @Inject
    public ColorInversionTile(
            QSHost host,
@@ -126,11 +120,7 @@ public class ColorInversionTile extends QSTileImpl<BooleanState> {
    protected void handleUpdateState(BooleanState state, Object arg) {
        final int value = arg instanceof Integer ? (Integer) arg : mSetting.getValue();
        final boolean enabled = value != 0;
        if (state.slash == null) {
            state.slash = new SlashState();
        }
        state.value = enabled;
        state.slash.isSlashed = !state.value;
        state.state = state.value ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE;
        state.label = mContext.getString(R.string.quick_settings_inversion_label);
        state.icon = mIcon;
@@ -142,15 +132,4 @@ public class ColorInversionTile extends QSTileImpl<BooleanState> {
    public int getMetricsCategory() {
        return MetricsEvent.QS_COLORINVERSION;
    }

    @Override
    protected String composeChangeAnnouncement() {
        if (mState.value) {
            return mContext.getString(
                    R.string.accessibility_quick_settings_color_inversion_changed_on);
        } else {
            return mContext.getString(
                    R.string.accessibility_quick_settings_color_inversion_changed_off);
        }
    }
}