mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-12 15:24:01 +00:00
Merge "Force persistent taskbar all apps icon to light version." into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
858092151c
@@ -47,6 +47,7 @@ import com.android.launcher3.util.DisplayController;
|
||||
import com.android.launcher3.util.LauncherBindableItemsContainer;
|
||||
import com.android.launcher3.views.ActivityContext;
|
||||
import com.android.launcher3.views.DoubleShadowBubbleTextView;
|
||||
import com.android.launcher3.views.IconButtonView;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
@@ -80,7 +81,7 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
|
||||
private @Nullable FolderIcon mLeaveBehindFolderIcon;
|
||||
|
||||
// Only non-null when device supports having an All Apps button.
|
||||
private @Nullable View mAllAppsButton;
|
||||
private @Nullable IconButtonView mAllAppsButton;
|
||||
|
||||
// Only non-null when device supports having an All Apps button.
|
||||
private @Nullable View mTaskbarDivider;
|
||||
@@ -125,10 +126,14 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
|
||||
|
||||
if (FeatureFlags.ENABLE_ALL_APPS_IN_TASKBAR.get()
|
||||
&& !mActivityContext.getPackageManager().hasSystemFeature(FEATURE_PC)) {
|
||||
mAllAppsButton = LayoutInflater.from(context)
|
||||
mAllAppsButton = (IconButtonView) LayoutInflater.from(context)
|
||||
.inflate(R.layout.taskbar_all_apps_button, this, false);
|
||||
mAllAppsButton.setPadding(mItemPadding, mItemPadding, mItemPadding, mItemPadding);
|
||||
mAllAppsButton.setScaleX(mIsRtl ? -1 : 1);
|
||||
mAllAppsButton.setForegroundTint(mActivityContext.getColor(
|
||||
DisplayController.isTransientTaskbar(mActivityContext)
|
||||
? R.color.all_apps_button_color
|
||||
: R.color.all_apps_button_color_dark));
|
||||
|
||||
if (FeatureFlags.ENABLE_TASKBAR_PINNING.get()) {
|
||||
mTaskbarDivider = LayoutInflater.from(context).inflate(R.layout.taskbar_divider,
|
||||
|
||||
@@ -24,6 +24,4 @@
|
||||
<color name="home_settings_thumb_off_color">@android:color/system_neutral2_300</color>
|
||||
<color name="home_settings_track_on_color">@android:color/system_accent2_700</color>
|
||||
<color name="home_settings_track_off_color">@android:color/system_neutral1_700</color>
|
||||
|
||||
<color name="all_apps_button_color">?android:attr/textColorSecondary</color>
|
||||
</resources>
|
||||
@@ -17,5 +17,5 @@
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<color name="all_apps_button_color">#BFC8CC</color>
|
||||
<color name="all_apps_button_color">@color/all_apps_button_color_dark</color>
|
||||
</resources>
|
||||
@@ -62,5 +62,6 @@
|
||||
<color name="preload_icon_accent_color_dark">@android:color/system_accent1_300</color>
|
||||
<color name="preload_icon_background_color_dark">@android:color/system_neutral2_700</color>
|
||||
|
||||
<color name="all_apps_button_color">?android:attr/textColorSecondary</color>
|
||||
<color name="all_apps_button_color_light">@android:color/system_neutral2_700</color>
|
||||
<color name="all_apps_button_color_dark">@android:color/system_neutral2_200</color>
|
||||
</resources>
|
||||
|
||||
@@ -80,7 +80,9 @@
|
||||
<color name="workspace_accent_color_light">#ff8df5e3</color>
|
||||
<color name="workspace_accent_color_dark">#ff3d665f</color>
|
||||
|
||||
<color name="all_apps_button_color">#40484B</color>
|
||||
<color name="all_apps_button_color">@color/all_apps_button_color_light</color>
|
||||
<color name="all_apps_button_color_light">#40484B</color>
|
||||
<color name="all_apps_button_color_dark">#BFC8CC</color>
|
||||
|
||||
<color name="preload_icon_accent_color_light">#00668B</color>
|
||||
<color name="preload_icon_background_color_light">#B5CAD7</color>
|
||||
|
||||
@@ -30,6 +30,8 @@ import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
|
||||
import com.android.launcher3.BubbleTextView;
|
||||
import com.android.launcher3.icons.BaseIconFactory;
|
||||
import com.android.launcher3.icons.FastBitmapDrawable;
|
||||
@@ -68,6 +70,14 @@ public class IconButtonView extends BubbleTextView {
|
||||
}
|
||||
}
|
||||
|
||||
/** Updates the color of the icon's foreground layer. */
|
||||
public void setForegroundTint(@ColorInt int tintColor) {
|
||||
FastBitmapDrawable icon = getIcon();
|
||||
if (icon instanceof IconDrawable) {
|
||||
((IconDrawable) icon).mFg.setTint(tintColor);
|
||||
}
|
||||
}
|
||||
|
||||
private static class IconDrawable extends FastBitmapDrawable {
|
||||
|
||||
private final Drawable mFg;
|
||||
|
||||
Reference in New Issue
Block a user