當前位置: 首頁>>代碼示例>>Java>>正文


Java ViewDebug.trace方法代碼示例

本文整理匯總了Java中android.view.ViewDebug.trace方法的典型用法代碼示例。如果您正苦於以下問題:Java ViewDebug.trace方法的具體用法?Java ViewDebug.trace怎麽用?Java ViewDebug.trace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.view.ViewDebug的用法示例。


在下文中一共展示了ViewDebug.trace方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: makeAndAddView

import android.view.ViewDebug; //導入方法依賴的package包/類
/**
 * Obtain the view and add it to our list of children. The view can be made
 * fresh, converted from an unused view, or used as is if it was in the
 * recycle bin.
 *
 * @param position Logical position in the list
 * @param childrenBottomOrTop Top or bottom edge of the view to add
 * @param flow If flow is true, align top edge to y. If false, align bottom
 *        edge to y.
 * @param selected Is this position selected?
 * @return View that was added
 */
@SuppressWarnings("deprecation")
private View makeAndAddView(int position, int childrenBottomOrTop, boolean flow,
        boolean selected) {
    View child;

    int childrenLeft;
    if (!mDataChanged) {
        // Try to use an exsiting view for this position
        child = mRecycler.getActiveView(position);
        if (child != null) {

            if (ViewDebug.TRACE_RECYCLER) {
                ViewDebug.trace(child, ViewDebug.RecyclerTraceType.RECYCLE_FROM_ACTIVE_HEAP,
                        position, getChildCount());
            }

            // Found it -- we're using an existing child
            // This just needs to be positioned
            childrenLeft = getItemLeft(position);
            setupChild(child, position, childrenBottomOrTop, flow, childrenLeft, selected, true);
            return child;
        }
    }

    //Notify new item is added to view.

    onItemAddedToList( position, flow );
    childrenLeft = getItemLeft( position );

    // Make a new view for this position, or convert an unused view if possible
    DebugUtil.i("makeAndAddView:" + position);
    child = obtainView(position, mIsScrap);

    // This needs to be positioned and measured
    setupChild(child, position, childrenBottomOrTop, flow, childrenLeft, selected, mIsScrap[0]);

    return child;
}
 
開發者ID:Shmilyz,項目名稱:Swap,代碼行數:51,代碼來源:PLA_ListView.java

示例2: makeAndAddView

import android.view.ViewDebug; //導入方法依賴的package包/類
/**
 * Obtain the view and add it to our list of children. The view can be made
 * fresh, converted from an unused view, or used as is if it was in the
 * recycle bin.
 * 
 * @param position
 *            Logical position in the list
 * @param childrenBottomOrTop
 *            Top or bottom edge of the view to add
 * @param flow
 *            If flow is true, align top edge to y. If false, align bottom
 *            edge to y.
 * @param childrenLeft
 *            Left edge where children should be positioned
 * @param selected
 *            Is this position selected?
 * @return View that was added
 */
@SuppressWarnings("deprecation")
private View makeAndAddView(int position, int childrenBottomOrTop, boolean flow, boolean selected) {
    View child;

    int childrenLeft;
    if (!mDataChanged) {
        // Try to use an exsiting view for this position
        child = mRecycler.getActiveView(position);
        if (child != null) {

            if (ViewDebug.TRACE_RECYCLER) {
                ViewDebug.trace(child, ViewDebug.RecyclerTraceType.RECYCLE_FROM_ACTIVE_HEAP, position, getChildCount());
            }

            // Found it -- we're using an existing child
            // This just needs to be positioned
            childrenLeft = getItemLeft(position);
            setupChild(child, position, childrenBottomOrTop, flow, childrenLeft, selected, true);
            return child;
        }
    }

    // Notify new item is added to view.

    onItemAddedToList(position, flow);
    childrenLeft = getItemLeft(position);

    // Make a new view for this position, or convert an unused view if
    // possible
    child = obtainView(position, mIsScrap);

    // This needs to be positioned and measured
    setupChild(child, position, childrenBottomOrTop, flow, childrenLeft, selected, mIsScrap[0]);

    return child;
}
 
開發者ID:ysYvonne,項目名稱:KitchenSecret_Android,代碼行數:55,代碼來源:PLA_ListView.java

示例3: makeAndAddView

