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

Commit 2e4e4ed1 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Replace banner video with static image for Color Inversion." into rvc-dev

parents 02e712ce 5b957476
Loading
Loading
Loading
Loading
+4.83 KiB
Loading image diff...
−470 KiB

File deleted.

+0 −34
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2019 The Android Open Source Project

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->

<PreferenceScreen
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:settings="http://schemas.android.com/apk/res-auto"
    android:persistent="false"
    android:title="@string/accessibility_display_inversion_preference_title">

    <com.android.settings.widget.VideoPreference
        android:key="color_inversion_preview"
        android:persistent="false"
        android:selectable="false"
        android:title="@string/summary_placeholder"
        settings:allowDividerBelow="true"
        settings:animation="@raw/accessibility_color_inversion"
        settings:controller="com.android.settings.widget.VideoPreferenceController"
        settings:searchable="false" />

</PreferenceScreen>
+5 −11
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import static com.android.settings.accessibility.AccessibilityUtil.State.OFF;
import static com.android.settings.accessibility.AccessibilityUtil.State.ON;

import android.app.settings.SettingsEnums;
import android.content.ContentResolver;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
@@ -33,14 +34,11 @@ import android.view.ViewGroup;
import androidx.preference.SwitchPreference;

import com.android.settings.R;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.search.SearchIndexable;

import java.util.ArrayList;
import java.util.List;

/** Settings page for color inversion. */
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
public class ToggleColorInversionPreferenceFragment extends ToggleFeaturePreferenceFragment {

    private static final String ENABLED = Settings.Secure.ACCESSIBILITY_DISPLAY_INVERSION_ENABLED;
@@ -58,11 +56,6 @@ public class ToggleColorInversionPreferenceFragment extends ToggleFeaturePrefere
        Settings.Secure.putInt(getContentResolver(), ENABLED, enabled ? ON : OFF);
    }

    @Override
    protected int getPreferenceScreenResId() {
        return R.xml.accessibility_color_inversion_settings;
    }

    @Override
    protected void onRemoveSwitchPreferenceToggleSwitch() {
        super.onRemoveSwitchPreferenceToggleSwitch();
@@ -91,6 +84,10 @@ public class ToggleColorInversionPreferenceFragment extends ToggleFeaturePrefere
        mComponentName = COLOR_INVERSION_COMPONENT_NAME;
        mPackageName = getText(R.string.accessibility_display_inversion_preference_title);
        mHtmlDescription = getText(R.string.accessibility_display_inversion_preference_subtitle);
        mImageUri = new Uri.Builder().scheme(ContentResolver.SCHEME_ANDROID_RESOURCE)
                .authority(getPrefContext().getPackageName())
                .appendPath(String.valueOf(R.drawable.accessibility_color_inversion_banner))
                .build();
        final List<String> enableServiceFeatureKeys = new ArrayList<>(/* initialCapacity= */ 1);
        enableServiceFeatureKeys.add(ENABLED);
        mSettingsContentObserver = new SettingsContentObserver(mHandler, enableServiceFeatureKeys) {
@@ -139,7 +136,4 @@ public class ToggleColorInversionPreferenceFragment extends ToggleFeaturePrefere
        }
        mToggleServiceDividerSwitchPreference.setChecked(checked);
    }

    public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
            new BaseSearchIndexProvider(R.xml.accessibility_color_inversion_settings);
}