diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2018-03-22 12:18:08 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2018-03-22 12:18:35 -0700 |
commit | c9d3d0677398f8402b2c26f65dc7e694c8a48bf8 (patch) | |
tree | 61ddbba7daf7cf8db45a023ec0e0e82d88b93361 /src | |
parent | 25a54729479a85bb81f9f6f0248c8a3c64b0a636 (diff) | |
download | android_packages_apps_Trebuchet-c9d3d0677398f8402b2c26f65dc7e694c8a48bf8.tar.gz android_packages_apps_Trebuchet-c9d3d0677398f8402b2c26f65dc7e694c8a48bf8.tar.bz2 android_packages_apps_Trebuchet-c9d3d0677398f8402b2c26f65dc7e694c8a48bf8.zip |
Disabling default focus from icons as we use an animated focus indicator
Change-Id: I9d3f1b5f5710ff8931f02f1a3a41e4986b4e0f9c
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/keyboard/FocusIndicatorHelper.java | 15 | ||||
-rw-r--r-- | src/com/android/launcher3/keyboard/FocusedItemDecorator.java | 11 |
2 files changed, 18 insertions, 8 deletions
diff --git a/src/com/android/launcher3/keyboard/FocusIndicatorHelper.java b/src/com/android/launcher3/keyboard/FocusIndicatorHelper.java index c07ab084c..c50189c1c 100644 --- a/src/com/android/launcher3/keyboard/FocusIndicatorHelper.java +++ b/src/com/android/launcher3/keyboard/FocusIndicatorHelper.java @@ -236,4 +236,19 @@ public abstract class FocusIndicatorHelper implements } } } + + /** + * Simple subclass which assumes that the target view is a child of the container. + */ + public static class SimpleFocusIndicatorHelper extends FocusIndicatorHelper { + + public SimpleFocusIndicatorHelper(View container) { + super(container); + } + + @Override + public void viewToRect(View v, Rect outRect) { + outRect.set(v.getLeft(), v.getTop(), v.getRight(), v.getBottom()); + } + } } diff --git a/src/com/android/launcher3/keyboard/FocusedItemDecorator.java b/src/com/android/launcher3/keyboard/FocusedItemDecorator.java index 9c80b0f08..05ae406e8 100644 --- a/src/com/android/launcher3/keyboard/FocusedItemDecorator.java +++ b/src/com/android/launcher3/keyboard/FocusedItemDecorator.java @@ -17,13 +17,14 @@ package com.android.launcher3.keyboard; import android.graphics.Canvas; -import android.graphics.Rect; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView.ItemDecoration; import android.support.v7.widget.RecyclerView.State; import android.view.View; import android.view.View.OnFocusChangeListener; +import com.android.launcher3.keyboard.FocusIndicatorHelper.SimpleFocusIndicatorHelper; + /** * {@link ItemDecoration} for drawing and animating focused view background. */ @@ -32,13 +33,7 @@ public class FocusedItemDecorator extends ItemDecoration { private FocusIndicatorHelper mHelper; public FocusedItemDecorator(View container) { - mHelper = new FocusIndicatorHelper(container) { - - @Override - public void viewToRect(View v, Rect outRect) { - outRect.set(v.getLeft(), v.getTop(), v.getRight(), v.getBottom()); - } - }; + mHelper = new SimpleFocusIndicatorHelper(container); } public OnFocusChangeListener getFocusListener() { |