OSDN Git Service

Fit and finish on status bar:
authorDaniel Sandler <dsandler@google.com>
Tue, 25 Jan 2011 04:44:47 +0000 (23:44 -0500)
committerDaniel Sandler <dsandler@google.com>
Tue, 25 Jan 2011 21:46:43 +0000 (16:46 -0500)
  - Clock color fixed. [3374581]
  - Clock vertically aligned. [3388224]
  - Clock uses system font assets now. [3385564]
  - Solid version of AndroidClock added to build. [3385564]
  - Extraneous background glow removed from notification panel.
  - Removed solid black background from notifications. [3388223]
  - Added background image behind large notification icons
    and increased large size to 64dip [33884343384355]
  - Corrected size & leading of notification text [3388577]

Bug: 3374581
Bug: 3384355
Bug: 3385564
Bug: 3388223
Bug: 3388224
Bug: 3388434
Bug: 3388577
Change-Id: I8e443da5758deca412d1ce5944f887b35f6265ed

16 files changed:
core/res/res/drawable-hdpi/notify_panel_notification_icon_bg.png [new file with mode: 0644]
core/res/res/drawable-mdpi/notify_panel_notification_icon_bg.png [new file with mode: 0644]
core/res/res/layout-xlarge/status_bar_latest_event_content.xml
core/res/res/layout-xlarge/status_bar_latest_event_content_large_icon.xml
core/res/res/values/dimens.xml
core/res/res/values/styles.xml
data/fonts/AndroidClock_Solid.ttf [moved from data/fonts/AndroidClock-Solid.ttf with 100% similarity]
data/fonts/fonts.mk
packages/SystemUI/res/layout-xlarge/status_bar_notification_area.xml
packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml
packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml
packages/SystemUI/src/com/android/systemui/statusbar/tablet/HoloClock.java
packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
tests/StatusBar/res/drawable-mdpi/pineapple.png
tests/StatusBar/res/drawable-mdpi/pineapple2.png

diff --git a/core/res/res/drawable-hdpi/notify_panel_notification_icon_bg.png b/core/res/res/drawable-hdpi/notify_panel_notification_icon_bg.png
new file mode 100644 (file)
index 0000000..f5b762e
Binary files /dev/null and b/core/res/res/drawable-hdpi/notify_panel_notification_icon_bg.png differ
diff --git a/core/res/res/drawable-mdpi/notify_panel_notification_icon_bg.png b/core/res/res/drawable-mdpi/notify_panel_notification_icon_bg.png
new file mode 100644 (file)
index 0000000..9ecb8af
Binary files /dev/null and b/core/res/res/drawable-mdpi/notify_panel_notification_icon_bg.png differ
index dca2c57..1a3ee82 100644 (file)
@@ -3,9 +3,9 @@
     android:layout_height="match_parent"
     >
     <ImageView android:id="@+id/icon"
-        android:layout_width="48dp"
-        android:layout_height="64dp"
-        android:layout_marginLeft="4dp"
+        android:layout_width="@dimen/notification_large_icon_width"
+        android:layout_height="@dimen/notification_large_icon_height"
+        android:background="@drawable/notify_panel_notification_icon_bg"
         android:scaleType="center"
         />
     <LinearLayout
@@ -14,7 +14,7 @@
         android:layout_gravity="center_vertical"
         android:layout_weight="1"
         android:orientation="vertical"
-        android:paddingLeft="8dp"
+        android:paddingLeft="16dp"
         >
         <TextView android:id="@+id/title"
             android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Title"
@@ -23,6 +23,7 @@
             android:singleLine="true"
             android:ellipsize="marquee"
             android:fadingEdge="horizontal"
+            android:layout_marginBottom="-4dp"
             />
         <TextView android:id="@+id/text"
             android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
index 144fa0d..e9b106d 100644 (file)
@@ -8,6 +8,7 @@
         android:layout_gravity="center_vertical"
         android:layout_weight="1"
         android:orientation="vertical"
+        android:paddingLeft="16dp"
         >
         <TextView android:id="@+id/title"
             android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Title"
