// Path: challenge-four/app/src/main/java/com/reoky/crackme/challengefour/listeners/ChallengeFourFragmentOnClickListener.java
// public class ChallengeFourFragmentOnClickListener implements View.OnClickListener {
// 
//     private ChallengeFourFragment fragment;
// 
//     // Since we're not using an anonymous OnClickListener, but rather a named outer OnClickListener
//     public ChallengeFourFragmentOnClickListener(ChallengeFourFragment fragment) {
//         this.fragment = fragment;
//     }
// 
//     @Override
//     public void onClick(View view) {
//         View parent = (View) view.getParent().getParent(); // TextGuess is in the parent parent view
//         switch (view.getId()) {
//             // Check to see whether the phone is in the GPS fenced area
//             case R.id.challenge_four_button_check:
//                 fragment.checkLocation();
//                 break;
//         }
//     }
// }


import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.os.Vibrator;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import com.reoky.crackme.challengefour.R;
import com.reoky.crackme.challengefour.listeners.ChallengeFourFragmentOnClickListener;
package com.reoky.crackme.challengefour.fragments;



public class ChallengeFourFragment extends Fragment implements LocationListener {

    public ChallengeFourFragment() {}

    // Location
    private LocationManager locationManager;
    private Context context;
    private Location location;

    // UI
    private TextView textViewLatitude;
    private TextView textViewLongitude;

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

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_challenge_four, container, false);

        // Handle the user checking their answer
        final Button buttonCheck = (Button) view.findViewById(R.id.challenge_four_button_check);
// Path: challenge-four/app/src/main/java/com/reoky/crackme/challengefour/listeners/ChallengeFourFragmentOnClickListener.java
// public class ChallengeFourFragmentOnClickListener implements View.OnClickListener {
// 
//     private ChallengeFourFragment fragment;
// 
//     // Since we're not using an anonymous OnClickListener, but rather a named outer OnClickListener
//     public ChallengeFourFragmentOnClickListener(ChallengeFourFragment fragment) {
//         this.fragment = fragment;
//     }
// 
//     @Override
//     public void onClick(View view) {
//         View parent = (View) view.getParent().getParent(); // TextGuess is in the parent parent view
//         switch (view.getId()) {
//             // Check to see whether the phone is in the GPS fenced area
//             case R.id.challenge_four_button_check:
//                 fragment.checkLocation();
//                 break;
//         }
//     }
// }


// Path: challenge-four/app/src/main/java/com/reoky/crackme/challengefour/fragments/ChallengeFourFragment.java
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.os.Vibrator;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import com.reoky.crackme.challengefour.R;
import com.reoky.crackme.challengefour.listeners.ChallengeFourFragmentOnClickListener;

package com.reoky.crackme.challengefour.fragments;



public class ChallengeFourFragment extends Fragment implements LocationListener {

    public ChallengeFourFragment() {}

    // Location
    private LocationManager locationManager;
    private Context context;
    private Location location;

    // UI
    private TextView textViewLatitude;
    private TextView textViewLongitude;

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

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_challenge_four, container, false);

        // Handle the user checking their answer
        final Button buttonCheck = (Button) view.findViewById(R.id.challenge_four_button_check);
        buttonCheck.setOnClickListener(new ChallengeFourFragmentOnClickListener(this));