Configured color attribute properly for focus outline

Bug: 310953377
Test: Manual
Flag: ACONFIG com.android.launcher3.enable_focus_outline Development
Change-Id: If85c33ecea3241e69927917e910386d0346ef43b
This commit is contained in:
helencheuk
2024-01-02 15:19:12 +00:00
parent 1438af66f8
commit 2691cdfa8b
4 changed files with 6 additions and 3 deletions
+1
View File
@@ -42,6 +42,7 @@
<attr name="overviewScrimColor" format="color" />
<attr name="popupNotificationDotColor" format="color" />
<attr name="notificationDotColor" format="color" />
<attr name="focusOutlineColor" format="color" />
<attr name="folderPaginationColor" format="color" />
<attr name="folderPreviewColor" format="color" />
-1
View File
@@ -25,7 +25,6 @@
<color name="uninstall_target_hover_tint">#FFF0592B</color>
<color name="focused_background">#80c6c5c5</color>
<color name="focus_outline_color">@color/material_color_on_secondary_container</color>
<color name="default_shadow_color_no_alpha">#FF000000</color>
+1
View File
@@ -52,6 +52,7 @@
<item name="workspaceAmbientShadowColor">#40000000</item>
<item name="workspaceKeyShadowColor">#89000000</item>
<item name="widgetsTheme">@style/WidgetContainerTheme</item>
<item name="focusOutlineColor">@color/material_color_on_secondary_container</item>
<item name="folderPaginationColor">@color/folder_pagination_color_light</item>
<item name="folderPreviewColor">@color/folder_preview_light</item>
<item name="folderBackgroundColor">@color/folder_background_light</item>
@@ -22,6 +22,7 @@ import android.view.View.OnFocusChangeListener;
import com.android.launcher3.Flags;
import com.android.launcher3.R;
import com.android.launcher3.util.Themes;
/**
* A helper class to draw background of a focused view.
@@ -30,8 +31,9 @@ public abstract class FocusIndicatorHelper extends ItemFocusIndicatorHelper<View
implements OnFocusChangeListener {
public FocusIndicatorHelper(View container) {
super(container, container.getResources().getColor(Flags.enableFocusOutline()
? R.color.focus_outline_color : R.color.focused_background));
super(container, Flags.enableFocusOutline() ? Themes.getAttrColor(container.getContext(),
R.attr.focusOutlineColor)
: container.getResources().getColor(R.color.focused_background));
}
@Override