mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 16:26:47 +00:00
Merge "Fix contrast issue with folder background and text colors." into sc-dev am: d75f89c6c0
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14506765 Change-Id: I5773e0dc435cb3da3ad4a1392f2af58679008085
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowShowWallpaper">true</item>
|
||||
<item name="folderTextColor">?attr/workspaceTextColor</item>
|
||||
<item name="isFolderDarkText">?attr/isWorkspaceDarkText</item>
|
||||
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
|
||||
<item name="android:enforceStatusBarContrast">false</item>
|
||||
<item name="android:enforceNavigationBarContrast">false</item>
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowShowWallpaper">true</item>
|
||||
<item name="folderTextColor">?attr/workspaceTextColor</item>
|
||||
<item name="isFolderDarkText">?attr/isWorkspaceDarkText</item>
|
||||
<item name="android:windowLayoutInDisplayCutoutMode">always</item>
|
||||
<item name="android:enforceStatusBarContrast">false</item>
|
||||
<item name="android:enforceNavigationBarContrast">false</item>
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
<attr name="folderIconBorderColor" format="color" />
|
||||
<attr name="folderTextColor" format="color" />
|
||||
<attr name="folderHintColor" format="color" />
|
||||
<attr name="isFolderDarkText" format="boolean" />
|
||||
<attr name="workProfileOverlayTextColor" format="color" />
|
||||
<attr name="gridColor" format="color" />
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowShowWallpaper">true</item>
|
||||
<item name="folderTextColor">?attr/workspaceTextColor</item>
|
||||
<item name="isFolderDarkText">?attr/isWorkspaceDarkText</item>
|
||||
</style>
|
||||
|
||||
<style name="LauncherTheme" parent="@style/BaseLauncherTheme">
|
||||
@@ -50,6 +51,7 @@
|
||||
<item name="folderFillColor">?android:attr/colorBackground</item>
|
||||
<item name="folderIconBorderColor">?android:attr/colorPrimary</item>
|
||||
<item name="folderTextColor">?android:attr/textColorPrimary</item>
|
||||
<item name="isFolderDarkText">true</item>
|
||||
<item name="folderHintColor">#89616161</item>
|
||||
<item name="loadingIconColor">#CCFFFFFF</item>
|
||||
<item name="iconOnlyShortcutColor">?android:attr/textColorSecondary</item>
|
||||
@@ -71,6 +73,7 @@
|
||||
<style name="LauncherTheme.DarkMainColor" parent="@style/LauncherTheme">
|
||||
<item name="folderFillColor">#FF3C4043</item> <!-- 100% GM2 800 -->
|
||||
<item name="folderTextColor">?attr/workspaceTextColor</item>
|
||||
<item name="isFolderDarkText">?attr/isWorkspaceDarkText</item>
|
||||
<item name="disabledIconAlpha">.254</item>
|
||||
|
||||
</style>
|
||||
@@ -86,6 +89,7 @@
|
||||
<item name="folderFillColor">#CDFFFFFF</item>
|
||||
<item name="folderIconBorderColor">#FF80868B</item>
|
||||
<item name="folderTextColor">?attr/workspaceTextColor</item>
|
||||
<item name="isFolderDarkText">true</item>
|
||||
</style>
|
||||
|
||||
<style name="LauncherTheme.Dark" parent="@style/LauncherTheme">
|
||||
@@ -107,6 +111,7 @@
|
||||
<item name="folderFillColor">?android:attr/colorBackground</item>
|
||||
<item name="folderIconBorderColor">?android:attr/colorPrimary</item>
|
||||
<item name="folderTextColor">?android:attr/textColorPrimary</item>
|
||||
<item name="isFolderDarkText">false</item>
|
||||
<item name="folderHintColor">#89CCCCCC</item>
|
||||
<item name="isMainColorDark">true</item>
|
||||
<item name="loadingIconColor">#99FFFFFF</item>
|
||||
@@ -119,6 +124,7 @@
|
||||
<style name="LauncherTheme.Dark.DarkMainColor" parent="@style/LauncherTheme.Dark">
|
||||
<item name="folderFillColor">#FF3C4043</item> <!-- 100% GM2 800 -->
|
||||
<item name="folderTextColor">@android:color/white</item>
|
||||
<item name="isFolderDarkText">false</item>
|
||||
<item name="disabledIconAlpha">.54</item>
|
||||
</style>
|
||||
|
||||
@@ -126,6 +132,7 @@
|
||||
<item name="android:colorControlHighlight">#19212121</item>
|
||||
<item name="folderFillColor">#CDFFFFFF</item>
|
||||
<item name="folderTextColor">?attr/workspaceTextColor</item>
|
||||
<item name="isFolderDarkText">?attr/isWorkspaceDarkText</item>
|
||||
<item name="workspaceTextColor">@color/workspace_text_color_dark</item>
|
||||
<item name="workspaceShadowColor">@android:color/transparent</item>
|
||||
<item name="workspaceAmbientShadowColor">@android:color/transparent</item>
|
||||
|
||||
@@ -296,6 +296,8 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
|
||||
}
|
||||
|
||||
if (Utilities.ATLEAST_S) {
|
||||
mColorExtractionIndex = LocalColorExtractor.getColorIndex(
|
||||
!Themes.getAttrBoolean(getContext(), R.attr.isFolderDarkText));
|
||||
mColorExtractor = LocalColorExtractor.newInstance(getContext());
|
||||
mColorListener = (RectF rect, SparseIntArray extractedColors) -> {
|
||||
mColorChangeRunnable = () -> {
|
||||
|
||||
@@ -168,15 +168,15 @@ public class FolderAnimationManager {
|
||||
final float yDistance = initialY - lp.y;
|
||||
|
||||
// Set up the Folder background.
|
||||
int previewBackgroundColor = Themes.getAttrColor(mContext, R.attr.folderFillColor);
|
||||
final int finalColor;
|
||||
int folderFillColor = Themes.getAttrColor(mContext, R.attr.folderFillColor);
|
||||
if (mIsOpening) {
|
||||
finalColor = Themes.getAttrColor(mContext, R.attr.popupColorPrimary);
|
||||
finalColor = folderFillColor;
|
||||
} else {
|
||||
finalColor = mFolderBackground.getColor().getDefaultColor();
|
||||
}
|
||||
final int initialColor = setColorAlphaBound(previewBackgroundColor,
|
||||
mPreviewBackground.getBackgroundAlpha());
|
||||
final int initialColor = setColorAlphaBound(
|
||||
folderFillColor, mPreviewBackground.getBackgroundAlpha());
|
||||
mFolderBackground.mutate();
|
||||
mFolderBackground.setColor(mIsOpening ? initialColor : finalColor);
|
||||
|
||||
|
||||
@@ -113,8 +113,14 @@ public class LocalColorExtractor implements ResourceBasedOverride {
|
||||
* Returns an index used to query the color of interest from the list of extracted colors.
|
||||
*/
|
||||
public static int getColorIndex(Context context) {
|
||||
return Utilities.isDarkTheme(context)
|
||||
? DARK_COLOR_EXTRACTION_INDEX
|
||||
: LIGHT_COLOR_EXTRACTION_INDEX;
|
||||
return getColorIndex(Utilities.isDarkTheme(context));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an index used to query the color of interest from the list of extracted colors.
|
||||
* @param getDarkIndex True when dark index is wanted, False when light index is wanted.
|
||||
*/
|
||||
public static int getColorIndex(boolean getDarkIndex) {
|
||||
return getDarkIndex ? DARK_COLOR_EXTRACTION_INDEX : LIGHT_COLOR_EXTRACTION_INDEX;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user