am 34430260: Merge "Fit and finish on status bar:" into honeycomb

* commit '344302600a87175a9fd2bdfbf38708b1d1759731':
  Fit and finish on status bar:
This commit is contained in:
Daniel Sandler
2011-01-25 18:58:50 -08:00
committed by Android Git Automerger
16 changed files with 64 additions and 72 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View 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"

View 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"
@@ -28,20 +30,27 @@
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>

View 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>

View File

@@ -224,7 +224,7 @@
<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">

View 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

View File

@@ -68,20 +68,16 @@
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:layout_height="wrap_content"
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:singleLine="true"
android:textSize="40sp"
android:textColor="#2e2e2e" />
android:textColor="#8cffffff" />
</com.android.systemui.statusbar.tablet.HoloClock>
<TextView

View 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"
@@ -66,21 +66,9 @@
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>

View 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"

View 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() {

View 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;
}

View 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);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 12 KiB