feat: SettingsLib验证通过-使用App module启用

This commit is contained in:
2024-12-09 16:04:49 +08:00
parent 1f18a59dab
commit a7f5c61005
1562 changed files with 181632 additions and 18 deletions

View File

@@ -47,7 +47,9 @@ android {
}
dependencies {
// implementation "androidx.annotation:annotation:1.0.0"
implementation files('../../libs/preference-1.3.0-alpha01.aar')
implementation libs.androidx.annotation.annotation
implementation libs.preference
implementation project(':SettingsLib:Utils')
implementation libs.recyclerview
}

View File

@@ -48,6 +48,8 @@ android {
dependencies {
implementation libs.androidx.annotation.annotation
implementation files('../../libs/preference-1.3.0-alpha01.aar')
implementation libs.preference
implementation project(':SettingsLib:SettingsTheme')
implementation libs.recyclerview
}

View File

@@ -47,7 +47,10 @@ android {
}
dependencies {
implementation files('../../libs/preference-1.3.0-alpha01.aar')
implementation libs.androidx.annotation.annotation
implementation libs.preference
implementation project(':SettingsLib:SettingsTheme')
implementation project(':SettingsLib:Utils')
implementation libs.recyclerview
}

View File

@@ -47,5 +47,8 @@ android {
}
dependencies {
implementation files('../../libs/preference-1.3.0-alpha01.aar')
implementation libs.preference
implementation libs.androidx.annotation.annotation
implementation libs.recyclerview
}

View File

@@ -47,6 +47,9 @@ android {
}
dependencies {
implementation files('../../libs/preference-1.3.0-alpha01.aar')
implementation libs.preference
implementation project(':SettingsLib:SettingsTheme')
implementation libs.androidx.annotation.annotation
implementation libs.recyclerview
}

View File

@@ -53,4 +53,8 @@ dependencies {
implementation project(':SettingsLib:SettingsTransition')
implementation project(':SettingsLib:Utils')
implementation project(':SettingsLib:SettingsTheme')
implementation libs.recyclerview
implementation libs.androidx.appcompat
implementation libs.preference
}

View File

@@ -20,7 +20,7 @@ plugins {
android {
namespace = "com.android.settingslib.color"
compileSdk = 34
sourceSets {
sourceSets.getByName("main") {
res.setSrcDirs(listOf("res"))

View File

@@ -0,0 +1,50 @@
/**
* Include this gradle file if you are building against this as a standalone gradle library project,
* as opposed to building it as part of the git-tree. This is typically the file you want to include
* if you create a new project in Android Studio.
*
* For example, you can include the following in your settings.gradle file:
* include ':setupcompat'
* project(':setupcompat').projectDir = new File(PATH_TO_THIS_DIRECTORY)
*
* And then you can include the :setupcompat project as one of your dependencies
* dependencies {
* implementation project(path: ':setupcompat')
* }
*/
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
// Not specifying compileSdkVersion here so clients can specify it; must be at least Q
namespace = "com.android.settingslib.devicestate"
compileSdk 34
defaultConfig {
minSdkVersion 31
targetSdkVersion 34
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.flags'
}
}
sourceSets.main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
}

View File

@@ -0,0 +1,50 @@
/**
* Include this gradle file if you are building against this as a standalone gradle library project,
* as opposed to building it as part of the git-tree. This is typically the file you want to include
* if you create a new project in Android Studio.
*
* For example, you can include the following in your settings.gradle file:
* include ':setupcompat'
* project(':setupcompat').projectDir = new File(PATH_TO_THIS_DIRECTORY)
*
* And then you can include the :setupcompat project as one of your dependencies
* dependencies {
* implementation project(path: ':setupcompat')
* }
*/
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
// Not specifying compileSdkVersion here so clients can specify it; must be at least Q
namespace = "com.android.settingslib.display"
compileSdk 34
defaultConfig {
minSdkVersion 31
targetSdkVersion 34
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.flags'
}
}
sourceSets.main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
}

View File

@@ -0,0 +1,51 @@
/**
* Include this gradle file if you are building against this as a standalone gradle library project,
* as opposed to building it as part of the git-tree. This is typically the file you want to include
* if you create a new project in Android Studio.
*
* For example, you can include the following in your settings.gradle file:
* include ':setupcompat'
* project(':setupcompat').projectDir = new File(PATH_TO_THIS_DIRECTORY)
*
* And then you can include the :setupcompat project as one of your dependencies
* dependencies {
* implementation project(path: ':setupcompat')
* }
*/
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
// Not specifying compileSdkVersion here so clients can specify it; must be at least Q
namespace = "com.android.settingslib.emergencynumber"
compileSdk 34
defaultConfig {
minSdkVersion 31
targetSdkVersion 34
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.flags'
}
}
sourceSets.main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
implementation libs.androidx.annotation.annotation
}

