本文整理汇总了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();
}
示例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;
}
示例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;
}
示例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);
}
示例5: getAdapter
import io.nlopez.smartadapters.adapters.MultiAdapter; //导入依赖的package包/类
/**
* @return
*/
public MultiAdapter getAdapter(){
return mAdapter;
}
示例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);
}
示例7: initAdapter
import io.nlopez.smartadapters.adapters.MultiAdapter; //导入依赖的package包/类
/**
* 初始化适配器
* @return
*/
public abstract MultiAdapter initAdapter();
示例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;
}