mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
Separating the draglayer alpha into multiple dimensions so that different animaitons
can run without affecting the other. Bug: 79323355 Bug: 78880824 Change-Id: I11cb464ebdaad0a7f0a56d4bc4c3dff1d56da16b
This commit is contained in:
@@ -30,6 +30,8 @@ import com.android.launcher3.BaseActivity;
|
||||
import com.android.launcher3.BaseDraggingActivity;
|
||||
import com.android.launcher3.InsettableFrameLayout;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.util.MultiValueAlpha;
|
||||
import com.android.launcher3.util.MultiValueAlpha.AlphaProperty;
|
||||
import com.android.launcher3.util.TouchController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -45,17 +47,18 @@ public abstract class BaseDragLayer<T extends BaseDraggingActivity> extends Inse
|
||||
protected final Rect mHitRect = new Rect();
|
||||
|
||||
protected final T mActivity;
|
||||
private final MultiValueAlpha mMultiValueAlpha;
|
||||
|
||||
protected TouchController[] mControllers;
|
||||
protected TouchController mActiveController;
|
||||
private TouchCompleteListener mTouchCompleteListener;
|
||||
|
||||
public BaseDragLayer(Context context, AttributeSet attrs) {
|
||||
public BaseDragLayer(Context context, AttributeSet attrs, int alphaChannelCount) {
|
||||
super(context, attrs);
|
||||
mActivity = (T) BaseActivity.fromContext(context);
|
||||
mMultiValueAlpha = new MultiValueAlpha(this, alphaChannelCount);
|
||||
}
|
||||
|
||||
|
||||
public boolean isEventOverView(View view, MotionEvent ev) {
|
||||
getDescendantRectRelativeToSelf(view, mHitRect);
|
||||
return mHitRect.contains((int) ev.getX(), (int) ev.getY());
|
||||
@@ -276,6 +279,10 @@ public abstract class BaseDragLayer<T extends BaseDraggingActivity> extends Inse
|
||||
return new LayoutParams(p);
|
||||
}
|
||||
|
||||
public AlphaProperty getAlphaProperty(int index) {
|
||||
return mMultiValueAlpha.getProperty(index);
|
||||
}
|
||||
|
||||
public static class LayoutParams extends InsettableFrameLayout.LayoutParams {
|
||||
public int x, y;
|
||||
public boolean customPosition = false;
|
||||
|
||||
Reference in New Issue
Block a user