View File

@@ -0,0 +1,52 @@
/**
* Include this gradle file if you are building against this as a standalone gradle library project,
* as opposed to building it as part of the git-tree. This is typically the file you want to include
* if you create a new project in Android Studio.
*
* For example, you can include the following in your settings.gradle file:
* include ':setupcompat'
* project(':setupcompat').projectDir = new File(PATH_TO_THIS_DIRECTORY)
*
* And then you can include the :setupcompat project as one of your dependencies
* dependencies {
* implementation project(path: ':setupcompat')
* }
*/
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
// Not specifying compileSdkVersion here so clients can specify it; must be at least Q
namespace = "com.android.settingslib.widget.entityheader"
compileSdk 34
defaultConfig {
minSdkVersion 31
targetSdkVersion 34
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.flags'
}
}
sourceSets.main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
implementation libs.androidx.annotation.annotation
implementation project(':SettingsLib:SettingsTheme')
}

View File

@@ -0,0 +1,55 @@
/**
* Include this gradle file if you are building against this as a standalone gradle library project,
* as opposed to building it as part of the git-tree. This is typically the file you want to include
* if you create a new project in Android Studio.
*
* For example, you can include the following in your settings.gradle file:
* include ':setupcompat'
* project(':setupcompat').projectDir = new File(PATH_TO_THIS_DIRECTORY)
*
* And then you can include the :setupcompat project as one of your dependencies
* dependencies {
* implementation project(path: ':setupcompat')
* }
*/
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
// Not specifying compileSdkVersion here so clients can specify it; must be at least Q
namespace = "com.android.settingslib.widget.preference.footer"
compileSdk 34
defaultConfig {
minSdkVersion 31
targetSdkVersion 34
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.flags'
}
}
sourceSets.main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
implementation libs.androidx.annotation.annotation
implementation libs.preference
implementation project(':SettingsLib:SettingsTheme')
implementation libs.recyclerview
}

View File

@@ -0,0 +1,31 @@
package {
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "frameworks_base_license"
// to get the below license kinds:
// SPDX-license-identifier-Apache-2.0
default_applicable_licenses: ["frameworks_base_license"],
}
android_library {
name: "SettingsLibHelpUtils",
use_resource_processor: true,
defaults: [
"SettingsLintDefaults",
],
srcs: ["src/**/*.java"],
resource_dirs: ["res"],
libs: [
"androidx.annotation_annotation",
],
sdk_version: "system_current",
min_sdk_version: "21",
apex_available: [
"//apex_available:platform",
"com.android.permission",
"com.android.healthfitness",
],
}

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 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 xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.settingslib.widget.help">
</manifest>

View File

