// Path: app/src/main/java/com/kong/app/demo/about/TextItemViewBinder.java
// public class TextItemViewBinder extends ItemViewBinder<TextViewItem, TextItemViewBinder.TextHolder> {
// 
//     @NonNull
//     @Override
//     protected TextHolder onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
//         View inflate = inflater.inflate(R.layout.item_textview, parent, false);
//         return new TextHolder(inflate);
//     }
// 
//     @Override
//     protected void onBindViewHolder(@NonNull TextHolder holder, @NonNull TextViewItem textItem) {
//         holder.text.setText(textItem.text);
//     }
// 
//     static class TextHolder extends RecyclerView.ViewHolder {
// 
//         private final TextView text;
// 
//         TextHolder(@NonNull View itemView) {
//             super(itemView);
//             this.text = (TextView) itemView.findViewById(R.id.item_textview_id);
//         }
//     }
// }
// 
// Path: app/src/main/java/com/kong/app/demo/about/TextViewItem.java
// public class TextViewItem {
// 
//     public String text;
// 
// }
// 
// Path: app/src/main/java/com/kong/app/news/base/ToolBarActivity.java
// public abstract class ToolBarActivity extends BaseActivity {
// 
//     private Toolbar mToolbar;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(getLayoutId());
//         mToolbar = (Toolbar) findViewById(R.id.base_toolbar);
//         initToolBar(mToolbar);
//     }
// 
//     protected abstract int getLayoutId();
// 
//     @Override
//     public void setTitle(CharSequence title) {
//         if (mToolbar != null) {
//             mToolbar.setTitle(title);
//         }
//     }
// 
//     @Override
//     public void setTitle(int titleId) {
//         if (mToolbar != null) {
//             mToolbar.setTitle(ResourceUtil.getString(titleId));
//         }
//     }
// 
//     public Toolbar getToolbar() {
//         return mToolbar;
//     }
// 
//     public void initToolBar(Toolbar toolbar) {
//         if (null != toolbar) {
//             setSupportActionBar(toolbar);
//             getSupportActionBar().setDisplayShowHomeEnabled(false);
//             getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//             toolbar.setNavigationOnClickListener(new View.OnClickListener() {
//                 @Override
//                 public void onClick(View view) {
//                     onBackPressed();
//                 }
//             });
//         }
//     }
// 
//     public void initToolBar(Toolbar toolbar, String title) {
//         toolbar.setTitle(title);
//         initToolBar(toolbar);
//     }
// 
// }
// 
// Path: app/src/main/java/com/kong/lib/utils/ResourceUtil.java
// public class ResourceUtil {
// 
//     public static String getString(int resId) {
//         return getResources().getString(resId);
//     }
// 
//     public static int getColor(int resId) {
//         return getResources().getColor(resId);
//     }
// 
//     public static Drawable getDrawable(int resId) {
//         return getResources().getDrawable(resId);
//     }
// 
//     public static int getDimen(int dimen) {
//         return (int) getResources().getDimension(dimen);
//     }
// 
//     public static Resources getResources() {
//         return getContext().getResources();
//     }
// 
//     public static Context getContext() {
//         return AppRun.get().getApplicationContext();
//     }
// 
//     public static String getRawFileStr(int rawId) throws IOException {
//         InputStream is = getResources().openRawResource(rawId);
//         BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
//         StringBuilder sb = new StringBuilder();
//         String line;
//         while ((line = reader.readLine()) != null) {
//             sb.append(line).append("\n");
//         }
//         sb.deleteCharAt(sb.length() - 1);
//         reader.close();
//         return sb.toString();
//     }
// }


import android.os.Bundle;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.kong.R;
import com.kong.app.demo.about.TextItemViewBinder;
import com.kong.app.demo.about.TextViewItem;
import com.kong.app.news.base.ToolBarActivity;
import com.kong.lib.utils.ResourceUtil;
import java.util.ArrayList;
import java.util.List;
import me.drakeet.multitype.MultiTypeAdapter;
package com.kong.app.demo.me;





/**
 * Created by CaoPengfei on 17/6/18.
 */

public class MeActivity extends ToolBarActivity {

