From cd23c849afefe58b213d5abb1c581f15d3ad543a Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Thu, 29 May 2014 18:30:51 -0700 Subject: Updating paddings to design spec. Change-Id: I11286937216494304c38c87280bc69ef9522c596 --- packages/SystemUI/res/layout/recents_empty.xml | 5 ++-- packages/SystemUI/res/values-land/dimens.xml | 3 ++ .../SystemUI/res/values-sw600dp-land/dimens.xml | 3 ++ packages/SystemUI/res/values-sw600dp/dimens.xml | 3 ++ packages/SystemUI/res/values/colors.xml | 2 ++ packages/SystemUI/res/values/dimens.xml | 9 ++++++ packages/SystemUI/res/values/strings.xml | 2 +- .../com/android/systemui/recents/Constants.java | 2 -- .../systemui/recents/RecentsConfiguration.java | 32 ++++++++++++++++++---- .../systemui/recents/views/TaskBarView.java | 31 +++++++++++++++++++++ .../systemui/recents/views/TaskStackView.java | 19 ++++++------- 11 files changed, 90 insertions(+), 21 deletions(-) (limited to 'packages') diff --git a/packages/SystemUI/res/layout/recents_empty.xml b/packages/SystemUI/res/layout/recents_empty.xml index 6268628..ac6450b 100644 --- a/packages/SystemUI/res/layout/recents_empty.xml +++ b/packages/SystemUI/res/layout/recents_empty.xml @@ -19,8 +19,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" - android:textSize="40sp" + android:textSize="20sp" android:textColor="#ffffffff" + android:textStyle="italic" android:text="@string/recents_empty_message" - android:fontFamily="sans-serif-thin" + android:fontFamily="sans-serif-light" android:visibility="gone" /> \ No newline at end of file diff --git a/packages/SystemUI/res/values-land/dimens.xml b/packages/SystemUI/res/values-land/dimens.xml index 39ce0a2..42c4392 100644 --- a/packages/SystemUI/res/values-land/dimens.xml +++ b/packages/SystemUI/res/values-land/dimens.xml @@ -38,6 +38,9 @@ 8dp 8dp + + 0.2229 + 384dp diff --git a/packages/SystemUI/res/values-sw600dp-land/dimens.xml b/packages/SystemUI/res/values-sw600dp-land/dimens.xml index b510fef..326f602 100644 --- a/packages/SystemUI/res/values-sw600dp-land/dimens.xml +++ b/packages/SystemUI/res/values-sw600dp-land/dimens.xml @@ -19,6 +19,9 @@ 190dip + + 0.25 + 37% 14% diff --git a/packages/SystemUI/res/values-sw600dp/dimens.xml b/packages/SystemUI/res/values-sw600dp/dimens.xml index 5750faa..313e2e8 100644 --- a/packages/SystemUI/res/values-sw600dp/dimens.xml +++ b/packages/SystemUI/res/values-sw600dp/dimens.xml @@ -46,6 +46,9 @@ @dimen/close_handle_height + + 0.075 + 384dp diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml index e6fa535..757d4ad 100644 --- a/packages/SystemUI/res/values/colors.xml +++ b/packages/SystemUI/res/values/colors.xml @@ -72,6 +72,8 @@ #ffeeeeee #ff333333 + + #28ffffff #ffffffff diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index e65d9a6..8c80c3b 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -232,12 +232,21 @@ 100dp + + 1dp + 50dp 64dp + + 0.04444 + + + 16dp + 800dp diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index ef3956e..59f1efd 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -522,7 +522,7 @@ Notifications - RECENTS + No recent apps Application Info diff --git a/packages/SystemUI/src/com/android/systemui/recents/Constants.java b/packages/SystemUI/src/com/android/systemui/recents/Constants.java index 4db81bf..76e88a5 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/Constants.java +++ b/packages/SystemUI/src/com/android/systemui/recents/Constants.java @@ -101,8 +101,6 @@ public class Constants { public static final int TaskStackOverscrollRange = 150; public static final int FilterStartDelay = 25; - // The padding will be applied to the smallest dimension, and then applied to all sides - public static final float StackPaddingPct = 0.085f; // The overlap height relative to the task height public static final float StackOverlapPct = 0.65f; // The height of the peek space relative to the stack height diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java index 1ae7a0d..6391685 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java @@ -52,10 +52,12 @@ public class RecentsConfiguration { public int filteringCurrentViewsMinAnimDuration; public int filteringNewViewsMinAnimDuration; - public int taskBarEnterAnimDuration; - public int taskBarExitAnimDuration; + public int taskStackScrollDismissInfoPaneDistance; public int taskStackMaxDim; + public float taskStackWidthPaddingPct; + public int taskStackTopPaddingPx; + public int taskViewInfoPaneAnimDuration; public int taskViewRemoveAnimDuration; public int taskViewRemoveAnimTranslationXPx; @@ -63,12 +65,18 @@ public class RecentsConfiguration { public int taskViewTranslationZIncrementPx; public int taskViewShadowOutlineBottomInsetPx; public int taskViewRoundedCornerRadiusPx; + public int taskViewHighlightPx; + public int searchBarSpaceHeightPx; public int taskBarViewDefaultBackgroundColor; public int taskBarViewDefaultTextColor; public int taskBarViewLightTextColor; public int taskBarViewDarkTextColor; + public int taskBarViewHighlightColor; + + public int taskBarEnterAnimDuration; + public int taskBarExitAnimDuration; public boolean launchedFromAltTab; public boolean launchedWithThumbnailAnimation; @@ -115,13 +123,16 @@ public class RecentsConfiguration { res.getInteger(R.integer.recents_filter_animate_current_views_min_duration); filteringNewViewsMinAnimDuration = res.getInteger(R.integer.recents_filter_animate_new_views_min_duration); - taskBarEnterAnimDuration = - res.getInteger(R.integer.recents_animate_task_bar_enter_duration); - taskBarExitAnimDuration = - res.getInteger(R.integer.recents_animate_task_bar_exit_duration); + taskStackScrollDismissInfoPaneDistance = res.getDimensionPixelSize( R.dimen.recents_task_stack_scroll_dismiss_info_pane_distance); taskStackMaxDim = res.getInteger(R.integer.recents_max_task_stack_view_dim); + + TypedValue widthPaddingPctValue = new TypedValue(); + res.getValue(R.dimen.recents_stack_width_padding_percentage, widthPaddingPctValue, true); + taskStackWidthPaddingPct = widthPaddingPctValue.getFloat(); + taskStackTopPaddingPx = res.getDimensionPixelSize(R.dimen.recents_stack_top_padding); + taskViewInfoPaneAnimDuration = res.getInteger(R.integer.recents_animate_task_view_info_pane_duration); taskViewRemoveAnimDuration = @@ -130,11 +141,13 @@ public class RecentsConfiguration { res.getDimensionPixelSize(R.dimen.recents_task_view_remove_anim_translation_x); taskViewRoundedCornerRadiusPx = res.getDimensionPixelSize(R.dimen.recents_task_view_rounded_corners_radius); + taskViewHighlightPx = res.getDimensionPixelSize(R.dimen.recents_task_view_highlight); taskViewTranslationZMinPx = res.getDimensionPixelSize(R.dimen.recents_task_view_z_min); taskViewTranslationZIncrementPx = res.getDimensionPixelSize(R.dimen.recents_task_view_z_increment); taskViewShadowOutlineBottomInsetPx = res.getDimensionPixelSize(R.dimen.recents_task_view_shadow_outline_bottom_inset); + searchBarSpaceHeightPx = res.getDimensionPixelSize(R.dimen.recents_search_bar_space_height); taskBarViewDefaultBackgroundColor = @@ -145,6 +158,13 @@ public class RecentsConfiguration { res.getColor(R.color.recents_task_bar_light_text_color); taskBarViewDarkTextColor = res.getColor(R.color.recents_task_bar_dark_text_color); + taskBarViewHighlightColor = + res.getColor(R.color.recents_task_bar_highlight_color); + + taskBarEnterAnimDuration = + res.getInteger(R.integer.recents_animate_task_bar_enter_duration); + taskBarExitAnimDuration = + res.getInteger(R.integer.recents_animate_task_bar_exit_duration); fastOutSlowInInterpolator = AnimationUtils.loadInterpolator(context, com.android.internal.R.interpolator.fast_out_slow_in); diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskBarView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskBarView.java index 9e6c98e..c10ddd1 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskBarView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskBarView.java @@ -18,6 +18,10 @@ package com.android.systemui.recents.views; import android.content.Context; import android.content.res.Resources; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffXfermode; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.widget.FrameLayout; @@ -41,6 +45,8 @@ class TaskBarView extends FrameLayout { Drawable mLightDismissDrawable; Drawable mDarkDismissDrawable; + static Paint sHighlightPaint; + public TaskBarView(Context context) { this(context, null); } @@ -55,9 +61,23 @@ class TaskBarView extends FrameLayout { public TaskBarView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); + setWillNotDraw(false); + + // Load the dismiss resources Resources res = context.getResources(); mLightDismissDrawable = res.getDrawable(R.drawable.recents_dismiss_light); mDarkDismissDrawable = res.getDrawable(R.drawable.recents_dismiss_dark); + + // Configure the highlight paint + if (sHighlightPaint == null) { + RecentsConfiguration config = RecentsConfiguration.getInstance(); + sHighlightPaint = new Paint(); + sHighlightPaint.setStyle(Paint.Style.STROKE); + sHighlightPaint.setStrokeWidth(config.taskViewHighlightPx); + sHighlightPaint.setColor(config.taskBarViewHighlightColor); + sHighlightPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.ADD)); + sHighlightPaint.setAntiAlias(true); + } } @Override @@ -68,6 +88,17 @@ class TaskBarView extends FrameLayout { mDismissButton = (ImageView) findViewById(R.id.dismiss_task); } + @Override + protected void onDraw(Canvas canvas) { + RecentsConfiguration config = RecentsConfiguration.getInstance(); + + // Draw the highlight at the top edge (but put the bottom edge just out of view) + float offset = config.taskViewHighlightPx / 2f; + float radius = config.taskViewRoundedCornerRadiusPx; + canvas.drawRoundRect(-offset, 0f, (float) getMeasuredWidth() + offset, + getMeasuredHeight() + radius, radius, radius, sHighlightPaint); + } + /** Synchronizes this bar view's properties with the task's transform */ void updateViewPropertiesToTaskTransform(TaskViewTransform animateFromTransform, TaskViewTransform toTransform, int duration) { diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java index 1fbaf87..053f122 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java @@ -645,6 +645,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal // Note: We let the stack view be the full height because we want the cards to go under the // navigation bar if possible. However, the stack rects which we use to calculate // max scroll, etc. need to take the nav bar into account + RecentsConfiguration config = RecentsConfiguration.getInstance(); // Compute the stack rects mRect.set(0, 0, width, height); @@ -652,23 +653,21 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal mStackRect.left += insetLeft; mStackRect.bottom -= insetBottom; - int smallestDimension = Math.min(width, height); - int padding = (int) (Constants.Values.TaskStackView.StackPaddingPct * smallestDimension / 2f); + int widthPadding = (int) (config.taskStackWidthPaddingPct * mStackRect.width()); + int heightPadding = config.taskStackTopPaddingPx; if (Constants.DebugFlags.App.EnableSearchLayout) { - mStackRect.top += padding; - mStackRect.left += padding; - mStackRect.right -= padding; - mStackRect.bottom -= padding; + mStackRect.top += heightPadding; + mStackRect.left += widthPadding; + mStackRect.right -= widthPadding; + mStackRect.bottom -= heightPadding; } else { - mStackRect.inset(padding, padding); + mStackRect.inset(widthPadding, heightPadding); } mStackRectSansPeek.set(mStackRect); mStackRectSansPeek.top += Constants.Values.TaskStackView.StackPeekHeightPct * mStackRect.height(); // Compute the task rect - int minHeight = (int) (mStackRect.height() - - (Constants.Values.TaskStackView.StackPeekHeightPct * mStackRect.height())); - int size = Math.min(minHeight, Math.min(mStackRect.width(), mStackRect.height())); + int size = mStackRect.width(); int left = mStackRect.left + (mStackRect.width() - size) / 2; mTaskRect.set(left, mStackRectSansPeek.top, left + size, mStackRectSansPeek.top + size); -- cgit v1.1