@@ -0,0 +1,39 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
namespace = "com.android.settingslib.widget.help"
compileSdk 34
defaultConfig {
minSdk 31
targetSdk 34
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
sourceSets {
main {
java.srcDirs = ['src']
manifest.srcFile 'AndroidManifest.xml'
res.srcDirs = ['res']
}
}
lint {
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
buildToolsVersion '34.0.0'
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
dependencies {
compileOnly files('../../libs/framework.jar')
implementation libs.androidx.annotation.annotation
}

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:autoMirrored="true"
android:tint="?android:attr/colorControlNormal">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M11,18h2v-2h-2V18zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10s10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8s8,3.59 8,8S16.41,20 12,20zM12,6c-2.21,0 -4,1.79 -4,4h2c0,-1.1 0.9,-2 2,-2s2,0.9 2,2c0,2 -3,1.75 -3,5h2c0,-2.25 3,-2.5 3,-5C16,7.79 14.21,6 12,6z"/>
</vector>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2018 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.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="help_feedback_label" msgid="7106780063063027882">"帮助和反馈"</string>
</resources>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 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.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Label for Help and feedback menu item [CHAR LIMIT=45]-->
<string name="help_feedback_label">Help &amp; feedback</string>
</resources>

View File

@@ -0,0 +1,281 @@
/*
* Copyright (C) 2012 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;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Build;
import android.provider.Settings.Global;
import android.text.TextUtils;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MenuItem.OnMenuItemClickListener;
import androidx.annotation.RequiresApi;
import androidx.annotation.VisibleForTesting;
import com.android.settingslib.widget.help.R;
import java.net.URISyntaxException;
import java.util.Locale;
/**
* Functions to easily prepare contextual help menu option items with an intent that opens up the
* browser to a particular URL, while taking into account the preferred language and app version.
*/
public class HelpUtils {
private final static String TAG = HelpUtils.class.getSimpleName();
@VisibleForTesting
static final int MENU_HELP = Menu.FIRST + 100;
/**
* Help URL query parameter key for the preferred language.
*/
private final static String PARAM_LANGUAGE_CODE = "hl";
/**
* Help URL query parameter key for the app version.
*/
private final static String PARAM_VERSION = "version";
// Constants for help intents.
private static final String EXTRA_CONTEXT = "EXTRA_CONTEXT";
private static final String EXTRA_THEME = "EXTRA_THEME";
private static final String EXTRA_BACKUP_URI = "EXTRA_BACKUP_URI";
/**
* Cached version code to prevent repeated calls to the package manager.
*/
private static String sCachedVersionCode = null;
/** Static helper that is not instantiable */
private HelpUtils() {
}
/**
* Prepares the help menu item by doing the following.
* - If the helpUrlString is empty or null, the help menu item is made invisible.
* - Otherwise, this makes the help menu item visible and sets the intent for the help menu
* item to view the URL.
*
* @return returns whether the help menu item has been made visible.
*/
@RequiresApi(Build.VERSION_CODES.P)
public static boolean prepareHelpMenuItem(Activity activity, Menu menu, String helpUri,
String backupContext) {
// menu contains help item, skip it
if (menu.findItem(MENU_HELP) != null) {
return false;
}
MenuItem helpItem = menu.add(0, MENU_HELP, 0, R.string.help_feedback_label);
helpItem.setIcon(R.drawable.ic_help_actionbar);
return prepareHelpMenuItem(activity, helpItem, helpUri, backupContext);
}
/**
* Prepares the help menu item by doing the following.
* - If the helpUrlString is empty or null, the help menu item is made invisible.
* - Otherwise, this makes the help menu item visible and sets the intent for the help menu
* item to view the URL.
*
* @return returns whether the help menu item has been made visible.
*/
@RequiresApi(Build.VERSION_CODES.P)
public static boolean prepareHelpMenuItem(Activity activity, Menu menu, int helpUriResource,
String backupContext) {
// menu contains help item, skip it
if (menu.findItem(MENU_HELP) != null) {
return false;
}
MenuItem helpItem = menu.add(0, MENU_HELP, 0, R.string.help_feedback_label);
helpItem.setIcon(R.drawable.ic_help_actionbar);
return prepareHelpMenuItem(activity, helpItem, activity.getString(helpUriResource),
backupContext);
}
/**
* Prepares the help menu item by doing the following.
* - If the helpUrlString is empty or null, the help menu item is made invisible.
* - Otherwise, this makes the help menu item visible and sets the intent for the help menu
* item to view the URL.
*
* @return returns whether the help menu item has been made visible.
*/
@VisibleForTesting
@RequiresApi(Build.VERSION_CODES.P)
static boolean prepareHelpMenuItem(final Activity activity, MenuItem helpMenuItem,
String helpUriString, String backupContext) {
if (Global.getInt(activity.getContentResolver(), Global.DEVICE_PROVISIONED, 0) == 0) {
return false;
}
if (TextUtils.isEmpty(helpUriString)) {
// The help url string is empty or null, so set the help menu item to be invisible.
helpMenuItem.setVisible(false);
// return that the help menu item is not visible (i.e. false)
return false;
} else {
final Intent intent = getHelpIntent(activity, helpUriString, backupContext);
// Set the intent to the help menu item, show the help menu item in the overflow
// menu, and make it visible.
if (intent != null) {
helpMenuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
/**
* TODO: Enable metrics logger for @SystemApi (b/111552654)
*
MetricsLogger.action(activity,
MetricsEvent.ACTION_SETTING_HELP_AND_FEEDBACK,
intent.getStringExtra(EXTRA_CONTEXT));
*/
try {
activity.startActivityForResult(intent, 0);
} catch (ActivityNotFoundException exc) {
Log.e(TAG, "No activity found for intent: " + intent);
}
return true;
}
});
helpMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
helpMenuItem.setVisible(true);
} else {
helpMenuItem.setVisible(false);
return false;
}
// return that the help menu item is visible (i.e., true)
return true;
}
}
/**
* Get the help intent from helpUriString.
*/
@RequiresApi(Build.VERSION_CODES.P)
public static Intent getHelpIntent(Context context, String helpUriString,
String backupContext) {
if (Global.getInt(context.getContentResolver(), Global.DEVICE_PROVISIONED, 0) == 0) {
return null;
}
// Try to handle as Intent Uri, otherwise just treat as Uri.
try {
Intent intent = Intent.parseUri(helpUriString,
Intent.URI_ANDROID_APP_SCHEME | Intent.URI_INTENT_SCHEME);
addIntentParameters(context, intent, backupContext, true /* sendPackageName */);
ComponentName component = intent.resolveActivity(context.getPackageManager());
if (component != null) {
return intent;
} else if (intent.hasExtra(EXTRA_BACKUP_URI)) {
// This extra contains a backup URI for when the intent isn't available.
return getHelpIntent(context, intent.getStringExtra(EXTRA_BACKUP_URI),
backupContext);
} else {
return null;
}
} catch (URISyntaxException e) {
}
// The help url string exists, so first add in some extra query parameters.
final Uri fullUri = uriWithAddedParameters(context, Uri.parse(helpUriString));
// Then, create an intent that will be fired when the user
// selects this help menu item.
Intent intent = new Intent(Intent.ACTION_VIEW, fullUri);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
return intent;
}
public static void addIntentParameters(Context context, Intent intent, String backupContext,
boolean sendPackageName) {
if (!intent.hasExtra(EXTRA_CONTEXT)) {
// Insert some context if none exists.
intent.putExtra(EXTRA_CONTEXT, backupContext);
}
Resources resources = context.getResources();
boolean includePackageName =
resources.getBoolean(android.R.bool.config_sendPackageName);
if (sendPackageName && includePackageName) {
String[] packageNameKey =
{resources.getString(android.R.string.config_helpPackageNameKey)};
String[] packageNameValue =
{resources.getString(android.R.string.config_helpPackageNameValue)};
String helpIntentExtraKey =
resources.getString(android.R.string.config_helpIntentExtraKey);
String helpIntentNameKey =
resources.getString(android.R.string.config_helpIntentNameKey);
String feedbackIntentExtraKey =
resources.getString(android.R.string.config_feedbackIntentExtraKey);
String feedbackIntentNameKey =
resources.getString(android.R.string.config_feedbackIntentNameKey);
intent.putExtra(helpIntentExtraKey, packageNameKey);
intent.putExtra(helpIntentNameKey, packageNameValue);
intent.putExtra(feedbackIntentExtraKey, packageNameKey);
intent.putExtra(feedbackIntentNameKey, packageNameValue);
}
intent.putExtra(EXTRA_THEME, 3 /* System Default theme */);
}
/**
* Adds two query parameters into the Uri, namely the language code and the version code
* of the app's package as gotten via the context.
*
* @return the uri with added query parameters
*/
@RequiresApi(Build.VERSION_CODES.P)
public static Uri uriWithAddedParameters(Context context, Uri baseUri) {
Uri.Builder builder = baseUri.buildUpon();
// Add in the preferred language
builder.appendQueryParameter(PARAM_LANGUAGE_CODE, Locale.getDefault().toString());
// Add in the package version code
if (sCachedVersionCode == null) {
// There is no cached version code, so try to get it from the package manager.
try {
// cache the version code
PackageInfo info = context.getPackageManager().getPackageInfo(
context.getPackageName(), 0);
sCachedVersionCode = Long.toString(info.getLongVersionCode());
// append the version code to the uri
builder.appendQueryParameter(PARAM_VERSION, sCachedVersionCode);
} catch (NameNotFoundException e) {
// Cannot find the package name, so don't add in the version parameter
// This shouldn't happen.
Log.wtf(TAG, "Invalid package name for context", e);
}
} else {
builder.appendQueryParameter(PARAM_VERSION, sCachedVersionCode);
}
// Build the full uri and return it
return builder.build();
}
}

