package com.ashazar.tabdrawerexample;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.ViewGroup;
import android.widget.RelativeLayout;

import java.util.ArrayList;

//public class MainActivity extends BaseActivity {
public class MainActivity extends AppCompatActivity {
    private ArrayList<RelativeLayout> drawerLayoutList = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        /*
        setContentView(R.layout.activity_main);

        prepareTabDrawer();
        */




        drawerLayoutList = new ArrayList<>();
        for (int i = 0; i < tabCount; i++) {
            RelativeLayout layout = prepareItemListContainerView(i);
            drawerLayoutList.add(layout);
        }


        LinearLayoutManager layoutManager = new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false);
        RecyclerView recyclerView = new RecyclerView(context);
        recyclerView.setLayoutManager(layoutManager);

        DrawerRecyclerViewAdapter adapter = new DrawerRecyclerViewAdapter(context, drawerLayoutList);
        recyclerView.setAdapter(adapter);


        tabListContainer.addView(recyclerView);


    }

    public class DrawerRecyclerViewAdapter extends RecyclerView.Adapter<DrawerRecyclerViewAdapter.DrawerViewHolder> {
        private ArrayList<RelativeLayout> drawerList;
        private Context mContext;

        public DrawerRecyclerViewAdapter(Context context, ArrayList<RelativeLayout> drawerList) {
            this.drawerList = drawerList;
            this.mContext = context;
        }

        @Override
        public int getItemViewType(int position) {
            //return super.getItemViewType(position);
            return position;
        }

        @Override
        public DrawerViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
            /*
            View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.list_row, null);
            DrawerViewHolder viewHolder = new DrawerViewHolder(view);
            */
            View view = drawerList.get(i);
            DrawerViewHolder viewHolder = new DrawerViewHolder(view);
            return viewHolder;
        }

        @Override
        public void onBindViewHolder(DrawerViewHolder customViewHolder, int i) {
            RelativeLayout drawer = drawerList.get(i);

            //customViewHolder.textView.setText(Html.fromHtml(feedItem.getTitle()));
        }

        @Override
        public int getItemCount() {
            return (null != drawerList ? drawerList.size() : 0);
        }

        class DrawerViewHolder extends RecyclerView.ViewHolder {
            //protected ImageView imageView;
            //protected TextView textView;

            public DrawerViewHolder(View view) {
                super(view);
                //this.imageView = (ImageView) view.findViewById(R.id.thumbnail);
                //this.textView = (TextView) view.findViewById(R.id.title);
            }
        }
    }

}

@@ -51,467 +51,68 @@
 oid.
-content.Context;%0Aimport android.os.Bundle;%0Aimport android.support.v7.app.AppCompatActivity;%0Aimport android.support.v7.widget.LinearLayoutManager;%0Aimport android.support.v7.widget.RecyclerView;%0Aimport android.view.ViewGroup;%0Aimport android.widget.RelativeLayout;%0A%0Aimport java.util.ArrayList;%0A%0A//public class MainActivity extends BaseActivity %7B%0Apublic class MainActivity extends AppCompatActivity %7B%0A    private ArrayList%3CRelativeLayout%3E drawerLayoutList = null;
+os.Bundle;%0A%0Apublic class MainActivity extends BaseActivity %7B
 %0A%0A  
@@ -224,27 +224,16 @@
 State);%0A
-        /*%0A
         
@@ -309,2485 +309,8 @@
     
-    */%0A%0A%0A%0A%0A        drawerLayoutList = new ArrayList%3C%3E();%0A        for (int i = 0; i %3C tabCount; i++) %7B%0A            RelativeLayout layout = prepareItemListContainerView(i);%0A            drawerLayoutList.add(layout);%0A        %7D%0A%0A%0A        LinearLayoutManager layoutManager = new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false);%0A        RecyclerView recyclerView = new RecyclerView(context);%0A        recyclerView.setLayoutManager(layoutManager);%0A%0A        DrawerRecyclerViewAdapter adapter = new DrawerRecyclerViewAdapter(context, drawerLayoutList);%0A        recyclerView.setAdapter(adapter);%0A%0A%0A        tabListContainer.addView(recyclerView);%0A%0A%0A    %7D%0A%0A    public class DrawerRecyclerViewAdapter extends RecyclerView.Adapter%3CDrawerRecyclerViewAdapter.DrawerViewHolder%3E %7B%0A        private ArrayList%3CRelativeLayout%3E drawerList;%0A        private Context mContext;%0A%0A        public DrawerRecyclerViewAdapter(Context context, ArrayList%3CRelativeLayout%3E drawerList) %7B%0A            this.drawerList = drawerList;%0A            this.mContext = context;%0A        %7D%0A%0A        @Override%0A        public int getItemViewType(int position) %7B%0A            //return super.getItemViewType(position);%0A            return position;%0A        %7D%0A%0A        @Override%0A        public DrawerViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) %7B%0A            /*%0A            View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.list_row, null);%0A            DrawerViewHolder viewHolder = new DrawerViewHolder(view);%0A            */%0A            View view = drawerList.get(i);%0A            DrawerViewHolder viewHolder = new DrawerViewHolder(view);%0A            return viewHolder;%0A        %7D%0A%0A        @Override%0A        public void onBindViewHolder(DrawerViewHolder customViewHolder, int i) %7B%0A            RelativeLayout drawer = drawerList.get(i);%0A%0A            //customViewHolder.textView.setText(Html.fromHtml(feedItem.getTitle()));%0A        %7D%0A%0A        @Override%0A        public int getItemCount() %7B%0A            return (null != drawerList ? drawerList.size() : 0);%0A        %7D%0A%0A        class DrawerViewHolder extends RecyclerView.ViewHolder %7B%0A            //protected ImageView imageView;%0A            //protected TextView textView;%0A%0A            public DrawerViewHolder(View view) %7B%0A                super(view);%0A                //this.imageView = (ImageView) view.findViewById(R.id.thumbnail);%0A                //this.textView = (TextView) view.findViewById(R.id.title);%0A            %7D%0A        %7D%0A    %7D%0A
+%7D
 %0A%7D%0A

remove test codes