Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions res/values/cr_colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

<!-- Appseat -->
<color name="appseat_color">@*android:color/system_neutral2_50</color>
<color name="appseat_color_light_wallpaper">@*android:color/system_neutral2_50</color>
<color name="appseat_color_dark_wallpaper">@*android:color/system_neutral2_900</color>

<!-- Wallpaper carousel -->
<color name="accent_primary_device_default">#ffd3e3fd</color>
Expand Down
2 changes: 2 additions & 0 deletions res/values/cr_strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@
<!-- Hotseat Background -->
<string name="hotseat_bg_title">Hotseat background</string>
<string name="hotseat_bg_summary">Add translucent background to the app dock</string>
<string name="hotseat_opacity_light_title">Background opacity in light theme</string>
<string name="hotseat_opacity_dark_title">Background opacity in dark theme</string>

<!-- Background opacity -->
<string name="background_opacity_title">Background opacity</string>
Expand Down
12 changes: 11 additions & 1 deletion res/xml/launcher_home_screen_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,19 @@
android:defaultValue="false"
launcher:iconSpaceReserved="false" />

<com.android.launcher3.settings.preferences.CustomSeekBarPreference
android:key="pref_hotseat_opacity_light"
android:title="@string/hotseat_opacity_light_title"
android:persistent="true"
android:max="100"
settings:min="0"
settings:units="%"
android:dependency="pref_show_hotseat_bg"
android:defaultValue="40" />

<com.android.launcher3.settings.preferences.CustomSeekBarPreference
android:key="pref_hotseat_opacity"
android:title="@string/background_opacity_title"
android:title="@string/hotseat_opacity_dark_title"
android:persistent="true"
android:max="100"
settings:min="0"
Expand Down
14 changes: 12 additions & 2 deletions src/com/android/launcher3/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.GradientDrawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
Expand Down Expand Up @@ -1320,8 +1321,17 @@ protected void setupViews() {
mWorkspace.getCurrentPage() - 1));

if (LauncherPrefs.SHOW_HOTSEAT_BG.get(this)) {
mHotseat.setBackgroundResource(R.drawable.bkg_appseat);
mHotseat.getBackground().setAlpha(LauncherPrefs.HOTSEAT_OPACITY.get(this) * 255 / 100);
GradientDrawable hotseatBackground =
(GradientDrawable) getDrawable(R.drawable.bkg_appseat).mutate();
int hotseatColor = Themes.getAttrBoolean(this, R.attr.isWorkspaceDarkText)
? R.color.appseat_color_light_wallpaper
: R.color.appseat_color_dark_wallpaper;
hotseatBackground.setColor(getColor(hotseatColor));
int hotseatOpacity = Utilities.isDarkTheme(this)
? LauncherPrefs.HOTSEAT_OPACITY.get(this)
: LauncherPrefs.HOTSEAT_OPACITY_LIGHT.get(this);
hotseatBackground.setAlpha(hotseatOpacity * 255 / 100);
mHotseat.setBackground(hotseatBackground);
}

// Setup the drag layer
Expand Down
1 change: 1 addition & 0 deletions src/com/android/launcher3/LauncherPrefs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ constructor(@ApplicationContext private val encryptedContext: Context) {
@JvmField val DRAWER_SCROLLBAR = backedUpItem("pref_drawer_scrollbar", true)
@JvmField val FONT_SIZE = backedUpItem("pref_custom_font_size", 100)
@JvmField val HOTSEAT_OPACITY = backedUpItem("pref_hotseat_opacity", 40)
@JvmField val HOTSEAT_OPACITY_LIGHT = backedUpItem("pref_hotseat_opacity_light", 40)
@JvmField val HOTSEAT_QSB_OPACITY = backedUpItem("pref_hotseat_qsb_opacity", 70)
@JvmField val HOTSEAT_QSB_OUTER_OPACITY = backedUpItem("pref_hotseat_qsb_outer_opacity", 60)
@JvmField val HOTSEAT_QSB_STROKE_WIDTH = backedUpItem("pref_hotseat_qsb_stroke_width", 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,6 @@ public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
private float[] mBottomSheetCornerRadii;
private ScrimView mScrimView;
private int mHeaderColor;
private int mBottomSheetBackgroundColorOverBlur;
private int mBottomSheetBackgroundColorLegacy;
private int mTabsProtectionAlpha;
@Nullable private AllAppsTransitionController mAllAppsTransitionController;

Expand Down Expand Up @@ -337,14 +335,6 @@ protected void onFinishInflate() {
0 // Bottom left
};

if (Flags.allAppsBlur()) {
int layerFg = getContext().getColor(R.color.blur_shade_panel_fg);
int layerBg = getContext().getColor(R.color.blur_shade_panel_bg);
mBottomSheetBackgroundColorOverBlur = ColorUtils.compositeColors(layerFg, layerBg);
}

mBottomSheetBackgroundColorLegacy = AppDrawerStyle.getThemedBackgroundColor(getContext());

updateBackgroundVisibility(mActivityContext.getDeviceProfile());
mSearchUiManager.initializeSearch(this);
updateOneUiPageIndicatorState();
Expand Down Expand Up @@ -993,27 +983,7 @@ private int getScrimColor() {
}

int getBottomSheetBackgroundColor() {
int bgColor;
boolean preserveSurfaceAlpha = false;
if (LauncherPrefs.APP_DRAWER_CUSTOM_COLOR_ENABLED.get(mContext)) {
bgColor = AppDrawerStyle.getBackgroundColor(mContext);
} else {
if (!Flags.allAppsBlur()) {
bgColor = mBottomSheetBackgroundColorLegacy;
} else if (!mActivityContext.isAllAppsBackgroundBlurEnabled()) {
// Don't apply any alpha if the blur is disabled.
bgColor = AppDrawerStyle.getThemedBackgroundColor(mContext);
} else {
bgColor = mBottomSheetBackgroundColorOverBlur;
preserveSurfaceAlpha = true;
}
}
int opacity = LauncherPrefs.APP_DRAWER_OPACITY.get(mContext);
int alpha = preserveSurfaceAlpha
? Math.round(Color.alpha(bgColor) * opacity / 100f)
: opacity * 255 / 100;
return ColorUtils.setAlphaComponent(
bgColor, alpha);
return getScrimColor();
}

boolean isBackgroundBlurEnabled() {
Expand Down
1 change: 1 addition & 0 deletions src/com/android/launcher3/settings/SettingsHomescreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public void onDestroy() {
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if (LauncherPrefs.SHOW_HOTSEAT_BG.getSharedPrefKey().equals(key) ||
LauncherPrefs.HOTSEAT_OPACITY.getSharedPrefKey().equals(key) ||
LauncherPrefs.HOTSEAT_OPACITY_LIGHT.getSharedPrefKey().equals(key) ||
LauncherPrefs.DOCK_SEARCH.getSharedPrefKey().equals(key) ||
LauncherPrefs.DOCK_SEARCH_PIXEL_STYLE.getSharedPrefKey().equals(key) ||
LauncherPrefs.DOCK_THEME.getSharedPrefKey().equals(key) ||
Expand Down