diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-04-08 17:45:58 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-04-08 17:45:59 +0000 |
commit | 724d0e22ac0811a17a39c682aec2cc6a13bee1bc (patch) | |
tree | 665cc5bed52fe2848f977e82bf854d1115c0f64b /src | |
parent | c624a26aa37bfd89ccc103b949a235fe765c5089 (diff) | |
parent | 059228ad8e99658d6007c0f7f8bc205245d2dc9e (diff) | |
download | android_packages_apps_Trebuchet-724d0e22ac0811a17a39c682aec2cc6a13bee1bc.tar.gz android_packages_apps_Trebuchet-724d0e22ac0811a17a39c682aec2cc6a13bee1bc.tar.bz2 android_packages_apps_Trebuchet-724d0e22ac0811a17a39c682aec2cc6a13bee1bc.zip |
Merge "Fixing focus indicator position when the overlay page has different size than the current page." into ub-launcher3-burnaby
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/FocusIndicatorView.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/com/android/launcher3/FocusIndicatorView.java b/src/com/android/launcher3/FocusIndicatorView.java index ab21c90e6..ecf93e4b3 100644 --- a/src/com/android/launcher3/FocusIndicatorView.java +++ b/src/com/android/launcher3/FocusIndicatorView.java @@ -149,7 +149,7 @@ public class FocusIndicatorView extends View implements View.OnFocusChangeListen } /** - * Computes the location of a view relative to {@link #mCommonParent}, off-setting + * Computes the location of a view relative to {@param parent}, off-setting * any shift due to page view scroll. * @param pos an array of two integers in which to hold the coordinates */ @@ -166,12 +166,12 @@ public class FocusIndicatorView extends View implements View.OnFocusChangeListen private static void computeLocationRelativeToParentHelper(View child, View commonParent, int[] shift) { View parent = (View) child.getParent(); - if (parent instanceof PagedView) { - child = ((PagedView) parent).getPageAt(0); - } - shift[0] += child.getLeft(); shift[1] += child.getTop(); + if (parent instanceof PagedView) { + PagedView page = (PagedView) parent; + shift[0] -= page.getScrollForPage(page.indexOfChild(child)); + } if (parent != commonParent) { computeLocationRelativeToParentHelper(parent, commonParent, shift); |