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

Commit b756f3e0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic "catalyst" into main

* changes:
  [Catalyst] Move MainSwitchPreferenceBinding
  [Catalyst] Introducing SliderPreferenceBinding
parents e539f591 c29c84cc
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ android_library {
    defaults: [
        "SettingsLintDefaults",
    ],
    min_sdk_version: "21",
    srcs: [":SettingsLibDataStore-srcs"],
    static_libs: [
        "androidx.annotation_annotation",
@@ -21,4 +22,11 @@ android_library {
        "guava",
    ],
    kotlincflags: ["-Xjvm-default=all"],
    apex_available: [
        "//apex_available:platform",
        "com.android.adservices",
        "com.android.cellbroadcast",
        "com.android.extservices",
        "com.android.healthfitness",
    ],
}
+5 −1
Original line number Diff line number Diff line
@@ -14,11 +14,15 @@ android_library {
        "SettingsLintDefaults",
    ],

    srcs: ["src/**/*.java"],
    srcs: [
        "src/**/*.java",
        "src/**/*.kt",
    ],
    resource_dirs: ["res"],

    static_libs: [
        "androidx.preference_preference",
        "SettingsLibPreference",
        "SettingsLibSettingsTheme",
    ],

+27 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 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.settingslib.widget

import android.content.Context
import androidx.preference.Preference
import com.android.settingslib.preference.BooleanValuePreferenceBinding

/** A boolean value type preference associated with [MainSwitchPreference]. */
interface MainSwitchPreferenceBinding : BooleanValuePreferenceBinding {

    override fun createWidget(context: Context): Preference = MainSwitchPreference(context)
}
+8 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ android_library {
    defaults: [
        "SettingsLintDefaults",
    ],
    min_sdk_version: "21",
    srcs: [":SettingsLibMetadata-srcs"],
    static_libs: [
        "SettingsLibDataStore",
@@ -22,4 +23,11 @@ android_library {
    optimize: {
        proguard_flags_files: ["proguard.pgcfg"],
    },
    apex_available: [
        "//apex_available:platform",
        "com.android.adservices",
        "com.android.cellbroadcast",
        "com.android.extservices",
        "com.android.healthfitness",
    ],
}
+0 −6
Original line number Diff line number Diff line
@@ -63,9 +63,3 @@ constructor(
    @StringRes override val title: Int = 0,
    @StringRes override val summary: Int = 0,
) : BooleanValuePreference

/** A preference that provides a two-state toggleable option that can be used as a main switch. */
open class MainSwitchPreference
@JvmOverloads
constructor(override val key: String, @StringRes override val title: Int = 0) :
    BooleanValuePreference
Loading