Refactor / Cleanup / Simplify a bunch of dnd related rendering / animation

Addresses:
=> Fix folder icon drop location mapping (was very far off)
=> Fix BubbleTextView drop animation shifted by a few pixels
=> Get rid multiple unnecessary calls to setDragMode(none), was breaking
   some of the reorder flow; still some issues to address here.
=> Fix folder icon parallax (didn't work when the folder had a dot)

Test: manual

Change-Id: I5959cf341996f75d30212353ec096ed25bf40ea5
This commit is contained in:
Adam Cohen
2020-02-19 08:40:49 -08:00
parent 0465b4d71e
commit 650869973a
16 changed files with 355 additions and 274 deletions

View File

@@ -24,12 +24,15 @@ import android.view.View;
import android.view.ViewDebug;
import android.view.ViewGroup;
import com.android.launcher3.dragndrop.DraggableView;
import java.util.ArrayList;
/**
* Extension of AppWidgetHostView with support for controlled keyboard navigation.
*/
public abstract class NavigableAppWidgetHostView extends AppWidgetHostView {
public abstract class NavigableAppWidgetHostView extends AppWidgetHostView
implements DraggableView {
@ViewDebug.ExportedProperty(category = "launcher")
private boolean mChildrenFocused;
@@ -133,4 +136,14 @@ public abstract class NavigableAppWidgetHostView extends AppWidgetHostView {
// The host view's background changes when selected, to indicate the focus is inside.
setSelected(childIsFocused);
}
@Override
public int getViewType() {
return DRAGGABLE_WIDGET;
}
@Override
public void getVisualDragBounds(Rect bounds) {
bounds.set(0, 0 , getMeasuredWidth(), getMeasuredHeight());
}
}