// Path: app/src/main/java/ca/rmen/android/scrumchatter/util/Log.java
// @SuppressWarnings("unused")
// public class Log {
//     public static void v(String tag, String message) {
//         if (BuildConfig.DEBUG) android.util.Log.v(tag, message);
//     }
// 
//     public static void v(String tag, String message, Throwable t) {
//         if (BuildConfig.DEBUG) android.util.Log.v(tag, message, t);
//     }
// 
//     public static void d(String tag, String message) {
//         if (BuildConfig.DEBUG) android.util.Log.d(tag, message);
//     }
// 
//     public static void d(String tag, String message, Throwable t) {
//         if (BuildConfig.DEBUG) android.util.Log.d(tag, message, t);
//     }
// 
//     public static void i(String tag, String message) {
//         android.util.Log.i(tag, message);
//     }
// 
//     public static void i(String tag, String message, Throwable t) {
//         android.util.Log.i(tag, message, t);
//     }
// 
//     public static void w(String tag, String message) {
//         android.util.Log.w(tag, message);
//     }
// 
//     public static void w(String tag, String message, Throwable t) {
//         android.util.Log.w(tag, message, t);
//     }
// 
//     public static void e(String tag, String message) {
//         android.util.Log.e(tag, message);
//     }
// 
//     public static void e(String tag, String message, Throwable t) {
//         android.util.Log.e(tag, message, t);
//     }
// 
//     public static void wtf(String tag, String message) {
//         android.util.Log.wtf(tag, message);
//     }
// 
//     public static void wtf(String tag, String message, Throwable t) {
//         android.util.Log.wtf(tag, message, t);
//     }
// }
// 
// Path: app/src/main/java/ca/rmen/android/scrumchatter/Constants.java
// public class Constants {
//     public static final String TAG = "ScrumChatter";
//     public static final String PREF_TEAM_ID = "team_id";
//     public static final int DEFAULT_TEAM_ID = 1;
//     public static final String DEFAULT_TEAM_NAME = "Team A";
// }
// 
// Path: app/src/main/java/ca/rmen/android/scrumchatter/dialog/ChoiceDialogFragment.java
// public interface DialogItemListener {
//     void onItemSelected(int actionId, CharSequence[] choices, int which);
// }
// 
// Path: app/src/main/java/ca/rmen/android/scrumchatter/dialog/ConfirmDialogFragment.java
// public interface DialogButtonListener {
//     void onOkClicked(int actionId, Bundle extras);
// }


import java.util.Arrays;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentActivity;
import ca.rmen.android.scrumchatter.util.Log;
import ca.rmen.android.scrumchatter.Constants;
import ca.rmen.android.scrumchatter.dialog.ChoiceDialogFragment.DialogItemListener;
import ca.rmen.android.scrumchatter.dialog.ConfirmDialogFragment.DialogButtonListener;
/*
 * Copyright 2013-2017 Carmen Alvarez
 *
 * This file is part of Scrum Chatter.
 *
 * Scrum Chatter is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Scrum Chatter is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Scrum Chatter. If not, see <http://www.gnu.org/licenses/>.
 */
package ca.rmen.android.scrumchatter.dialog;



/**
 * Create different types of dialog fragments (edit text input, information, choice, confirmation, progress).
 * The dialogs created by this class are not only created but also shown in the activity given to the creation methods.
 */
public class DialogFragmentFactory extends DialogFragment {

    private static final String TAG = Constants.TAG + "/" + DialogFragmentFactory.class.getSimpleName();
    static final String EXTRA_TITLE = "title";
    static final String EXTRA_MESSAGE = "message";
    static final String EXTRA_ACTION_ID = "action_id";
    static final String EXTRA_CHOICES = "choices";
    static final String EXTRA_SELECTED_ITEM = "selected_item";
    static final String EXTRA_EXTRAS = "extras";
    static final String EXTRA_INPUT_HINT = "input_hint";
    static final String EXTRA_INPUT_VALIDATOR_CLASS = "input_validator_class";
    static final String EXTRA_ENTERED_TEXT = "entered_text";

