package com.ashazar.tabdrawer;

import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;

import com.ashazar.tabdrawer.model.Tab;
import com.ashazar.tabdrawer.model.TabDetail;

import java.util.ArrayList;

public class MainActivity extends AppCompatActivity {
    Context context;
    Activity activity;

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

        context = this;
        activity = this;

        ArrayList<Tab> tabArray = new ArrayList<>();
        ArrayList<TabDetail> tabDetailArray = new ArrayList<>();
        Tab tab;
        TabDetail tabDetail;

        tabDetail = new TabDetail("item 1");
        tabDetailArray.add(tabDetail);

        tabDetail = new TabDetail("item 2");
        tabDetailArray.add(tabDetail);


        tab = new Tab("Activity", R.drawable.n_activity, R.drawable.s_activity);
        tabArray.add(tab);

        tab = new Tab("Queue", R.drawable.n_queue, R.drawable.s_queue);
        tab.addList(tabDetailArray);
        tabArray.add(tab);

        tab = new Tab("Chat", R.drawable.n_chat, R.drawable.s_chat);
        tabArray.add(tab);



        tabDetail = new TabDetail("item 3", android.R.drawable.ic_menu_zoom);
        tabDetailArray.add(tabDetail);

        tabDetail = new TabDetail("item 4", android.R.drawable.ic_search_category_default);
        tabDetailArray.add(tabDetail);

        tab = new Tab("Reports", R.drawable.n_report, R.drawable.s_report);
        tab.addList(tabDetailArray);
        tabArray.add(tab);

        tab = new Tab("Settings", R.drawable.n_settings, R.drawable.s_settings);
        tabArray.add(tab);

        TabDrawer tabDrawer = new TabDrawer(context, activity, R.id.tabDrawer, tabArray) {
            @Override
            public void onTabClicked(int pos) {
                super.onTabClicked(pos);

                String text;
                text = "Tab " + pos;

                Toast toast = Toast.makeText(context, text, Toast.LENGTH_SHORT);
                toast.show();
            }
           /*
            @Override
            public void onClick(View v) {
                super.onClick(v);

                String text;
                //text = clickedTabPos + " - " + clickedTabDetailPos;
                text = "Tab " + clickedTabPos;

                Toast toast = Toast.makeText(context, text, Toast.LENGTH_SHORT);
                toast.show();
            }
            */
        };

        tabDrawer.setTabPadding(3, 3, 3, 3);
        tabDrawer.setTabTitleColor(Color.parseColor("#3199ff"));
        tabDrawer.setTabBackgroundColor(Color.parseColor("#ffffff"));
        tabDrawer.setTabBackgroundSelectedColor(Color.parseColor("#3199ff"));
        tabDrawer.setTabBackgroundSelectedPassiveColor(Color.parseColor("#cccccc"));

        //tabDrawer.setTabListContainerHeight(350);

        tabDrawer.initialize();

    }
}

@@ -437,16 +437,43 @@
 ivity;%0A%0A
+    TabDrawer tabDrawer;%0A%0A%0A
     @Ove
@@ -674,24 +674,153 @@
 ty = this;%0A%0A
+        if (savedInstanceState == null) %7B%0A            prepareTabDrawer();%0A        %7D%0A    %7D%0A%0A    private void prepareTabDrawer() %7B%0A
         Arra
@@ -1992,34 +1992,24 @@
 );%0A%0A        
-TabDrawer 
 tabDrawer = 
@@ -3137,18 +3137,16 @@
         
-//
 tabDrawe
@@ -3170,18 +3170,30 @@
 iner
-Height(350
+Padding(16, 16, 16, 16
 );%0A%0A
@@ -3223,16 +3223,22 @@
 alize();
+%0A    %7D
 %0A%0A    %7D%0A

Prepare & initialize TabDrawer in a seperate method.