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

Commit c9d3d067 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Disabling default focus from icons as we use an animated focus indicator

Change-Id: I9d3f1b5f5710ff8931f02f1a3a41e4986b4e0f9c
parent 25a54729
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() {