package com.ntels.kneet.v3.view.things;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.ntels.kneet.v3.R;
import com.ntels.kneet.v3.common.Constants;
import com.ntels.kneet.v3.common.util.Util;

/**
 * A simple {@link Fragment} subclass.
 */
public class Fragment_Things_Homehub_Guide_03 extends Fragment {
    private Activity    act;
    private Util        util = new Util();
    private View        view;

    public Fragment_Things_Homehub_Guide_03() {
        // Required empty public constructor
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        view = inflater.inflate(R.layout.fragment__things__homehub__guide_03, container, false);
        return view;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        act = getActivity();

        util.getViewUnderline(view, R.id.tvConnect);
        util.getView(view, R.id.tvConnect).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(act, Things_Homehub_Register.class);
                util.callActivityForResultNoAnim(act, intent, Constants.ACT_THINGS_HOMEHUB_REGISTER);
            }
        });
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
    }

    @Override
    public void onDetach() {
        super.onDetach();
    }
}
