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

Commit 662d41ca authored by Android Build Merger (Role)'s avatar Android Build Merger (Role)
Browse files

[automerger] Accounting for view translation when calculating the focus location am: db9f86a4

Change-Id: I704898f82292d655a0f13c4940ae9579c8d28bb9
parents cd1727c0 db9f86a4
Loading
Loading
Loading
Loading
+2 −21
Original line number Diff line number Diff line
@@ -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();
                }
            }
        };
    }
}