summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@android.com>2011-12-07 17:40:07 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-12-07 17:40:07 -0800
commit29933fb26a4294a9bd30f9227809e28949252833 (patch)
tree8b9403689d00425b7148a8ee288cb3681f8f3429 /packages/SystemUI/src/com/android
parentaa2719df72225402737009b1cc2e3cfea8e74bc7 (diff)
parenta3850b68399ab49032e1fc2a2eab129fe3a7e69e (diff)
downloadframeworks_base-29933fb26a4294a9bd30f9227809e28949252833.zip
frameworks_base-29933fb26a4294a9bd30f9227809e28949252833.tar.gz
frameworks_base-29933fb26a4294a9bd30f9227809e28949252833.tar.bz2
Merge "Improve handling of small largeIcons in tablet ticker." into ics-mr1
Diffstat (limited to 'packages/SystemUI/src/com/android')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java
index 6045e31..e93a32b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java
@@ -73,6 +73,8 @@ public class TabletTicker
private StatusBarNotification[] mQueue = new StatusBarNotification[QUEUE_LENGTH];
private int mQueuePos;
+ private final int mLargeIconHeight;
+
private TabletStatusBar mBar;
private LayoutTransition mLayoutTransition;
@@ -81,6 +83,9 @@ public class TabletTicker
public TabletTicker(TabletStatusBar bar) {
mBar = bar;
mContext = bar.getContext();
+ final Resources res = mContext.getResources();
+ mLargeIconHeight = res.getDimensionPixelSize(
+ android.R.dimen.notification_large_icon_height);
}
public void add(IBinder key, StatusBarNotification notification) {
@@ -209,8 +214,6 @@ public class TabletTicker
final Resources res = mContext.getResources();
final FrameLayout view = new FrameLayout(mContext);
final int width = res.getDimensionPixelSize(R.dimen.notification_ticker_width);
- final int height = res.getDimensionPixelSize(
- android.R.dimen.notification_large_icon_height);
int windowFlags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
| WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
| WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS;
@@ -219,7 +222,7 @@ public class TabletTicker
} else {
windowFlags |= WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE;
}
- WindowManager.LayoutParams lp = new WindowManager.LayoutParams(width, height,
+ WindowManager.LayoutParams lp = new WindowManager.LayoutParams(width, mLargeIconHeight,
WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL, windowFlags,
PixelFormat.TRANSLUCENT);
lp.gravity = Gravity.BOTTOM | Gravity.RIGHT;
@@ -297,6 +300,16 @@ public class TabletTicker
if (n.largeIcon != null) {
largeIcon.setImageBitmap(n.largeIcon);
largeIcon.setVisibility(View.VISIBLE);
+ final ViewGroup.LayoutParams lp = largeIcon.getLayoutParams();
+ final int statusBarHeight = mBar.getStatusBarHeight();
+ if (n.largeIcon.getHeight() <= statusBarHeight) {
+ // for smallish largeIcons, it looks a little odd to have them floating halfway up
+ // the ticker, so we vertically center them in the status bar area instead
+ lp.height = statusBarHeight;
+ } else {
+ lp.height = mLargeIconHeight;
+ }
+ largeIcon.setLayoutParams(lp);
}
if (CLICKABLE_TICKER) {