Skip to content

Commit

Permalink
Merge "Showing page indicator while dragging (Bug: 5117192)"
Browse files Browse the repository at this point in the history
  • Loading branch information
Winson Chung authored and Android (Google) Code Review committed Jan 24, 2012
2 parents e4e5066 + 1afedc3 commit d7654c4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/com/android/launcher2/PagedView.java
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,10 @@ protected boolean isPageMoving() {

// a method that subclasses can override to add behavior
protected void onPageBeginMoving() {
showScrollingIndicator(false);
}

// a method that subclasses can override to add behavior
protected void onPageEndMoving() {
hideScrollingIndicator(false);
}

/**
Expand Down
8 changes: 8 additions & 0 deletions src/com/android/launcher2/PagedViewWithDraggableItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,12 @@ protected void onDetachedFromWindow() {
cancelDragging();
super.onDetachedFromWindow();
}

/** Show the scrolling indicators when we move the page */
protected void onPageBeginMoving() {
showScrollingIndicator(false);
}
protected void onPageEndMoving() {
hideScrollingIndicator(false);
}
}
14 changes: 14 additions & 0 deletions src/com/android/launcher2/Workspace.java
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,9 @@ protected void onPageBeginMoving() {
if (LauncherApplication.isScreenLarge()) {
showOutlines();
}

// Show the scroll indicator as you pan the page
showScrollingIndicator(false);
}

protected void onPageEndMoving() {
Expand All @@ -701,6 +704,11 @@ protected void onPageEndMoving() {
if (LauncherApplication.isScreenLarge()) {
hideOutlines();
}

// Hide the scroll indicator as you pan the page
if (!mDragController.isDragging()) {
hideScrollingIndicator(false);
}
}
mOverScrollMaxBackgroundAlpha = 0.0f;
mOverScrollPageIndex = -1;
Expand Down Expand Up @@ -1928,6 +1936,9 @@ public void beginDragShared(View child, DragSource source) {
mDragController.startDrag(b, dragLayerX, dragLayerY, source, child.getTag(),
DragController.DRAG_ACTION_MOVE, dragVisualizeOffset, dragRect);
b.recycle();

// Show the scrolling indicator when you pick up an item
showScrollingIndicator(false);
}

void addApplicationShortcut(ShortcutInfo info, CellLayout target, long container, int screen,
Expand Down Expand Up @@ -3118,6 +3129,9 @@ public void onDropCompleted(View target, DragObject d, boolean success) {
}
mDragOutline = null;
mDragInfo = null;

// Hide the scrolling indicator after you pick up an item
hideScrollingIndicator(false);
}

public boolean isDropEnabled() {
Expand Down

0 comments on commit d7654c4

Please sign in to comment.