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


Java View.onStartTemporaryDetach方法代码示例

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


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

示例1: dispatchStartTemporaryDetach

import android.view.View; //导入方法依赖的package包/类
public void dispatchStartTemporaryDetach(View view) {
    if (!this.mTempDetachBound) {
        bindTempDetach();
    }
    if (this.mDispatchStartTemporaryDetach != null) {
        try {
            this.mDispatchStartTemporaryDetach.invoke(view, new Object[0]);
            return;
        } catch (Exception e) {
            Log.d("ViewCompat", "Error calling dispatchStartTemporaryDetach", e);
            return;
        }
    }
    view.onStartTemporaryDetach();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:16,代码来源:ViewCompat.java

示例2: 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

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