Fixing drag icon location on non-xlarge devices
Change-Id: I7897f67e145818866a51c6a50d4d3e59674b08b4
This commit is contained in:
1 parent
99e8b40b37
commit
8878a32f26
6 files changed
+14
-15
No files matched your search
@@ -53,11 +53,6 @@
|
||||
Should be an even number, for pixel alignment. -->
|
||||
<integer name="config_dragViewExtraPixels">0</integer>
|
||||
|
||||
<!-- When dragging items on the workspace, the number of pixels by which the position of
|
||||
the drag view should be offset from the position of the original view. -->
|
||||
<integer name="config_dragViewOffsetX">0</integer>
|
||||
<integer name="config_dragViewOffsetY">-12</integer>
|
||||
|
||||
<!-- When items are dropped on the mini screens in customize mode, we have a bounce animation
|
||||
of the bright green hover outline, and then fade out the outline at the end. These are
|
||||
the values used in that animation -->
|
||||
|
||||
@@ -62,4 +62,9 @@
|
||||
<!-- How much the content view of an alert dialog should be inset (currently used
|
||||
for the WallpaperChooser in XLarge mode) -->
|
||||
<dimen name="alert_dialog_content_inset">0dp</dimen>
|
||||
|
||||
<!-- When dragging items on the workspace, the number of dps by which the position of
|
||||
the drag view should be offset from the position of the original view. -->
|
||||
<dimen name="dragViewOffsetX">0dp</dimen>
|
||||
<dimen name="dragViewOffsetY">-12dp</dimen>
|
||||
</resources>
|
||||
@@ -12,12 +12,6 @@
|
||||
Should be an even number, for pixel alignment. -->
|
||||
<integer name="config_dragViewExtraPixels">40</integer>
|
||||
|
||||
<!-- When dragging items on the workspace, the number of pixels by which the position of
|
||||
the drag view should be offset from the position of the original view.
|
||||
Setting to 1/2 of config_dragViewExtraPixels keeps it centered on its old position. -->
|
||||
<integer name="config_dragViewOffsetX">20</integer>
|
||||
<integer name="config_dragViewOffsetY">20</integer>
|
||||
|
||||
<!-- The duration (in ms) of the fade animation on the object outlines, used when
|
||||
we are dragging objects around on the home screen. -->
|
||||
<integer name="config_dragOutlineFadeTime">900</integer>
|
||||
|
||||
@@ -44,4 +44,9 @@
|
||||
<!-- the area at the edge of the screen that makes the workspace go left
|
||||
or right while you're dragging. -->
|
||||
<dimen name="scroll_zone">20dp</dimen>
|
||||
|
||||
<!-- When dragging items on the workspace, the number of dps by which the position of
|
||||
the drag view should be offset from the position of the original view. -->
|
||||
<dimen name="dragViewOffsetX">0dp</dimen>
|
||||
<dimen name="dragViewOffsetY">-8dp</dimen>
|
||||
</resources>
|
||||
@@ -87,8 +87,8 @@ public class DragView extends View {
|
||||
scale.setScale(scaleFactor, scaleFactor);
|
||||
}
|
||||
|
||||
final int offsetX = res.getInteger(R.integer.config_dragViewOffsetX);
|
||||
final int offsetY = res.getInteger(R.integer.config_dragViewOffsetY);
|
||||
final int offsetX = res.getDimensionPixelSize(R.dimen.dragViewOffsetX);
|
||||
final int offsetY = res.getDimensionPixelSize(R.dimen.dragViewOffsetY);
|
||||
|
||||
// Animate the view into the correct position
|
||||
mAnim = ValueAnimator.ofFloat(0.0f, 1.0f);
|
||||
|
||||
@@ -2175,8 +2175,8 @@ public class Workspace extends SmoothPagedView
|
||||
// Based on the position of the drag view, find the top left of the original view
|
||||
int viewX = dragViewX + (dragView.getWidth() - child.getWidth()) / 2;
|
||||
int viewY = dragViewY + (dragView.getHeight() - child.getHeight()) / 2;
|
||||
viewX += getResources().getInteger(R.integer.config_dragViewOffsetX);
|
||||
viewY += getResources().getInteger(R.integer.config_dragViewOffsetY);
|
||||
viewX += getResources().getDimensionPixelSize(R.dimen.dragViewOffsetX);
|
||||
viewY += getResources().getDimensionPixelSize(R.dimen.dragViewOffsetY);
|
||||
|
||||
// Set its old pos (in the new parent's coordinates); it will be animated
|
||||
// in animateViewIntoPosition after the next layout pass
|
||||
|
||||
Reference in new issue
Block a user