mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 17:36:49 +00:00
Accessibility fixes
1) Use a different content description for temporary new page 2) Use different accessibility description for add widget toast 3) Announce when an item is deleted 4) Announce when hovering over a drop target 5) Announce state during drag-n-drop and widget resize (similar to seekbar) Bug: 23573321, 24057944 Change-Id: Icabb317625e70c78e11c0b4f99b9339172d93594
This commit is contained in:
@@ -14,6 +14,8 @@ import android.view.Gravity;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.android.launcher3.accessibility.DragViewStateAnnouncer;
|
||||
|
||||
public class AppWidgetResizeFrame extends FrameLayout {
|
||||
private static final int SNAP_DURATION = 150;
|
||||
private static final float DIMMED_HANDLE_ALPHA = 0f;
|
||||
@@ -40,6 +42,8 @@ public class AppWidgetResizeFrame extends FrameLayout {
|
||||
private final int[] mLastDirectionVector = new int[2];
|
||||
private final int[] mTmpPt = new int[2];
|
||||
|
||||
private final DragViewStateAnnouncer mStateAnnouncer;
|
||||
|
||||
private boolean mLeftBorderActive;
|
||||
private boolean mRightBorderActive;
|
||||
private boolean mTopBorderActive;
|
||||
@@ -78,6 +82,8 @@ public class AppWidgetResizeFrame extends FrameLayout {
|
||||
mMinHSpan = info.minSpanX;
|
||||
mMinVSpan = info.minSpanY;
|
||||
|
||||
mStateAnnouncer = DragViewStateAnnouncer.createFor(this);
|
||||
|
||||
setBackgroundResource(R.drawable.widget_resize_shadow);
|
||||
setForeground(getResources().getDrawable(R.drawable.widget_resize_frame));
|
||||
setPadding(0, 0, 0, 0);
|
||||
@@ -320,12 +326,18 @@ public class AppWidgetResizeFrame extends FrameLayout {
|
||||
|
||||
if (mCellLayout.createAreaForResize(cellX, cellY, spanX, spanY, mWidgetView,
|
||||
mDirectionVector, onDismiss)) {
|
||||
if (mStateAnnouncer != null && (lp.cellHSpan != spanX || lp.cellVSpan != spanY) ) {
|
||||
mStateAnnouncer.announce(
|
||||
mLauncher.getString(R.string.widget_resized, spanX, spanY));
|
||||
}
|
||||
|
||||
lp.tmpCellX = cellX;
|
||||
lp.tmpCellY = cellY;
|
||||
lp.cellHSpan = spanX;
|
||||
lp.cellVSpan = spanY;
|
||||
mRunningVInc += vSpanDelta;
|
||||
mRunningHInc += hSpanDelta;
|
||||
|
||||
if (!onDismiss) {
|
||||
updateWidgetSizeRanges(mWidgetView, mLauncher, spanX, spanY);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user