当前位置: 首页>>代码示例>>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;未经允许,请勿转载。