Search in sources :

Example 11 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)

Example 12 with Items

use of me.drakeet.multitype.Items in project MultiType by drakeet.

the class WeiboActivity method loadRemoteData.

private void loadRemoteData() {
    List<Weibo> weiboList = WeiboJsonParser.fromJson(JSON_FROM_SERVICE);
    // atomically
    items = new Items(items);
    items.addAll(0, weiboList);
    adapter.setItems(items);
    adapter.notifyDataSetChanged();
}
Also used : Items(me.drakeet.multitype.Items)

Aggregations

Items (me.drakeet.multitype.Items)12 MultiTypeAdapter (me.drakeet.multitype.MultiTypeAdapter)11 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)4 RecyclerView (android.support.v7.widget.RecyclerView)4 TextItem (me.drakeet.multitype.sample.normal.TextItem)3 AlarmInfoProvider (adapter.AlarmInfoProvider)1 LogInfoProvider (adapter.LogInfoProvider)1 RecordFileProvider (adapter.RecordFileProvider)1 SensorProvider (adapter.SensorProvider)1 SerialAppProvider (adapter.SerialAppProvider)1 SuppressLint (android.annotation.SuppressLint)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 Category (com.jweihao.jdemo.bean.Category)1 Post (com.jweihao.jdemo.bean.Post)1 PostList (com.jweihao.jdemo.bean.PostList)1 Song (com.jweihao.jdemo.bean.Song)1 CategoryViewBinder (com.jweihao.jdemo.ui.activity.md.viewBinder.CategoryViewBinder)1