import android.view.ViewDebug; //導入方法依賴的package包/類
/**
 * Obtain the view and add it to our list of children. The view can be made
 * fresh, converted from an unused view, or used as is if it was in the
 * recycle bin.
 *
 * @param position Logical position in the list
 * @param childrenBottomOrTop Top or bottom edge of the view to add
 * @param flow If flow is true, align top edge to y. If false, align bottom
 *        edge to y.
 * @param selected Is this position selected?
 * @return View that was added
 */
@SuppressWarnings("deprecation")
private View makeAndAddView(int position, int childrenBottomOrTop, boolean flow,
        boolean selected) {
    View child;

    int childrenLeft;
    if (!mDataChanged) {
        // Try to use an exsiting view for this position
        child = mRecycler.getActiveView(position);
        if (child != null) {

            if (ViewDebug.TRACE_RECYCLER) {
                ViewDebug.trace(child, ViewDebug.RecyclerTraceType.RECYCLE_FROM_ACTIVE_HEAP,
                        position, getChildCount());
            }

            // Found it -- we're using an existing child
            // This just needs to be positioned
            childrenLeft = getItemLeft(position);
            setupChild(child, position, childrenBottomOrTop, flow, childrenLeft, selected, true);
            return child;
        }
    }

    //Notify new item is added to view.

    onItemAddedToList( position, flow );
    childrenLeft = getItemLeft( position );

    // Make a new view for this position, or convert an unused view if possible
    child = obtainView(position, mIsScrap);

    // This needs to be positioned and measured
    setupChild(child, position, childrenBottomOrTop, flow, childrenLeft, selected, mIsScrap[0]);

    return child;
}
 
開發者ID:Dreamer206602,項目名稱:SimplifyReader2,代碼行數:50,代碼來源:PLAListView.java

示例4: makeAndAddView

import android.view.ViewDebug; //導入方法依賴的package包/類
/**
     * Obtain the view and add it to our list of children. The view can be made
     * fresh, converted from an unused view, or used as is if it was in the
     * recycle bin.
     *
     * @param position Logical position in the list
     * @param y Top or bottom edge of the view to add
     * @param flow If flow is true, align top edge to y. If false, align bottom
     *        edge to y.
     * @param childrenLeft Left edge where children should be positioned
     * @param selected Is this position selected?
     * @return View that was added
     */
    private View makeAndAddView(int position, int y, boolean flow, int childrenLeft,
            boolean selected) {
        View child;

        if (!mDataChanged) {
            // Try to use an exsiting view for this position
            child = mRecycler.getActiveView(position);
//            Log.d("TAG", "get active view " + position + " is " + child);
            if (child != null) {
                if (ViewDebug.TRACE_RECYCLER) {
                    ViewDebug.trace(child, ViewDebug.RecyclerTraceType.RECYCLE_FROM_ACTIVE_HEAP,
                            position, getChildCount());
                }

                // Found it -- we're using an existing child
                // This just needs to be positioned
                setupChild(child, position, y, flow, childrenLeft, selected, true);

                return child;
            }
        }
        
        // Make a new view for this position, or convert an unused view if possible
//        Log.d("TAG", "obtain view " + position);
        child = obtainView(position, mIsScrap);
//        Log.d("TAG", "mIsScrap 0 is " + mIsScrap[0]);
        // This needs to be positioned and measured
        setupChild(child, position, y, flow, childrenLeft, selected, mIsScrap[0]);

        return child;
    }
 
開發者ID:cheyiliu,項目名稱:test4XXX,代碼行數:45,代碼來源:ListView.java

示例5: obtainView

import android.view.ViewDebug; //導入方法依賴的package包/類
/**
 * Get a view and have it show the data associated with the specified
 * position. This is called when we have already discovered that the view is
 * not available for reuse in the recycle bin. The only choices left are
 * converting an old view or making a new one.
 *
 * @param position The position to display
 * @param isScrap Array of at least 1 boolean, the first entry will become true if
 *                the returned view was taken from the scrap heap, false if otherwise.
 *
 * @return A view displaying the data associated with the specified position
 */
