Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 52587f70 authored by Sunny Goyal's avatar Sunny Goyal Committed by Android (Google) Code Review
Browse files

Merge "Disabling default focus from icons as we use an animated focus...

Merge "Disabling default focus from icons as we use an animated focus indicator" into ub-launcher3-master
parents d3b4dfa7 c9d3d067
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -114,6 +114,7 @@
        <item name="android:singleLine">true</item>
        <item name="android:textColor">?android:attr/textColorSecondary</item>
        <item name="android:fontFamily">sans-serif-condensed</item>
        <item name="android:defaultFocusHighlightEnabled">false</item>

        <!-- No shadows in the base theme -->
        <item name="android:shadowRadius">0</item>
+15 −0
Original line number Diff line number Diff line
@@ -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());
        }
    }
}
+3 −8
Original line number Diff line number Diff line
@@ -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() {