當前位置: 首頁>>代碼示例>>Java>>正文


Java MultiAdapter類代碼示例

本文整理匯總了Java中io.nlopez.smartadapters.adapters.MultiAdapter的典型用法代碼示例。如果您正苦於以下問題:Java MultiAdapter類的具體用法?Java MultiAdapter怎麽用?Java MultiAdapter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MultiAdapter類屬於io.nlopez.smartadapters.adapters包,在下文中一共展示了MultiAdapter類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: test_item_operations_adapter

import io.nlopez.smartadapters.adapters.MultiAdapter; //導入依賴的package包/類
@Test
public void test_item_operations_adapter() {
    MultiAdapter adapter = SmartAdapter.items(mockList).adapter();
    MockModel model = new MockModel();
    adapter.addItem(model);
    verify(mockList).add(model);

    List<MockModel> modelList = Arrays.asList(new MockModel(), new MockModel());
    adapter.addItems(modelList);
    verify(mockList).addAll(modelList);

    adapter.delItem(model);
    verify(mockList).remove(model);

    adapter.clearItems();
    verify(mockList).clear();
}
 
開發者ID:mrmans0n,項目名稱:smart-adapters,代碼行數:18,代碼來源:SmartAdapterTest.java

示例2: canLoadData

import io.nlopez.smartadapters.adapters.MultiAdapter; //導入依賴的package包/類
protected boolean canLoadData(@NonNull MultiStateView multiStateView, @NonNull MultiAdapter adapter) {
    @ViewState int viewState = multiStateView.getViewState();
    if (viewState == VIEW_STATE_LOADING ||
        (viewState == VIEW_STATE_CONTENT && adapter.getCount() > 0) ||
        viewState == VIEW_STATE_EMPTY ||
        viewState == VIEW_STATE_ERROR) {
        return false;
    }
    return true;
}
 
開發者ID:CycloneAxe,項目名稱:phphub-android,代碼行數:11,代碼來源:LazyFragment.java

示例3: into

import io.nlopez.smartadapters.adapters.MultiAdapter; //導入依賴的package包/類
/**
 * Assigns the created adapter to the given {@code AbsListView} inherited widget (ListView, GridView).
 *
 * @param widget ListView, GridView, ie any widget inheriting from {@code AbsListView}
 * @return assigned adapter
 */
public MultiAdapter into(@NonNull AbsListView widget) {
    validateMapper();
    MultiAdapter adapter = adapter();
    widget.setAdapter(adapter);
    return adapter;
}
 
開發者ID:mrmans0n,項目名稱:smart-adapters,代碼行數:13,代碼來源:SmartAdapter.java

示例4: test_listener_adapter

import io.nlopez.smartadapters.adapters.MultiAdapter; //導入依賴的package包/類
@Test
public void test_listener_adapter() {
    MultiAdapter adapter = SmartAdapter.empty().listener(mockListener).adapter();
    Assert.assertEquals(adapter.getViewEventListener(), mockListener);

    adapter.notifyAction(NOTIFY_ACTION_ID, NOTIFY_MODEL, NOTIFY_POSITION, NOTIFY_VIEW);
    verify(mockListener).onViewEvent(NOTIFY_ACTION_ID, NOTIFY_MODEL, NOTIFY_POSITION, NOTIFY_VIEW);
}
 
開發者ID:mrmans0n,項目名稱:smart-adapters,代碼行數:9,代碼來源:SmartAdapterTest.java

示例5: getAdapter

import io.nlopez.smartadapters.adapters.MultiAdapter; //導入依賴的package包/類
/**
 * @return
 */
public MultiAdapter getAdapter(){
    return mAdapter;
}
 
開發者ID:bodismile,項目名稱:smile-mvp,代碼行數:7,代碼來源:BaseFragmentWithRefresh.java

示例6: test_into_abslistview

import io.nlopez.smartadapters.adapters.MultiAdapter; //導入依賴的package包/類
@Test
public void test_into_abslistview() {
    MultiAdapter adapter = SmartAdapter.empty().into(mockListView);
    verify(mockListView).setAdapter(adapter);
}
 
開發者ID:mrmans0n,項目名稱:smart-adapters,代碼行數:6,代碼來源:SmartAdapterTest.java

示例7: initAdapter

import io.nlopez.smartadapters.adapters.MultiAdapter; //導入依賴的package包/類
/**
 * 初始化適配器
 * @return
 */
public abstract MultiAdapter initAdapter();
 
開發者ID:bodismile,項目名稱:smile-mvp,代碼行數:6,代碼來源:BaseFragmentWithRefresh.java

示例8: adapter

import io.nlopez.smartadapters.adapters.MultiAdapter; //導入依賴的package包/類
/**
 * Returns the instantiated adapter for AbsListView inherited widgets (ListView, GridView)
 * created with all the parameters already set. It is based on BaseAdapter adapters.
 *
 * @return adapter for {@code AbsListView} based on {@code BaseAdapter}
 */
public MultiAdapter adapter() {
    MultiAdapter response = new MultiAdapter(mapper, elements, builder);
    response.setViewEventListener(listener);
    return response;
}
 
開發者ID:mrmans0n,項目名稱:smart-adapters,代碼行數:12,代碼來源:SmartAdapter.java


注:本文中的io.nlopez.smartadapters.adapters.MultiAdapter類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。