Replace banner video with static image for Color Inversion.

Bug: 152466128
Test: manual test
Change-Id: I859052385930b01929cad8dbf231d212a9507453
This commit is contained in:
Peter_Liang
2020-05-05 17:01:47 +08:00
parent d29dd6ca5e
commit 5b957476be
4 changed files with 5 additions and 45 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@@ -1,34 +0,0 @@
<?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>

View File

@@ -22,6 +22,7 @@ import static com.android.settings.accessibility.AccessibilityUtil.State.OFF;
import static com.android.settings.accessibility.AccessibilityUtil.State.ON; import static com.android.settings.accessibility.AccessibilityUtil.State.ON;
import android.app.settings.SettingsEnums; import android.app.settings.SettingsEnums;
import android.content.ContentResolver;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
@@ -33,14 +34,11 @@ import android.view.ViewGroup;
import androidx.preference.SwitchPreference; import androidx.preference.SwitchPreference;
import com.android.settings.R; import com.android.settings.R;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.search.SearchIndexable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/** Settings page for color inversion. */ /** Settings page for color inversion. */
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
public class ToggleColorInversionPreferenceFragment extends ToggleFeaturePreferenceFragment { public class ToggleColorInversionPreferenceFragment extends ToggleFeaturePreferenceFragment {
private static final String ENABLED = Settings.Secure.ACCESSIBILITY_DISPLAY_INVERSION_ENABLED; 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); Settings.Secure.putInt(getContentResolver(), ENABLED, enabled ? ON : OFF);
} }
@Override
protected int getPreferenceScreenResId() {
return R.xml.accessibility_color_inversion_settings;
}
@Override @Override
protected void onRemoveSwitchPreferenceToggleSwitch() { protected void onRemoveSwitchPreferenceToggleSwitch() {
super.onRemoveSwitchPreferenceToggleSwitch(); super.onRemoveSwitchPreferenceToggleSwitch();
@@ -91,6 +84,10 @@ public class ToggleColorInversionPreferenceFragment extends ToggleFeaturePrefere
mComponentName = COLOR_INVERSION_COMPONENT_NAME; mComponentName = COLOR_INVERSION_COMPONENT_NAME;
mPackageName = getText(R.string.accessibility_display_inversion_preference_title); mPackageName = getText(R.string.accessibility_display_inversion_preference_title);
mHtmlDescription = getText(R.string.accessibility_display_inversion_preference_subtitle); 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); final List<String> enableServiceFeatureKeys = new ArrayList<>(/* initialCapacity= */ 1);
enableServiceFeatureKeys.add(ENABLED); enableServiceFeatureKeys.add(ENABLED);
mSettingsContentObserver = new SettingsContentObserver(mHandler, enableServiceFeatureKeys) { mSettingsContentObserver = new SettingsContentObserver(mHandler, enableServiceFeatureKeys) {
@@ -139,7 +136,4 @@ public class ToggleColorInversionPreferenceFragment extends ToggleFeaturePrefere
} }
mToggleServiceDividerSwitchPreference.setChecked(checked); mToggleServiceDividerSwitchPreference.setChecked(checked);
} }
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new BaseSearchIndexProvider(R.xml.accessibility_color_inversion_settings);
} }