Merge "Allow corner UI to decouple from rounded_corner_radius" into rvc-dev
This commit is contained in:
@@ -1304,4 +1304,9 @@
|
|||||||
|
|
||||||
<!-- Opacity at which the background for the shutdown UI will be drawn. -->
|
<!-- Opacity at which the background for the shutdown UI will be drawn. -->
|
||||||
<item name="shutdown_scrim_behind_alpha" format="float" type="dimen">0.95</item>
|
<item name="shutdown_scrim_behind_alpha" format="float" type="dimen">0.95</item>
|
||||||
|
|
||||||
|
<!-- Allow CornerHandleView and PathSpecCornerPathRenderer to decouple from corner-radius -->
|
||||||
|
<dimen name="config_rounded_mask_size">@*android:dimen/rounded_corner_radius</dimen>
|
||||||
|
<dimen name="config_rounded_mask_size_top">@*android:dimen/rounded_corner_radius_top</dimen>
|
||||||
|
<dimen name="config_rounded_mask_size_bottom">@*android:dimen/rounded_corner_radius_bottom</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -168,14 +168,14 @@ public class CornerHandleView extends View {
|
|||||||
// Attempt to get the bottom corner radius, otherwise fall back on the generic or top
|
// Attempt to get the bottom corner radius, otherwise fall back on the generic or top
|
||||||
// values. If none are available, use the FALLBACK_RADIUS_DP.
|
// values. If none are available, use the FALLBACK_RADIUS_DP.
|
||||||
int radius = getResources().getDimensionPixelSize(
|
int radius = getResources().getDimensionPixelSize(
|
||||||
com.android.internal.R.dimen.rounded_corner_radius_bottom);
|
com.android.systemui.R.dimen.config_rounded_mask_size_bottom);
|
||||||
if (radius == 0) {
|
if (radius == 0) {
|
||||||
radius = getResources().getDimensionPixelSize(
|
radius = getResources().getDimensionPixelSize(
|
||||||
com.android.internal.R.dimen.rounded_corner_radius);
|
com.android.systemui.R.dimen.config_rounded_mask_size);
|
||||||
}
|
}
|
||||||
if (radius == 0) {
|
if (radius == 0) {
|
||||||
radius = getResources().getDimensionPixelSize(
|
radius = getResources().getDimensionPixelSize(
|
||||||
com.android.internal.R.dimen.rounded_corner_radius_top);
|
com.android.systemui.R.dimen.config_rounded_mask_size_top);
|
||||||
}
|
}
|
||||||
if (radius == 0) {
|
if (radius == 0) {
|
||||||
radius = (int) convertDpToPixel(FALLBACK_RADIUS_DP, mContext);
|
radius = (int) convertDpToPixel(FALLBACK_RADIUS_DP, mContext);
|
||||||
|
|||||||
@@ -84,8 +84,8 @@ public class DisplayUtils {
|
|||||||
public static int getCornerRadiusBottom(Context context) {
|
public static int getCornerRadiusBottom(Context context) {
|
||||||
int radius = 0;
|
int radius = 0;
|
||||||
|
|
||||||
int resourceId = context.getResources().getIdentifier("rounded_corner_radius_bottom",
|
int resourceId = context.getResources().getIdentifier("config_rounded_mask_size_bottom",
|
||||||
"dimen", "android");
|
"dimen", "com.android.systemui");
|
||||||
if (resourceId > 0) {
|
if (resourceId > 0) {
|
||||||
radius = context.getResources().getDimensionPixelSize(resourceId);
|
radius = context.getResources().getDimensionPixelSize(resourceId);
|
||||||
}
|
}
|
||||||
@@ -103,8 +103,8 @@ public class DisplayUtils {
|
|||||||
public static int getCornerRadiusTop(Context context) {
|
public static int getCornerRadiusTop(Context context) {
|
||||||
int radius = 0;
|
int radius = 0;
|
||||||
|
|
||||||
int resourceId = context.getResources().getIdentifier("rounded_corner_radius_top",
|
int resourceId = context.getResources().getIdentifier("config_rounded_mask_size_top",
|
||||||
"dimen", "android");
|
"dimen", "com.android.systemui");
|
||||||
if (resourceId > 0) {
|
if (resourceId > 0) {
|
||||||
radius = context.getResources().getDimensionPixelSize(resourceId);
|
radius = context.getResources().getDimensionPixelSize(resourceId);
|
||||||
}
|
}
|
||||||
@@ -118,8 +118,8 @@ public class DisplayUtils {
|
|||||||
private static int getCornerRadiusDefault(Context context) {
|
private static int getCornerRadiusDefault(Context context) {
|
||||||
int radius = 0;
|
int radius = 0;
|
||||||
|
|
||||||
int resourceId = context.getResources().getIdentifier("rounded_corner_radius", "dimen",
|
int resourceId = context.getResources().getIdentifier("config_rounded_mask_size",
|
||||||
"android");
|
"dimen", "com.android.systemui");
|
||||||
if (resourceId > 0) {
|
if (resourceId > 0) {
|
||||||
radius = context.getResources().getDimensionPixelSize(resourceId);
|
radius = context.getResources().getDimensionPixelSize(resourceId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ public final class PathSpecCornerPathRenderer extends CornerPathRenderer {
|
|||||||
mWidth = DisplayUtils.getWidth(context);
|
mWidth = DisplayUtils.getWidth(context);
|
||||||
mHeight = DisplayUtils.getHeight(context);
|
mHeight = DisplayUtils.getHeight(context);
|
||||||
|
|
||||||
mBottomCornerRadius = DisplayUtils.getCornerRadiusBottom(context);
|
mBottomCornerRadius = DisplayUtils.getCornerRadiusBottom(context);
|
||||||
mTopCornerRadius = DisplayUtils.getCornerRadiusTop(context);
|
mTopCornerRadius = DisplayUtils.getCornerRadiusTop(context);
|
||||||
|
|
||||||
String pathData = context.getResources().getString(R.string.config_rounded_mask);
|
String pathData = context.getResources().getString(R.string.config_rounded_mask);
|
||||||
Path path = PathParser.createPathFromPathData(pathData);
|
Path path = PathParser.createPathFromPathData(pathData);
|
||||||
|
|||||||
Reference in New Issue
Block a user