package com.ntels.onecable.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.onecable.R;
import com.ntels.onecable.common.Constants;
import com.ntels.onecable.common.util.Util;

/**
 * <pre>
 * 1. ClassName :   FragmentThingsHomehubGuide3rd
 * 2. FileName  :   FragmentThingsHomehubGuide3rd.java
 * 3. Package   :   com.ntels.onecable.view.things
 * 4. Date      :   2016-11-28
 * 5. Author    :   aaron
 * 6. Comment   :   Initialize
 * </pre>
 */
public class FragmentThingsHomehubGuide3rd extends Fragment {
  private Activity act;
  private Util util = new Util();
  private View view;

  public FragmentThingsHomehubGuide3rd() {
    // 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 view) {
        Intent intent = new Intent(act, ThingsHomehubRegister.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();
  }
}
