use of com.blankj.utildebug.base.rv.RecycleViewDivider in project AndroidUtilCode by Blankj.
the class SpViewerContentView method onAttach.
@Override
public void onAttach() {
spViewTitle = findViewById(R.id.spViewTitle);
spViewSearchEt = findViewById(R.id.spViewSearchEt);
spViewRv = findViewById(R.id.spViewRv);
spViewTitle.setText(mSpName);
mAdapter = new BaseItemAdapter<>();
mSrcItems = SpItem.getSpItems(mSPUtils);
mAdapter.setItems(mSrcItems);
spViewRv.setAdapter(mAdapter);
spViewRv.setLayoutManager(new LinearLayoutManager(getContext()));
spViewRv.addItemDecoration(new RecycleViewDivider(getContext(), RecycleViewDivider.VERTICAL, R.drawable.du_shape_divider));
spViewSearchEt.setOnTextChangedListener(new SearchEditText.OnTextChangedListener() {
@Override
public void onTextChanged(String text) {
mAdapter.setItems(SpItem.filterItems(mSrcItems, text));
mAdapter.notifyDataSetChanged();
}
});
setOnRefreshListener(spViewRv, new OnRefreshListener() {
@Override
public void onRefresh(BaseContentFloatView floatView) {
mSrcItems = SpItem.getSpItems(mSPUtils);
mAdapter.setItems(mSrcItems);
mAdapter.notifyDataSetChanged();
spViewSearchEt.reset();
floatView.closeRefresh();
}
});
}
use of com.blankj.utildebug.base.rv.RecycleViewDivider in project AndroidUtilCode by Blankj.
the class DeviceInfoFloatView method initContentView.
@Override
public void initContentView() {
deviceInfoRv = findViewById(R.id.deviceInfoRv);
final BaseItemAdapter<DeviceInfoItem> adapter = new BaseItemAdapter<>();
adapter.setItems(DeviceInfoItem.getAppInfoItems());
deviceInfoRv.setAdapter(adapter);
deviceInfoRv.setLayoutManager(new LinearLayoutManager(getContext()));
deviceInfoRv.addItemDecoration(new RecycleViewDivider(getContext(), RecycleViewDivider.VERTICAL, R.drawable.du_shape_divider));
getContentView().setOnRefreshListener(deviceInfoRv, new OnRefreshListener() {
@Override
public void onRefresh(final BaseContentFloatView floatView) {
adapter.setItems(DeviceInfoItem.getAppInfoItems());
adapter.notifyDataSetChanged();
floatView.closeRefresh();
}
});
}
use of com.blankj.utildebug.base.rv.RecycleViewDivider in project AndroidUtilCode by Blankj.
the class FileContentView method onAttach.
@Override
public void onAttach() {
fileExplorerSearchEt = findViewById(R.id.fileExplorerSearchEt);
fileExplorerRv = findViewById(R.id.fileExplorerRv);
if (FileItem.isEmptyItems(mSrcItems)) {
fileExplorerSearchEt.setVisibility(GONE);
}
mAdapter = new BaseItemAdapter<>();
mAdapter.setItems(mSrcItems);
fileExplorerRv.setAdapter(mAdapter);
fileExplorerRv.setLayoutManager(new LinearLayoutManager(getContext()));
fileExplorerRv.addItemDecoration(new RecycleViewDivider(getContext(), RecycleViewDivider.VERTICAL, R.drawable.du_shape_file_divider));
fileExplorerSearchEt.setOnTextChangedListener(new SearchEditText.OnTextChangedListener() {
@Override
public void onTextChanged(String text) {
mAdapter.setItems(FileItem.filterItems(mSrcItems, text));
mAdapter.notifyDataSetChanged();
}
});
setOnRefreshListener(fileExplorerRv, new OnRefreshListener() {
@Override
public void onRefresh(BaseContentFloatView floatView) {
mSrcItems = FileItem.getFileItems(mParent);
mAdapter.setItems(mSrcItems);
mAdapter.notifyDataSetChanged();
fileExplorerSearchEt.reset();
floatView.closeRefresh();
}
});
}
use of com.blankj.utildebug.base.rv.RecycleViewDivider in project AndroidUtilCode by Blankj.
the class AppInfoFloatView method initContentView.
@Override
public void initContentView() {
appInfoRv = findViewById(R.id.appInfoRv);
BaseItemAdapter<AppInfoItem> adapter = new BaseItemAdapter<>();
adapter.setItems(AppInfoItem.getAppInfoItems());
appInfoRv.setAdapter(adapter);
appInfoRv.setLayoutManager(new LinearLayoutManager(getContext()));
appInfoRv.addItemDecoration(new RecycleViewDivider(getContext(), RecycleViewDivider.VERTICAL, R.drawable.du_shape_divider));
}
Aggregations