summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/compat/AppWidgetManagerCompatVL.java
diff options
context:
space:
mode:
authorHyunyoung Song <hyunyoungs@google.com>2015-05-14 17:08:45 -0700
committerHyunyoung Song <hyunyoungs@google.com>2015-05-14 17:08:45 -0700
commit6babf2e27e6260f02751413b8f7a55e46659af27 (patch)
treee1f5562ea4fdd67f4b317d6532133b29e30a2378 /src/com/android/launcher3/compat/AppWidgetManagerCompatVL.java
parent8a496ac99e6418c6e05fc8cc6f2c72bdf7c125d5 (diff)
downloadandroid_packages_apps_Trebuchet-6babf2e27e6260f02751413b8f7a55e46659af27.tar.gz
android_packages_apps_Trebuchet-6babf2e27e6260f02751413b8f7a55e46659af27.tar.bz2
android_packages_apps_Trebuchet-6babf2e27e6260f02751413b8f7a55e46659af27.zip
Place the work profile badge in the correct bottom right (left for RTL)
location Also: - clean up of some code - remove requestLayout() method call that is not needed. b/20338602 Change-Id: I65e0e1ac40da2e3fa85af4d3aca54bed3f200a99
Diffstat (limited to 'src/com/android/launcher3/compat/AppWidgetManagerCompatVL.java')
-rw-r--r--src/com/android/launcher3/compat/AppWidgetManagerCompatVL.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/android/launcher3/compat/AppWidgetManagerCompatVL.java b/src/com/android/launcher3/compat/AppWidgetManagerCompatVL.java
index 6c3e092e8..96ace8477 100644
--- a/src/com/android/launcher3/compat/AppWidgetManagerCompatVL.java
+++ b/src/com/android/launcher3/compat/AppWidgetManagerCompatVL.java
@@ -108,7 +108,7 @@ class AppWidgetManagerCompatVL extends AppWidgetManagerCompat {
}
@Override
- public Bitmap getBadgeBitmap(LauncherAppWidgetProviderInfo info, Bitmap bitmap) {
+ public Bitmap getBadgeBitmap(LauncherAppWidgetProviderInfo info, Bitmap bitmap, int imageHeight) {
if (info.isCustomWidget || info.getProfile().equals(android.os.Process.myUserHandle())) {
return bitmap;
}
@@ -117,9 +117,10 @@ class AppWidgetManagerCompatVL extends AppWidgetManagerCompat {
final Resources res = mContext.getResources();
final int badgeSize = res.getDimensionPixelSize(R.dimen.profile_badge_size);
final int badgeMargin = res.getDimensionPixelSize(R.dimen.profile_badge_margin);
+ final int badgeMinTop = res.getDimensionPixelSize(R.dimen.profile_badge_minimum_top);
final Rect badgeLocation = new Rect(0, 0, badgeSize, badgeSize);
- final int top = bitmap.getHeight() - badgeSize - badgeMargin;
+ final int top = Math.max(imageHeight - badgeSize - badgeMargin, badgeMinTop);
if (res.getConfiguration().getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
badgeLocation.offset(badgeMargin, top);
} else {