android.view.View#setAccessibilityDelegate ( )源码实例Demo

下面列出了android.view.View#setAccessibilityDelegate ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: ans-android-sdk   文件: BaseViewVisitor.java
@Override
public void cleanup() {
    for (final Map.Entry<View, TrackingAccessibilityDelegate> entry :
            mWatching.entrySet()) {
        final View v = entry.getKey();
        final TrackingAccessibilityDelegate toCleanup = entry.getValue();
        final View.AccessibilityDelegate currentViewDelegate = getOldDelegate(v);
        if (currentViewDelegate == toCleanup) {
            v.setAccessibilityDelegate(toCleanup.getRealDelegate());
        } else if (currentViewDelegate instanceof TrackingAccessibilityDelegate) {
            final TrackingAccessibilityDelegate newChain =
                    (TrackingAccessibilityDelegate) currentViewDelegate;
            newChain.removeFromDelegateChain(toCleanup);
        } else {
            // Assume we've been replaced, zeroed out, or for some other reason we're
            // already gone.
            // (This isn't too weird, for example, it's expected when views get recycled)
        }
    }
    mWatching.clear();
}
 
源代码2 项目: Dashchan   文件: DrawerLayout.java
@Override
public void addView(View child, int index, ViewGroup.LayoutParams params) {
	super.addView(child, index, params);

	final View openDrawer = findOpenDrawer();
	if (openDrawer != null || isDrawerView(child)) {
		// A drawer is already open or the new view is a drawer, so the
		// new view should start out hidden.
		child.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);
	} else {
		// Otherwise this is a content view and no drawer is open, so the
		// new view should start out visible.
		child.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);
	}

	// We only need a delegate here if the framework doesn't understand
	// NO_HIDE_DESCENDANTS importance.
	if (!CAN_HIDE_DESCENDANTS) {
		child.setAccessibilityDelegate(mChildAccessibilityDelegate);
	}
}
 
源代码3 项目: letv   文件: AbsHListView.java
@SuppressLint({"NewApi"})
public void reclaimViews(List<View> views) {
    int childCount = getChildCount();
    RecyclerListener listener = RecycleBin.access$2200(this.mRecycler);
    for (int i = 0; i < childCount; i++) {
        View child = getChildAt(i);
        LayoutParams lp = (LayoutParams) child.getLayoutParams();
        if (lp != null && this.mRecycler.shouldRecycleViewType(lp.viewType)) {
            views.add(child);
            if (VERSION.SDK_INT >= 14) {
                child.setAccessibilityDelegate(null);
            }
            if (listener != null) {
                listener.onMovedToScrapHeap(child);
            }
        }
    }
    this.mRecycler.reclaimScrapViews(views);
    removeAllViewsInLayout();
}
 
源代码4 项目: Noyze   文件: RecycleBin.java
/** 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);

            victim.setAccessibilityDelegate(null);
        }
    }

    pruneScrapViews();
}
 
源代码5 项目: UltimateAndroid   文件: Recycler.java
/**
 * Put a view into the ScrapViews list. These views are unordered.
 * 
 * @param scrap
 *            The view to add
 */
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
void addScrapView(View scrap, int position, int viewType) {
	// create a new Scrap
	Scrap item = new Scrap(scrap, true);
	
	if (viewTypeCount == 1) {
		currentScraps.put(position, item);
	} else {
		scraps[viewType].put(position, item);
	}
	if (Build.VERSION.SDK_INT >= 14) {
		scrap.setAccessibilityDelegate(null);
	}
}
 
源代码6 项目: tubatu-viewpager   文件: RecycleBin.java
/**
 * 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();
}
 
源代码7 项目: salvage   文件: RecycleBin.java
/**
 * 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);
  }
}
 
源代码8 项目: ParallaxViewPager   文件: RecycleBin.java
/**
 * 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);
  }
}
 
源代码9 项目: ParallaxViewPager   文件: RecycleBin.java
/** 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();
}
 
源代码10 项目: AndroidAnimationExercise   文件: Recycler.java
/**
 * Put a view into the ScrapViews list. These views are unordered.
 * 
 * @param scrap
 *            The view to add
 */
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
void addScrapView(View scrap, int position, int viewType) {
	// create a new Scrap
	Scrap item = new Scrap(scrap, true);
	
	if (viewTypeCount == 1) {
		currentScraps.put(position, item);
	} else {
		scraps[viewType].put(position, item);
	}
	if (Build.VERSION.SDK_INT >= 14) {
		scrap.setAccessibilityDelegate(null);
	}
}
 
源代码11 项目: SprintNBA   文件: RecycleBin.java
/**
 * 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);
	}
}
 
源代码12 项目: SprintNBA   文件: RecycleBin.java
/** 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();
}
 
源代码13 项目: InfiniteViewPager   文件: RecycleBin.java
/**
 * 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);
  }
}
 
源代码14 项目: Noyze   文件: RecycleBin.java
/** 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);

            victim.setAccessibilityDelegate(null);
        }
    }

    pruneScrapViews();
}
 
源代码15 项目: UltimateAndroid   文件: Recycler.java
/**
 * Put a view into the ScrapViews list. These views are unordered.
 * 
 * @param scrap
 *            The view to add
 */
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
void addScrapView(View scrap, int position, int viewType) {
	// create a new Scrap
	Scrap item = new Scrap(scrap, true);
	
	if (viewTypeCount == 1) {
		currentScraps.put(position, item);
	} else {
		scraps[viewType].put(position, item);
	}
	if (Build.VERSION.SDK_INT >= 14) {
		scrap.setAccessibilityDelegate(null);
	}
}
 
源代码16 项目: tubatu-viewpager   文件: RecycleBin.java
/**
 * 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);
    }
}
 
源代码17 项目: COCOFramework   文件: RecycleBin.java
/**
 * 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);
    }
}
 
源代码18 项目: CodenameOne   文件: ViewCompatICS.java
public static void setAccessibilityDelegate(View v, Object delegate) {
    v.setAccessibilityDelegate((AccessibilityDelegate) delegate);
}
 
源代码19 项目: MiBandDecompiled   文件: al.java
public static void a(View view, Object obj)
{
    view.setAccessibilityDelegate((android.view.View.AccessibilityDelegate)obj);
}
 
源代码20 项目: guideshow   文件: ViewCompatICS.java
public static void setAccessibilityDelegate(View v, Object delegate) {
    v.setAccessibilityDelegate((AccessibilityDelegate) delegate);
}
 
 方法所在类
 同类方法