@SuppressWarnings("deprecation")
View obtainView(int position, boolean[] isScrap) {
    isScrap[0] = false;
    View scrapView;

    scrapView = mRecycler.getScrapView(position);

    View child;
    if (scrapView != null) {
        if (ViewDebug.TRACE_RECYCLER) {
            ViewDebug.trace(scrapView, ViewDebug.RecyclerTraceType.RECYCLE_FROM_SCRAP_HEAP,
                    position, -1);
        }

        child = mAdapter.getView(position, scrapView, this);

        if (ViewDebug.TRACE_RECYCLER) {
            ViewDebug.trace(child, ViewDebug.RecyclerTraceType.BIND_VIEW,
                    position, getChildCount());
        }

        if (child != scrapView) {
            DebugUtil.i("obtainView");
            mRecycler.addScrapView(scrapView);
            if (mCacheColorHint != 0) {
                child.setDrawingCacheBackgroundColor(mCacheColorHint);
            }
            if (ViewDebug.TRACE_RECYCLER) {
                ViewDebug.trace(scrapView, ViewDebug.RecyclerTraceType.MOVE_TO_SCRAP_HEAP,
                        position, -1);
            }
        } else {
            isScrap[0] = true;
            //child.dispatchFinishTemporaryDetach();
            dispatchFinishTemporaryDetach(child);
        }
    } else {
        DebugUtil.i("makeView:" + position);
        child = mAdapter.getView(position, null, this);
        if (mCacheColorHint != 0) {
            child.setDrawingCacheBackgroundColor(mCacheColorHint);
        }
        if (ViewDebug.TRACE_RECYCLER) {
            ViewDebug.trace(child, ViewDebug.RecyclerTraceType.NEW_VIEW,
                    position, getChildCount());
        }
    }

    return child;
}
 
開發者ID:Shmilyz,項目名稱:Swap,代碼行數:63,代碼來源:PLA_AbsListView.java

示例6: scrapActiveViews

import android.view.ViewDebug; //導入方法依賴的package包/類
/**
 * Move all views remaining in mActiveViews to mScrapViews.
 */
@SuppressWarnings("deprecation")
void scrapActiveViews() {
    final View[] activeViews = mActiveViews;
    final boolean hasListener = mRecyclerListener != null;
    final boolean multipleScraps = mViewTypeCount > 1;

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

            activeViews[i] = null;

            if (!shouldRecycleViewType(whichScrap)) {
                // Do not move views that should be ignored
                if (whichScrap != ITEM_VIEW_TYPE_HEADER_OR_FOOTER) {
                    removeDetachedView(victim, false);
                }
                continue;
            }

            if (multipleScraps) {
                scrapViews = mScrapViews[whichScrap];
            }
            //victim.dispatchStartTemporaryDetach();
            dispatchFinishTemporaryDetach(victim);
            DebugUtil.i("addToScrap from scrapActiveViews");
            scrapViews.add(victim);

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

            if (ViewDebug.TRACE_RECYCLER) {
                ViewDebug.trace(victim,
                        ViewDebug.RecyclerTraceType.MOVE_FROM_ACTIVE_TO_SCRAP_HEAP,
                        mFirstActivePosition + i, -1);
            }
        }
    }

    pruneScrapViews();
}
 
開發者ID:Shmilyz,項目名稱:Swap,代碼行數:49,代碼來源:PLA_AbsListView.java

示例7: obtainView

import android.view.ViewDebug; //導入方法依賴的package包/類
/**
 * Get a view and have it show the data associated with the specified
 * position. This is called when we have already discovered that the view is
 * not available for reuse in the recycle bin. The only choices left are
 * converting an old view or making a new one.
 *
 * @param position
 *            The position to display
 * @param isScrap
 *            Array of at least 1 boolean, the first entry will become true
 *            if the returned view was taken from the scrap heap, false if
 *            otherwise.
 *
 * @return A view displaying the data associated with the specified position
 */
@SuppressWarnings("deprecation")
View obtainView(int position, boolean[] isScrap) {
    isScrap[0] = false;
    View scrapView;

    scrapView = mRecycler.getScrapView(position);

    View child;
    if (scrapView != null) {
        if (ViewDebug.TRACE_RECYCLER) {
            ViewDebug.trace(scrapView, ViewDebug.RecyclerTraceType.RECYCLE_FROM_SCRAP_HEAP, position, -1);
        }

        child = mAdapter.getView(position, scrapView, this);

        if (ViewDebug.TRACE_RECYCLER) {
            ViewDebug.trace(child, ViewDebug.RecyclerTraceType.BIND_VIEW, position, getChildCount());
        }

        if (child != scrapView) {
            mRecycler.addScrapView(scrapView);
            if (mCacheColorHint != 0) {
                child.setDrawingCacheBackgroundColor(mCacheColorHint);
            }
            if (ViewDebug.TRACE_RECYCLER) {
                ViewDebug.trace(scrapView, ViewDebug.RecyclerTraceType.MOVE_TO_SCRAP_HEAP, position, -1);
            }
        } else {
            isScrap[0] = true;
            // child.dispatchFinishTemporaryDetach();
            dispatchFinishTemporaryDetach(child);
        }
    } else {
        child = mAdapter.getView(position, null, this);
        if (mCacheColorHint != 0) {
            child.setDrawingCacheBackgroundColor(mCacheColorHint);
        }
        if (ViewDebug.TRACE_RECYCLER) {
            ViewDebug.trace(child, ViewDebug.RecyclerTraceType.NEW_VIEW, position, getChildCount());
        }
    }

    return child;
}
 
