Update adjacent page hints
-> draw the hints immediately above the workspace Change-Id: Id09070e3876516daf9650132052ab61d02a2cf4d
Before Width: | Height: | Size: 170 B After Width: | Height: | Size: 184 B |
Before Width: | Height: | Size: 160 B After Width: | Height: | Size: 183 B |
Before Width: | Height: | Size: 155 B After Width: | Height: | Size: 174 B |
Before Width: | Height: | Size: 158 B After Width: | Height: | Size: 174 B |
Before Width: | Height: | Size: 141 B After Width: | Height: | Size: 172 B |
Before Width: | Height: | Size: 156 B After Width: | Height: | Size: 169 B |
Before Width: | Height: | Size: 140 B After Width: | Height: | Size: 162 B |
Before Width: | Height: | Size: 153 B After Width: | Height: | Size: 162 B |
Before Width: | Height: | Size: 166 B After Width: | Height: | Size: 190 B |
Before Width: | Height: | Size: 166 B After Width: | Height: | Size: 189 B |
Before Width: | Height: | Size: 177 B After Width: | Height: | Size: 192 B |
Before Width: | Height: | Size: 182 B After Width: | Height: | Size: 192 B |
Before Width: | Height: | Size: 206 B After Width: | Height: | Size: 216 B |
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 216 B |
Before Width: | Height: | Size: 199 B After Width: | Height: | Size: 233 B |
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 233 B |
|
@ -81,6 +81,14 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
|
||||||
private Drawable mBackground;
|
private Drawable mBackground;
|
||||||
private float mBackgroundAlpha = 0;
|
private float mBackgroundAlpha = 0;
|
||||||
|
|
||||||
|
// Related to adjacent page hints
|
||||||
|
private boolean mInScrollArea;
|
||||||
|
private boolean mShowPageHints;
|
||||||
|
private Drawable mLeftHoverDrawable;
|
||||||
|
private Drawable mRightHoverDrawable;
|
||||||
|
private Drawable mLeftHoverDrawableActive;
|
||||||
|
private Drawable mRightHoverDrawableActive;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to create a new DragLayer from XML.
|
* Used to create a new DragLayer from XML.
|
||||||
*
|
*
|
||||||
|
@ -851,13 +859,6 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean mInScrollArea;
|
|
||||||
private boolean mShowPageHints;
|
|
||||||
private Drawable mLeftHoverDrawable;
|
|
||||||
private Drawable mRightHoverDrawable;
|
|
||||||
private Drawable mLeftHoverDrawableActive;
|
|
||||||
private Drawable mRightHoverDrawableActive;
|
|
||||||
|
|
||||||
void onEnterScrollArea(int direction) {
|
void onEnterScrollArea(int direction) {
|
||||||
mInScrollArea = true;
|
mInScrollArea = true;
|
||||||
invalidate();
|
invalidate();
|
||||||
|
@ -896,8 +897,9 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
|
||||||
}
|
}
|
||||||
|
|
||||||
super.dispatchDraw(canvas);
|
super.dispatchDraw(canvas);
|
||||||
|
}
|
||||||
|
|
||||||
// Draw screen hover indicators above children.
|
private void drawPageHints(Canvas canvas) {
|
||||||
if (mShowPageHints) {
|
if (mShowPageHints) {
|
||||||
Workspace workspace = mLauncher.getWorkspace();
|
Workspace workspace = mLauncher.getWorkspace();
|
||||||
int width = getMeasuredWidth();
|
int width = getMeasuredWidth();
|
||||||
|
@ -920,7 +922,6 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
|
||||||
if (rightPage != null && rightPage.isDragTarget()) {
|
if (rightPage != null && rightPage.isDragTarget()) {
|
||||||
Drawable right = mInScrollArea && rightPage.getIsDragOverlapping() ?
|
Drawable right = mInScrollArea && rightPage.getIsDragOverlapping() ?
|
||||||
mRightHoverDrawableActive : mRightHoverDrawable;
|
mRightHoverDrawableActive : mRightHoverDrawable;
|
||||||
|
|
||||||
right.setBounds(width - right.getIntrinsicWidth(),
|
right.setBounds(width - right.getIntrinsicWidth(),
|
||||||
childRect.top, width, childRect.bottom);
|
childRect.top, width, childRect.bottom);
|
||||||
right.draw(canvas);
|
right.draw(canvas);
|
||||||
|
@ -928,6 +929,16 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
|
||||||
|
boolean ret = super.drawChild(canvas, child, drawingTime);
|
||||||
|
|
||||||
|
// We want to draw the page hints above the workspace, but below the drag view.
|
||||||
|
if (child instanceof Workspace) {
|
||||||
|
drawPageHints(canvas);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
public void setBackgroundAlpha(float alpha) {
|
public void setBackgroundAlpha(float alpha) {
|
||||||
if (alpha != mBackgroundAlpha) {
|
if (alpha != mBackgroundAlpha) {
|
||||||
mBackgroundAlpha = alpha;
|
mBackgroundAlpha = alpha;
|
||||||
|
|