use of me.drakeet.multitype.Items in project GwellDemo by dxsdyhm.
the class AllarmImageListActivity method initData.
private void initData() {
items = new Items();
adapter = new MultiTypeAdapter(items);
creatFile();
AlarmInfoProvider p = new AlarmInfoProvider();
p.setOnItemClickListner(listner);
adapter.register(AlarmInfo.class, p);
rcAllarm.setLayoutManager(new LinearLayoutManager(this));
rcAllarm.setAdapter(adapter);
}
use of me.drakeet.multitype.Items in project MultiType by drakeet.
the class SimpleActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.list);
Items items = new Items();
adapter = new MultiTypeAdapter();
adapter.register(TextItem.class, new TextItemWithOutsizeDataViewBinder(aFieldValue));
recyclerView.setAdapter(adapter);
assertHasTheSameAdapter(recyclerView, adapter);
for (int i = 0; i < 20; i++) {
items.add(new TextItem(valueOf(i)));
}
adapter.setItems(items);
adapter.notifyDataSetChanged();
assertAllRegistered(adapter, items);
}
use of me.drakeet.multitype.Items in project MultiType by drakeet.
the class WeiboActivity method loadRemoteData.
private void loadRemoteData() {
RemoteData dataFromParser = GsonProvider.gson.fromJson(JSON_FROM_SERVICE, RemoteData.class);
// Update the items atomically and safely.
items = new Items(items);
items.addAll(0, dataFromParser.weibos);
adapter.setItems(items);
adapter.notifyDataSetChanged();
}
use of me.drakeet.multitype.Items in project GwellDemo by dxsdyhm.
the class SerialAppActivity method initRC.
private void initRC() {
txt_num = (TextView) findViewById(R.id.txt_num);
rcSerialApp = (RecyclerView) findViewById(R.id.rc_serialapp);
rcSerialApp.setLayoutManager(new LinearLayoutManager(this));
items = new Items();
adapter = new MultiTypeAdapter(items);
SerialAppProvider provider = new SerialAppProvider();
adapter.register(String.class, provider);
rcSerialApp.setAdapter(adapter);
}
Aggregations