本文整理汇总了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();
}
}
});
}
示例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);
}