View File

@@ -0,0 +1,56 @@
/**
* Include this gradle file if you are building against this as a standalone gradle library project,
* as opposed to building it as part of the git-tree. This is typically the file you want to include
* if you create a new project in Android Studio.
*
* For example, you can include the following in your settings.gradle file:
* include ':setupcompat'
* project(':setupcompat').projectDir = new File(PATH_TO_THIS_DIRECTORY)
*
* And then you can include the :setupcompat project as one of your dependencies
* dependencies {
* implementation project(path: ':setupcompat')
* }
*/
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
// Not specifying compileSdkVersion here so clients can specify it; must be at least Q
namespace = "com.android.settingslib.widget.preference.illustration"
compileSdk 34
defaultConfig {
minSdkVersion 31
targetSdkVersion 34
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.flags'
}
}
sourceSets.main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
implementation project(':SettingsLib:Color')
implementation libs.preference
implementation libs.lottie
implementation libs.recyclerview
implementation libs.androidx.appcompat
}

View File

@@ -0,0 +1,55 @@
/**
* Include this gradle file if you are building against this as a standalone gradle library project,
* as opposed to building it as part of the git-tree. This is typically the file you want to include
* if you create a new project in Android Studio.
*
* For example, you can include the following in your settings.gradle file:
* include ':setupcompat'
* project(':setupcompat').projectDir = new File(PATH_TO_THIS_DIRECTORY)
*
* And then you can include the :setupcompat project as one of your dependencies
* dependencies {
* implementation project(path: ':setupcompat')
* }
*/
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
// Not specifying compileSdkVersion here so clients can specify it; must be at least Q
namespace = "com.android.settingslib.widget.preference.layout"
compileSdk 34
defaultConfig {
minSdkVersion 31
targetSdkVersion 34
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.flags'
}
}
sourceSets.main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
implementation libs.preference
implementation project(':SettingsLib:SettingsTheme')
implementation libs.recyclerview
implementation libs.androidx.core.core
}

