summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/values-xlarge/config.xml5
-rw-r--r--res/values-xlarge/dimens.xml5
-rw-r--r--res/values/config.xml6
-rw-r--r--res/values/dimens.xml5
-rw-r--r--src/com/android/launcher2/DragView.java4
-rw-r--r--src/com/android/launcher2/Workspace.java4
6 files changed, 14 insertions, 15 deletions
diff --git a/res/values-xlarge/config.xml b/res/values-xlarge/config.xml
index 56c7bc688..b9880e3ea 100644
--- a/res/values-xlarge/config.xml
+++ b/res/values-xlarge/config.xml
@@ -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 -->
diff --git a/res/values-xlarge/dimens.xml b/res/values-xlarge/dimens.xml
index 2b9769716..fffa0f231 100644
--- a/res/values-xlarge/dimens.xml
+++ b/res/values-xlarge/dimens.xml
@@ -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>
diff --git a/res/values/config.xml b/res/values/config.xml
index c56a8cec2..ec01fa840 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -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>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index d6cd3eeb0..e346c6a0e 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -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>
diff --git a/src/com/android/launcher2/DragView.java b/src/com/android/launcher2/DragView.java
index 45620b90b..ab997446d 100644
--- a/src/com/android/launcher2/DragView.java
+++ b/src/com/android/launcher2/DragView.java
@@ -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);
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 92be5dc77..15c164ad7 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -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