本文整理汇总了Java中com.heaven7.adapter.QuickRecycleViewAdapter类的典型用法代码示例。如果您正苦于以下问题:Java QuickRecycleViewAdapter类的具体用法?Java QuickRecycleViewAdapter怎么用?Java QuickRecycleViewAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QuickRecycleViewAdapter类属于com.heaven7.adapter包,在下文中一共展示了QuickRecycleViewAdapter类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initData
import com.heaven7.adapter.QuickRecycleViewAdapter; //导入依赖的package包/类
@Override
protected void initData(Bundle savedInstanceState) {
mRv.setLayoutManager(new LinearLayoutManager(this));
// mRv.setHasFixedSize(true);
mRv.setAdapter(new QuickRecycleViewAdapter<ParentData>(R.layout.item_recycler_view, createParentList()) {
@Override
protected void onBindData(Context context, int position, final ParentData item, int itemLayoutId, ViewHelper helper) {
helper.performViewGetter(R.id.rv_child, new Getters.RecyclerViewGetter() {
@Override
public void onGotView(RecyclerView view, ViewHelper vp) {
// view.setHasFixedSize(true);
view.setLayoutManager(new LinearLayoutManager(view.getContext()));
setChildAdapter(view, item);
}
});
}
});
}
示例2: onItemRangeInserted
import com.heaven7.adapter.QuickRecycleViewAdapter; //导入依赖的package包/类
public void onItemRangeInserted(int positionStart, int itemCount) {
//Logger.i(TAG, "onItemRangeInserted", "");
checkAdapter();
final QuickRecycleViewAdapter<T> adapter = getAdapter();
final AdapterManager<T> am = adapter.getAdapterManager();
final Map<T, ItemInfo> mMap = CountDownManager2.this.mMap;
int pos;
T bean;
for (int i = 0; i < itemCount; i++) {
pos = positionStart + i;
if (adapter.isHeader(pos) || adapter.isFooter(pos)) {
continue;
}
bean = am.getItemAt(pos);
mMap.put(bean, new ItemInfo(pos));
}
startLoop();
}
示例3: setAdapter
import com.heaven7.adapter.QuickRecycleViewAdapter; //导入依赖的package包/类
private void setAdapter() {
mAdapter = new QuickRecycleViewAdapter<TestBean>(android.R.layout.simple_list_item_1,
new ArrayList<TestBean>()) {
@Override
protected void onBindData(Context context, int position, final TestBean item, int itemLayoutId, final ViewHelper helper) {
Logger.w(TAG, "onBindData", "position = " + position);
final TextView tv = helper.getView(android.R.id.text1);
tv.setText(DF.format(new Date(item.getLeftTime())));
/*
mCDM.setCountDownCallback(item, new CountDownCallbackImpl<TestBean>(position, tv) {
@Override
protected CharSequence format(int position, TestBean bean, long millisUntilFinished) {
return DF.format(new Date(millisUntilFinished));
}
});*/
}
};
//必须在setAdapter之前调用
mCDM.attach(mAdapter);
mRv.setAdapter(mAdapter);
}
示例4: initData
import com.heaven7.adapter.QuickRecycleViewAdapter; //导入依赖的package包/类
@Override
protected void initData(Bundle savedInstanceState) {
QuickRecycleViewAdapter<RecyclerViewNestedTest.ChildData> adapter = createTestSelectAdapter();
mRv.setLayoutManager(new LinearLayoutManager(this));
mRv.setAdapter(adapter);
}
示例5: attach
import com.heaven7.adapter.QuickRecycleViewAdapter; //导入依赖的package包/类
/**
* attach the adapter to this , if the work thread is not prepared. it will auto prepare for count down task.
*
* @param adapter the adapter
*/
public synchronized void attach(QuickRecycleViewAdapter<T> adapter) {
prepare();
detach();
this.mDetached = false;
this.mAdapter = adapter;
adapter.registerAdapterDataObserver(mImpl);
adapter.getAdapterManager().registerAdapterDataRemoveObserver(mImpl);
}
示例6: createTestSelectAdapter
import com.heaven7.adapter.QuickRecycleViewAdapter; //导入依赖的package包/类
private QuickRecycleViewAdapter<RecyclerViewNestedTest.ChildData> createTestSelectAdapter() {
return new TestSelectAdapter(ISelectable.SELECT_MODE_MULTI);
}
示例7: createTestDeleteAdapter
import com.heaven7.adapter.QuickRecycleViewAdapter; //导入依赖的package包/类
@NonNull
private QuickRecycleViewAdapter<RecyclerViewNestedTest.ChildData> createTestDeleteAdapter() {
return new TestDeleteAdapter();
}
示例8: attachCountDownObserver
import com.heaven7.adapter.QuickRecycleViewAdapter; //导入依赖的package包/类
/**
* attach count down observer for adapter.
* @param adapter the adapter
*/
public void attachCountDownObserver(final QuickRecycleViewAdapter<T> adapter) {
detachCountDownObserver();
mObserver = new CountDownDataObserver<T>(this,adapter);
mObserver.attach();
}
示例9: getAdapter
import com.heaven7.adapter.QuickRecycleViewAdapter; //导入依赖的package包/类
private QuickRecycleViewAdapter<T> getAdapter() {
return mAdapter;
}
示例10: CountDownDataObserver
import com.heaven7.adapter.QuickRecycleViewAdapter; //导入依赖的package包/类
public CountDownDataObserver(CountDownManager<T> cdm,QuickRecycleViewAdapter<T> mAdapter) {
this.mCDM = cdm;
this.mAdapter = mAdapter;
}