Use ConstraintLayout for BadgedImageView
App icon badge size is based on the view size, as a ratio.
Use ConstraintLayout to define the app icon size based on constraints.
This way we do not have to recalculate the app icon size manually.
If the BadgedImageView size changes, app icon will be resized automatically.
App icon badge position is fixed to the right. If it needs to be shown
on the left, due to bubble position, we update the location using
translationX.
Bug: 162857077
Test: verified visually that bubble with app icon looks the same
Test: verified visually that when display size changes, app icon changes
together with bubble size
Test: ran WMShellUnitTests unit tests
Change-Id: I63a6cadfc7847dd0c0d9dca6bb6efd11f5b9958e
diff --git a/libs/WindowManager/Shell/Android.bp b/libs/WindowManager/Shell/Android.bp
index cdff585..e9b3c49 100644
--- a/libs/WindowManager/Shell/Android.bp
+++ b/libs/WindowManager/Shell/Android.bp
@@ -43,7 +43,7 @@
name: "wm_shell_util-sources",
srcs: [
"src/com/android/wm/shell/util/**/*.java",
- "src/com/android/wm/shell/common/split/SplitScreenConstants.java"
+ "src/com/android/wm/shell/common/split/SplitScreenConstants.java",
],
path: "src",
}
@@ -74,13 +74,13 @@
],
tools: ["protologtool"],
cmd: "$(location protologtool) transform-protolog-calls " +
- "--protolog-class com.android.internal.protolog.common.ProtoLog " +
- "--protolog-impl-class com.android.wm.shell.protolog.ShellProtoLogImpl " +
- "--protolog-cache-class com.android.wm.shell.protolog.ShellProtoLogCache " +
- "--loggroups-class com.android.wm.shell.protolog.ShellProtoLogGroup " +
- "--loggroups-jar $(location :wm_shell_protolog-groups) " +
- "--output-srcjar $(out) " +
- "$(locations :wm_shell-sources)",
+ "--protolog-class com.android.internal.protolog.common.ProtoLog " +
+ "--protolog-impl-class com.android.wm.shell.protolog.ShellProtoLogImpl " +
+ "--protolog-cache-class com.android.wm.shell.protolog.ShellProtoLogCache " +
+ "--loggroups-class com.android.wm.shell.protolog.ShellProtoLogGroup " +
+ "--loggroups-jar $(location :wm_shell_protolog-groups) " +
+ "--output-srcjar $(out) " +
+ "$(locations :wm_shell-sources)",
out: ["wm_shell_protolog.srcjar"],
}
@@ -92,13 +92,14 @@
],
tools: ["protologtool"],
cmd: "$(location protologtool) generate-viewer-config " +
- "--protolog-class com.android.internal.protolog.common.ProtoLog " +
- "--loggroups-class com.android.wm.shell.protolog.ShellProtoLogGroup " +
- "--loggroups-jar $(location :wm_shell_protolog-groups) " +
- "--viewer-conf $(out) " +
- "$(locations :wm_shell-sources)",
+ "--protolog-class com.android.internal.protolog.common.ProtoLog " +
+ "--loggroups-class com.android.wm.shell.protolog.ShellProtoLogGroup " +
+ "--loggroups-jar $(location :wm_shell_protolog-groups) " +
+ "--viewer-conf $(out) " +
+ "$(locations :wm_shell-sources)",
out: ["wm_shell_protolog.json"],
}
+
// End ProtoLog
java_library {
@@ -123,11 +124,12 @@
"res",
],
java_resources: [
- ":generate-wm_shell_protolog.json"
+ ":generate-wm_shell_protolog.json",
],
static_libs: [
"androidx.appcompat_appcompat",
"androidx.arch.core_core-runtime",
+ "androidx-constraintlayout_constraintlayout",
"androidx.dynamicanimation_dynamicanimation",
"androidx.recyclerview_recyclerview",
"kotlinx-coroutines-android",