開發者ID:ysYvonne,項目名稱:KitchenSecret_Android,代碼行數:60,代碼來源:PLA_AbsListView.java

示例8: scrapActiveViews

import android.view.ViewDebug; //導入方法依賴的package包/類
/**
 * Move all views remaining in mActiveViews to mScrapViews.
 */
@SuppressWarnings("deprecation")
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) {
            int whichScrap = ((PLA_AbsListView.LayoutParams) victim.getLayoutParams()).viewType;

            activeViews[i] = null;

            if (!shouldRecycleViewType(whichScrap)) {
                // Do not move views that should be ignored
                if (whichScrap != ITEM_VIEW_TYPE_HEADER_OR_FOOTER) {
                    removeDetachedView(victim, false);
                }
                continue;
            }

            if (multipleScraps) {
                scrapViews = mScrapViews[whichScrap];
            }
            // victim.dispatchStartTemporaryDetach();
            dispatchFinishTemporaryDetach(victim);
            scrapViews.add(victim);

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

            if (ViewDebug.TRACE_RECYCLER) {
                ViewDebug.trace(victim, ViewDebug.RecyclerTraceType.MOVE_FROM_ACTIVE_TO_SCRAP_HEAP, mFirstActivePosition + i, -1);
            }
        }
    }

    pruneScrapViews();
}
 
開發者ID:ysYvonne,項目名稱:KitchenSecret_Android,代碼行數:46,代碼來源:PLA_AbsListView.java

示例9: obtainView

import android.view.ViewDebug; //導入方法依賴的package包/類
/**
 * Get a view and have it show the data associated with the specified
 * position. This is called when we have already discovered that the view is
 * not available for reuse in the recycle bin. The only choices left are
 * converting an old view or making a new one.
 *
 * @param position The position to display
 * @param isScrap Array of at least 1 boolean, the first entry will become true if
 *                the returned view was taken from the scrap heap, false if otherwise.
 *
 * @return A view displaying the data associated with the specified position
 */
@SuppressWarnings("deprecation")
View obtainView(int position, boolean[] isScrap) {
    isScrap[0] = false;
    View scrapView;

    scrapView = mRecycler.getScrapView(position);

    View child;
    if (scrapView != null) {
        if (ViewDebug.TRACE_RECYCLER) {
            ViewDebug.trace(scrapView, ViewDebug.RecyclerTraceType.RECYCLE_FROM_SCRAP_HEAP,
                    position, -1);
        }

        child = mAdapter.getView(position, scrapView, this);

        if (ViewDebug.TRACE_RECYCLER) {
            ViewDebug.trace(child, ViewDebug.RecyclerTraceType.BIND_VIEW,
                    position, getChildCount());
        }

        if (child != scrapView) {
            mRecycler.addScrapView(scrapView);
            if (mCacheColorHint != 0) {
                child.setDrawingCacheBackgroundColor(mCacheColorHint);
            }
            if (ViewDebug.TRACE_RECYCLER) {
                ViewDebug.trace(scrapView, ViewDebug.RecyclerTraceType.MOVE_TO_SCRAP_HEAP,
                        position, -1);
            }
        } else {
            isScrap[0] = true;
            //child.dispatchFinishTemporaryDetach();
            dispatchFinishTemporaryDetach(child);
        }
    } else {
        child = mAdapter.getView(position, null, this);
        if (mCacheColorHint != 0) {
            child.setDrawingCacheBackgroundColor(mCacheColorHint);
        }
        if (ViewDebug.TRACE_RECYCLER) {
            ViewDebug.trace(child, ViewDebug.RecyclerTraceType.NEW_VIEW,
                    position, getChildCount());
        }
    }

    return child;
}
 
