diff options
author | Daniel Sandler <dsandler@google.com> | 2011-01-26 11:52:48 -0500 |
---|---|---|
committer | Daniel Sandler <dsandler@google.com> | 2011-01-26 15:25:36 -0500 |
commit | 6aa2d3a166b7b2fe5362931297953d08c17a0fb6 (patch) | |
tree | 730c451ce40b2ea6c30aa4fe4dfde7ccd8aca097 /packages | |
parent | e9b644fcef08b0716efd3843ca7152e75cde3447 (diff) | |
download | frameworks_base-6aa2d3a166b7b2fe5362931297953d08c17a0fb6.zip frameworks_base-6aa2d3a166b7b2fe5362931297953d08c17a0fb6.tar.gz frameworks_base-6aa2d3a166b7b2fe5362931297953d08c17a0fb6.tar.bz2 |
Ticker visual fixes.
- Includes the correct ticker background image, finally
- Confines the ticker height to 48dp (status bar height)
- Aligns the ticker to the bottom of the screen
Bug: 3361133
Change-Id: I9497f29d2b4c1cbcb195f0e66393f6db97d01ee2
Diffstat (limited to 'packages')
5 files changed, 54 insertions, 49 deletions
diff --git a/packages/SystemUI/res/drawable-mdpi/status_bar_ticker_tile.png b/packages/SystemUI/res/drawable-mdpi/status_bar_ticker_tile.png Binary files differnew file mode 100644 index 0000000..85394fa --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/status_bar_ticker_tile.png diff --git a/packages/SystemUI/res/drawable/status_bar_ticker_background.xml b/packages/SystemUI/res/drawable/status_bar_ticker_background.xml index c230358..83524a6 100644 --- a/packages/SystemUI/res/drawable/status_bar_ticker_background.xml +++ b/packages/SystemUI/res/drawable/status_bar_ticker_background.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2010 The Android Open Source Project +<!-- Copyright (C) 2011 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. @@ -14,14 +14,8 @@ limitations under the License. --> -<layer-list +<bitmap xmlns:android="http://schemas.android.com/apk/res/android" - android:opacity="translucent" - > - <item - android:drawable="@drawable/ticker_background_color" - android:top="12dp" - /> -</layer-list> - - + android:tileMode="repeat" + android:src="@drawable/status_bar_ticker_tile" + /> diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_ticker_compat.xml b/packages/SystemUI/res/layout-xlarge/status_bar_ticker_compat.xml index 6de7697..d963de1 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar_ticker_compat.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar_ticker_compat.xml @@ -18,9 +18,9 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" - android:layout_height="@*android:dimen/status_bar_height" + android:layout_height="match_parent" android:orientation="horizontal" - android:background="@drawable/status_bar_ticker_background" + android:gravity="bottom" > <ImageView @@ -30,29 +30,38 @@ android:scaleType="center" android:visibility="gone" /> - - <ImageView android:id="@+id/left_icon" - android:layout_width="64dp" - android:layout_height="match_parent" - android:scaleType="center" - android:visibility="gone" - /> - <TextView android:id="@+id/text" - android:textAppearance="@*android:style/TextAppearance.StatusBar.Ticker" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_gravity="center_vertical" - android:layout_marginLeft="12dp" - android:gravity="center_vertical" - android:maxLines="2" - /> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="@*android:dimen/status_bar_height" + android:layout_weight="1" + android:background="@drawable/status_bar_ticker_background" + > + + <ImageView android:id="@+id/left_icon" + android:layout_width="64dp" + android:layout_height="match_parent" + android:scaleType="center" + android:visibility="gone" + /> - <ImageView android:id="@+id/right_icon" - android:layout_width="64dp" - android:layout_height="match_parent" - android:scaleType="center" - android:visibility="gone" - /> + <TextView android:id="@+id/text" + android:textAppearance="@*android:style/TextAppearance.StatusBar.Ticker" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_gravity="center_vertical" + android:layout_marginLeft="12dp" + android:gravity="center_vertical" + android:maxLines="2" + /> + + <ImageView android:id="@+id/right_icon" + android:layout_width="64dp" + android:layout_height="match_parent" + android:scaleType="center" + android:visibility="gone" + /> + + </LinearLayout> </LinearLayout> diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_ticker_panel.xml b/packages/SystemUI/res/layout-xlarge/status_bar_ticker_panel.xml index d570ace..6cd8899 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar_ticker_panel.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar_ticker_panel.xml @@ -18,14 +18,10 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:orientation="horizontal" - android:background="@drawable/status_bar_ticker_background" android:gravity="bottom" > - <!-- - android:background="@drawable/ticker_background" - --> <ImageView android:id="@+id/large_icon" @@ -34,6 +30,12 @@ android:scaleType="center" android:visibility="gone" /> - <!-- TODO: scaleType should be top-left but ImageView doesn't support that. --> + <FrameLayout + android:id="@+id/ticker_expanded" + android:layout_weight="1" + android:layout_height="@*android:dimen/status_bar_height" + android:layout_width="match_parent" + android:background="@drawable/status_bar_ticker_background" + /> </LinearLayout> 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 440d680..5184462 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java @@ -38,7 +38,7 @@ import android.view.WindowManager; import android.view.WindowManagerImpl; import android.widget.FrameLayout; import android.widget.ImageView; -import android.widget.LinearLayout; +import android.widget.FrameLayout; import android.widget.TextView; import com.android.internal.statusbar.StatusBarIcon; @@ -173,6 +173,7 @@ public class TabletTicker mWindow = makeWindow(); WindowManagerImpl.getDefault().addView(mWindow, mWindow.getLayoutParams()); } + mWindow.addView(mCurrentView); sendEmptyMessageDelayed(MSG_ADVANCE, ADVANCE_DELAY); break; @@ -259,10 +260,11 @@ public class TabletTicker } if (n.tickerView != null) { group = (ViewGroup)inflater.inflate(R.layout.status_bar_ticker_panel, null, false); + ViewGroup content = (FrameLayout) group.findViewById(R.id.ticker_expanded); View expanded = null; Exception exception = null; try { - expanded = n.tickerView.apply(mContext, group); + expanded = n.tickerView.apply(mContext, content); } catch (RuntimeException e) { exception = e; @@ -273,12 +275,10 @@ public class TabletTicker Slog.e(TAG, "couldn't inflate view for notification " + ident, exception); return null; } - final int statusBarHeight = mContext.getResources().getDimensionPixelSize( - com.android.internal.R.dimen.status_bar_height); - LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams( - ViewGroup.LayoutParams.WRAP_CONTENT, statusBarHeight, 1.0f); - lp.gravity = Gravity.BOTTOM; - group.addView(expanded, lp); + FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams( + ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.MATCH_PARENT); + content.addView(expanded, lp); } else if (n.tickerText != null) { group = (ViewGroup)inflater.inflate(R.layout.status_bar_ticker_compat, mWindow, false); final Drawable icon = StatusBarIconView.getIcon(mContext, |