当前位置: 首页>>代码示例>>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;未经允许,请勿转载。