Search in sources :

Example 6 with Items

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);
}
Also used : AlarmInfoProvider(adapter.AlarmInfoProvider) Items(me.drakeet.multitype.Items) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) MultiTypeAdapter(me.drakeet.multitype.MultiTypeAdapter)

Example 7 with Items

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);
}
Also used : TextItem(me.drakeet.multitype.sample.normal.TextItem) RecyclerView(android.support.v7.widget.RecyclerView) Items(me.drakeet.multitype.Items) MultiTypeAdapter(me.drakeet.multitype.MultiTypeAdapter)

Example 8 with 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();
}
Also used : Items(me.drakeet.multitype.Items)

Example 9 with Items

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);
}
Also used : Items(me.drakeet.multitype.Items) SerialAppProvider(adapter.SerialAppProvider) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) MultiTypeAdapter(me.drakeet.multitype.MultiTypeAdapter)

Aggregations

Items (me.drakeet.multitype.Items)9 MultiTypeAdapter (me.drakeet.multitype.MultiTypeAdapter)7 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)3 RecyclerView (android.support.v7.widget.RecyclerView)3 AlarmInfoProvider (adapter.AlarmInfoProvider)1 LogInfoProvider (adapter.LogInfoProvider)1 RecordFileProvider (adapter.RecordFileProvider)1 SensorProvider (adapter.SensorProvider)1 SerialAppProvider (adapter.SerialAppProvider)1 Intent (android.content.Intent)1 Bundle (android.os.Bundle)1 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)1 GridLayoutManager (android.support.v7.widget.GridLayoutManager)1 RecordFile (entity.RecordFile)1 Date (java.util.Date)1 Timer (java.util.Timer)1 TimerTask (java.util.TimerTask)1 TextItem (me.drakeet.multitype.sample.normal.TextItem)1 SimpleImage (me.drakeet.multitype.sample.weibo.content.SimpleImage)1 SimpleImageViewBinder (me.drakeet.multitype.sample.weibo.content.SimpleImageViewBinder)1