當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。