diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2018-11-01 23:12:54 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2018-11-02 14:18:45 -0700 |
commit | 719eee2be266bd84bba33ce35142b0cad46e40ea (patch) | |
tree | fba75356c0acc6c1572a7901e9fe7c5bcba0379b | |
parent | b1513bd811d4efd6ec9b0251c5663c544c278909 (diff) | |
download | android_packages_apps_Trebuchet-719eee2be266bd84bba33ce35142b0cad46e40ea.tar.gz android_packages_apps_Trebuchet-719eee2be266bd84bba33ce35142b0cad46e40ea.tar.bz2 android_packages_apps_Trebuchet-719eee2be266bd84bba33ce35142b0cad46e40ea.zip |
Create iconloader library
Bug: 115891474
Test: Builds everything
Change-Id: I1d75702d4e5a10d694eeb839784a629de2f74dd2
-rw-r--r-- | Android.bp | 20 | ||||
-rw-r--r-- | Android.mk | 3 | ||||
-rw-r--r-- | build.gradle | 24 | ||||
-rw-r--r-- | gradle.properties | 13 | ||||
-rw-r--r-- | iconloaderlib/Android.bp | 28 | ||||
-rw-r--r-- | iconloaderlib/AndroidManifest.xml | 20 | ||||
-rw-r--r-- | iconloaderlib/build.gradle | 50 | ||||
-rw-r--r-- | iconloaderlib/res/drawable-v26/adaptive_icon_drawable_wrapper.xml (renamed from res/drawable-v26/adaptive_icon_drawable_wrapper.xml) | 0 | ||||
-rw-r--r-- | iconloaderlib/res/drawable/ic_instant_app_badge.xml (renamed from res/drawable/ic_instant_app_badge.xml) | 6 | ||||
-rw-r--r-- | iconloaderlib/res/values/colors.xml | 21 | ||||
-rw-r--r-- | iconloaderlib/res/values/dimens.xml | 19 | ||||
-rw-r--r-- | iconloaderlib/src/com/android.launcher3/icons/BaseIconFactory.java (renamed from src/com/android/launcher3/icons/BaseIconFactory.java) | 2 | ||||
-rw-r--r-- | iconloaderlib/src/com/android.launcher3/icons/BitmapInfo.java (renamed from src/com/android/launcher3/icons/BitmapInfo.java) | 0 | ||||
-rw-r--r-- | iconloaderlib/src/com/android.launcher3/icons/ColorExtractor.java (renamed from src/com/android/launcher3/icons/ColorExtractor.java) | 0 | ||||
-rw-r--r-- | iconloaderlib/src/com/android.launcher3/icons/FixedScaleDrawable.java (renamed from src/com/android/launcher3/icons/FixedScaleDrawable.java) | 0 | ||||
-rw-r--r-- | iconloaderlib/src/com/android.launcher3/icons/IconNormalizer.java (renamed from src/com/android/launcher3/icons/IconNormalizer.java) | 3 | ||||
-rw-r--r-- | iconloaderlib/src/com/android.launcher3/icons/ShadowGenerator.java (renamed from src/com/android/launcher3/icons/ShadowGenerator.java) | 0 | ||||
-rw-r--r-- | res/values/colors.xml | 1 | ||||
-rw-r--r-- | settings.gradle | 2 |
19 files changed, 171 insertions, 41 deletions
diff --git a/Android.bp b/Android.bp index e3dd5e56a..c5832441c 100644 --- a/Android.bp +++ b/Android.bp @@ -29,23 +29,3 @@ java_library_static { ], platform_apis: true, } - - -android_library { - name: "icon-loader", - sdk_version: "28", - static_libs: [ - "androidx.core_core", - ], - resource_dirs: [ - "res", - ], - srcs: [ - "src/com/android/launcher3/icons/BaseIconFactory.java", - "src/com/android/launcher3/icons/BitmapInfo.java", - "src/com/android/launcher3/icons/IconNormalizer.java", - "src/com/android/launcher3/icons/FixedScaleDrawable.java", - "src/com/android/launcher3/icons/ShadowGenerator.java", - "src/com/android/launcher3/icons/ColorExtractor.java", - ], -} diff --git a/Android.mk b/Android.mk index 5614e25ca..9d6e629a0 100644 --- a/Android.mk +++ b/Android.mk @@ -67,7 +67,8 @@ LOCAL_MODULE_TAGS := optional LOCAL_STATIC_ANDROID_LIBRARIES := \ androidx.recyclerview_recyclerview \ androidx.dynamicanimation_dynamicanimation \ - androidx.preference_preference + androidx.preference_preference \ + iconloader LOCAL_STATIC_JAVA_LIBRARIES := LauncherPluginLib diff --git a/build.gradle b/build.gradle index 476e92bf6..33409c5d0 100644 --- a/build.gradle +++ b/build.gradle @@ -4,19 +4,17 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' - classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.6' + classpath GRADLE_CLASS_PATH + classpath PROTOBUF_CLASS_PATH } } -final String SUPPORT_LIBS_VERSION = '1.0.0-alpha1' - apply plugin: 'com.android.application' apply plugin: 'com.google.protobuf' android { - compileSdkVersion 28 - buildToolsVersion '28.0.3' + compileSdkVersion COMPILE_SDK.toInteger() + buildToolsVersion BUILD_TOOLS_VERSION defaultConfig { minSdkVersion 21 @@ -120,9 +118,15 @@ repositories { } dependencies { - implementation "androidx.dynamicanimation:dynamicanimation:${SUPPORT_LIBS_VERSION}" - implementation "androidx.recyclerview:recyclerview:${SUPPORT_LIBS_VERSION}" - implementation 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7' + implementation "androidx.dynamicanimation:dynamicanimation:${ANDROID_X_VERSION}" + implementation "androidx.recyclerview:recyclerview:${ANDROID_X_VERSION}" + implementation "androidx.preference:preference:${ANDROID_X_VERSION}" + implementation PROTOBUF_DEPENDENCY + implementation project(':IconLoader') + + // This is already included in sysui_shared + aospImplementation fileTree(dir: "libs", include: 'plugin_core.jar') + l3goImplementation fileTree(dir: "libs", include: 'plugin_core.jar') quickstepImplementation fileTree(dir: "quickstep/libs", include: 'sysui_shared.jar') @@ -133,7 +137,7 @@ dependencies { androidTestImplementation 'com.android.support.test:runner:1.0.0' androidTestImplementation 'com.android.support.test:rules:1.0.0' androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2' - androidTestImplementation "androidx.annotation:annotation:${SUPPORT_LIBS_VERSION}" + androidTestImplementation "androidx.annotation:annotation:${ANDROID_X_VERSION}" } protobuf { diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 000000000..b299cfe51 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,13 @@ +# Until all the dependencies move to android X +android.useAndroidX = true +android.enableJetifier = true + +ANDROID_X_VERSION=1.0.0-beta01 + +GRADLE_CLASS_PATH=com.android.tools.build:gradle:3.2.0-rc03 + +PROTOBUF_CLASS_PATH=com.google.protobuf:protobuf-gradle-plugin:0.8.6 +PROTOBUF_DEPENDENCY=com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7 + +BUILD_TOOLS_VERSION=28.0.3 +COMPILE_SDK=28
\ No newline at end of file diff --git a/iconloaderlib/Android.bp b/iconloaderlib/Android.bp new file mode 100644 index 000000000..8a71f94ed --- /dev/null +++ b/iconloaderlib/Android.bp @@ -0,0 +1,28 @@ +// 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. + +android_library { + name: "iconloader", + sdk_version: "28", + min_sdk_version: "21", + static_libs: [ + "androidx.core_core", + ], + resource_dirs: [ + "res", + ], + srcs: [ + "src/**/*.java", + ], +} diff --git a/iconloaderlib/AndroidManifest.xml b/iconloaderlib/AndroidManifest.xml new file mode 100644 index 000000000..b30258da2 --- /dev/null +++ b/iconloaderlib/AndroidManifest.xml @@ -0,0 +1,20 @@ +<?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.launcher3.icons"> +</manifest> diff --git a/iconloaderlib/build.gradle b/iconloaderlib/build.gradle new file mode 100644 index 000000000..d08029386 --- /dev/null +++ b/iconloaderlib/build.gradle @@ -0,0 +1,50 @@ +buildscript { + repositories { + mavenCentral() + google() + } + dependencies { + classpath GRADLE_CLASS_PATH + } +} + +apply plugin: 'com.android.library' + +android { + compileSdkVersion COMPILE_SDK.toInteger() + buildToolsVersion BUILD_TOOLS_VERSION + publishNonDefault true + + defaultConfig { + minSdkVersion 21 + targetSdkVersion 28 + versionCode 1 + versionName "1.0" + } + + sourceSets { + main { + java.srcDirs = ['src'] + manifest.srcFile 'AndroidManifest.xml' + res.srcDirs = ['res'] + } + } + + lintOptions { + abortOnError false + } + + tasks.withType(JavaCompile) { + options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" + } +} + + +repositories { + mavenCentral() + google() +} + +dependencies { + implementation "androidx.core:core:${ANDROID_X_VERSION}" +} diff --git a/res/drawable-v26/adaptive_icon_drawable_wrapper.xml b/iconloaderlib/res/drawable-v26/adaptive_icon_drawable_wrapper.xml index 9f13cf571..9f13cf571 100644 --- a/res/drawable-v26/adaptive_icon_drawable_wrapper.xml +++ b/iconloaderlib/res/drawable-v26/adaptive_icon_drawable_wrapper.xml diff --git a/res/drawable/ic_instant_app_badge.xml b/iconloaderlib/res/drawable/ic_instant_app_badge.xml index cc532309c..b74317e5f 100644 --- a/res/drawable/ic_instant_app_badge.xml +++ b/iconloaderlib/res/drawable/ic_instant_app_badge.xml @@ -21,23 +21,19 @@ <path android:fillColor="@android:color/black" - android:fillType="evenOdd" android:strokeWidth="1" android:pathData="M 9 0 C 13.9705627485 0 18 4.02943725152 18 9 C 18 13.9705627485 13.9705627485 18 9 18 C 4.02943725152 18 0 13.9705627485 0 9 C 0 4.02943725152 4.02943725152 0 9 0 Z" /> <path android:fillColor="@android:color/white" - android:fillType="evenOdd" android:strokeWidth="1" android:pathData="M 9 0 C 13.9705627485 0 18 4.02943725152 18 9 C 18 13.9705627485 13.9705627485 18 9 18 C 4.02943725152 18 0 13.9705627485 0 9 C 0 4.02943725152 4.02943725152 0 9 0 Z" /> <path android:fillColor="@android:color/white" - android:fillType="evenOdd" android:strokeWidth="1" android:pathData="M 9 0 C 13.9705627485 0 18 4.02943725152 18 9 C 18 13.9705627485 13.9705627485 18 9 18 C 4.02943725152 18 0 13.9705627485 0 9 C 0 4.02943725152 4.02943725152 0 9 0 Z" /> <path android:fillColor="@android:color/black" android:fillAlpha="0.87" - android:fillType="evenOdd" android:strokeWidth="1" android:pathData="M 6 10.4123279 L 8.63934949 10.4123279 L 8.63934949 15.6 L 12.5577168 7.84517705 L 9.94547194 7.84517705 L 9.94547194 2 Z" /> -</vector>
\ No newline at end of file +</vector> diff --git a/iconloaderlib/res/values/colors.xml b/iconloaderlib/res/values/colors.xml new file mode 100644 index 000000000..873b2fc5f --- /dev/null +++ b/iconloaderlib/res/values/colors.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +** +** Copyright 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> + <color name="legacy_icon_background">#FFFFFF</color> +</resources> diff --git a/iconloaderlib/res/values/dimens.xml b/iconloaderlib/res/values/dimens.xml new file mode 100644 index 000000000..e8c0c44f7 --- /dev/null +++ b/iconloaderlib/res/values/dimens.xml @@ -0,0 +1,19 @@ +<?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> + <dimen name="profile_badge_size">24dp</dimen> +</resources> diff --git a/src/com/android/launcher3/icons/BaseIconFactory.java b/iconloaderlib/src/com/android.launcher3/icons/BaseIconFactory.java index cd60de55a..681c03c7c 100644 --- a/src/com/android/launcher3/icons/BaseIconFactory.java +++ b/iconloaderlib/src/com/android.launcher3/icons/BaseIconFactory.java @@ -18,7 +18,7 @@ import android.os.Build; import android.os.Process; import android.os.UserHandle; -import com.android.launcher3.R; +import com.android.launcher3.icons.R; import static android.graphics.Paint.DITHER_FLAG; import static android.graphics.Paint.FILTER_BITMAP_FLAG; diff --git a/src/com/android/launcher3/icons/BitmapInfo.java b/iconloaderlib/src/com/android.launcher3/icons/BitmapInfo.java index 245561ea5..245561ea5 100644 --- a/src/com/android/launcher3/icons/BitmapInfo.java +++ b/iconloaderlib/src/com/android.launcher3/icons/BitmapInfo.java diff --git a/src/com/android/launcher3/icons/ColorExtractor.java b/iconloaderlib/src/com/android.launcher3/icons/ColorExtractor.java index 87bda825c..87bda825c 100644 --- a/src/com/android/launcher3/icons/ColorExtractor.java +++ b/iconloaderlib/src/com/android.launcher3/icons/ColorExtractor.java diff --git a/src/com/android/launcher3/icons/FixedScaleDrawable.java b/iconloaderlib/src/com/android.launcher3/icons/FixedScaleDrawable.java index e594f477e..e594f477e 100644 --- a/src/com/android/launcher3/icons/FixedScaleDrawable.java +++ b/iconloaderlib/src/com/android.launcher3/icons/FixedScaleDrawable.java diff --git a/src/com/android/launcher3/icons/IconNormalizer.java b/iconloaderlib/src/com/android.launcher3/icons/IconNormalizer.java index 8eb82524e..05908df99 100644 --- a/src/com/android/launcher3/icons/IconNormalizer.java +++ b/iconloaderlib/src/com/android.launcher3/icons/IconNormalizer.java @@ -20,9 +20,6 @@ import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; -import android.graphics.Paint; -import android.graphics.PorterDuff; -import android.graphics.PorterDuffXfermode; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.drawable.AdaptiveIconDrawable; diff --git a/src/com/android/launcher3/icons/ShadowGenerator.java b/iconloaderlib/src/com/android.launcher3/icons/ShadowGenerator.java index 6491b7ec1..6491b7ec1 100644 --- a/src/com/android/launcher3/icons/ShadowGenerator.java +++ b/iconloaderlib/src/com/android.launcher3/icons/ShadowGenerator.java diff --git a/res/values/colors.xml b/res/values/colors.xml index eb207af1e..3c8fe1e25 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -34,7 +34,6 @@ <color name="notification_icon_default_color">#757575</color> <!-- Gray 600 --> <color name="icon_background">#E0E0E0</color> <!-- Gray 300 --> - <color name="legacy_icon_background">#FFFFFF</color> <color name="all_apps_bg_hand_fill">#E5E5E5</color> <color name="all_apps_bg_hand_fill_dark">#9AA0A6</color> diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 000000000..b52bd4f78 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,2 @@ +include ':IconLoader' +project(':IconLoader').projectDir = new File(rootDir, 'iconloaderlib') |