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

Commit 39835131 authored by Chaohui Wang's avatar Chaohui Wang Committed by Android (Google) Code Review
Browse files

Merge "Finish use_resource_processor for SettingsLib" into main

parents b502a3cc 11bf0a4d
Loading
Loading
Loading
Loading
+17 −50
Original line number Diff line number Diff line
@@ -11,50 +11,14 @@ android_library {
    name: "SettingsLib",

    static_libs: [
        "androidx.annotation_annotation",
        "androidx.appcompat_appcompat",
        "androidx.coordinatorlayout_coordinatorlayout",
        "androidx.core_core",
        "androidx.fragment_fragment",
        "androidx.lifecycle_lifecycle-runtime",
        "androidx.loader_loader",
        "androidx.localbroadcastmanager_localbroadcastmanager",
        "androidx.preference_preference",
        "androidx.recyclerview_recyclerview",
        "com.google.android.material_material",
        "iconloader",
        "androidx.room_room-runtime",
        "zxing-core",

        "WifiTrackerLibRes",
        "SettingsLibDeviceStateRotationLock",
        "SettingsLibDisplayUtils",
        "SettingsLibEmergencyNumber",
        "SettingsLibSearchWidget",
        "SettingsLibUtils",
        "SettingsLibWidget",
        "iconloader",
        "setupdesign",
        "zxing-core",
        "androidx.room_room-runtime",
        "settingslib_flags_lib",
    ],

    plugins: ["androidx.room_room-compiler-plugin"],
    use_resource_processor: true,
    resource_dirs: ["res"],

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

// Group all the libraries with namespace "com.android.settingslib.widget", to allow SettingsLib to
// set use_resource_processor = true.
// We can remove SettingsLibWidget when all these libraries have its own namespace.
android_library {
    name: "SettingsLibWidget",
    visibility: ["//visibility:private"],
    manifest: "AndroidManifest-SettingsLibWidget.xml",
    static_libs: [
        "SettingsLibActionBarShadow",
        "SettingsLibActionButtonsPreference",
        "SettingsLibAdaptiveIcon",
@@ -63,6 +27,9 @@ android_library {
        "SettingsLibBarChartPreference",
        "SettingsLibButtonPreference",
        "SettingsLibCollapsingToolbarBaseActivity",
        "SettingsLibDeviceStateRotationLock",
        "SettingsLibDisplayUtils",
        "SettingsLibEmergencyNumber",
        "SettingsLibEntityHeaderWidgets",
        "SettingsLibFooterPreference",
        "SettingsLibHelpUtils",
@@ -72,31 +39,31 @@ android_library {
        "SettingsLibProfileSelector",
        "SettingsLibProgressBar",
        "SettingsLibRestrictedLockUtils",
        "SettingsLibSearchWidget",
        "SettingsLibSelectorWithWidgetPreference",
        "SettingsLibSettingsSpinner",
        "SettingsLibSettingsTransition",
        "SettingsLibTopIntroPreference",
        "SettingsLibTwoTargetPreference",
        "SettingsLibUsageProgressBarPreference",
        "SettingsLibUtils",
        "settingslib_flags_lib",
    ],

    resource_dirs: [],
    plugins: ["androidx.room_room-compiler-plugin"],
    use_resource_processor: true,
    resource_dirs: ["res"],

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

// NOTE: Keep this module in sync with ./common.mk
java_defaults {
    name: "SettingsLibDefaults",
    static_libs: [
        "androidx.annotation_annotation",
        "androidx.appcompat_appcompat",
        "androidx.coordinatorlayout_coordinatorlayout",
        "androidx.core_core",
        "androidx.fragment_fragment",
        "androidx.lifecycle_lifecycle-runtime",
        "androidx.loader_loader",
        "androidx.localbroadcastmanager_localbroadcastmanager",
        "androidx.preference_preference",
        "androidx.recyclerview_recyclerview",
        "SettingsLib",
    ],
}
+0 −18
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2023 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.
-->

<manifest package="com.android.settingslib.widget" />
+1 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ package {

android_library {
    name: "SettingsLibMainSwitchPreference",
    use_resource_processor: true,

    srcs: ["src/**/*.java"],
    resource_dirs: ["res"],
+2 −3
Original line number Diff line number Diff line
@@ -31,12 +31,11 @@ import android.widget.TextView;
import androidx.annotation.ColorInt;

import com.android.settingslib.utils.BuildCompatUtils;
import com.android.settingslib.widget.mainswitch.R;

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

import com.android.settingslib.widget.mainswitch.R;

/**
 * MainSwitchBar is a View with a customized Switch.
 * This component is used as the main switch of the page
@@ -77,7 +76,7 @@ public class MainSwitchBar extends LinearLayout implements CompoundButton.OnChec
            final TypedArray a = context.obtainStyledAttributes(
                    new int[]{android.R.attr.colorAccent});
            mBackgroundActivatedColor = a.getColor(0, 0);
            mBackgroundColor = context.getColor(R.color.material_grey_600);
            mBackgroundColor = context.getColor(androidx.appcompat.R.color.material_grey_600);
            a.recycle();
        }

+0 −13
Original line number Diff line number Diff line
@@ -18,18 +18,5 @@
# to the corresponding module.
# NOTE: keep this file and ./Android.bp in sync.

LOCAL_STATIC_JAVA_LIBRARIES += \
    androidx.annotation_annotation

LOCAL_STATIC_ANDROID_LIBRARIES += \
    androidx.appcompat_appcompat \
    androidx.coordinatorlayout_coordinatorlayout \
    androidx.core_core \
    androidx.fragment_fragment \
    androidx.lifecycle_lifecycle-runtime \
    androidx.loader_loader \
    androidx.localbroadcastmanager_localbroadcastmanager \
    androidx.preference_preference \
    androidx.recyclerview_recyclerview \
    SettingsLib
Loading