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


Java StaggeredGridLayoutManager.LayoutParams方法代碼示例

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


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

示例1: onCreateViewHolder

import android.support.v7.widget.StaggeredGridLayoutManager; //導入方法依賴的package包/類
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View itemView = null;
    if (viewType == TYPE_HEADER) {
        itemView = headerView;
    } else if (viewType == TYPE_FOOTER) {
        itemView = footerView;
    }
    if (itemView != null) {
        //set StaggeredGridLayoutManager header & footer view
        if (layoutManager instanceof StaggeredGridLayoutManager) {
            ViewGroup.LayoutParams targetParams = itemView.getLayoutParams();
            StaggeredGridLayoutManager.LayoutParams StaggerLayoutParams;
            if (targetParams != null) {
                StaggerLayoutParams = new StaggeredGridLayoutManager.LayoutParams(targetParams.width, targetParams.height);
            } else {
                StaggerLayoutParams = new StaggeredGridLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
            }
            StaggerLayoutParams.setFullSpan(true);
            itemView.setLayoutParams(StaggerLayoutParams);
        }
        return new RecyclerView.ViewHolder(itemView) {
        };
    }
    return super.onCreateViewHolder(parent, viewType);
}
 
開發者ID:7763sea,項目名稱:VirtualHook,代碼行數:27,代碼來源:SmartRecyclerAdapter.java

示例2: onBindViewHolder

import android.support.v7.widget.StaggeredGridLayoutManager; //導入方法依賴的package包/類
@Override
public void onBindViewHolder( BaseViewHolder viewHolder, final int position ){
    super.onBindViewHolder( viewHolder, position );
    BaseItem i = getPresenter().getItem( position );
    if( getItemViewType( position ) == TYPE_BEER_PRODUCT ){
        final BeerProductItem item = (BeerProductItem) i;
        BeerProductHolder holder = (BeerProductHolder) viewHolder;
        holder.onBind( item );
        holder.setOnClickBeerListener( onClickBeer( item ) );
    }else if( getItemViewType( position ) == BaseItemType.TYPE_PROGRESS ){
        StaggeredGridLayoutManager.LayoutParams layoutParams =
                (StaggeredGridLayoutManager.LayoutParams) viewHolder.itemView.getLayoutParams();
        layoutParams.setFullSpan( true );
        viewHolder.itemView.setLayoutParams( layoutParams );
    }
}
 
開發者ID:TheKhaeng,項目名稱:nongbeer-mvp-android-demo,代碼行數:17,代碼來源:BeerProductAdapter.java

示例3: ExpandableHeaderViewHolder

