Loading iconloaderlib/src/com/android/launcher3/icons/FastBitmapDrawable.java +5 −0 Original line number Diff line number Diff line Loading @@ -312,6 +312,11 @@ public class FastBitmapDrawable extends Drawable implements Drawable.Callback { updateFilter(); } @VisibleForTesting public Drawable getBadge() { return mBadge; } /** * Updates the paint to reflect the current brightness and saturation. */ Loading iconloaderlib/src/com/android/launcher3/icons/UserBadgeDrawable.java +6 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.graphics.drawable.Drawable; import android.graphics.drawable.DrawableWrapper; import androidx.annotation.NonNull; import androidx.annotation.VisibleForTesting; import androidx.annotation.Nullable; /** Loading @@ -54,9 +55,13 @@ public class UserBadgeDrawable extends DrawableWrapper { private final int mBgColor; private boolean mShouldDrawBackground = true; @VisibleForTesting public final boolean mIsThemed; public UserBadgeDrawable(Context context, int badgeRes, int colorRes, boolean isThemed) { super(context.getDrawable(badgeRes)); mIsThemed = isThemed; if (isThemed) { mutate(); mBaseColor = context.getColor(R.color.themed_badge_icon_color); Loading @@ -71,6 +76,7 @@ public class UserBadgeDrawable extends DrawableWrapper { private UserBadgeDrawable(Drawable base, int bgColor, int baseColor, boolean shouldDrawBackground) { super(base); mIsThemed = false; mBgColor = bgColor; mBaseColor = baseColor; mShouldDrawBackground = shouldDrawBackground; Loading weathereffects/Android.bp +32 −32 Original line number Diff line number Diff line Loading @@ -16,47 +16,26 @@ package { default_applicable_licenses: ["Android-Apache-2.0"], } // The weather effects library only contains rendering logic. android_library { name: "WeatherEffectsLib", manifest: "AndroidManifest.xml", name: "WeatherEffectsGraphicsLib", sdk_version: "system_current", // min_sdk version must be specified to not compile against platform apis. // Using HardwareBufferRenderer requires minimum of 34. min_sdk_version: "34", static_libs: [ "androidx.slice_slice-core", "androidx.slice_slice-builders", "dagger2", "jsr330", // Dagger inject annotations. "kotlinx_coroutines_android", "kotlinx_coroutines", "androidx.core_core-ktx", // Do not add Torus dependency here, since this package is only for rendering. The host app // will include Torus or Livewallpaper frameworks. "androidx.appcompat_appcompat", "androidx-constraintlayout_constraintlayout", "toruslib", ], srcs: [ "src/**/*.java", "src/**/*.kt", // TODO(b/300991599): Split out debug source. "debug/src/**/*.java", "debug/src/**/*.kt" ], resource_dirs: [ "res", // TODO(b/300991599): Split out debug resources. "debug/res" ], // TODO(b/300991599): Split out debug resources. asset_dirs: [ "debug/assets" "graphics/src/**/*.java", "graphics/src/**/*.kt", ], javacflags: ["-Adagger.fastInit=enabled"], kotlincflags: ["-Xjvm-default=all"], plugins: ["dagger2-compiler"], dxflags: ["--multi-dex"], // This library is meant to access only public APIs, do not flip this flag to true. platform_apis: false } // Debug app. Loading @@ -64,11 +43,33 @@ android_app { name: "WeatherEffectsDebug", manifest: "debug/AndroidManifest.xml", owner: "google", privileged: false, sdk_version: "system_current", min_sdk_version: "34", srcs: [ "src/**/*.java", "src/**/*.kt", "debug/src/**/*.java", "debug/src/**/*.kt", ], resource_dirs: [ "res", "debug/res", ], asset_dirs: [ "debug/assets", ], static_libs: [ "WeatherEffectsLib" "androidx.slice_slice-core", "androidx.slice_slice-builders", "dagger2", "jsr330", // Dagger inject annotations. "kotlinx_coroutines_android", "kotlinx_coroutines", "androidx.core_core-ktx", "androidx.appcompat_appcompat", "androidx-constraintlayout_constraintlayout", "toruslib", "WeatherEffectsGraphicsLib", ], use_embedded_native_libs: true, plugins: ["dagger2-compiler"], Loading @@ -90,13 +91,12 @@ android_test { "tests/src/**/*.kt", ], static_libs: [ "WeatherEffectsLib", "WeatherEffectsGraphicsLib", "androidx.test.rules", "androidx.test.ext.junit", "androidx.test.core", "androidx.test.runner", "kotlinx_coroutines_test", "truth" "truth", ], } weathereffects/AndroidManifest.xml +0 −34 Original line number Diff line number Diff line Loading @@ -16,38 +16,4 @@ --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.google.android.wallpaper.weathereffects"> <!--TODO: Add privileged permission--> <uses-feature android:name="android.software.live_wallpaper" android:required="true" /> <queries> <package android:name="com.google.android.apps.wallpaper" /> <package android:name="com.android.wallpaper" /> </queries> <application android:icon="@mipmap/ic_launcher" android:label="@string/app_name"> <provider android:name="com.google.android.wallpaper.weathereffects.provider.WeatherEffectsContentProvider" android:authorities="${applicationId}.effectprovider" android:exported="true" /> <service android:name="com.google.android.wallpaper.weathereffects.WeatherWallpaperService" android:directBootAware="true" android:exported="true" android:label="@string/app_name" android:permission="android.permission.BIND_WALLPAPER"> <intent-filter> <action android:name="android.service.wallpaper.WallpaperService" /> </intent-filter> <meta-data android:name="android.service.wallpaper" android:resource="@xml/weather_wallpaper" /> </service> </application> </manifest> weathereffects/build.gradle +1 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,7 @@ android { dependencies { implementation project(':toruslib') implementation project(':graphics') implementation "androidx.slice:slice-builders:$versions.androidXLib" implementation "androidx.slice:slice-core:$versions.androidXLib" Loading Loading
iconloaderlib/src/com/android/launcher3/icons/FastBitmapDrawable.java +5 −0 Original line number Diff line number Diff line Loading @@ -312,6 +312,11 @@ public class FastBitmapDrawable extends Drawable implements Drawable.Callback { updateFilter(); } @VisibleForTesting public Drawable getBadge() { return mBadge; } /** * Updates the paint to reflect the current brightness and saturation. */ Loading
iconloaderlib/src/com/android/launcher3/icons/UserBadgeDrawable.java +6 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.graphics.drawable.Drawable; import android.graphics.drawable.DrawableWrapper; import androidx.annotation.NonNull; import androidx.annotation.VisibleForTesting; import androidx.annotation.Nullable; /** Loading @@ -54,9 +55,13 @@ public class UserBadgeDrawable extends DrawableWrapper { private final int mBgColor; private boolean mShouldDrawBackground = true; @VisibleForTesting public final boolean mIsThemed; public UserBadgeDrawable(Context context, int badgeRes, int colorRes, boolean isThemed) { super(context.getDrawable(badgeRes)); mIsThemed = isThemed; if (isThemed) { mutate(); mBaseColor = context.getColor(R.color.themed_badge_icon_color); Loading @@ -71,6 +76,7 @@ public class UserBadgeDrawable extends DrawableWrapper { private UserBadgeDrawable(Drawable base, int bgColor, int baseColor, boolean shouldDrawBackground) { super(base); mIsThemed = false; mBgColor = bgColor; mBaseColor = baseColor; mShouldDrawBackground = shouldDrawBackground; Loading
weathereffects/Android.bp +32 −32 Original line number Diff line number Diff line Loading @@ -16,47 +16,26 @@ package { default_applicable_licenses: ["Android-Apache-2.0"], } // The weather effects library only contains rendering logic. android_library { name: "WeatherEffectsLib", manifest: "AndroidManifest.xml", name: "WeatherEffectsGraphicsLib", sdk_version: "system_current", // min_sdk version must be specified to not compile against platform apis. // Using HardwareBufferRenderer requires minimum of 34. min_sdk_version: "34", static_libs: [ "androidx.slice_slice-core", "androidx.slice_slice-builders", "dagger2", "jsr330", // Dagger inject annotations. "kotlinx_coroutines_android", "kotlinx_coroutines", "androidx.core_core-ktx", // Do not add Torus dependency here, since this package is only for rendering. The host app // will include Torus or Livewallpaper frameworks. "androidx.appcompat_appcompat", "androidx-constraintlayout_constraintlayout", "toruslib", ], srcs: [ "src/**/*.java", "src/**/*.kt", // TODO(b/300991599): Split out debug source. "debug/src/**/*.java", "debug/src/**/*.kt" ], resource_dirs: [ "res", // TODO(b/300991599): Split out debug resources. "debug/res" ], // TODO(b/300991599): Split out debug resources. asset_dirs: [ "debug/assets" "graphics/src/**/*.java", "graphics/src/**/*.kt", ], javacflags: ["-Adagger.fastInit=enabled"], kotlincflags: ["-Xjvm-default=all"], plugins: ["dagger2-compiler"], dxflags: ["--multi-dex"], // This library is meant to access only public APIs, do not flip this flag to true. platform_apis: false } // Debug app. Loading @@ -64,11 +43,33 @@ android_app { name: "WeatherEffectsDebug", manifest: "debug/AndroidManifest.xml", owner: "google", privileged: false, sdk_version: "system_current", min_sdk_version: "34", srcs: [ "src/**/*.java", "src/**/*.kt", "debug/src/**/*.java", "debug/src/**/*.kt", ], resource_dirs: [ "res", "debug/res", ], asset_dirs: [ "debug/assets", ], static_libs: [ "WeatherEffectsLib" "androidx.slice_slice-core", "androidx.slice_slice-builders", "dagger2", "jsr330", // Dagger inject annotations. "kotlinx_coroutines_android", "kotlinx_coroutines", "androidx.core_core-ktx", "androidx.appcompat_appcompat", "androidx-constraintlayout_constraintlayout", "toruslib", "WeatherEffectsGraphicsLib", ], use_embedded_native_libs: true, plugins: ["dagger2-compiler"], Loading @@ -90,13 +91,12 @@ android_test { "tests/src/**/*.kt", ], static_libs: [ "WeatherEffectsLib", "WeatherEffectsGraphicsLib", "androidx.test.rules", "androidx.test.ext.junit", "androidx.test.core", "androidx.test.runner", "kotlinx_coroutines_test", "truth" "truth", ], }
weathereffects/AndroidManifest.xml +0 −34 Original line number Diff line number Diff line Loading @@ -16,38 +16,4 @@ --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.google.android.wallpaper.weathereffects"> <!--TODO: Add privileged permission--> <uses-feature android:name="android.software.live_wallpaper" android:required="true" /> <queries> <package android:name="com.google.android.apps.wallpaper" /> <package android:name="com.android.wallpaper" /> </queries> <application android:icon="@mipmap/ic_launcher" android:label="@string/app_name"> <provider android:name="com.google.android.wallpaper.weathereffects.provider.WeatherEffectsContentProvider" android:authorities="${applicationId}.effectprovider" android:exported="true" /> <service android:name="com.google.android.wallpaper.weathereffects.WeatherWallpaperService" android:directBootAware="true" android:exported="true" android:label="@string/app_name" android:permission="android.permission.BIND_WALLPAPER"> <intent-filter> <action android:name="android.service.wallpaper.WallpaperService" /> </intent-filter> <meta-data android:name="android.service.wallpaper" android:resource="@xml/weather_wallpaper" /> </service> </application> </manifest>
weathereffects/build.gradle +1 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,7 @@ android { dependencies { implementation project(':toruslib') implementation project(':graphics') implementation "androidx.slice:slice-builders:$versions.androidXLib" implementation "androidx.slice:slice-core:$versions.androidXLib" Loading