開發者ID:Dreamer206602,項目名稱:SimplifyReader2,代碼行數:61,代碼來源:PLAAbsListView.java

示例10: scrapActiveViews

import android.view.ViewDebug; //導入方法依賴的package包/類
/**
 * Move all views remaining in mActiveViews to mScrapViews.
 */
@SuppressWarnings("deprecation")
void scrapActiveViews() {
    final View[] activeViews = mActiveViews;
    final boolean hasListener = mRecyclerListener != null;
    final boolean multipleScraps = mViewTypeCount > 1;

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

            activeViews[i] = null;

            if (!shouldRecycleViewType(whichScrap)) {
                // Do not move views that should be ignored
                if (whichScrap != ITEM_VIEW_TYPE_HEADER_OR_FOOTER) {
                    removeDetachedView(victim, false);
                }
                continue;
            }

            if (multipleScraps) {
                scrapViews = mScrapViews[whichScrap];
            }
            //victim.dispatchStartTemporaryDetach();
            dispatchFinishTemporaryDetach(victim);
            scrapViews.add(victim);

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

            if (ViewDebug.TRACE_RECYCLER) {
                ViewDebug.trace(victim,
                        ViewDebug.RecyclerTraceType.MOVE_FROM_ACTIVE_TO_SCRAP_HEAP,
                        mFirstActivePosition + i, -1);
            }
        }
    }

    pruneScrapViews();
}
 
開發者ID:Dreamer206602,項目名稱:SimplifyReader2,代碼行數:48,代碼來源:PLAAbsListView.java

示例11: obtainView

import android.view.ViewDebug; //導入方法依賴的package包/類
/**
 * Get a view and have it show the data associated with the specified
 * position. This is called when we have already discovered that the view is
 * not available for reuse in the recycle bin. The only choices left are
 * converting an old view or making a new one.
 *
 * @param position The position to display
 * @param isScrap Array of at least 1 boolean, the first entry will become true if
 *                the returned view was taken from the scrap heap, false if otherwise.
 * 
 * @return A view displaying the data associated with the specified position
 */
View obtainView(int position, boolean[] isScrap) {
	isScrap[0] = false;
	View scrapView;

	scrapView = mRecycler.getScrapView(position);

	View child;
	if (scrapView != null) {
		if (ViewDebug.TRACE_RECYCLER) {
			ViewDebug.trace(scrapView, ViewDebug.RecyclerTraceType.RECYCLE_FROM_SCRAP_HEAP,
					position, -1);
		}

		child = mAdapter.getView(position, scrapView, this);

		if (ViewDebug.TRACE_RECYCLER) {
			ViewDebug.trace(child, ViewDebug.RecyclerTraceType.BIND_VIEW,
					position, getChildCount());
		}

		if (child != scrapView) {
			mRecycler.addScrapView(scrapView);
			if (mCacheColorHint != 0) {
				child.setDrawingCacheBackgroundColor(mCacheColorHint);
			}
			if (ViewDebug.TRACE_RECYCLER) {
				ViewDebug.trace(scrapView, ViewDebug.RecyclerTraceType.MOVE_TO_SCRAP_HEAP,
						position, -1);
			}
		} else {
			isScrap[0] = true;
			child.onFinishTemporaryDetach();
		}
	} else {
		child = mAdapter.getView(position, null, this);
		if (mCacheColorHint != 0) {
			child.setDrawingCacheBackgroundColor(mCacheColorHint);
		}
		if (ViewDebug.TRACE_RECYCLER) {
			ViewDebug.trace(child, ViewDebug.RecyclerTraceType.NEW_VIEW,
					position, getChildCount());
		}
	}

	return child;
}
 
開發者ID:amirarcane,項目名稱:recent-images,代碼行數:59,代碼來源:TwoWayAbsListView.java

示例12: scrapActiveViews

import android.view.ViewDebug; //導入方法依賴的package包/類
/**
 * Move all views remaining in mActiveViews to mScrapViews.
 */
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) {
			int whichScrap = ((TwoWayAbsListView.LayoutParams) victim.getLayoutParams()).viewType;

			activeViews[i] = null;

			if (!shouldRecycleViewType(whichScrap)) {
				// Do not move views that should be ignored
				if (whichScrap != ITEM_VIEW_TYPE_HEADER_OR_FOOTER) {
					removeDetachedView(victim, false);
				}
				continue;
			}

			if (multipleScraps) {
				scrapViews = mScrapViews[whichScrap];
			}
			victim.onStartTemporaryDetach();
			scrapViews.add(victim);

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

			if (ViewDebug.TRACE_RECYCLER) {
				ViewDebug.trace(victim,
						ViewDebug.RecyclerTraceType.MOVE_FROM_ACTIVE_TO_SCRAP_HEAP,
						mFirstActivePosition + i, -1);
			}
		}
	}

	pruneScrapViews();
}
 
