mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 07:46:55 +00:00
Use a selector instead of loading resource for drop target.
Test: manual Bug: 187355401,187035471 Change-Id: I65fef2c810c791c3282bd4a087359f6cff774cc4
This commit is contained in:
@@ -142,11 +142,6 @@ public abstract class ButtonDropTarget extends TextView
|
||||
}
|
||||
}
|
||||
|
||||
private void setBackgroundDrawable(int resId) {
|
||||
Drawable bd = AppCompatResources.getDrawable(getContext(), resId);
|
||||
setBackground(bd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void onDragEnter(DragObject d) {
|
||||
if (!mAccessibleDrag && !mTextVisible) {
|
||||
@@ -172,7 +167,7 @@ public abstract class ButtonDropTarget extends TextView
|
||||
}
|
||||
|
||||
d.dragView.setAlpha(DRAG_VIEW_HOVER_OVER_OPACITY);
|
||||
setBackgroundDrawable(R.drawable.drop_target_frame_hover);
|
||||
setSelected(true);
|
||||
if (d.stateAnnouncer != null) {
|
||||
d.stateAnnouncer.cancel();
|
||||
}
|
||||
@@ -190,7 +185,7 @@ public abstract class ButtonDropTarget extends TextView
|
||||
|
||||
if (!d.dragComplete) {
|
||||
d.dragView.setAlpha(1f);
|
||||
setBackgroundDrawable(R.drawable.drop_target_frame);
|
||||
setSelected(false);
|
||||
} else {
|
||||
d.dragView.setAlpha(DRAG_VIEW_HOVER_OVER_OPACITY);
|
||||
}
|
||||
@@ -230,6 +225,7 @@ public abstract class ButtonDropTarget extends TextView
|
||||
public void onDragEnd() {
|
||||
mActive = false;
|
||||
setOnClickListener(null);
|
||||
setSelected(false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user