    private RecyclerView mRecyclerView;
    private MultiTypeAdapter mAdapter;
    private List<Object> list = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setTitle(R.string.descover);
        init();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_me;
    }

    private void init() {
        mRecyclerView = (RecyclerView) findViewById(R.id.me_recycle_view);
        final LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        mRecyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
        mRecyclerView.setLayoutManager(layoutManager);
        mAdapter = new MultiTypeAdapter();
        mAdapter.register(SettingImgTvItem.class, new SettingImgTvItemViewBinder());
        mAdapter.register(AvatarItem.class,new AvatarItemViewBinder());
// Path: app/src/main/java/com/kong/app/demo/about/TextItemViewBinder.java
// public class TextItemViewBinder extends ItemViewBinder<TextViewItem, TextItemViewBinder.TextHolder> {
// 
//     @NonNull
//     @Override
//     protected TextHolder onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
//         View inflate = inflater.inflate(R.layout.item_textview, parent, false);
//         return new TextHolder(inflate);
//     }
// 
//     @Override
//     protected void onBindViewHolder(@NonNull TextHolder holder, @NonNull TextViewItem textItem) {
//         holder.text.setText(textItem.text);
//     }
// 
//     static class TextHolder extends RecyclerView.ViewHolder {
// 
//         private final TextView text;
// 
//         TextHolder(@NonNull View itemView) {
//             super(itemView);
//             this.text = (TextView) itemView.findViewById(R.id.item_textview_id);
//         }
//     }
// }
// 
// Path: app/src/main/java/com/kong/app/demo/about/TextViewItem.java
// public class TextViewItem {
// 
//     public String text;
// 
// }
// 
// Path: app/src/main/java/com/kong/app/news/base/ToolBarActivity.java
// public abstract class ToolBarActivity extends BaseActivity {
// 
//     private Toolbar mToolbar;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(getLayoutId());
//         mToolbar = (Toolbar) findViewById(R.id.base_toolbar);
//         initToolBar(mToolbar);
//     }
// 
//     protected abstract int getLayoutId();
// 
//     @Override
//     public void setTitle(CharSequence title) {
//         if (mToolbar != null) {
//             mToolbar.setTitle(title);
//         }
//     }
// 
//     @Override
//     public void setTitle(int titleId) {
//         if (mToolbar != null) {
//             mToolbar.setTitle(ResourceUtil.getString(titleId));
//         }
//     }
// 
//     public Toolbar getToolbar() {
//         return mToolbar;
//     }
// 
//     public void initToolBar(Toolbar toolbar) {
//         if (null != toolbar) {
//             setSupportActionBar(toolbar);
//             getSupportActionBar().setDisplayShowHomeEnabled(false);
//             getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//             toolbar.setNavigationOnClickListener(new View.OnClickListener() {
//                 @Override
//                 public void onClick(View view) {
//                     onBackPressed();
//                 }
//             });
//         }
//     }
// 
//     public void initToolBar(Toolbar toolbar, String title) {
//         toolbar.setTitle(title);
//         initToolBar(toolbar);
//     }
// 
// }
// 
// Path: app/src/main/java/com/kong/lib/utils/ResourceUtil.java
// public class ResourceUtil {
// 
//     public static String getString(int resId) {
//         return getResources().getString(resId);
//     }
// 
//     public static int getColor(int resId) {
//         return getResources().getColor(resId);
//     }
// 
//     public static Drawable getDrawable(int resId) {
//         return getResources().getDrawable(resId);
//     }
// 
//     public static int getDimen(int dimen) {
//         return (int) getResources().getDimension(dimen);
//     }
// 
//     public static Resources getResources() {
//         return getContext().getResources();
//     }
// 
//     public static Context getContext() {
//         return AppRun.get().getApplicationContext();
//     }
// 
//     public static String getRawFileStr(int rawId) throws IOException {
//         InputStream is = getResources().openRawResource(rawId);
//         BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
//         StringBuilder sb = new StringBuilder();
//         String line;
//         while ((line = reader.readLine()) != null) {
//             sb.append(line).append("\n");
//         }
//         sb.deleteCharAt(sb.length() - 1);
//         reader.close();
//         return sb.toString();
//     }
// }


// Path: app/src/main/java/com/kong/app/demo/me/MeActivity.java
import android.os.Bundle;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.kong.R;
import com.kong.app.demo.about.TextItemViewBinder;
import com.kong.app.demo.about.TextViewItem;
import com.kong.app.news.base.ToolBarActivity;
import com.kong.lib.utils.ResourceUtil;
import java.util.ArrayList;
import java.util.List;
import me.drakeet.multitype.MultiTypeAdapter;

package com.kong.app.demo.me;





/**
 * Created by CaoPengfei on 17/6/18.
 */

public class MeActivity extends ToolBarActivity {

    private RecyclerView mRecyclerView;
    private MultiTypeAdapter mAdapter;
    private List<Object> list = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setTitle(R.string.descover);
        init();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_me;
    }

    private void init() {
        mRecyclerView = (RecyclerView) findViewById(R.id.me_recycle_view);
        final LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        mRecyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
        mRecyclerView.setLayoutManager(layoutManager);
        mAdapter = new MultiTypeAdapter();
        mAdapter.register(SettingImgTvItem.class, new SettingImgTvItemViewBinder());
        mAdapter.register(AvatarItem.class,new AvatarItemViewBinder());
        mAdapter.register(TextViewItem.class, new TextItemViewBinder());