mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 16:26:47 +00:00
Refactor the BorderAnimator for simplicity
The internal implementation of BorderAnimator does not need to be as exposed. refactored the class to be simpler to implement Flag: ENABLE_KEYBOARD_QUICK_SWITCH, ENABLE_CURSOR_HOVER_STATES Bug: 302334949 Test: check border animation in keyboard quick switch and recents view Change-Id: I8a2e4fa0abc5af743352cd6409aee9f2912b41a2
This commit is contained in:
@@ -40,6 +40,8 @@ import com.android.systemui.shared.recents.model.ThumbnailData;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import kotlin.Unit;
|
||||
|
||||
/**
|
||||
* A view that displays a recent task during a keyboard quick switch.
|
||||
*/
|
||||
@@ -96,17 +98,18 @@ public class KeyboardQuickSwitchTaskView extends ConstraintLayout {
|
||||
Resources resources = mContext.getResources();
|
||||
|
||||
Preconditions.assertNotNull(mContent);
|
||||
mBorderAnimator = new BorderAnimator(
|
||||
mBorderAnimator = BorderAnimator.createScalingBorderAnimator(
|
||||
/* borderRadiusPx= */ resources.getDimensionPixelSize(
|
||||
R.dimen.keyboard_quick_switch_task_view_radius),
|
||||
/* borderColor= */ mBorderColor,
|
||||
/* borderAnimationParams= */ new BorderAnimator.ScalingParams(
|
||||
/* borderWidthPx= */ resources.getDimensionPixelSize(
|
||||
/* borderWidthPx= */ resources.getDimensionPixelSize(
|
||||
R.dimen.keyboard_quick_switch_border_width),
|
||||
/* boundsBuilder= */ bounds -> bounds.set(
|
||||
0, 0, getWidth(), getHeight()),
|
||||
/* targetView= */ this,
|
||||
/* contentView= */ mContent));
|
||||
/* boundsBuilder= */ bounds -> {
|
||||
bounds.set(0, 0, getWidth(), getHeight());
|
||||
return Unit.INSTANCE;
|
||||
},
|
||||
/* targetView= */ this,
|
||||
/* contentView= */ mContent,
|
||||
/* borderColor= */ mBorderColor);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
Reference in New Issue
Block a user