当前位置: 首页>>代码示例>>Java>>正文


Java View.setAccessibilityDelegate方法代码示例

本文整理汇总了Java中android.view.View.setAccessibilityDelegate方法的典型用法代码示例。如果您正苦于以下问题:Java View.setAccessibilityDelegate方法的具体用法?Java View.setAccessibilityDelegate怎么用?Java View.setAccessibilityDelegate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.View的用法示例。


在下文中一共展示了View.setAccessibilityDelegate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateAccessibilityComponentType

import android.view.View; //导入方法依赖的package包/类
public static void updateAccessibilityComponentType(View view, String componentType) {
  if (componentType == null) {
    view.setAccessibilityDelegate(null);
    return;
  }
  switch (componentType) {
    case BUTTON:
      view.setAccessibilityDelegate(BUTTON_DELEGATE);
      break;
    case RADIOBUTTON_CHECKED:
      view.setAccessibilityDelegate(RADIOBUTTON_CHECKED_DELEGATE);
      break;
    case RADIOBUTTON_UNCHECKED:
      view.setAccessibilityDelegate(RADIOBUTTON_UNCHECKED_DELEGATE);
      break;
    default:
      view.setAccessibilityDelegate(null);
      break;
  }
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:21,代码来源:AccessibilityHelper.java

示例2: scrapActiveViews

import android.view.View; //导入方法依赖的package包/类
/** Move all views remaining in activeViews to scrapViews. */
void scrapActiveViews() {
  final View[] activeViews = this.activeViews;
  final int[] activeViewTypes = this.activeViewTypes;
  final boolean multipleScraps = viewTypeCount > 1;

  SparseArray<View> scrapViews = currentScrapViews;
  final int count = activeViews.length;
  for (int i = count - 1; i >= 0; i--) {
    final View victim = activeViews[i];
    if (victim != null) {
      int whichScrap = activeViewTypes[i];

      activeViews[i] = null;
      activeViewTypes[i] = -1;

      if (!shouldRecycleViewType(whichScrap)) {
        continue;
      }

      if (multipleScraps) {
        scrapViews = this.scrapViews[whichScrap];
      }
      scrapViews.put(i, victim);

      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        victim.setAccessibilityDelegate(null);
      }
    }
  }

  pruneScrapViews();
}
 
开发者ID:LineChen,项目名称:Month_Calendar,代码行数:34,代码来源:RecycleBin.java

示例3: handleViewClick

import android.view.View; //导入方法依赖的package包/类
private void handleViewClick(Activity activity, MotionEvent event, HashMap<String, Object> commonInfo) {
    View view = activity.getWindow().getDecorView();
    View tagView = null;
    View clickView = getClickView(view, event, tagView);
    if (clickView != null) {
        if (mDelegate != null) {
            mDelegate.setCommonInfo(commonInfo);
        }
        clickView.setAccessibilityDelegate(mDelegate);
    }
}
 
开发者ID:alibaba,项目名称:android_viewtracker,代码行数:12,代码来源:ClickManager.java

示例4: addScrapView

import android.view.View; //导入方法依赖的package包/类
/**
 * Put a view into the ScrapViews list. These views are unordered.
 *
 * @param scrap The view to add
 */
void addScrapView(View scrap, int position, int viewType) {
  if (viewTypeCount == 1) {
    currentScrapViews.put(position, scrap);
  } else {
    scrapViews[viewType].put(position, scrap);
  }

  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
    scrap.setAccessibilityDelegate(null);
  }
}
 
开发者ID:AndroidBoySC,项目名称:Mybilibili,代码行数:17,代码来源:RecycleBin.java

示例5: reclaimViews

import android.view.View; //导入方法依赖的package包/类
/**
 * Move all views (excluding headers and footers) held by this AbsListView
 * into the supplied List. This includes views displayed on the screen as
 * well as views stored in AbsListView's internal view recycler.
 * 
 * @param views
 *            A list into which to put the reclaimed views
 */