View File

@@ -0,0 +1,69 @@
/**
* Include this gradle file if you are building against this as a standalone gradle library project,
* as opposed to building it as part of the git-tree. This is typically the file you want to include
* if you create a new project in Android Studio.
*
* For example, you can include the following in your settings.gradle file:
* include ':setupcompat'
* project(':setupcompat').projectDir = new File(PATH_TO_THIS_DIRECTORY)
*
* And then you can include the :setupcompat project as one of your dependencies
* dependencies {
* implementation project(path: ':setupcompat')
* }
*/
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
// Not specifying compileSdkVersion here so clients can specify it; must be at least Q
namespace = "com.android.settingslib.widget.mainswitch"
compileSdk 34
defaultConfig {
minSdkVersion 31
targetSdkVersion 34
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.flags'
}
}
sourceSets.main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
// configurations.configureEach {
// resolutionStrategy {
// // 强制使用 1.6.1 版本的 appcompat 包
// force 'androidx.lifecycle:lifecycle-viewmodel-android:2.6.1'
// force 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1'
// force 'androidx.lifecycle:lifecycle-viewmodel:2.6.1'
// force 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
// force 'androidx.lifecycle:lifecycle-livedata:2.6.1'
// force 'androidx.lifecycle:lifecycle-livedata-core:2.6.1'
// force 'androidx.lifecycle:lifecycle-common:2.6.1'
// }
// }
}
dependencies {
implementation libs.preference
implementation project(':SettingsLib:SettingsTheme')
implementation libs.recyclerview
implementation libs.androidx.annotation.annotation
implementation libs.androidx.appcompat
}

