本文整理匯總了Java中com.mikepenz.materialdrawer.util.RecyclerViewCacheUtil類的典型用法代碼示例。如果您正苦於以下問題:Java RecyclerViewCacheUtil類的具體用法?Java RecyclerViewCacheUtil怎麽用?Java RecyclerViewCacheUtil使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
RecyclerViewCacheUtil類屬於com.mikepenz.materialdrawer.util包,在下文中一共展示了RecyclerViewCacheUtil類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: DrawerBuilder
import com.mikepenz.materialdrawer.util.RecyclerViewCacheUtil; //導入依賴的package包/類
/**
* default constructor
*/
public DrawerBuilder() {
//make sure there are no elements in the cache from the previous activity
//this should only happen and cause troubles if you switch themes over activities
//but to make sure it works ;)
RecyclerViewCacheUtil.getInstance().clear();
}
示例2: onCreateViewHolder
import com.mikepenz.materialdrawer.util.RecyclerViewCacheUtil; //導入依賴的package包/類
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//first check if we (probably) have this item in the cache
RecyclerView.ViewHolder vh = RecyclerViewCacheUtil.getInstance().obtain(mTypeIds.get(viewType));
if (vh == null) {
return mTypeInstances.get(mTypeIds.get(viewType)).getViewHolder(parent);
} else {
return vh;
}
}