    /**
     * @param inputValidatorClass will be called with each text event on the edit text, to validate the user's input.
     */
    public static void showInputDialog(FragmentActivity activity, String title, String inputHint, String prefilledText,
            Class<?> inputValidatorClass, int actionId, Bundle extras) {
// Path: app/src/main/java/ca/rmen/android/scrumchatter/util/Log.java
// @SuppressWarnings("unused")
// public class Log {
//     public static void v(String tag, String message) {
//         if (BuildConfig.DEBUG) android.util.Log.v(tag, message);
//     }
// 
//     public static void v(String tag, String message, Throwable t) {
//         if (BuildConfig.DEBUG) android.util.Log.v(tag, message, t);
//     }
// 
//     public static void d(String tag, String message) {
//         if (BuildConfig.DEBUG) android.util.Log.d(tag, message);
//     }
// 
//     public static void d(String tag, String message, Throwable t) {
//         if (BuildConfig.DEBUG) android.util.Log.d(tag, message, t);
//     }
// 
//     public static void i(String tag, String message) {
//         android.util.Log.i(tag, message);
//     }
// 
//     public static void i(String tag, String message, Throwable t) {
//         android.util.Log.i(tag, message, t);
//     }
// 
//     public static void w(String tag, String message) {
//         android.util.Log.w(tag, message);
//     }
// 
//     public static void w(String tag, String message, Throwable t) {
//         android.util.Log.w(tag, message, t);
//     }
// 
//     public static void e(String tag, String message) {
//         android.util.Log.e(tag, message);
//     }
// 
//     public static void e(String tag, String message, Throwable t) {
//         android.util.Log.e(tag, message, t);
//     }
// 
//     public static void wtf(String tag, String message) {
//         android.util.Log.wtf(tag, message);
//     }
// 
//     public static void wtf(String tag, String message, Throwable t) {
//         android.util.Log.wtf(tag, message, t);
//     }
// }
// 
// Path: app/src/main/java/ca/rmen/android/scrumchatter/Constants.java
// public class Constants {
//     public static final String TAG = "ScrumChatter";
//     public static final String PREF_TEAM_ID = "team_id";
//     public static final int DEFAULT_TEAM_ID = 1;
//     public static final String DEFAULT_TEAM_NAME = "Team A";
// }
// 
// Path: app/src/main/java/ca/rmen/android/scrumchatter/dialog/ChoiceDialogFragment.java
// public interface DialogItemListener {
//     void onItemSelected(int actionId, CharSequence[] choices, int which);
// }
// 
// Path: app/src/main/java/ca/rmen/android/scrumchatter/dialog/ConfirmDialogFragment.java
// public interface DialogButtonListener {
//     void onOkClicked(int actionId, Bundle extras);
// }


// Path: app/src/main/java/ca/rmen/android/scrumchatter/dialog/DialogFragmentFactory.java
import java.util.Arrays;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentActivity;
import ca.rmen.android.scrumchatter.util.Log;
import ca.rmen.android.scrumchatter.Constants;
import ca.rmen.android.scrumchatter.dialog.ChoiceDialogFragment.DialogItemListener;
import ca.rmen.android.scrumchatter.dialog.ConfirmDialogFragment.DialogButtonListener;

/*
 * Copyright 2013-2017 Carmen Alvarez
 *
 * This file is part of Scrum Chatter.
 *
 * Scrum Chatter is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Scrum Chatter is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Scrum Chatter. If not, see <http://www.gnu.org/licenses/>.
 */
package ca.rmen.android.scrumchatter.dialog;



/**
 * Create different types of dialog fragments (edit text input, information, choice, confirmation, progress).
 * The dialogs created by this class are not only created but also shown in the activity given to the creation methods.
 */
public class DialogFragmentFactory extends DialogFragment {

    private static final String TAG = Constants.TAG + "/" + DialogFragmentFactory.class.getSimpleName();
    static final String EXTRA_TITLE = "title";
    static final String EXTRA_MESSAGE = "message";
    static final String EXTRA_ACTION_ID = "action_id";
    static final String EXTRA_CHOICES = "choices";
    static final String EXTRA_SELECTED_ITEM = "selected_item";
    static final String EXTRA_EXTRAS = "extras";
    static final String EXTRA_INPUT_HINT = "input_hint";
    static final String EXTRA_INPUT_VALIDATOR_CLASS = "input_validator_class";
    static final String EXTRA_ENTERED_TEXT = "entered_text";

    /**
     * @param inputValidatorClass will be called with each text event on the edit text, to validate the user's input.
     */
    public static void showInputDialog(FragmentActivity activity, String title, String inputHint, String prefilledText,
            Class<?> inputValidatorClass, int actionId, Bundle extras) {
        Log.v(TAG, "showInputDialog: title = " + title + ", prefilledText =  " + prefilledText + ", actionId = " + actionId + ", extras = " + extras);