mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 10:48:19 +00:00
Accessibility fixes
> Enabling top bar buttons in accessibility drag-drop > Unifying logic to show delete/uninstall/app-info targets > Announcing cell loction as 1-index instead of 0-index Change-Id: Ibc7801f77e938b2646f0655462cbe9b7f781818b
This commit is contained in:
@@ -26,18 +26,19 @@ import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.TransitionDrawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.util.Thunk;
|
||||
|
||||
/**
|
||||
* Implements a DropTarget.
|
||||
*/
|
||||
public abstract class ButtonDropTarget extends TextView implements DropTarget, DragController.DragListener {
|
||||
public abstract class ButtonDropTarget extends TextView
|
||||
implements DropTarget, DragController.DragListener, OnClickListener {
|
||||
|
||||
private static int DRAG_VIEW_DROP_DURATION = 285;
|
||||
|
||||
@@ -256,4 +257,18 @@ public abstract class ButtonDropTarget extends TextView implements DropTarget, D
|
||||
public void getLocationInDragLayer(int[] loc) {
|
||||
mLauncher.getDragLayer().getLocationInDragLayer(this, loc);
|
||||
}
|
||||
|
||||
public void enableAccessibleDrag(boolean enable) {
|
||||
setOnClickListener(enable ? this : null);
|
||||
}
|
||||
|
||||
protected String getAccessibilityDropConfirmation() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
LauncherAppState.getInstance().getAccessibilityDelegate()
|
||||
.handleAccessibleDrop(this, null, getAccessibilityDropConfirmation());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user