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

Commit 27d8ea4e authored by Jim Miller's avatar Jim Miller Committed by Android Git Automerger
Browse files

am 1962e264: Fix keyguard widget pager accessibility - announce when widget...

am 1962e264: Fix keyguard widget pager accessibility - announce when widget hovers over drop target - announce when widget leaves drop target

* commit '1962e264':
  Fix keyguard widget pager accessibility - announce when widget hovers over drop target - announce when widget leaves drop target
parents 48b2c775 1962e264
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -157,6 +157,12 @@
    <!-- Accessibility description for when the bouncer prompt is dismissed. [CHAR LIMIT=NONE] -->
    <string name="keyguard_accessibility_hide_bouncer">Launch canceled</string>

    <!-- Accessibility description announced when user drags widget over the delete drop target [CHAR LIMIT=NONE] -->
    <string name="keyguard_accessibility_delete_widget_start">Drop <xliff:g id="widget_index">%1$s</xliff:g> to delete.</string>

    <!-- Accessibility description announced when user drags widget away from delete drop target [CHAR LIMIT=NONE] -->
    <string name="keyguard_accessibility_delete_widget_end"><xliff:g id="widget_index">%1$s</xliff:g> will not be deleted.</string>

    <!-- Password keyboard strings. Used by LockScreen and Settings --><skip />
    <!-- Label for "switch to symbols" key.  Must be short to fit on key! -->
    <string name="password_keyboard_label_symbol_key">\?123</string>
+5 −1
Original line number Diff line number Diff line
@@ -147,6 +147,10 @@ public class KeyguardWidgetFrame extends FrameLayout {
        if (ENABLE_HOVER_OVER_DELETE_DROP_TARGET_OVERLAY) {
            if (mIsHoveringOverDeleteDropTarget != isHovering) {
                mIsHoveringOverDeleteDropTarget = isHovering;
                int resId = isHovering ? R.string.keyguard_accessibility_delete_widget_start
                        : R.string.keyguard_accessibility_delete_widget_end;
                String text = getContext().getResources().getString(resId, getContentDescription());
                announceForAccessibility(text);
                invalidate();
            }
        }
+16 −2
Original line number Diff line number Diff line
@@ -125,6 +125,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
    private int[] mChildOffsets;
    private int[] mChildRelativeOffsets;
    private int[] mChildOffsetsWithLayoutScale;
    private String mDeleteString; // Accessibility announcement when widget is deleted

    protected final static int TOUCH_STATE_REST = 0;
    protected final static int TOUCH_STATE_SCROLLING = 1;
@@ -1118,6 +1119,8 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
                // i.e. fall through to the next case (don't break)
                // (We sometimes miss ACTION_DOWN events in Workspace because it ignores all events
                // while it's small- this was causing a crash before we checked for INVALID_POINTER)

                break;
            }

            case MotionEvent.ACTION_DOWN: {
@@ -2194,9 +2197,14 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc

    protected void onEndReordering() {
        if (AccessibilityManager.getInstance(mContext).isEnabled()) {
            if (mDeleteString != null) {
                announceForAccessibility(mDeleteString);
                mDeleteString = null;
            } else {
                announceForAccessibility(mContext.getString(
                        R.string.keyguard_accessibility_widget_reorder_end));
            }
        }
        mIsReordering = false;

        // Mark all the non-widget pages as visible again
@@ -2507,6 +2515,9 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
        AnimatorUpdateListener updateCb = new FlingAlongVectorAnimatorUpdateListener(dragView, vel,
                from, startTime, FLING_TO_DELETE_FRICTION);

        mDeleteString = getContext().getResources()
                .getString(R.string.keyguard_accessibility_widget_deleted,
                        mDragView.getContentDescription());
        final Runnable onAnimationEndRunnable = createPostDeleteAnimationRunnable(dragView);

        // Create and start the animation
@@ -2562,6 +2573,9 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
                ObjectAnimator.ofFloat(dragView, "alpha", toAlpha));
        animations.add(alphaAnim);

        mDeleteString = getContext().getResources()
                .getString(R.string.keyguard_accessibility_widget_deleted,
                        mDragView.getContentDescription());
        final Runnable onAnimationEndRunnable = createPostDeleteAnimationRunnable(dragView);

        AnimatorSet anim = new AnimatorSet();