mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 23:36:47 +00:00
Merge "Cling allows touch explore and accessibility focus search behind it." into jb-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b6d33ebc41
@@ -28,6 +28,10 @@ import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.FocusFinder;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.accessibility.AccessibilityManager;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import com.android.launcher.R;
|
||||
@@ -129,6 +133,35 @@ public class Cling extends FrameLayout {
|
||||
return new int[]{-1, -1};
|
||||
}
|
||||
|
||||
@Override
|
||||
public View findViewToTakeAccessibilityFocusFromHover(View child, View descendant) {
|
||||
if (descendant.includeForAccessibility()) {
|
||||
return descendant;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View focusSearch(int direction) {
|
||||
return this.focusSearch(null, direction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View focusSearch(View focused, int direction) {
|
||||
return FocusFinder.getInstance().findNextFocus(this, focused, direction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onHoverEvent(MotionEvent event) {
|
||||
return (mDrawIdentifier.equals(WORKSPACE_PORTRAIT)
|
||||
|| mDrawIdentifier.equals(WORKSPACE_LANDSCAPE)
|
||||
|| mDrawIdentifier.equals(WORKSPACE_LARGE)
|
||||
|| mDrawIdentifier.equals(ALLAPPS_PORTRAIT)
|
||||
|| mDrawIdentifier.equals(ALLAPPS_LANDSCAPE)
|
||||
|| mDrawIdentifier.equals(ALLAPPS_LARGE)
|
||||
|| mDrawIdentifier.equals(WORKSPACE_CUSTOM));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(android.view.MotionEvent event) {
|
||||
if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) ||
|
||||
|
||||
@@ -3467,6 +3467,7 @@ public final class Launcher extends Activity
|
||||
cling.init(this, positionData);
|
||||
cling.setVisibility(View.VISIBLE);
|
||||
cling.setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
||||
cling.requestAccessibilityFocus();
|
||||
if (animate) {
|
||||
cling.buildLayer();
|
||||
cling.setAlpha(0f);
|
||||
|
||||
Reference in New Issue
Block a user