summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/layout/deep_shortcut.xml3
-rw-r--r--res/layout/notification.xml4
-rw-r--r--res/layout/notification_footer.xml2
-rw-r--r--res/layout/notification_main.xml2
-rw-r--r--res/layout/system_shortcut.xml3
-rw-r--r--res/layout/system_shortcut_icons.xml2
-rw-r--r--res/values/colors.xml7
-rw-r--r--res/values/dimens.xml32
-rw-r--r--src/com/android/launcher3/notification/NotificationItemView.java10
-rw-r--r--src/com/android/launcher3/popup/PopupContainerWithArrow.java12
-rw-r--r--src/com/android/launcher3/popup/PopupItemView.java14
-rw-r--r--src/com/android/launcher3/shortcuts/ShortcutsItemView.java9
12 files changed, 67 insertions, 33 deletions
diff --git a/res/layout/deep_shortcut.xml b/res/layout/deep_shortcut.xml
index 7744906bc..85caba4a0 100644
--- a/res/layout/deep_shortcut.xml
+++ b/res/layout/deep_shortcut.xml
@@ -26,11 +26,12 @@
android:background="?android:attr/selectableItemBackground"
android:gravity="start|center_vertical"
android:textAlignment="viewStart"
- android:paddingStart="@dimen/bg_popup_item_height"
+ android:paddingStart="@dimen/deep_shortcuts_text_padding_start"
android:paddingEnd="@dimen/popup_padding_end"
android:drawableEnd="@drawable/deep_shortcuts_drag_handle"
android:drawablePadding="@dimen/deep_shortcut_drawable_padding"
android:textSize="14sp"
+ android:textColor="?android:attr/textColorPrimary"
android:fontFamily="sans-serif"
launcher:layoutHorizontal="true"
launcher:iconDisplay="shortcut_popup"
diff --git a/res/layout/notification.xml b/res/layout/notification.xml
index 4250e1e54..f955c6b80 100644
--- a/res/layout/notification.xml
+++ b/res/layout/notification.xml
@@ -35,7 +35,7 @@
android:layout_height="@dimen/notification_header_height"
android:paddingStart="@dimen/notification_padding_start"
android:paddingEnd="@dimen/notification_padding_end"
- android:background="@color/notification_header_background_color"
+ android:background="@color/popup_header_background_color"
android:elevation="@dimen/notification_elevation">
<TextView
android:id="@+id/notification_text"
@@ -67,7 +67,7 @@
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="@dimen/popup_item_divider_height"
- android:background="@color/divider_color"
+ android:background="?android:attr/listDivider"
android:layout_below="@id/main_view"/>
<include layout="@layout/notification_footer"
diff --git a/res/layout/notification_footer.xml b/res/layout/notification_footer.xml
index f1f572438..ed2212be1 100644
--- a/res/layout/notification_footer.xml
+++ b/res/layout/notification_footer.xml
@@ -22,7 +22,7 @@
android:elevation="@dimen/notification_elevation"
android:clipChildren="false"
android:layout_gravity="center_vertical"
- android:background="@color/notification_background_color">
+ android:background="@color/popup_background_color">
<LinearLayout
android:id="@+id/icon_row"
diff --git a/res/layout/notification_main.xml b/res/layout/notification_main.xml
index 8fa1b68f8..ce4e137f7 100644
--- a/res/layout/notification_main.xml
+++ b/res/layout/notification_main.xml
@@ -28,7 +28,7 @@
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_vertical"
- android:background="@color/notification_background_color"
+ android:background="@color/popup_background_color"
android:paddingStart="@dimen/notification_padding_start"
android:paddingEnd="@dimen/notification_main_text_padding_end">
<TextView
diff --git a/res/layout/system_shortcut.xml b/res/layout/system_shortcut.xml
index 26e7697af..095270336 100644
--- a/res/layout/system_shortcut.xml
+++ b/res/layout/system_shortcut.xml
@@ -27,9 +27,10 @@
android:background="?android:attr/selectableItemBackground"
android:gravity="start|center_vertical"
android:textAlignment="viewStart"
- android:paddingStart="@dimen/bg_popup_item_height"
+ android:paddingStart="@dimen/deep_shortcuts_text_padding_start"
android:paddingEnd="@dimen/popup_padding_end"
android:textSize="14sp"
+ android:textColor="?android:attr/textColorPrimary"
android:fontFamily="sans-serif"
launcher:iconDisplay="shortcut_popup"
launcher:layoutHorizontal="true" />
diff --git a/res/layout/system_shortcut_icons.xml b/res/layout/system_shortcut_icons.xml
index 9dc56e41d..676be8e69 100644
--- a/res/layout/system_shortcut_icons.xml
+++ b/res/layout/system_shortcut_icons.xml
@@ -21,4 +21,4 @@
android:layout_height="@dimen/system_shortcut_header_height"
android:orientation="horizontal"
android:gravity="end|center_vertical"
- android:background="@color/notification_header_background_color" />
+ android:background="@color/popup_header_background_color" />
diff --git a/res/values/colors.xml b/res/values/colors.xml
index a3d26e34a..47bc5b568 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -30,12 +30,11 @@
<color name="spring_loaded_panel_color">#40FFFFFF</color>
<color name="spring_loaded_highlighted_panel_border_color">#FFF</color>
- <!-- Notifications -->
+ <!-- Popup container -->
+ <color name="popup_header_background_color">#EEEEEE</color> <!-- Gray 200 -->
+ <color name="popup_background_color">#FFF</color>
<color name="notification_icon_default_color">#757575</color> <!-- Gray 600 -->
- <color name="notification_header_background_color">#EEEEEE</color> <!-- Gray 200 -->
- <color name="notification_background_color">#FFF</color>
<color name="notification_color_beneath">#E0E0E0</color> <!-- Gray 300 -->
- <color name="divider_color">@color/notification_color_beneath</color>
<color name="icon_background">#E0E0E0</color> <!-- Gray 300 -->
<color name="legacy_icon_background">#FFFFFF</color>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 7dd9e5315..6add64d76 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -154,7 +154,7 @@
<!-- Deep shortcuts -->
<dimen name="deep_shortcuts_elevation">9dp</dimen>
- <dimen name="bg_popup_item_width">208dp</dimen>
+ <dimen name="bg_popup_item_width">220dp</dimen>
<dimen name="bg_popup_item_height">56dp</dimen>
<dimen name="popup_items_spacing">4dp</dimen>
<dimen name="pre_drag_view_scale">6dp</dimen>
@@ -163,23 +163,27 @@
<dimen name="deep_shortcut_icon_size">36dp</dimen>
<dimen name="deep_shortcut_drawable_padding">8dp</dimen>
<dimen name="deep_shortcut_drag_handle_size">16dp</dimen>
- <dimen name="popup_padding_start">6dp</dimen>
+ <dimen name="popup_padding_start">10dp</dimen>
<dimen name="popup_padding_end">16dp</dimen>
<dimen name="popup_arrow_width">10dp</dimen>
<dimen name="popup_arrow_height">8dp</dimen>
<dimen name="popup_arrow_vertical_offset">-2dp</dimen>
<!-- popup_padding_start + deep_shortcut_icon_size / 2 -->
- <!-- Note that this works for right-aligned shortcuts, too, because
- popup_padding_end + deep_shortcut_drag_handle_size / 2 also equals 24dp-->
- <dimen name="popup_arrow_horizontal_center">24dp</dimen>
- <!-- popup_arrow_center - popup_arrow_width / 2-->
- <dimen name="popup_arrow_horizontal_offset">19dp</dimen>
+ <dimen name="popup_arrow_horizontal_center_start">28dp</dimen>
+ <!-- popup_padding_end + deep_shortcut_drag_handle_size / 2 -->
+ <dimen name="popup_arrow_horizontal_center_end">24dp</dimen>
+ <!-- popup_arrow_center_start - popup_arrow_width / 2-->
+ <dimen name="popup_arrow_horizontal_offset_start">23dp</dimen>
+ <!-- popup_arrow_center_end - popup_arrow_width / 2-->
+ <dimen name="popup_arrow_horizontal_offset_end">19dp</dimen>
<dimen name="popup_arrow_corner_radius">2dp</dimen>
- <!-- popup_item_width - icon_size - padding_start - drawable_padding -->
- <dimen name="deep_shortcuts_divider_width">158dp</dimen>
+ <!-- popup_padding_start + icon_size + 10dp -->
+ <dimen name="deep_shortcuts_text_padding_start">56dp</dimen>
+ <!-- popup_item_width - deep_shortcuts_text_padding_start -->
+ <dimen name="deep_shortcuts_divider_width">164dp</dimen>
<dimen name="system_shortcut_icon_size">24dp</dimen>
- <!-- popup_arrow_center - system_shortcut_icon_size / 2 -->
- <dimen name="system_shortcut_margin_start">12dp</dimen>
+ <!-- popup_arrow_center_start - system_shortcut_icon_size / 2 -->
+ <dimen name="system_shortcut_margin_start">16dp</dimen>
<dimen name="system_shortcut_header_height">40dp</dimen>
<dimen name="system_shortcut_header_icon_touch_size">48dp</dimen>
<!-- (touch_size - icon_size) / 2 -->
@@ -200,15 +204,15 @@
<dimen name="notification_footer_height">32dp</dimen>
<dimen name="notification_header_text_size">13sp</dimen>
<dimen name="notification_header_count_text_size">12sp</dimen>
- <dimen name="notification_main_text_size">15sp</dimen>
+ <dimen name="notification_main_text_size">14sp</dimen>
<dimen name="notification_icon_size">24dp</dimen>
<dimen name="notification_footer_icon_size">18dp</dimen>
<!-- notification_icon_size + notification_padding_end + 16dp padding between icon and text -->
<dimen name="notification_main_text_padding_end">52dp</dimen>
<dimen name="notification_elevation">2dp</dimen>
<dimen name="horizontal_ellipsis_size">18dp</dimen>
- <!-- arrow_horizontal_offset - (ellipsis_size - arrow_width) / 2 -->
- <dimen name="horizontal_ellipsis_offset">15dp</dimen>
+ <!-- arrow_horizontal_offset_start - (ellipsis_size - arrow_width) / 2 -->
+ <dimen name="horizontal_ellipsis_offset">19dp</dimen>
<dimen name="popup_item_divider_height">0.5dp</dimen>
<dimen name="swipe_helper_falsing_threshold">70dp</dimen>
diff --git a/src/com/android/launcher3/notification/NotificationItemView.java b/src/com/android/launcher3/notification/NotificationItemView.java
index e5bf35a1e..dd272b3bc 100644
--- a/src/com/android/launcher3/notification/NotificationItemView.java
+++ b/src/com/android/launcher3/notification/NotificationItemView.java
@@ -21,6 +21,7 @@ import android.app.Notification;
import android.content.Context;
import android.graphics.Rect;
import android.support.annotation.Nullable;
+import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
@@ -93,7 +94,7 @@ public class NotificationItemView extends PopupItemView implements LogContainerP
if (mNotificationHeaderTextColor == Notification.COLOR_DEFAULT) {
mNotificationHeaderTextColor =
IconPalette.resolveContrastColor(getContext(), palette.dominantColor,
- getResources().getColor(R.color.notification_header_background_color));
+ getResources().getColor(R.color.popup_header_background_color));
}
mHeaderCount.setTextColor(mNotificationHeaderTextColor);
}
@@ -158,6 +159,13 @@ public class NotificationItemView extends PopupItemView implements LogContainerP
}
@Override
+ public int getArrowColor(boolean isArrowAttachedToBottom) {
+ return ContextCompat.getColor(getContext(), isArrowAttachedToBottom
+ ? R.color.popup_background_color
+ : R.color.popup_header_background_color);
+ }
+
+ @Override
public void fillInLogContainerData(View v, ItemInfo info, LauncherLogProto.Target target,
LauncherLogProto.Target targetParent) {
target.itemType = LauncherLogProto.ItemType.NOTIFICATION;
diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
index fb7f80ceb..d4ee3b8cb 100644
--- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java
+++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
@@ -25,7 +25,6 @@ import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.Resources;
-import android.graphics.Color;
import android.graphics.CornerPathEffect;
import android.graphics.Paint;
import android.graphics.PointF;
@@ -169,8 +168,6 @@ public class PopupContainerWithArrow extends AbstractFloatingView implements Dra
final Resources resources = getResources();
final int arrowWidth = resources.getDimensionPixelSize(R.dimen.popup_arrow_width);
final int arrowHeight = resources.getDimensionPixelSize(R.dimen.popup_arrow_height);
- final int arrowHorizontalOffset = resources.getDimensionPixelSize(
- R.dimen.popup_arrow_horizontal_offset);
final int arrowVerticalOffset = resources.getDimensionPixelSize(
R.dimen.popup_arrow_vertical_offset);
@@ -208,6 +205,9 @@ public class PopupContainerWithArrow extends AbstractFloatingView implements Dra
}
// Add the arrow.
+ final int arrowHorizontalOffset = resources.getDimensionPixelSize(isAlignedWithStart() ?
+ R.dimen.popup_arrow_horizontal_offset_start :
+ R.dimen.popup_arrow_horizontal_offset_end);
mArrow = addArrowView(arrowHorizontalOffset, arrowVerticalOffset, arrowWidth, arrowHeight);
mArrow.setPivotX(arrowWidth / 2);
mArrow.setPivotY(mIsAboveIcon ? 0 : arrowHeight);
@@ -493,7 +493,11 @@ public class PopupContainerWithArrow extends AbstractFloatingView implements Dra
ShapeDrawable arrowDrawable = new ShapeDrawable(TriangleShape.create(
width, height, !mIsAboveIcon));
Paint arrowPaint = arrowDrawable.getPaint();
- arrowPaint.setColor(Color.WHITE);
+ // Note that we have to use getChildAt() instead of getItemViewAt(),
+ // since the latter expects the arrow which hasn't been added yet.
+ PopupItemView itemAttachedToArrow = (PopupItemView)
+ (getChildAt(mIsAboveIcon ? getChildCount() - 1 : 0));
+ arrowPaint.setColor(itemAttachedToArrow.getArrowColor(mIsAboveIcon));
// The corner path effect won't be reflected in the shadow, but shouldn't be noticeable.
int radius = getResources().getDimensionPixelSize(R.dimen.popup_arrow_corner_radius);
arrowPaint.setPathEffect(new CornerPathEffect(radius));
diff --git a/src/com/android/launcher3/popup/PopupItemView.java b/src/com/android/launcher3/popup/PopupItemView.java
index 5ead971be..b073defa4 100644
--- a/src/com/android/launcher3/popup/PopupItemView.java
+++ b/src/com/android/launcher3/popup/PopupItemView.java
@@ -48,7 +48,7 @@ public abstract class PopupItemView extends FrameLayout
protected final Rect mPillRect;
private float mOpenAnimationProgress;
-
+ protected final boolean mIsRtl;
protected View mIconView;
private final Paint mBackgroundClipPaint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
@@ -75,6 +75,8 @@ public abstract class PopupItemView extends FrameLayout
canvas.setBitmap(mRoundedCornerBitmap);
canvas.drawArc(0, 0, radius*2, radius*2, 180, 90, true, mBackgroundClipPaint);
mBackgroundClipPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));
+
+ mIsRtl = Utilities.isRtl(getResources());
}
@Override
@@ -120,7 +122,9 @@ public abstract class PopupItemView extends FrameLayout
*/
public Animator createOpenAnimation(boolean isContainerAboveIcon, boolean pivotLeft) {
Point center = getIconCenter();
- int arrowCenter = getResources().getDimensionPixelSize(R.dimen.popup_arrow_horizontal_center);
+ int arrowCenter = getResources().getDimensionPixelSize(pivotLeft ^ mIsRtl ?
+ R.dimen.popup_arrow_horizontal_center_start:
+ R.dimen.popup_arrow_horizontal_center_end);
ValueAnimator openAnimator = new ZoomRevealOutlineProvider(center.x, center.y,
mPillRect, this, mIconView, isContainerAboveIcon, pivotLeft, arrowCenter)
.createRevealAnimator(this, false);
@@ -144,7 +148,9 @@ public abstract class PopupItemView extends FrameLayout
public Animator createCloseAnimation(boolean isContainerAboveIcon, boolean pivotLeft,
long duration) {
Point center = getIconCenter();
- int arrowCenter = getResources().getDimensionPixelSize(R.dimen.popup_arrow_horizontal_center);
+ int arrowCenter = getResources().getDimensionPixelSize(pivotLeft ^ mIsRtl ?
+ R.dimen.popup_arrow_horizontal_center_start :
+ R.dimen.popup_arrow_horizontal_center_end);
ValueAnimator closeAnimator = new ZoomRevealOutlineProvider(center.x, center.y,
mPillRect, this, mIconView, isContainerAboveIcon, pivotLeft, arrowCenter)
.createRevealAnimator(this, true);
@@ -177,6 +183,8 @@ public abstract class PopupItemView extends FrameLayout
return getResources().getDimensionPixelSize(R.dimen.bg_round_rect_radius);
}
+ public abstract int getArrowColor(boolean isArrowAttachedToBottom);
+
/**
* Extension of {@link PillRevealOutlineProvider} which scales the icon based on the height.
*/
diff --git a/src/com/android/launcher3/shortcuts/ShortcutsItemView.java b/src/com/android/launcher3/shortcuts/ShortcutsItemView.java
index a5c3120a5..5b3b02eac 100644
--- a/src/com/android/launcher3/shortcuts/ShortcutsItemView.java
+++ b/src/com/android/launcher3/shortcuts/ShortcutsItemView.java
@@ -20,6 +20,7 @@ import android.animation.Animator;
import android.animation.AnimatorSet;
import android.content.Context;
import android.graphics.Point;
+import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
@@ -246,6 +247,14 @@ public class ShortcutsItemView extends PopupItemView implements View.OnLongClick
}
@Override
+ public int getArrowColor(boolean isArrowAttachedToBottom) {
+ return ContextCompat.getColor(getContext(),
+ isArrowAttachedToBottom || mSystemShortcutIcons == null
+ ? R.color.popup_background_color
+ : R.color.popup_header_background_color);
+ }
+
+ @Override
public void fillInLogContainerData(View v, ItemInfo info, LauncherLogProto.Target target,
LauncherLogProto.Target targetParent) {
target.itemType = LauncherLogProto.ItemType.DEEPSHORTCUT;