@SuppressLint("NewApi")
public void reclaimViews(List<View> views) {
	int childCount = getChildCount();
	RecyclerListener listener = mRecycler.mRecyclerListener;

	// Reclaim views on screen
	for (int i = 0; i < childCount; i++) {
		View child = getChildAt(i);
		AbsHListView.LayoutParams lp = (AbsHListView.LayoutParams) child
				.getLayoutParams();
		// Don't reclaim header or footer views, or views that should be
		// ignored
		if (lp != null && mRecycler.shouldRecycleViewType(lp.viewType)) {
			views.add(child);

			if (android.os.Build.VERSION.SDK_INT >= 14) {
				child.setAccessibilityDelegate(null);
			}

			if (listener != null) {
				// Pretend they went through the scrap heap
				listener.onMovedToScrapHeap(child);
			}
		}
	}
	mRecycler.reclaimScrapViews(views);
	removeAllViewsInLayout();
}
 
开发者ID:junchenChow,项目名称:exciting-app,代码行数:37,代码来源:AbsHListView.java

示例6: addScrapView

import android.view.View; //导入方法依赖的package包/类
/**
 * Put a view into the ScrapViews list. These views are unordered.
 *
 * @param scrap The view to add
 */
void addScrapView(View scrap, int position, int viewType) {
    if (viewTypeCount == 1) {
        currentScrapViews.put(position, scrap);
    } else {
        scrapViews[viewType].put(position, scrap);
    }

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        scrap.setAccessibilityDelegate(null);
    }
}
 
开发者ID:Loofer,项目名称:Watermark,代码行数:17,代码来源:RecyclingPagerAdapter.java

示例7: scrapActiveViews

import android.view.View; //导入方法依赖的package包/类
/**
 * Move all views remaining in activeViews to scrapViews.
 */
void scrapActiveViews() {
    final View[] activeViews = this.activeViews;
    final int[] activeViewTypes = this.activeViewTypes;
    final boolean multipleScraps = viewTypeCount > 1;

    SparseArray<View> scrapViews = currentScrapViews;
    final int count = activeViews.length;
    for (int i = count - 1; i >= 0; i--) {
        final View victim = activeViews[i];
        if (victim != null) {
            int whichScrap = activeViewTypes[i];

            activeViews[i] = null;
            activeViewTypes[i] = -1;

            if (!shouldRecycleViewType(whichScrap)) {
                continue;
            }

            if (multipleScraps) {
                scrapViews = this.scrapViews[whichScrap];
            }
            scrapViews.put(i, victim);

            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
                victim.setAccessibilityDelegate(null);
            }
        }
    }

    pruneScrapViews();
}
 
开发者ID:Loofer,项目名称:Watermark,代码行数:36,代码来源:RecyclingPagerAdapter.java

示例8: addScrapView

import android.view.View; //导入方法依赖的package包/类
/**
 * Put a view into the ScrapViews list. These views are unordered.
 * 
 * @param scrap
 *            The view to add
 */
@SuppressLint("NewApi")
void addScrapView(View scrap, int position, int viewType) {
	if (viewTypeCount == 1) {
		currentScrapViews.put(position, scrap);
	} else {
		scrapViews[viewType].put(position, scrap);
	}

	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
		scrap.setAccessibilityDelegate(null);
	}
}
 
开发者ID:snowwolf10285,项目名称:PicShow-zhaipin,代码行数:19,代码来源:RecycleBin.java

示例9: scrapActiveViews

import android.view.View; //导入方法依赖的package包/类
/** Move all views remaining in activeViews to scrapViews. */
@SuppressLint("NewApi")
void scrapActiveViews() {
	final View[] activeViews = this.activeViews;
	final int[] activeViewTypes = this.activeViewTypes;
	final boolean multipleScraps = viewTypeCount > 1;

	SparseArray<View> scrapViews = currentScrapViews;
	final int count = activeViews.length;
	for (int i = count - 1; i >= 0; i--) {
		final View victim = activeViews[i];
		if (victim != null) {
			int whichScrap = activeViewTypes[i];

			activeViews[i] = null;
			activeViewTypes[i] = -1;

			if (!shouldRecycleViewType(whichScrap)) {
				continue;
			}

			if (multipleScraps) {
				scrapViews = this.scrapViews[whichScrap];
			}
			scrapViews.put(i, victim);

			if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
				victim.setAccessibilityDelegate(null);
			}
		}
	}

	pruneScrapViews();
}
 