View File

@@ -0,0 +1,52 @@
/**
* Include this gradle file if you are building against this as a standalone gradle library project,
* as opposed to building it as part of the git-tree. This is typically the file you want to include
* if you create a new project in Android Studio.
*
* For example, you can include the following in your settings.gradle file:
* include ':setupcompat'
* project(':setupcompat').projectDir = new File(PATH_TO_THIS_DIRECTORY)
*
* And then you can include the :setupcompat project as one of your dependencies
* dependencies {
* implementation project(path: ':setupcompat')
* }
*/
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
// Not specifying compileSdkVersion here so clients can specify it; must be at least Q
namespace = "com.android.settingslib.widget.profileselector"
compileSdk 34
defaultConfig {
minSdkVersion 31
targetSdkVersion 34
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.flags'
}
}
sourceSets.main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
implementation libs.material
implementation project(':SettingsLib:SettingsTheme')
}

View File

@@ -0,0 +1,50 @@
/**
* Include this gradle file if you are building against this as a standalone gradle library project,
* as opposed to building it as part of the git-tree. This is typically the file you want to include
* if you create a new project in Android Studio.
*
* For example, you can include the following in your settings.gradle file:
* include ':setupcompat'
* project(':setupcompat').projectDir = new File(PATH_TO_THIS_DIRECTORY)
*
* And then you can include the :setupcompat project as one of your dependencies
* dependencies {
* implementation project(path: ':setupcompat')
* }
*/
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
// Not specifying compileSdkVersion here so clients can specify it; must be at least Q
namespace = "com.android.settingslib.widget.progressbar"
compileSdk 34
defaultConfig {
minSdkVersion 31
targetSdkVersion 34
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.flags'
}
}
sourceSets.main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
}

View File

@@ -0,0 +1,51 @@
/**
* Include this gradle file if you are building against this as a standalone gradle library project,
* as opposed to building it as part of the git-tree. This is typically the file you want to include
* if you create a new project in Android Studio.
*
* For example, you can include the following in your settings.gradle file:
* include ':setupcompat'
* project(':setupcompat').projectDir = new File(PATH_TO_THIS_DIRECTORY)
*
* And then you can include the :setupcompat project as one of your dependencies
* dependencies {
* implementation project(path: ':setupcompat')
* }
*/
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
// Not specifying compileSdkVersion here so clients can specify it; must be at least Q
namespace = "com.android.settingslib.widget.restricted"
compileSdk 34
defaultConfig {
minSdkVersion 31
targetSdkVersion 34
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.flags'
}
}
sourceSets.main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
implementation libs.androidx.annotation.annotation
}

View File

@@ -0,0 +1,50 @@
/**
* Include this gradle file if you are building against this as a standalone gradle library project,
* as opposed to building it as part of the git-tree. This is typically the file you want to include
* if you create a new project in Android Studio.
*
* For example, you can include the following in your settings.gradle file:
* include ':setupcompat'
* project(':setupcompat').projectDir = new File(PATH_TO_THIS_DIRECTORY)
*
* And then you can include the :setupcompat project as one of your dependencies
* dependencies {
* implementation project(path: ':setupcompat')
* }
*/
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
// Not specifying compileSdkVersion here so clients can specify it; must be at least Q
namespace = "com.android.settingslib.search.widget"
compileSdk 34
defaultConfig {
minSdkVersion 31
targetSdkVersion 34
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.flags'
}
}
sourceSets.main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
}

