package com.sendsms.fragment;

import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.sendsms.R;
import com.sendsms.delegate.NavigationDeleget;
import com.sendsms.utills.Constant;

/**
 * Created by hemants on 6/29/2016.
 */
@SuppressLint("ValidFragment")
public class FragmentDashboard extends Fragment implements View.OnClickListener {

    Context mContext;
    public NavigationDeleget mNavigationDeleget;
    Button friends_sms,office_friends_sms,family_sms,diwali_sms;
    View rootView;
    @SuppressLint("ValidFragment")
    public FragmentDashboard(Context context) {
        mContext = context;
        mNavigationDeleget = (NavigationDeleget) mContext;
    }

    @Override
    public View onCreateView(LayoutInflater inflater,  ViewGroup container,  Bundle savedInstanceState) {
        rootView = inflater.inflate(R.layout.fragment_dashboard, container, false);
        initializeView();
        return rootView;
    }


    public void initializeView() {

        friends_sms = (Button) rootView.findViewById(R.id.friends_sms);
        office_friends_sms = (Button) rootView.findViewById(R.id.office_friends_sms);
        family_sms = (Button) rootView.findViewById(R.id.family_sms);
        diwali_sms = (Button) rootView.findViewById(R.id.diwali_sms);

        onClickListener();

    }

    public void onClickListener() {

        friends_sms.setOnClickListener(this);
        office_friends_sms.setOnClickListener(this);
        family_sms.setOnClickListener(this);
        diwali_sms.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        if(v == friends_sms)
        {
            mNavigationDeleget.executeFragment(Constant.FRAGMENT_DETAILS,null);
        }
        else if(v == office_friends_sms)
        {

        }
        else if(v == family_sms)
        {

        }
        else if(v == diwali_sms)
        {

        }
    }
}
