summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2018-05-23 15:49:39 -0700
committerSunny Goyal <sunnygoyal@google.com>2018-05-25 17:52:49 +0000
commitdb9f86a472844aa3a24c422983839ffd0253e2f8 (patch)
treebd64984f47df2a1bc3e7c08e9cbb0ea084659d85
parent012d39a0e954614d41229e35af5152dbd3b27efb (diff)
downloadandroid_packages_apps_Trebuchet-db9f86a472844aa3a24c422983839ffd0253e2f8.tar.gz
android_packages_apps_Trebuchet-db9f86a472844aa3a24c422983839ffd0253e2f8.tar.bz2
android_packages_apps_Trebuchet-db9f86a472844aa3a24c422983839ffd0253e2f8.zip
Accounting for view translation when calculating the focus location
Bug: 80160107 Change-Id: Ibb0cb82c33c141bb3abf9b7576be4253630cb8c5
-rw-r--r--src/com/android/launcher3/keyboard/ViewGroupFocusHelper.java23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/com/android/launcher3/keyboard/ViewGroupFocusHelper.java b/src/com/android/launcher3/keyboard/ViewGroupFocusHelper.java
index bd5c06e5b..fde220cbf 100644
--- a/src/com/android/launcher3/keyboard/ViewGroupFocusHelper.java
+++ b/src/com/android/launcher3/keyboard/ViewGroupFocusHelper.java
@@ -18,7 +18,6 @@ package com.android.launcher3.keyboard;
import android.graphics.Rect;
import android.view.View;
-import android.view.View.OnFocusChangeListener;
import com.android.launcher3.PagedView;
@@ -52,8 +51,8 @@ public class ViewGroupFocusHelper extends FocusIndicatorHelper {
private void computeLocationRelativeToContainer(View child, Rect outRect) {
View parent = (View) child.getParent();
- outRect.left += child.getLeft();
- outRect.top += child.getTop();
+ outRect.left += child.getX();
+ outRect.top += child.getY();
if (parent != mContainer) {
if (parent instanceof PagedView) {
@@ -64,22 +63,4 @@ public class ViewGroupFocusHelper extends FocusIndicatorHelper {
computeLocationRelativeToContainer(parent, outRect);
}
}
-
- /**
- * Sets the alpha of this FocusIndicatorHelper to 0 when a view with this listener
- * receives focus.
- */
- public View.OnFocusChangeListener getHideIndicatorOnFocusListener() {
- return new OnFocusChangeListener() {
- @Override
- public void onFocusChange(View v, boolean hasFocus) {
- if (hasFocus) {
- endCurrentAnimation();
- setCurrentView(null);
- setAlpha(0);
- invalidateDirty();
- }
- }
- };
- }
}