View File

@@ -0,0 +1,54 @@
/**
* Include this gradle file if you are building against this as a standalone gradle library project,
* as opposed to building it as part of the git-tree. This is typically the file you want to include
* if you create a new project in Android Studio.
*
* For example, you can include the following in your settings.gradle file:
* include ':setupcompat'
* project(':setupcompat').projectDir = new File(PATH_TO_THIS_DIRECTORY)
*
* And then you can include the :setupcompat project as one of your dependencies
* dependencies {
* implementation project(path: ':setupcompat')
* }
*/
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
// Not specifying compileSdkVersion here so clients can specify it; must be at least Q
namespace = "com.android.settingslib.widget.preference.selector"
compileSdk 34
defaultConfig {
minSdkVersion 31
targetSdkVersion 34
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.flags'
}
}
sourceSets.main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
implementation libs.preference
implementation project(':SettingsLib:SettingsTheme')
implementation libs.recyclerview
}

View File

@@ -0,0 +1,54 @@
/**
* Include this gradle file if you are building against this as a standalone gradle library project,
* as opposed to building it as part of the git-tree. This is typically the file you want to include
* if you create a new project in Android Studio.
*
* For example, you can include the following in your settings.gradle file:
* include ':setupcompat'
* project(':setupcompat').projectDir = new File(PATH_TO_THIS_DIRECTORY)
*
* And then you can include the :setupcompat project as one of your dependencies
* dependencies {
* implementation project(path: ':setupcompat')
* }
*/
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
// Not specifying compileSdkVersion here so clients can specify it; must be at least Q
namespace = "com.android.settingslib.widget.spinner"
compileSdk 34
defaultConfig {
minSdkVersion 31
targetSdkVersion 34
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.flags'
}
}
sourceSets.main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
implementation libs.preference
implementation project(':SettingsLib:SettingsTheme')
implementation libs.recyclerview
}

View File

@@ -47,5 +47,5 @@ android {
}
dependencies {
implementation files('../../libs/preference-1.3.0-alpha01.aar')
implementation libs.preference
}

View File

@@ -0,0 +1,55 @@
/**
* Include this gradle file if you are building against this as a standalone gradle library project,
* as opposed to building it as part of the git-tree. This is typically the file you want to include
* if you create a new project in Android Studio.
*
* For example, you can include the following in your settings.gradle file:
* include ':setupcompat'
* project(':setupcompat').projectDir = new File(PATH_TO_THIS_DIRECTORY)
*
* And then you can include the :setupcompat project as one of your dependencies
* dependencies {
* implementation project(path: ':setupcompat')
* }
*/
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
// Not specifying compileSdkVersion here so clients can specify it; must be at least Q
namespace = "com.android.settingslib.widget.preference.topintro"
compileSdk 34
defaultConfig {
minSdkVersion 31
targetSdkVersion 34
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.flags'
}
}
sourceSets.main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
implementation libs.androidx.annotation.annotation
implementation libs.preference
implementation project(':SettingsLib:SettingsTheme')
implementation libs.recyclerview
}

View File

