Merge "Create an empty color and motion screen with Catalyst Infra" into main

This commit is contained in:
Chun-Ku Lin
2024-10-18 20:26:09 +00:00
committed by Android (Google) Code Review
5 changed files with 100 additions and 2 deletions

View File

@@ -17,12 +17,15 @@
package com.android.settings.accessibility;
import android.app.settings.SettingsEnums;
import android.content.Context;
import android.hardware.display.ColorDisplayManager;
import android.os.Bundle;
import android.os.Handler;
import android.provider.Settings;
import android.view.accessibility.Flags;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
import androidx.preference.TwoStatePreference;
@@ -148,6 +151,12 @@ public class ColorAndMotionFragment extends DashboardFragment {
}
}
@Nullable
@Override
public String getPreferenceScreenBindingKey(@NonNull Context context) {
return ColorAndMotionScreen.KEY;
}
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new BaseSearchIndexProvider(R.xml.accessibility_color_and_motion);
}

View File

@@ -0,0 +1,43 @@
/*
* Copyright (C) 2024 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.
*/
package com.android.settings.accessibility
import android.content.Context
import com.android.settings.flags.Flags
import com.android.settings.R
import com.android.settingslib.metadata.ProvidePreferenceScreen
import com.android.settingslib.metadata.preferenceHierarchy
import com.android.settingslib.preference.PreferenceScreenCreator
@ProvidePreferenceScreen
class ColorAndMotionScreen : PreferenceScreenCreator {
override val key: String = KEY
override val title: Int = R.string.accessibility_color_and_motion_title
override fun isFlagEnabled(context: Context) = Flags.catalystAccessibilityColorAndMotion()
override fun hasCompleteHierarchy(): Boolean = false
override fun fragmentClass() = ColorAndMotionFragment::class.java
override fun getPreferenceHierarchy(context: Context) = preferenceHierarchy(this) {}
companion object {
const val KEY = "accessibility_color_and_motion"
}
}