mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Cleaning up some drop-target issues.
- Setting text color during drag over transitions - Fixing regression in drop target padding = Using old drop-down animation where possible Change-Id: Ia1c5ec9e58fc734d28133349d9920d123ed71ae6
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package com.android.launcher2;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Paint;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.FrameLayout;
|
||||
@@ -32,6 +33,7 @@ public class ButtonDropTarget extends FrameLayout implements DropTarget, DragCon
|
||||
protected final int mTransitionDuration;
|
||||
|
||||
protected Launcher mLauncher;
|
||||
private int mBottomDragPadding;
|
||||
|
||||
/** Whether this drop target is active for the current drag */
|
||||
protected boolean mActive;
|
||||
@@ -46,8 +48,9 @@ public class ButtonDropTarget extends FrameLayout implements DropTarget, DragCon
|
||||
public ButtonDropTarget(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
|
||||
mTransitionDuration =
|
||||
context.getResources().getInteger(R.integer.config_dropTargetBgTransitionDuration);
|
||||
Resources r = getResources();
|
||||
mTransitionDuration = r.getInteger(R.integer.config_dropTargetBgTransitionDuration);
|
||||
mBottomDragPadding = r.getDimensionPixelSize(R.dimen.drop_target_drag_padding);
|
||||
}
|
||||
|
||||
void setLauncher(Launcher launcher) {
|
||||
@@ -86,6 +89,12 @@ public class ButtonDropTarget extends FrameLayout implements DropTarget, DragCon
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getHitRect(android.graphics.Rect outRect) {
|
||||
super.getHitRect(outRect);
|
||||
outRect.bottom += mBottomDragPadding;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DropTarget getDropTargetDelegate(DragObject d) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user