@@ -24,6 +24,7 @@ import androidx.preference.PreferenceViewHolder;
import com.android.settingslib.widget.preference.topintro.R;
/**
* The TopIntroPreference shows a text which describe a feature. Gernerally, we expect this
* preference always shows on the top of screen.

View File

@@ -0,0 +1,55 @@
/**
* Include this gradle file if you are building against this as a standalone gradle library project,
* as opposed to building it as part of the git-tree. This is typically the file you want to include
* if you create a new project in Android Studio.
*
* For example, you can include the following in your settings.gradle file:
* include ':setupcompat'
* project(':setupcompat').projectDir = new File(PATH_TO_THIS_DIRECTORY)
*
* And then you can include the :setupcompat project as one of your dependencies
* dependencies {
* implementation project(path: ':setupcompat')
* }
*/
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
// Not specifying compileSdkVersion here so clients can specify it; must be at least Q
namespace = "com.android.settingslib.widget.preference.twotarget"
compileSdk 34
defaultConfig {
minSdkVersion 31
targetSdkVersion 34
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.flags'
}
}
sourceSets.main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
implementation libs.androidx.annotation.annotation
implementation libs.preference
implementation project(':SettingsLib:SettingsTheme')
implementation libs.recyclerview
}

View File

@@ -0,0 +1,54 @@
/**
* Include this gradle file if you are building against this as a standalone gradle library project,
* as opposed to building it as part of the git-tree. This is typically the file you want to include
* if you create a new project in Android Studio.
*
* For example, you can include the following in your settings.gradle file:
* include ':setupcompat'
* project(':setupcompat').projectDir = new File(PATH_TO_THIS_DIRECTORY)
*
* And then you can include the :setupcompat project as one of your dependencies
* dependencies {
* implementation project(path: ':setupcompat')
* }
*/
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
// Not specifying compileSdkVersion here so clients can specify it; must be at least Q
namespace = "com.android.settingslib.widget.preference.usage"
compileSdk 34
defaultConfig {
minSdkVersion 31
targetSdkVersion 34
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.flags'
}
}
sourceSets.main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
implementation libs.preference
implementation libs.androidx.constraintlayout
implementation libs.recyclerview
}

View File

@@ -48,14 +48,14 @@ android {
dependencies {
// implementation "androidx.annotation:annotation:1.0.0"
implementation files('../libs/localbroadcastmanager-1.1.0-alpha02.aar')
// implementation files('../libs/localbroadcastmanager-1.1.0-alpha02.aar')
implementation libs.room.runtime
implementation libs.sqlite
implementation files('../libs/zxing-core.jar')
// Android14\out\soong\.intermediates\external\guava\guava\android_common\turbine-combined
implementation files('../libs/guava.jar')
// implementation files('../libs/guava.jar')
implementation files('../libs/WifiTrackerLibRes.jar')
// implementation files('../libs/WifiTrackerLibRes.jar')
implementation project(':iconloaderlib')
implementation project(':setupdesign')
@@ -67,11 +67,29 @@ dependencies {
implementation project(':SettingsLib:BarChartPreference')
implementation project(':SettingsLib:ButtonPreference')
implementation project(':SettingsLib:CollapsingToolbarBaseActivity')
implementation project(':SettingsLib:Color')
implementation project(':SettingsLib:DeviceStateRotationLock')
implementation project(':SettingsLib:DisplayUtils')
implementation project(':SettingsLib:EmergencyNumber')
implementation project(':SettingsLib:EntityHeaderWidgets')
implementation project(':SettingsLib:FooterPreference')
implementation project(':SettingsLib:HelpUtils')
implementation project(':SettingsLib:IllustrationPreference')
implementation project(':SettingsLib:LayoutPreference')
implementation project(':SettingsLib:MainSwitchPreference')
implementation project(':SettingsLib:ProfileSelector')
implementation project(':SettingsLib:ProgressBar')
implementation project(':SettingsLib:RestrictedLockUtils')
implementation project(':SettingsLib:SearchWidget')
implementation project(':SettingsLib:SelectorWithWidgetPreference')
implementation project(':SettingsLib:SettingsSpinner')
implementation project(':SettingsLib:SettingsTheme')
implementation project(':SettingsLib:SettingsTransition')
implementation project(':SettingsLib:Tile')
implementation project(':SettingsLib:TopIntroPreference')
implementation project(':SettingsLib:TwoTargetPreference')
implementation project(':SettingsLib:UsageProgressBarPreference')
implementation project(':SettingsLib:Utils')
implementation files('../libs/settingslib_media_flags_lib.jar')
implementation files('../libs/settingslib_flags_lib.jar')
}