// Path: app/src/main/java/com/pushapp/press/interfaces/OnFragmentInteractionListener.java
// public interface OnFragmentInteractionListener {
//     void onFragmentInteraction(Uri id);
//     void onFragmentInteraction(String id);
// }


import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.Toast;
import com.androidquery.AQuery;
import com.pushapp.press.R;
import com.pushapp.press.interfaces.OnFragmentInteractionListener;
import java.text.DecimalFormat;
        View view = inflater.inflate(R.layout.fragment_donate_page, container, false);
        aq = new AQuery(view);

        aq.id(R.id.btn_donate).clicked(new View.OnClickListener() {
            @Override
            public void onClick(View view){
                String amount = aq.id(R.id.txt_amount).getText().toString().trim();
                if(amount.length() == 0){
                    Toast.makeText(getActivity(), getActivity().getString(R.string.enter_valid_amount), Toast.LENGTH_LONG).show();
                    return;
                }
                InputMethodManager imm = (InputMethodManager)getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
                imm.hideSoftInputFromWindow(view.getWindowToken(), 0);

                DonateConfirmationDialog.newInstance(amount).show(getFragmentManager(), "confirm_donation");
            }
        });
        return view;
    }

    // TODO: Rename method, update argument and hook method into UI event
    public void onButtonPressed(Uri uri) {
        if (mListener != null) {
            mListener.onFragmentInteraction(uri);
        }
    }

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
// Path: app/src/main/java/com/pushapp/press/interfaces/OnFragmentInteractionListener.java
// public interface OnFragmentInteractionListener {
//     void onFragmentInteraction(Uri id);
//     void onFragmentInteraction(String id);
// }


// Path: app/src/main/java/com/pushapp/press/fragment/DonatePage.java
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.Toast;
import com.androidquery.AQuery;
import com.pushapp.press.R;
import com.pushapp.press.interfaces.OnFragmentInteractionListener;
import java.text.DecimalFormat;

        View view = inflater.inflate(R.layout.fragment_donate_page, container, false);
        aq = new AQuery(view);

        aq.id(R.id.btn_donate).clicked(new View.OnClickListener() {
            @Override
            public void onClick(View view){
                String amount = aq.id(R.id.txt_amount).getText().toString().trim();
                if(amount.length() == 0){
                    Toast.makeText(getActivity(), getActivity().getString(R.string.enter_valid_amount), Toast.LENGTH_LONG).show();
                    return;
                }
                InputMethodManager imm = (InputMethodManager)getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
                imm.hideSoftInputFromWindow(view.getWindowToken(), 0);

                DonateConfirmationDialog.newInstance(amount).show(getFragmentManager(), "confirm_donation");
            }
        });
        return view;
    }

    // TODO: Rename method, update argument and hook method into UI event
    public void onButtonPressed(Uri uri) {
        if (mListener != null) {
            mListener.onFragmentInteraction(uri);
        }
    }

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        try {