mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 01:16:49 +00:00
Merge "Do not hide icon app chip menu when resetting color tint." into main
This commit is contained in:
@@ -319,7 +319,7 @@ public class FloatingTaskView extends FrameLayout {
|
||||
|
||||
// Fade in the placeholder view during Normal > OverviewSplitSelect
|
||||
if (mSplitPlaceholderView.getAlpha() == 0) {
|
||||
mSplitPlaceholderView.getIconView().setAlpha(0);
|
||||
mSplitPlaceholderView.getIconView().setContentAlpha(0);
|
||||
fadeInSplitPlaceholder(animation, timings);
|
||||
}
|
||||
|
||||
|
||||
@@ -436,7 +436,7 @@ public class GroupedTaskView extends TaskView {
|
||||
super.setIconsAndBannersTransitionProgress(progress, invert);
|
||||
// Value set by super call
|
||||
float scale = mIconView.getAlpha();
|
||||
mIconView2.setAlpha(scale);
|
||||
mIconView2.setContentAlpha(scale);
|
||||
mDigitalWellBeingToast2.updateBannerOffset(1f - scale);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.touch.PagedOrientationHandler;
|
||||
import com.android.launcher3.util.MultiValueAlpha;
|
||||
import com.android.launcher3.views.ActivityContext;
|
||||
import com.android.quickstep.util.RecentsOrientedState;
|
||||
|
||||
@@ -51,6 +52,12 @@ public class IconAppChipView extends FrameLayout implements TaskViewIcon {
|
||||
private static final int MENU_BACKGROUND_REVEAL_DURATION = 417;
|
||||
private static final int MENU_BACKGROUND_HIDE_DURATION = 333;
|
||||
|
||||
private static final int NUM_ALPHA_CHANNELS = 2;
|
||||
private static final int INDEX_CONTENT_ALPHA = 0;
|
||||
private static final int INDEX_COLOR_FILTER_ALPHA = 1;
|
||||
|
||||
private final MultiValueAlpha mMultiValueAlpha;
|
||||
|
||||
private IconView mIconView;
|
||||
// Two textview so we can ellipsize the collapsed view and crossfade on expand to the full name.
|
||||
private TextView mIconTextCollapsedView;
|
||||
@@ -98,6 +105,8 @@ public class IconAppChipView extends FrameLayout implements TaskViewIcon {
|
||||
int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
Resources res = getResources();
|
||||
mMultiValueAlpha = new MultiValueAlpha(this, NUM_ALPHA_CHANNELS);
|
||||
mMultiValueAlpha.setUpdateVisibility(/* updateVisibility= */ true);
|
||||
|
||||
// Menu dimensions
|
||||
mMaxMenuWidth = res.getDimensionPixelSize(R.dimen.task_thumbnail_icon_menu_max_width);
|
||||
@@ -286,7 +295,13 @@ public class IconAppChipView extends FrameLayout implements TaskViewIcon {
|
||||
@Override
|
||||
public void setIconColorTint(int color, float amount) {
|
||||
// RecentsView's COLOR_TINT animates between 0 and 0.5f, we want to hide the app chip menu.
|
||||
setAlpha(Utilities.mapToRange(amount, 0f, 0.5f, 1f, 0f, LINEAR));
|
||||
float colorTintAlpha = Utilities.mapToRange(amount, 0f, 0.5f, 1f, 0f, LINEAR);
|
||||
mMultiValueAlpha.get(INDEX_COLOR_FILTER_ALPHA).setValue(colorTintAlpha);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setContentAlpha(float alpha) {
|
||||
mMultiValueAlpha.get(INDEX_CONTENT_ALPHA).setValue(alpha);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -143,6 +143,11 @@ public class IconView extends View implements TaskViewIcon {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setContentAlpha(float alpha) {
|
||||
setAlpha(alpha);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAlpha(float alpha) {
|
||||
super.setAlpha(alpha);
|
||||
|
||||
@@ -630,7 +630,7 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
return;
|
||||
}
|
||||
mModalness = modalness;
|
||||
mIconView.setAlpha(1 - modalness);
|
||||
mIconView.setContentAlpha(1 - modalness);
|
||||
mDigitalWellBeingToast.updateBannerOffset(modalness);
|
||||
}
|
||||
|
||||
@@ -1253,7 +1253,7 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
float upperClamp = invert ? 1 : iconScalePercentage;
|
||||
float scale = Interpolators.clampToProgress(FAST_OUT_SLOW_IN, lowerClamp, upperClamp)
|
||||
.getInterpolation(progress);
|
||||
mIconView.setAlpha(scale);
|
||||
mIconView.setContentAlpha(scale);
|
||||
mDigitalWellBeingToast.updateBannerOffset(1f - scale);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public interface TaskViewIcon {
|
||||
/**
|
||||
* Sets the opacity of the view.
|
||||
*/
|
||||
void setAlpha(float alpha);
|
||||
void setContentAlpha(float alpha);
|
||||
|
||||
/**
|
||||
* Returns this icon view's drawable.
|
||||
|
||||
Reference in New Issue
Block a user