mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Update the enforce_system_radius_for_app_widgets flag's type
Renamed to use_system_radius_for_app_widgets since metadata cannot be updated after submitting definition. Bug: 373351337 Test: N/A flag metadata update Change-Id: I25283b05341517f5984b0f2fc0d27efe8027a3de Flag: com.android.launcher3.use_system_radius_for_app_widgets
This commit is contained in:
@@ -501,10 +501,13 @@ flag {
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enforce_system_radius_for_app_widgets"
|
||||
name: "use_system_radius_for_app_widgets"
|
||||
namespace: "launcher"
|
||||
description: "Enforce system radius for widget corners instead of a separate 16.dp value"
|
||||
bug: "370950552"
|
||||
description: "Use system radius for enforced widget corners instead of a separate 16.dp value"
|
||||
bug: "373351337"
|
||||
metadata {
|
||||
purpose: PURPOSE_BUGFIX
|
||||
}
|
||||
}
|
||||
|
||||
flag {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package com.android.launcher3.widget;
|
||||
|
||||
import static com.android.launcher3.Flags.enforceSystemRadiusForAppWidgets;
|
||||
import static com.android.launcher3.Flags.useSystemRadiusForAppWidgets;
|
||||
|
||||
import android.appwidget.AppWidgetHostView;
|
||||
import android.content.Context;
|
||||
@@ -99,7 +99,7 @@ public class RoundedCornerEnforcement {
|
||||
public static float computeEnforcedRadius(@NonNull Context context) {
|
||||
Resources res = context.getResources();
|
||||
float systemRadius = res.getDimension(android.R.dimen.system_app_widget_background_radius);
|
||||
if (enforceSystemRadiusForAppWidgets()) {
|
||||
if (useSystemRadiusForAppWidgets()) {
|
||||
return systemRadius;
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ class RoundedCornerEnforcementTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisableFlags(Flags.FLAG_ENFORCE_SYSTEM_RADIUS_FOR_APP_WIDGETS)
|
||||
@DisableFlags(Flags.FLAG_USE_SYSTEM_RADIUS_FOR_APP_WIDGETS)
|
||||
fun `Compute system radius when smaller`() {
|
||||
val mockContext = mock(Context::class.java)
|
||||
val mockRes = mock(Resources::class.java)
|
||||
@@ -103,7 +103,7 @@ class RoundedCornerEnforcementTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisableFlags(Flags.FLAG_ENFORCE_SYSTEM_RADIUS_FOR_APP_WIDGETS)
|
||||
@DisableFlags(Flags.FLAG_USE_SYSTEM_RADIUS_FOR_APP_WIDGETS)
|
||||
fun `Compute launcher radius when smaller`() {
|
||||
val mockContext = mock(Context::class.java)
|
||||
val mockRes = mock(Resources::class.java)
|
||||
@@ -120,7 +120,7 @@ class RoundedCornerEnforcementTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@EnableFlags(Flags.FLAG_ENFORCE_SYSTEM_RADIUS_FOR_APP_WIDGETS)
|
||||
@EnableFlags(Flags.FLAG_USE_SYSTEM_RADIUS_FOR_APP_WIDGETS)
|
||||
fun `Compute system radius ignoring launcher radius`() {
|
||||
val mockContext = mock(Context::class.java)
|
||||
val mockRes = mock(Resources::class.java)
|
||||
|
||||
Reference in New Issue
Block a user