import android.support.v7.widget.StaggeredGridLayoutManager; //導入方法依賴的package包/類
ExpandableHeaderViewHolder(View view, FlexibleAdapter adapter) {
	super(view, adapter, true);//True for sticky
	mTitle = (TextView) view.findViewById(R.id.title);
	mSubtitle = (TextView) view.findViewById(R.id.subtitle);
	this.mHandleView = (ImageView) view.findViewById(R.id.row_handle);
	if (adapter.isHandleDragEnabled()) {
		this.mHandleView.setVisibility(View.VISIBLE);
		setDragHandleView(mHandleView);
	} else {
		this.mHandleView.setVisibility(View.GONE);
	}

	//Support for StaggeredGridLayoutManager
	if (itemView.getLayoutParams() instanceof StaggeredGridLayoutManager.LayoutParams) {
		((StaggeredGridLayoutManager.LayoutParams) itemView.getLayoutParams()).setFullSpan(true);
	}
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:18,代碼來源:ExpandableHeaderItem.java

示例4: onViewAttachedToWindow

import android.support.v7.widget.StaggeredGridLayoutManager; //導入方法依賴的package包/類
@Override
public void onViewAttachedToWindow(RecyclerView.ViewHolder holder) {
    super.onViewAttachedToWindow(holder);
    ViewGroup.LayoutParams lp = holder.itemView.getLayoutParams();
    if (lp != null
            && lp instanceof StaggeredGridLayoutManager.LayoutParams
            && (isHeader(holder.getLayoutPosition()) || isRefreshHeader(holder.getLayoutPosition()) || isFooter(holder.getLayoutPosition()))) {
        StaggeredGridLayoutManager.LayoutParams p = (StaggeredGridLayoutManager.LayoutParams) lp;
        p.setFullSpan(true);
    }
    adapter.onViewAttachedToWindow(holder);
}
 
開發者ID:Mrqinlei,項目名稱:ImitateZHRB,代碼行數:13,代碼來源:XRecyclerView.java

示例5: onViewAttachedToWindow

import android.support.v7.widget.StaggeredGridLayoutManager; //導入方法依賴的package包/類
@Override
public void onViewAttachedToWindow(XViewHolder holder) {
    super.onViewAttachedToWindow(holder);
    int position = holder.getLayoutPosition();
    if (isFooterPosition(position)||isHeaderPosition(position)) {
        ViewGroup.LayoutParams lp = holder.itemView.getLayoutParams();
        if (lp != null && lp instanceof StaggeredGridLayoutManager.LayoutParams) {
            StaggeredGridLayoutManager.LayoutParams p = (StaggeredGridLayoutManager.LayoutParams) lp;
            p.setFullSpan(true);
        }
    }
}
 
開發者ID:youth5201314,項目名稱:XFrame,代碼行數:13,代碼來源:XRecyclerViewAdapter.java

示例6: onViewAttachedToWindow

import android.support.v7.widget.StaggeredGridLayoutManager; //導入方法依賴的package包/類
@Override
public void onViewAttachedToWindow(BaseRecyclerViewHolder holder)
{
    super.onViewAttachedToWindow(holder);
    ViewGroup.LayoutParams lp = holder.itemView.getLayoutParams();
    if (lp != null && lp instanceof StaggeredGridLayoutManager.LayoutParams && holder.getLayoutPosition() == 0)
    {
        StaggeredGridLayoutManager.LayoutParams p = (StaggeredGridLayoutManager.LayoutParams)lp;
        p.setFullSpan(true);
    }
}
 
開發者ID:Dreamxiaoxuan,項目名稱:AndroidTvDemo,代碼行數:12,代碼來源:BaseRecyclerViewAdapter.java

示例7: onViewAttachedToWindow

import android.support.v7.widget.StaggeredGridLayoutManager; //導入方法依賴的package包/類
@Override
public void onViewAttachedToWindow(ViewHolder holder) {
    super.onViewAttachedToWindow(holder);
    ViewGroup.LayoutParams lp = holder.itemView.getLayoutParams();
    if (lp != null
            && lp instanceof StaggeredGridLayoutManager.LayoutParams
            && (isFooter(holder.getLayoutPosition()))) {
        StaggeredGridLayoutManager.LayoutParams p = (StaggeredGridLayoutManager.LayoutParams) lp;
        p.setFullSpan(true);
    }
    adapter.onViewAttachedToWindow(holder);
}
 
開發者ID:jiang111,項目名稱:MultiRecyclerView,代碼行數:13,代碼來源:MultiRecyclerView.java

示例8: onViewAttachedToWindow

import android.support.v7.widget.StaggeredGridLayoutManager; //導入方法依賴的package包/類
@Override
public void onViewAttachedToWindow(RecyclerView.ViewHolder holder) {
    super.onViewAttachedToWindow(holder);
    ViewGroup.LayoutParams lp = holder.itemView.getLayoutParams();
    if (lp != null
            && lp instanceof StaggeredGridLayoutManager.LayoutParams
            && (isHeader(holder.getLayoutPosition()) || isFooter(holder.getLayoutPosition()))) {
        StaggeredGridLayoutManager.LayoutParams p = (StaggeredGridLayoutManager.LayoutParams) lp;
        p.setFullSpan(true);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:12,代碼來源:WrapAdapter.java

示例9: setFullSpan

import android.support.v7.widget.StaggeredGridLayoutManager; //導入方法依賴的package包/類
public static void setFullSpan(RecyclerView.ViewHolder holder)
{
    ViewGroup.LayoutParams lp = holder.itemView.getLayoutParams();

    if (lp != null
            && lp instanceof StaggeredGridLayoutManager.LayoutParams)
    {

        StaggeredGridLayoutManager.LayoutParams p = (StaggeredGridLayoutManager.LayoutParams) lp;

        p.setFullSpan(true);
    }
}
 
開發者ID:codeccc,項目名稱:baselibrary-master,代碼行數:14,代碼來源:WrapperUtils.java

示例10: onViewAttachedToWindow

import android.support.v7.widget.StaggeredGridLayoutManager; //導入方法依賴的package包/類
@Override
public void onViewAttachedToWindow(ViewHolder holder) {
    super.onViewAttachedToWindow(holder);
    ViewGroup.LayoutParams lp = holder.itemView.getLayoutParams();
    if (lp != null
            && lp instanceof StaggeredGridLayoutManager.LayoutParams
            && (isHeader(holder.getLayoutPosition()) || isFooter(holder.getLayoutPosition()))) {
        StaggeredGridLayoutManager.LayoutParams p = (StaggeredGridLayoutManager.LayoutParams) lp;
        p.setFullSpan(true);
    }
}
 
開發者ID:fengdongfei,項目名稱:CXJPadProject,代碼行數:12,代碼來源:YRecycleview.java

示例11: refreshAdapter

import android.support.v7.widget.StaggeredGridLayoutManager; //導入方法依賴的package包/類
private void refreshAdapter(BaseRecyclerAdapter adapter, RecyclerView.LayoutManager manager) {
    if (false && adapter != null && manager != null && !mRefreshAdapter && !hasLoadCompleted()) {
        if (!(manager instanceof GridLayoutManager)) {
            View footerView = adapter.getCustomLoadMoreView();
            if (footerView != null) {
                ViewGroup.LayoutParams layoutParams = footerView.getLayoutParams();
                if (layoutParams instanceof StaggeredGridLayoutManager.LayoutParams) {
                    Utils.setFullSpan((StaggeredGridLayoutManager.LayoutParams) layoutParams);
                    mRefreshAdapter = true;
                }
            }
        }
    }
}
 
開發者ID:LonelyMushroom,項目名稱:aarLibrary,代碼行數:15,代碼來源:XRefreshContentView.java

示例12: onViewAttachedToWindow

import android.support.v7.widget.StaggeredGridLayoutManager; //導入方法依賴的package包/類
@Override
public void onViewAttachedToWindow(RecyclerView.ViewHolder holder) {
    super.onViewAttachedToWindow(holder);
    ViewGroup.LayoutParams lp = holder.itemView.getLayoutParams();
    if (lp != null
            && lp instanceof StaggeredGridLayoutManager.LayoutParams
            && holder.getLayoutPosition() == adapter.getItemCount()) {
        StaggeredGridLayoutManager.LayoutParams p = (StaggeredGridLayoutManager.LayoutParams) lp;
        p.setFullSpan(true);
    }
}
 
開發者ID:yanyiqun001,項目名稱:goRefresh,代碼行數:12,代碼來源:RvLoadMoreWrapper.java

示例13: onViewAttachedToWindow

import android.support.v7.widget.StaggeredGridLayoutManager; //導入方法依賴的package包/類
public static void onViewAttachedToWindow(RecyclerView.ViewHolder holder, RecyclerView.Adapter adapter, int pinnedHeaderType) {
    // 如果是瀑布流布局,這裏處理標簽的布局占滿一行
    final ViewGroup.LayoutParams lp = holder.itemView.getLayoutParams();
    if (lp instanceof StaggeredGridLayoutManager.LayoutParams) {
        final StaggeredGridLayoutManager.LayoutParams slp = (StaggeredGridLayoutManager.LayoutParams) lp;
        slp.setFullSpan(adapter.getItemViewType(holder.getLayoutPosition()) == pinnedHeaderType);
    }
}
 
開發者ID:yedashen,項目名稱:UltimateRecyclerView,代碼行數:9,代碼來源:FullSpanUtil.java

示例14: onViewAttachedToWindow

import android.support.v7.widget.StaggeredGridLayoutManager; //導入方法依賴的package包/類
@Override
public void onViewAttachedToWindow(RecyclerView.ViewHolder holder) {
    super.onViewAttachedToWindow(holder);
    int position = holder.getLayoutPosition();
    int type = getItemViewType(position);
    if (isFullSpanType(type)) {
        ViewGroup.LayoutParams layoutParams = holder.itemView.getLayoutParams();
        if (layoutParams instanceof StaggeredGridLayoutManager.LayoutParams) {
            StaggeredGridLayoutManager.LayoutParams lp = (StaggeredGridLayoutManager.LayoutParams) layoutParams;
            lp.setFullSpan(true);
        }
    }
}
 
開發者ID:ynztlxdeai,項目名稱:MVPtemplate,代碼行數:14,代碼來源:WrapperAdapter.java

示例15: setFullSpan

import android.support.v7.widget.StaggeredGridLayoutManager; //導入方法依賴的package包/類
public static void setFullSpan(RecyclerView.ViewHolder holder) {
    ViewGroup.LayoutParams lp = holder.itemView.getLayoutParams();

    if (lp != null
            && lp instanceof StaggeredGridLayoutManager.LayoutParams) {

        StaggeredGridLayoutManager.LayoutParams p = (StaggeredGridLayoutManager.LayoutParams) lp;

        p.setFullSpan(true);
    }
}
 
開發者ID:huashengzzz,項目名稱:SmartChart,代碼行數:12,代碼來源:WrapperUtils.java


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