use of com.blankj.utildebug.base.rv.BaseItemAdapter in project AndroidUtilCode by Blankj.
the class DebugMenuItem method bind.
@Override
public void bind(@NonNull ItemViewHolder holder, int position) {
TextView menuTitle = holder.findViewById(R.id.menuCategory);
RecyclerView menuRv = holder.findViewById(R.id.menuRv);
ShadowHelper.applyMenu(holder.itemView);
menuTitle.setText(mTitle);
BaseItemAdapter<DebugItem> adapter = new BaseItemAdapter<>();
adapter.setItems(DebugItem.getDebugItems(mDebugs));
menuRv.setAdapter(adapter);
menuRv.setLayoutManager(new GridLayoutManager(menuRv.getContext(), 4));
}
use of com.blankj.utildebug.base.rv.BaseItemAdapter 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.BaseItemAdapter 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