當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。