開發者ID:amirarcane,項目名稱:recent-images,代碼行數:46,代碼來源:TwoWayAbsListView.java

示例13: obtainView

import android.view.ViewDebug; //導入方法依賴的package包/類
/**
	 * Get a view and have it show the data associated with the specified
	 * position. This is called when we have already discovered that the view is
	 * not available for reuse in the recycle bin. The only choices left are
	 * converting an old view or making a new one.
	 * 
	 * @param position
	 *            The position to display
	 * @param isScrap
	 *            Array of at least 1 boolean, the first entry will become true
	 *            if the returned view was taken from the scrap heap, false if
	 *            otherwise.
	 * 
	 * @return A view displaying the data associated with the specified position
	 */
	View obtainView(int position, boolean[] isScrap) {
		isScrap[0] = false;
		View scrapView;

		scrapView = mRecycler.getScrapView(position);
//		Log.d("TAG", "obtain the scrap view is " + scrapView);
		View child;
		if (scrapView != null) {
			if (ViewDebug.TRACE_RECYCLER) {
				ViewDebug.trace(scrapView, ViewDebug.RecyclerTraceType.RECYCLE_FROM_SCRAP_HEAP,
						position, -1);
			}
			child = mAdapter.getView(position, scrapView, this);

			if (ViewDebug.TRACE_RECYCLER) {
				ViewDebug.trace(child, ViewDebug.RecyclerTraceType.BIND_VIEW, position,
						getChildCount());
			}
//			Log.d("TAG", "obtain the scrap view child is same with scrap " + (child == scrapView));
			if (child != scrapView) {
				mRecycler.addScrapView(scrapView);
				if (mCacheColorHint != 0) {
					child.setDrawingCacheBackgroundColor(mCacheColorHint);
				}
				if (ViewDebug.TRACE_RECYCLER) {
					ViewDebug.trace(scrapView, ViewDebug.RecyclerTraceType.MOVE_TO_SCRAP_HEAP,
							position, -1);
				}
			} else {
				isScrap[0] = true;
				dispatchFinishTemporaryDetach(child);
			}
		} else {
			child = mAdapter.getView(position, null, this);
			if (mCacheColorHint != 0) {
				child.setDrawingCacheBackgroundColor(mCacheColorHint);
			}
			if (ViewDebug.TRACE_RECYCLER) {
				ViewDebug.trace(child, ViewDebug.RecyclerTraceType.NEW_VIEW, position,
						getChildCount());
			}
		}
//		Log.d("TAG", "mIsScrap 0 in obtainView is " + isScrap[0]);
		return child;
	}
 
開發者ID:cheyiliu,項目名稱:test4XXX,代碼行數:61,代碼來源:AbsListView.java

示例14: scrapActiveViews

import android.view.ViewDebug; //導入方法依賴的package包/類
/**
		 * Move all views remaining in mActiveViews to mScrapViews.
		 */
		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) {
					int whichScrap = ((AbsListView.LayoutParams) victim.getLayoutParams()).viewType;

					activeViews[i] = null;

					if (!shouldRecycleViewType(whichScrap)) {
						// Do not move views that should be ignored
						if (whichScrap != ITEM_VIEW_TYPE_HEADER_OR_FOOTER) {
							removeDetachedView(victim, false);
						}
						continue;
					}

					if (multipleScraps) {
						scrapViews = mScrapViews[whichScrap];
					}
//					victim.dispatchStartTemporaryDetach();
					dispatchFinishTemporaryDetach(victim);
					scrapViews.add(victim);

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

					if (ViewDebug.TRACE_RECYCLER) {
						ViewDebug.trace(victim,
								ViewDebug.RecyclerTraceType.MOVE_FROM_ACTIVE_TO_SCRAP_HEAP,
								mFirstActivePosition + i, -1);
					}
				}
			}

			pruneScrapViews();
		}
 
開發者ID:cheyiliu,項目名稱:test4XXX,代碼行數:47,代碼來源:AbsListView.java


注:本文中的android.view.ViewDebug.trace方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。