am 044602b2: Merge "Ticker visual fixes." into honeycomb

* commit '044602b226638e92907fbd573723772856256259':
  Ticker visual fixes.
This commit is contained in:
Daniel Sandler
2011-01-26 12:53:58 -08:00
committed by Android Git Automerger
5 changed files with 54 additions and 49 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 B

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?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"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@@ -14,14 +14,8 @@
limitations under the License. limitations under the License.
--> -->
<layer-list <bitmap
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:opacity="translucent" android:tileMode="repeat"
> android:src="@drawable/status_bar_ticker_tile"
<item />
android:drawable="@drawable/ticker_background_color"
android:top="12dp"
/>
</layer-list>

View File

@@ -18,9 +18,9 @@
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@*android:dimen/status_bar_height" android:layout_height="match_parent"
android:orientation="horizontal" android:orientation="horizontal"
android:background="@drawable/status_bar_ticker_background" android:gravity="bottom"
> >
<ImageView <ImageView
@@ -30,29 +30,38 @@
android:scaleType="center" android:scaleType="center"
android:visibility="gone" 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" <LinearLayout
android:textAppearance="@*android:style/TextAppearance.StatusBar.Ticker" android:layout_width="wrap_content"
android:layout_width="match_parent" android:layout_height="@*android:dimen/status_bar_height"
android:layout_height="match_parent" android:layout_weight="1"
android:layout_gravity="center_vertical" android:background="@drawable/status_bar_ticker_background"
android:layout_marginLeft="12dp" >
android:gravity="center_vertical"
android:maxLines="2" <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" <TextView android:id="@+id/text"
android:layout_width="64dp" android:textAppearance="@*android:style/TextAppearance.StatusBar.Ticker"
android:layout_height="match_parent" android:layout_width="match_parent"
android:scaleType="center" android:layout_height="match_parent"
android:visibility="gone" 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> </LinearLayout>

View File

@@ -18,14 +18,10 @@
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:orientation="horizontal" android:orientation="horizontal"
android:background="@drawable/status_bar_ticker_background"
android:gravity="bottom" android:gravity="bottom"
> >
<!--
android:background="@drawable/ticker_background"
-->
<ImageView <ImageView
android:id="@+id/large_icon" android:id="@+id/large_icon"
@@ -34,6 +30,12 @@
android:scaleType="center" android:scaleType="center"
android:visibility="gone" 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> </LinearLayout>

View File

@@ -38,7 +38,7 @@ import android.view.WindowManager;
import android.view.WindowManagerImpl; import android.view.WindowManagerImpl;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.FrameLayout;
import android.widget.TextView; import android.widget.TextView;
import com.android.internal.statusbar.StatusBarIcon; import com.android.internal.statusbar.StatusBarIcon;
@@ -173,6 +173,7 @@ public class TabletTicker
mWindow = makeWindow(); mWindow = makeWindow();
WindowManagerImpl.getDefault().addView(mWindow, mWindow.getLayoutParams()); WindowManagerImpl.getDefault().addView(mWindow, mWindow.getLayoutParams());
} }
mWindow.addView(mCurrentView); mWindow.addView(mCurrentView);
sendEmptyMessageDelayed(MSG_ADVANCE, ADVANCE_DELAY); sendEmptyMessageDelayed(MSG_ADVANCE, ADVANCE_DELAY);
break; break;
@@ -259,10 +260,11 @@ public class TabletTicker
} }
if (n.tickerView != null) { if (n.tickerView != null) {
group = (ViewGroup)inflater.inflate(R.layout.status_bar_ticker_panel, null, false); group = (ViewGroup)inflater.inflate(R.layout.status_bar_ticker_panel, null, false);
ViewGroup content = (FrameLayout) group.findViewById(R.id.ticker_expanded);
View expanded = null; View expanded = null;
Exception exception = null; Exception exception = null;
try { try {
expanded = n.tickerView.apply(mContext, group); expanded = n.tickerView.apply(mContext, content);
} }
catch (RuntimeException e) { catch (RuntimeException e) {
exception = e; exception = e;
@@ -273,12 +275,10 @@ public class TabletTicker
Slog.e(TAG, "couldn't inflate view for notification " + ident, exception); Slog.e(TAG, "couldn't inflate view for notification " + ident, exception);
return null; return null;
} }
final int statusBarHeight = mContext.getResources().getDimensionPixelSize( FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
com.android.internal.R.dimen.status_bar_height); ViewGroup.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT);
ViewGroup.LayoutParams.WRAP_CONTENT, statusBarHeight, 1.0f); content.addView(expanded, lp);
lp.gravity = Gravity.BOTTOM;
group.addView(expanded, lp);
} else if (n.tickerText != null) { } else if (n.tickerText != null) {
group = (ViewGroup)inflater.inflate(R.layout.status_bar_ticker_compat, mWindow, false); group = (ViewGroup)inflater.inflate(R.layout.status_bar_ticker_compat, mWindow, false);
final Drawable icon = StatusBarIconView.getIcon(mContext, final Drawable icon = StatusBarIconView.getIcon(mContext,