本文整理汇总了Java中android.view.View.AccessibilityDelegate类的典型用法代码示例。如果您正苦于以下问题:Java AccessibilityDelegate类的具体用法?Java AccessibilityDelegate怎么用?Java AccessibilityDelegate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AccessibilityDelegate类属于android.view.View包,在下文中一共展示了AccessibilityDelegate类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testScrolling_scroll
import android.view.View.AccessibilityDelegate; //导入依赖的package包/类
@MediumTest
public void testScrolling_scroll() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
return;
}
final ScrollView scrollView = (ScrollView) getActivity().findViewById(R.id.scroll_id);
final CountDownLatch scrollsMissed = new CountDownLatch(1);
scrollView.setAccessibilityDelegate(new AccessibilityDelegate() {
@Override
public boolean performAccessibilityAction(@NonNull View host, int action, Bundle args) {
if (action == AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD) {
scrollsMissed.countDown();
}
return super.performAccessibilityAction(host, action, args);
}
});
sendKeyEventSync(mMoveFocusEvent);
sendKeyEventSync(mScrollForwardEvent);
assertEquals(0, scrollsMissed.getCount());
}
示例2: getAccessibilityNodeProvider
import android.view.View.AccessibilityDelegate; //导入依赖的package包/类
public final AccessibilityNodeProviderCompat getAccessibilityNodeProvider(Object paramObject, View paramView)
{
AccessibilityNodeProvider localAccessibilityNodeProvider = ((View.AccessibilityDelegate)paramObject).getAccessibilityNodeProvider(paramView);
if (localAccessibilityNodeProvider != null) {
return new AccessibilityNodeProviderCompat(localAccessibilityNodeProvider);
}
return null;
}
示例3: setAccessibilityDelegate
import android.view.View.AccessibilityDelegate; //导入依赖的package包/类
public final void setAccessibilityDelegate(View paramView, AccessibilityDelegateCompat paramAccessibilityDelegateCompat)
{
if (paramAccessibilityDelegateCompat == null) {}
for (Object localObject = null;; localObject = paramAccessibilityDelegateCompat.mBridge)
{
paramView.setAccessibilityDelegate((View.AccessibilityDelegate)localObject);
return;
}
}
示例4: a
import android.view.View.AccessibilityDelegate; //导入依赖的package包/类
public final void a(View paramView, ld paramld)
{
if (paramld == null) {}
for (Object localObject = null;; localObject = paramld.c)
{
paramView.setAccessibilityDelegate((View.AccessibilityDelegate)localObject);
return;
}
}
示例5: a
import android.view.View.AccessibilityDelegate; //导入依赖的package包/类
public final qb a(Object paramObject, View paramView)
{
AccessibilityNodeProvider localAccessibilityNodeProvider = ((View.AccessibilityDelegate)paramObject).getAccessibilityNodeProvider(paramView);
if (localAccessibilityNodeProvider != null) {
return new qb(localAccessibilityNodeProvider);
}
return null;
}
示例6: filterAndShow
import android.view.View.AccessibilityDelegate; //导入依赖的package包/类
/**
* Filters the Autofill suggestions to the ones that we support and shows the popup.
* @param suggestions Autofill suggestion data.
* @param isRtl @code true if right-to-left text.
* @param backgroundColor popup background color, or {@code Color.TRANSPARENT} if unspecified.
* @param dividerColor color for divider between popup items, or {@code Color.TRANSPARENT} if
* unspecified.
* @param isBoldLabel true if suggestion label's type face is {@code Typeface.BOLD}, false if
* suggestion label's type face is {@code Typeface.NORMAL}.
* @param dropdownItemHeight height of each dropdown item in dimension independent pixel units,
* 0 if unspecified.
* @param margin Margin for icon, label and between icon and label in dimension independent
* pixel units, 0 if not specified.
*/
@SuppressLint("InlinedApi")
public void filterAndShow(AutofillSuggestion[] suggestions, boolean isRtl,
int backgroundColor, int dividerColor, int dropdownItemHeight, int margin) {
mSuggestions = new ArrayList<AutofillSuggestion>(Arrays.asList(suggestions));
// Remove the AutofillSuggestions with IDs that are not supported by Android
ArrayList<DropdownItem> cleanedData = new ArrayList<DropdownItem>();
HashSet<Integer> separators = new HashSet<Integer>();
for (int i = 0; i < suggestions.length; i++) {
int itemId = suggestions[i].getSuggestionId();
if (itemId == ITEM_ID_SEPARATOR_ENTRY) {
separators.add(cleanedData.size());
} else {
cleanedData.add(suggestions[i]);
}
}
setAdapter(new DropdownAdapter(mContext, cleanedData, separators,
backgroundColor == Color.TRANSPARENT ? null : backgroundColor,
dividerColor == Color.TRANSPARENT ? null : dividerColor,
dropdownItemHeight == 0 ? null : dropdownItemHeight,
margin == 0 ? null : margin));
setRtl(isRtl);
show();
getListView().setOnItemLongClickListener(this);
getListView().setAccessibilityDelegate(new AccessibilityDelegate() {
@Override
public boolean onRequestSendAccessibilityEvent(
ViewGroup host, View child, AccessibilityEvent event) {
getListView().removeCallbacks(mClearAccessibilityFocusRunnable);
if (event.getEventType()
== AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED) {
getListView().postDelayed(
mClearAccessibilityFocusRunnable, CLEAR_ACCESSIBILITY_FOCUS_DELAY_MS);
}
return super.onRequestSendAccessibilityEvent(host, child, event);
}
});
}
示例7: onAttach
import android.view.View.AccessibilityDelegate; //导入依赖的package包/类
@Override public void onAttach(Activity activity) {
super.onAttach(activity);
if (globalData == null) {
globalData = ((Globals) getActivity().getApplicationContext());
}
settingsManager = globalData.getSettingsManagerInstance();
poiManager = globalData.getPOIManagerInstance();
positionManager = globalData.getPositionManagerInstance();
sensorsManager = globalData.getSensorsManagerInstance();
addressManager = globalData.getAddressManagerInstance();
keyboardManager = globalData.getKeyboardManagerInstance();
ttsInstance = globalData.getTTSInstance();
vibrator = (Vibrator) getActivity().getApplicationContext().getSystemService(Context.VIBRATOR_SERVICE);
processedPOIList = new ArrayList<Point>();
mHandler = new Handler();
routeSimulator = new RouteSimulator();
gpsStatusHandler = new Handler();
gpsStatusUpdater = new GPSStatusUpdater();
focusedElement = UIElement.DEFAULT;
defaultAccessibilityDelegate = new AccessibilityDelegate() {
@Override public void onPopulateAccessibilityEvent(View host, AccessibilityEvent event) {
super.onPopulateAccessibilityEvent(host, event);
if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED) {
focusedElement = UIElement.DEFAULT;
}
}
};
// This makes sure that the container activity has implemented
// the callback interface. If not, it throws an exception
try {
mRouterFListener = (MessageFromRouterFragmentListener) ((MainActivity) activity).getMessageFromRouterFragmentListener();
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString()
+ " must implement MessageFromRouterFragmentListener");
}
}
示例8: a
import android.view.View.AccessibilityDelegate; //导入依赖的package包/类
public final android.support.v4.view.a.f a(Object paramObject, View paramView)
{
AccessibilityNodeProvider localAccessibilityNodeProvider = ((View.AccessibilityDelegate)paramObject).getAccessibilityNodeProvider(paramView);
if (localAccessibilityNodeProvider != null)
return new android.support.v4.view.a.f(localAccessibilityNodeProvider);
return null;
}
示例9: getAccessibilityDelegate
import android.view.View.AccessibilityDelegate; //导入依赖的package包/类
public AccessibilityDelegate getAccessibilityDelegate() {
return null;
}
示例10: setAccessibilityDelegate
import android.view.View.AccessibilityDelegate; //导入依赖的package包/类
public static void setAccessibilityDelegate(View v, @Nullable Object delegate) {
v.setAccessibilityDelegate((AccessibilityDelegate) delegate);
}
示例11: setAccessibilityDelegate
import android.view.View.AccessibilityDelegate; //导入依赖的package包/类
/**
* @see View#setAccessibilityDelegate(AccessibilityDelegate)
*/
public W setAccessibilityDelegate(AccessibilityDelegate delegate) {
mView.setAccessibilityDelegate(delegate);
return (W)this;
}
示例12: setAccessibilityDelegate
import android.view.View.AccessibilityDelegate; //导入依赖的package包/类
public void setAccessibilityDelegate(AccessibilityDelegate delegate) {
if (!this.mLockAccessibilityDelegate) {
super.setAccessibilityDelegate(delegate);
}
}
示例13: getAccessibilityNodeProvider
import android.view.View.AccessibilityDelegate; //导入依赖的package包/类
public static Object getAccessibilityNodeProvider(Object delegate, View host) {
return ((AccessibilityDelegate) delegate).getAccessibilityNodeProvider(host);
}
示例14: performAccessibilityAction
import android.view.View.AccessibilityDelegate; //导入依赖的package包/类
public static boolean performAccessibilityAction(Object delegate, View host, int action, Bundle args) {
return ((AccessibilityDelegate) delegate).performAccessibilityAction(host, action, args);
}
示例15: newAccessibilityDelegateDefaultImpl
import android.view.View.AccessibilityDelegate; //导入依赖的package包/类
public static Object newAccessibilityDelegateDefaultImpl() {
return new AccessibilityDelegate();
}