mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 07:46:55 +00:00
Merge "Slightly round corners of popup arrow" into ub-launcher3-dorval
This commit is contained in:
@@ -170,6 +170,7 @@
|
||||
<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_corner_radius">2dp</dimen>
|
||||
<!-- popup_item_width - icon_size - padding_start - drawable_padding -->
|
||||
<dimen name="deep_shortcuts_divider_width">158dp</dimen>
|
||||
<dimen name="system_shortcut_icon_size">24dp</dimen>
|
||||
|
||||
@@ -26,6 +26,8 @@ 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;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.ShapeDrawable;
|
||||
@@ -486,7 +488,11 @@ public class PopupContainerWithArrow extends AbstractFloatingView implements Dra
|
||||
} else {
|
||||
ShapeDrawable arrowDrawable = new ShapeDrawable(TriangleShape.create(
|
||||
width, height, !mIsAboveIcon));
|
||||
arrowDrawable.getPaint().setColor(Color.WHITE);
|
||||
Paint arrowPaint = arrowDrawable.getPaint();
|
||||
arrowPaint.setColor(Color.WHITE);
|
||||
// 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));
|
||||
arrowView.setBackground(arrowDrawable);
|
||||
arrowView.setElevation(getElevation());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user