开发者ID:snowwolf10285,项目名称:PicShow-zhaipin,代码行数:35,代码来源:RecycleBin.java

示例10: addScrapView

import android.view.View; //导入方法依赖的package包/类
void addScrapView(View scrap, int position, int viewType) {
    if (this.viewTypeCount == 1) {
        this.currentScrapViews.put(position, scrap);
    } else {
        this.scrapViews[viewType].put(position, scrap);
    }
    if (VERSION.SDK_INT >= 14) {
        scrap.setAccessibilityDelegate(null);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:11,代码来源:RecycleBin.java

示例11: scrapActiveViews

import android.view.View; //导入方法依赖的package包/类
void scrapActiveViews() {
    boolean multipleScraps = true;
    View[] activeViews = this.activeViews;
    int[] activeViewTypes = this.activeViewTypes;
    if (this.viewTypeCount <= 1) {
        multipleScraps = false;
    }
    SparseArray<View> scrapViews = this.currentScrapViews;
    for (int i = activeViews.length - 1; i >= 0; i--) {
        View victim = activeViews[i];
        if (victim != null) {
            int whichScrap = activeViewTypes[i];
            activeViews[i] = null;
            activeViewTypes[i] = -1;
            if (shouldRecycleViewType(whichScrap)) {
                if (multipleScraps) {
                    scrapViews = this.scrapViews[whichScrap];
                }
                scrapViews.put(i, victim);
                if (VERSION.SDK_INT >= 14) {
                    victim.setAccessibilityDelegate(null);
                }
            }
        }
    }
    pruneScrapViews();
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:28,代码来源:RecycleBin.java

示例12: addDummyViews

import android.view.View; //导入方法依赖的package包/类
private void addDummyViews(PopupPopulator.Item[] itemTypesToPopulate,
        boolean notificationFooterHasIcons) {
    final Resources res = getResources();
    final int spacing = res.getDimensionPixelSize(R.dimen.popup_items_spacing);
    final LayoutInflater inflater = LayoutInflater.from(new ContextThemeWrapper(mLauncher, R.style.Base_Theme));

    int numItems = itemTypesToPopulate.length;
    for (int i = 0; i < numItems; i++) {
        PopupPopulator.Item itemTypeToPopulate = itemTypesToPopulate[i];
        PopupPopulator.Item nextItemTypeToPopulate =
                i < numItems - 1 ? itemTypesToPopulate[i + 1] : null;
        final View item = inflater.inflate(itemTypeToPopulate.layoutId, this, false);

        if (itemTypeToPopulate == PopupPopulator.Item.NOTIFICATION) {
            mNotificationItemView = (NotificationItemView) item;
            int footerHeight = notificationFooterHasIcons ?
                    res.getDimensionPixelSize(R.dimen.notification_footer_height) : 0;
            item.findViewById(R.id.footer).getLayoutParams().height = footerHeight;
            mNotificationItemView.getMainView().setAccessibilityDelegate(mAccessibilityDelegate);
        } else if (itemTypeToPopulate == PopupPopulator.Item.SHORTCUT) {
            item.setAccessibilityDelegate(mAccessibilityDelegate);
        }

        boolean shouldAddBottomMargin = nextItemTypeToPopulate != null
                && itemTypeToPopulate.isShortcut ^ nextItemTypeToPopulate.isShortcut;

        if (itemTypeToPopulate.isShortcut) {
            if (mShortcutsItemView == null) {
                mShortcutsItemView = (ShortcutsItemView) inflater.inflate(
                        R.layout.shortcuts_item, this, false);
                addView(mShortcutsItemView);
            }
            mShortcutsItemView.addShortcutView(item, itemTypeToPopulate);
            if (shouldAddBottomMargin) {
                ((LayoutParams) mShortcutsItemView.getLayoutParams()).bottomMargin = spacing;
            }
        } else {
            addView(item);
            if (shouldAddBottomMargin) {
                ((LayoutParams) item.getLayoutParams()).bottomMargin = spacing;
            }
        }
    }
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:45,代码来源:PopupContainerWithArrow.java

示例13: setAccessibilityDelegate

import android.view.View; //导入方法依赖的package包/类
public static void setAccessibilityDelegate(View v, @Nullable Object delegate) {
    v.setAccessibilityDelegate((AccessibilityDelegate) delegate);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:4,代码来源:ViewCompatICS.java

示例14: addScrapView

import android.view.View; //导入方法依赖的package包/类
/**
 * Put a view into the ScrapViews list. These views are unordered.
 * 
 * @param scrap
 *            The view to add
 */
@SuppressLint("NewApi")
public void addScrapView(View scrap, int position) {
	AbsHListView.LayoutParams lp = (AbsHListView.LayoutParams) scrap
			.getLayoutParams();
	if (lp == null) {
		return;
	}

	lp.scrappedFromPosition = position;

	// Don't put header or footer views or views that should be ignored
	// into the scrap heap
	int viewType = lp.viewType;

	final boolean scrapHasTransientState = android.os.Build.VERSION.SDK_INT >= 16 ? scrap
			.hasTransientState() : false;

	if (!shouldRecycleViewType(viewType) || scrapHasTransientState) {
		if (viewType != ITEM_VIEW_TYPE_HEADER_OR_FOOTER
				|| scrapHasTransientState) {
			if (mSkippedScrap == null) {
				mSkippedScrap = new ArrayList<View>();
			}
			mSkippedScrap.add(scrap);
		}
		if (scrapHasTransientState) {
			if (mTransientStateViews == null) {
				mTransientStateViews = new SparseArrayCompat<View>();
			}
			scrap.onStartTemporaryDetach();
			mTransientStateViews.put(position, scrap);
		}
		return;
	}

	scrap.onStartTemporaryDetach();
	if (mViewTypeCount == 1) {
		mCurrentScrap.add(scrap);
	} else {
		mScrapViews[viewType].add(scrap);
	}

	if (android.os.Build.VERSION.SDK_INT >= 14) {
		scrap.setAccessibilityDelegate(null);
	}

	if (mRecyclerListener != null) {
		mRecyclerListener.onMovedToScrapHeap(scrap);
	}
}
 
开发者ID:junchenChow,项目名称:exciting-app,代码行数:57,代码来源:AbsHListView.java

示例15: scrapActiveViews

import android.view.View; //导入方法依赖的package包/类
/**
 * Move all views remaining in mActiveViews to mScrapViews.
 */
@SuppressLint("NewApi")
public void scrapActiveViews() {
	final View[] activeViews = mActiveViews;
	final boolean hasListener = mRecyclerListener != null;
	final boolean multipleScraps = mViewTypeCount > 1;

	ArrayList<View> scrapViews = mCurrentScrap;
	final int count = activeViews.length;
	for (int i = count - 1; i >= 0; i--) {
		final View victim = activeViews[i];
		if (victim != null) {
			final AbsHListView.LayoutParams lp = (AbsHListView.LayoutParams) victim
					.getLayoutParams();
			int whichScrap = lp.viewType;

			activeViews[i] = null;

			final boolean scrapHasTransientState = android.os.Build.VERSION.SDK_INT >= 16 ? victim
					.hasTransientState() : false;
			if (!shouldRecycleViewType(whichScrap)
					|| scrapHasTransientState) {
				// Do not move views that should be ignored
				if (whichScrap != ITEM_VIEW_TYPE_HEADER_OR_FOOTER
						|| scrapHasTransientState) {
					removeDetachedView(victim, false);
				}
				if (scrapHasTransientState) {
					if (mTransientStateViews == null) {
						mTransientStateViews = new SparseArrayCompat<View>();
					}
					mTransientStateViews.put(mFirstActivePosition + i,
							victim);
				}
				continue;
			}

			if (multipleScraps) {
				scrapViews = mScrapViews[whichScrap];
			}
			victim.onStartTemporaryDetach();
			lp.scrappedFromPosition = mFirstActivePosition + i;
			scrapViews.add(victim);

			if (android.os.Build.VERSION.SDK_INT >= 14) {
				victim.setAccessibilityDelegate(null);
			}

			if (hasListener) {
				mRecyclerListener.onMovedToScrapHeap(victim);
			}
		}
	}

	pruneScrapViews();
}
 
开发者ID:junchenChow,项目名称:exciting-app,代码行数:59,代码来源:AbsHListView.java


注:本文中的android.view.View.setAccessibilityDelegate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。