am cab5b8a9
: Merge "Nodes with contentDescription should always be important for accessibility." into jb-dev
* commit 'cab5b8a91d6fbcbb694284038f5529ff02f10f78': Nodes with contentDescription should always be important for accessibility.
This commit is contained in:
@ -3457,7 +3457,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case com.android.internal.R.styleable.View_contentDescription:
|
case com.android.internal.R.styleable.View_contentDescription:
|
||||||
mContentDescription = a.getString(attr);
|
setContentDescription(a.getString(attr));
|
||||||
break;
|
break;
|
||||||
case com.android.internal.R.styleable.View_soundEffectsEnabled:
|
case com.android.internal.R.styleable.View_soundEffectsEnabled:
|
||||||
if (!a.getBoolean(attr, true)) {
|
if (!a.getBoolean(attr, true)) {
|
||||||
@ -5048,6 +5048,10 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
|
|||||||
@RemotableViewMethod
|
@RemotableViewMethod
|
||||||
public void setContentDescription(CharSequence contentDescription) {
|
public void setContentDescription(CharSequence contentDescription) {
|
||||||
mContentDescription = contentDescription;
|
mContentDescription = contentDescription;
|
||||||
|
final boolean nonEmptyDesc = contentDescription != null && contentDescription.length() > 0;
|
||||||
|
if (nonEmptyDesc && getImportantForAccessibility() == IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
|
||||||
|
setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -100,6 +100,9 @@ public class TouchExplorer {
|
|||||||
// Temporary array for storing pointer IDs.
|
// Temporary array for storing pointer IDs.
|
||||||
private final int[] mTempPointerIds = new int[MAX_POINTER_COUNT];
|
private final int[] mTempPointerIds = new int[MAX_POINTER_COUNT];
|
||||||
|
|
||||||
|
// Timeout before trying to decide what the user is trying to do.
|
||||||
|
private final int mDetermineUserIntentTimeout;
|
||||||
|
|
||||||
// Timeout within which we try to detect a tap.
|
// Timeout within which we try to detect a tap.
|
||||||
private final int mTapTimeout;
|
private final int mTapTimeout;
|
||||||
|
|
||||||
@ -199,6 +202,7 @@ public class TouchExplorer {
|
|||||||
mInjectedPointerTracker = new InjectedPointerTracker();
|
mInjectedPointerTracker = new InjectedPointerTracker();
|
||||||
mInputFilter = inputFilter;
|
mInputFilter = inputFilter;
|
||||||
mTapTimeout = ViewConfiguration.getTapTimeout();
|
mTapTimeout = ViewConfiguration.getTapTimeout();
|
||||||
|
mDetermineUserIntentTimeout = (int) (mTapTimeout * 1.5f);
|
||||||
mDoubleTapTimeout = ViewConfiguration.getDoubleTapTimeout();
|
mDoubleTapTimeout = ViewConfiguration.getDoubleTapTimeout();
|
||||||
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
|
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
|
||||||
mDoubleTapSlop = ViewConfiguration.get(context).getScaledDoubleTapSlop();
|
mDoubleTapSlop = ViewConfiguration.get(context).getScaledDoubleTapSlop();
|
||||||
@ -1332,7 +1336,7 @@ public class TouchExplorer {
|
|||||||
mPrototype = MotionEvent.obtain(prototype);
|
mPrototype = MotionEvent.obtain(prototype);
|
||||||
mPointerIdBits = pointerIdBits;
|
mPointerIdBits = pointerIdBits;
|
||||||
mPolicyFlags = policyFlags;
|
mPolicyFlags = policyFlags;
|
||||||
mHandler.postDelayed(this, mTapTimeout);
|
mHandler.postDelayed(this, mDetermineUserIntentTimeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getX() {
|
public float getX() {
|
||||||
|
Reference in New Issue
Block a user