@@ -16,6 +17,7 @@
             android:singleLine="true"
             android:ellipsize="marquee"
             android:fadingEdge="horizontal"
+            android:layout_marginBottom="-4dp"
             />
         <TextView android:id="@+id/text"
             android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
             android:fadingEdge="horizontal"
             />
     </LinearLayout>
-    <TextView android:id="@+id/info"
-        android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Info"
+    <RelativeLayout
         android:layout_width="wrap_content"
         android:layout_height="match_parent"
-        android:singleLine="true"
-        android:gravity="center_vertical"
-        android:paddingLeft="8dp"
-        />
-    <ImageView android:id="@+id/icon"
-        android:layout_width="48dp"
-        android:layout_height="32dp"
-        android:layout_gravity="top"
-        android:layout_marginTop="8dp"
-        android:scaleType="center"
-        />
+        >
+        <TextView android:id="@+id/info"
+            android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Info"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:singleLine="true"
+            android:gravity="center_vertical"
+            android:layout_alignParentLeft="true"
+            android:paddingLeft="8dp"
+            />
+        <ImageView android:id="@+id/icon"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentBottom="true"
+            android:layout_alignRight="@id/info"
+            android:layout_marginBottom="8dip"
+            android:scaleType="center"
+            />
+    </RelativeLayout>
 </LinearLayout>
 
index d094bad..8a590cd 100644 (file)
@@ -70,9 +70,9 @@
     <item type="dimen" name="dialog_min_width_minor">95%</item>
 
     <!-- The width of the big icons in notifications. -->
-    <dimen name="notification_large_icon_width">60dp</dimen>
+    <dimen name="notification_large_icon_width">64dp</dimen>
     <!-- The width of the big icons in notifications. -->
-    <dimen name="notification_large_icon_height">60dp</dimen>
+    <dimen name="notification_large_icon_height">64dp</dimen>
 
     <!-- Minimum width of the search view text entry area. -->
     <dimen name="search_view_text_min_width">160dip</dimen>
index 25a43e0..811d870 100644 (file)
         <item name="android:textStyle">bold</item>
     </style>
     <style name="TextAppearance.StatusBar.EventContent">
-        <item name="android:textAppearance">?android:attr/textAppearanceSmall</item>
+        <item name="android:textSize">10sp</item>
         <item name="android:textColor">?android:attr/textColorPrimaryInverse</item>
     </style>
     <style name="TextAppearance.StatusBar.EventContent.Title">
index b8a93e8..faecfee 100644 (file)
@@ -28,4 +28,5 @@ PRODUCT_COPY_FILES := \
     frameworks/base/data/fonts/Clockopia.ttf:system/fonts/Clockopia.ttf \
     frameworks/base/data/fonts/DroidSansFallback.ttf:system/fonts/DroidSansFallback.ttf \
     frameworks/base/data/fonts/AndroidClock.ttf:system/fonts/AndroidClock.ttf \
-    frameworks/base/data/fonts/AndroidClock_Highlight.ttf:system/fonts/AndroidClock_Highlight.ttf 
+    frameworks/base/data/fonts/AndroidClock_Highlight.ttf:system/fonts/AndroidClock_Highlight.ttf \
+    frameworks/base/data/fonts/AndroidClock_Highlight.ttf:system/fonts/AndroidClock_Solid.ttf 
index faae62c..2ee2ac4 100644 (file)
             android:id="@+id/clock"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginBottom="4dp"
+            android:layout_marginBottom="2dip"
+            android:layout_marginLeft="4dip"
+            android:layout_marginRight="4dip"
             >
-            <TextView android:id="@+id/time_bg"
+            <TextView android:id="@+id/time_solid"
                 android:layout_width="wrap_content"
-                android:layout_height="match_parent"
-                android:singleLine="true"
-                android:textSize="40sp"
-                android:textColor="#1f1f1f" />
-            <TextView android:id="@+id/time_fg"
-                android:layout_width="wrap_content"
-                android:layout_height="match_parent"
+                android:layout_height="wrap_content"
                 android:singleLine="true"
                 android:textSize="40sp"
