@Override public boolean hasTransientState(@NonNull View view) { return view.hasTransientState(); } }
attributes.add(new ViewAttribute<>("HasFocusable", view.hasFocusable())); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { attributes.add(new ViewAttribute<>("HasTransientState", view.hasTransientState()));
public static boolean hasTransientState(View view) { return view.hasTransientState(); }
/** * Makes sure that the size of mScrapViews does not exceed the size of mActiveViews. (This can happen if an adapter does not * recycle its views). */ @SuppressLint ( "NewApi" ) private void pruneScrapViews() { final int maxViews = mActiveViews.length; final int viewTypeCount = mViewTypeCount; final ArrayList<View>[] scrapViews = mScrapViews; for ( int i = 0; i < viewTypeCount; ++i ) { final ArrayList<View> scrapPile = scrapViews[i]; int size = scrapPile.size(); final int extras = size - maxViews; size--; for ( int j = 0; j < extras; j++ ) { removeDetachedView( scrapPile.remove( size-- ), false ); } } if ( mTransientStateViews != null ) { for ( int i = 0; i < mTransientStateViews.size(); i++ ) { final View v = mTransientStateViews.valueAt( i ); // this code is never executed on android < 16 if ( !v.hasTransientState() ) { mTransientStateViews.removeAt( i ); i--; } } } }
final boolean scrapHasTransientState = android.os.Build.VERSION.SDK_INT >= 16 ? scrap.hasTransientState() : false;
final boolean scrapHasTransientState = android.os.Build.VERSION.SDK_INT >= 16 ? victim.hasTransientState() : false; if ( !shouldRecycleViewType( whichScrap ) || scrapHasTransientState ) {
data.put("WindowSystemUiVisibility", v.getWindowSystemUiVisibility());//16; data.put("HasOverlappingRendering", v.hasOverlappingRendering());//16 data.put("HasTransientState", v.hasTransientState());//16