本文整理匯總了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);
}