-                android:textColor="#2e2e2e" />
+                android:textColor="#8cffffff" />
         </com.android.systemui.statusbar.tablet.HoloClock>
 
         <TextView
index 821cf6a..ef57228 100644 (file)
@@ -57,7 +57,7 @@
                 android:layout_width="match_parent"
                 android:layout_weight="1"
                 >
-                <com.android.systemui.statusbar.tablet.NotificationLinearLayout
+                <LinearLayout
                     android:id="@+id/content"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:clickable="true"
                     android:focusable="true"
                     android:descendantFocusability="afterDescendants"
-                    >
-                </com.android.systemui.statusbar.tablet.NotificationLinearLayout>
+                    />
             </ScrollView>
         </LinearLayout>
     </RelativeLayout>
 
-    <View
-        android:id="@+id/glow"
-        android:background="@drawable/notify_glow_back"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignTop="@id/content_parent"
-        android:layout_alignLeft="@id/content_parent"
-        android:layout_marginLeft="100dip"
-        android:layout_marginTop="50dip"
-        />
-
 </com.android.systemui.statusbar.tablet.NotificationPanel>
index 233cb46..0f3f5f0 100644 (file)
@@ -1,7 +1,6 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="65dp"
-    android:background="@drawable/status_bar_item_background"
     >
 
     <ImageButton
@@ -12,8 +11,9 @@
         android:layout_alignParentRight="true"
         android:src="@drawable/status_bar_veto"
         android:scaleType="center"
-        android:background="#ff000000"
+        android:background="@null"
         android:paddingRight="8dp"
+        android:paddingLeft="8dp"
         />
 
     <ImageView
@@ -24,7 +24,6 @@
         android:layout_alignParentLeft="true"
         android:scaleType="center"
         />
-        <!-- TODO: scaleType should be top-left but ImageView doesn't support that. -->
 
     <com.android.systemui.statusbar.LatestItemView android:id="@+id/content"
         android:layout_width="match_parent"
