当前位置: 首页>>代码示例>>Java>>正文


Java AsymmetricGridViewAdapter类代码示例

本文整理汇总了Java中com.felipecsl.asymmetricgridview.library.widget.AsymmetricGridViewAdapter的典型用法代码示例。如果您正苦于以下问题:Java AsymmetricGridViewAdapter类的具体用法?Java AsymmetricGridViewAdapter怎么用?Java AsymmetricGridViewAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AsymmetricGridViewAdapter类属于com.felipecsl.asymmetricgridview.library.widget包,在下文中一共展示了AsymmetricGridViewAdapter类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: reload

import com.felipecsl.asymmetricgridview.library.widget.AsymmetricGridViewAdapter; //导入依赖的package包/类
public void reload() {
    getActivity().runOnUiThread(new Runnable() {
        @Override
        public void run() {
            CacheImageManager.clear();
            mFodexItems = itemsForAdapters();
            if (mFodexItems == null)
                throw new AssertionError("expect itemsForAdapters to be not null.");

            List<FodexLayoutSpecItem> layoutItems = new ArrayList<>();
            for (int i = 0; i < mFodexItems.size(); i++) {
                int index = i % 10;
                int columnSpan;
                switch (index) {
                    case 0:
                    case 6:
                        columnSpan = 2;
                        break;
                    default:
                        columnSpan = 1;
                        break;
                }
                FodexLayoutSpecItem item = new FodexLayoutSpecItem(columnSpan, 1, mFodexItems.get(i));
                layoutItems.add(i, item);
            }
            ((AsymmetricGridViewAdapter) mGridView.getAdapter()).setItems(layoutItems);
            mFloatingActionMenu.collapse();

            // notify user no photos found
            if (layoutItems.size() == 0) {
                ErrorToast.make(getActivity(), getString(R.string.message_no_photos_found)).show();
            }
        }
    });
}
 
开发者ID:dyhpoon,项目名称:Fo.dex,代码行数:36,代码来源:FodexBaseFragment.java

示例2: AsymmetricSizeProvider

import com.felipecsl.asymmetricgridview.library.widget.AsymmetricGridViewAdapter; //导入依赖的package包/类
public AsymmetricSizeProvider(@NonNull Context context, @NonNull AsymmetricGridViewAdapter adapter) {
    this.mAdapter = adapter;

    Resources res = context.getResources();
    leftMargin      = res.getDimensionPixelSize(R.dimen.grid_item_left_margin);
    topMargin       = res.getDimensionPixelSize(R.dimen.grid_item_top_margin);
    rightMargin     = res.getDimensionPixelSize(R.dimen.grid_item_right_margin);
    bottomMargin    = res.getDimensionPixelSize(R.dimen.grid_item_bottom_margin);
}
 
开发者ID:dyhpoon,项目名称:Fo.dex,代码行数:10,代码来源:AsymmetricSizeProvider.java


注:本文中的com.felipecsl.asymmetricgridview.library.widget.AsymmetricGridViewAdapter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。