index 3b76434..0121211 100644 (file)
@@ -52,8 +52,13 @@ public class HoloClock extends FrameLayout {
     private String mClockFormatString;
     private SimpleDateFormat mClockFormat;
 
-    private static Typeface sBackgroundType, sForegroundType;
-    private TextView mBgText, mFgText;
+    private static final String FONT_DIR = "/system/fonts/";
+    private static final String CLOCK_FONT = FONT_DIR + "AndroidClock_Solid.ttf"; 
+    private static final String CLOCK_FG_FONT = FONT_DIR + "AndroidClock.ttf"; 
+    private static final String CLOCK_BG_FONT = FONT_DIR + "AndroidClock_Highlight.ttf"; 
+
+    private static Typeface sBackgroundType, sForegroundType, sSolidType;
+    private TextView mSolidText, mBgText, mFgText;
 
     public HoloClock(Context context) {
         this(context, null);
@@ -71,13 +76,10 @@ public class HoloClock extends FrameLayout {
     protected void onFinishInflate() {
         super.onFinishInflate();
 
-        if (sBackgroundType == null) {
-            AssetManager assets = getContext().getAssets();
-
-            sBackgroundType = Typeface.createFromAsset(assets,
-                "fonts/AndroidClock.ttf");
-            sForegroundType = Typeface.createFromAsset(assets,
-                "fonts/AndroidClock2.ttf");
+        if (sSolidType == null) {
+            sSolidType = Typeface.createFromFile(CLOCK_FONT);
+            sBackgroundType = Typeface.createFromFile(CLOCK_BG_FONT);
+            sForegroundType = Typeface.createFromFile(CLOCK_FG_FONT);
         }
         mBgText = (TextView) findViewById(R.id.time_bg);
         if (mBgText != null) {
@@ -87,6 +89,10 @@ public class HoloClock extends FrameLayout {
         if (mFgText != null) {
             mFgText.setTypeface(sForegroundType);
         }
+        mSolidText = (TextView) findViewById(R.id.time_solid);
+        if (mSolidText != null) {
+            mSolidText.setTypeface(sSolidType);
+        }
     }
 
     @Override
@@ -142,8 +148,9 @@ public class HoloClock extends FrameLayout {
     final void updateClock() {
         mCalendar.setTimeInMillis(System.currentTimeMillis());
         CharSequence txt = getTimeText();
-        mBgText.setText(txt);
-        mFgText.setText(txt);
+        if (mBgText != null) mBgText.setText(txt);
+        if (mFgText != null) mFgText.setText(txt);
+        if (mSolidText != null) mSolidText.setText(txt);
     }
 
     private final CharSequence getTimeText() {
index 092f0b8..1004e18 100644 (file)
@@ -58,7 +58,6 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
     ViewGroup mContentFrame;
     Rect mContentArea = new Rect();
     View mSettingsView;
-    View mGlow;
     ViewGroup mContentParent;
 
     Choreographer mChoreo = new Choreographer();
@@ -83,8 +82,6 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
         mModeToggle = findViewById(R.id.mode_toggle);
         mModeToggle.setOnClickListener(this);
 
-        mGlow = findViewById(R.id.glow);
-
         mSettingsButton = (ImageView)findViewById(R.id.settings_button);
         mNotificationButton = (ImageView)findViewById(R.id.notification_button);
 
@@ -306,18 +303,15 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
                     ? new android.view.animation.DecelerateInterpolator(1.0f)
                     : new android.view.animation.AccelerateInterpolator(1.0f));
 
-            Animator glowAnim = ObjectAnimator.ofInt(mGlow.getBackground(), "alpha",
-                    mVisible ? 255 : 0, appearing ? 255 : 0);
-            glowAnim.setInterpolator(appearing
-                    ? new android.view.animation.AccelerateInterpolator(1.0f)
-                    : new android.view.animation.DecelerateInterpolator(1.0f));
+            if (mContentAnim != null && mContentAnim.isRunning()) {
+                mContentAnim.cancel();
+            }
 
             mContentAnim = new AnimatorSet();
             mContentAnim
                 .play(ObjectAnimator.ofFloat(mContentParent, "alpha",
                     mContentParent.getAlpha(), appearing ? 1.0f : 0.0f))
                 .with(bgAnim)
-                .with(glowAnim)
                 .with(posAnim)
                 ;
             mContentAnim.setDuration((DEBUG?10:1)*(appearing ? OPEN_DURATION : CLOSE_DURATION));
@@ -330,7 +324,6 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
             createAnimation(appearing);
 
             mContentParent.setLayerType(View.LAYER_TYPE_HARDWARE, null);
-            mGlow.setLayerType(View.LAYER_TYPE_HARDWARE, null);
             mContentAnim.start();
 
             mVisible = appearing;
@@ -338,8 +331,6 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
 
         public void onAnimationCancel(Animator animation) {
             if (DEBUG) Slog.d(TAG, "onAnimationCancel");
-            // force this to zero so we close the window
-            mVisible = false;
         }
 
         public void onAnimationEnd(Animator animation) {
@@ -348,7 +339,6 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
                 setVisibility(View.GONE);
             }
             mContentParent.setLayerType(View.LAYER_TYPE_NONE, null);
-            mGlow.setLayerType(View.LAYER_TYPE_NONE, null);
             mContentAnim = null;
         }
 
index 9549930..d46de15 100644 (file)
@@ -1222,6 +1222,7 @@ public class TabletStatusBar extends StatusBar implements
 
     void workAroundBadLayerDrawableOpacity(View v) {
         LayerDrawable d = (LayerDrawable)v.getBackground();
+        if (d == null) return;
         v.setBackgroundDrawable(null);
         d.setOpacity(PixelFormat.TRANSLUCENT);
         v.setBackgroundDrawable(d);
index 7377b96..a903723 100644 (file)
Binary files a/tests/StatusBar/res/drawable-mdpi/pineapple.png and b/tests/StatusBar/res/drawable-mdpi/pineapple.png differ
index ddc1038..8e5009b 100644 (file)
Binary files a/tests/StatusBar/res/drawable-mdpi/pineapple2.png and b/tests/StatusBar/res/drawable-mdpi/pineapple2.png differ