// Path: app/src/main/java/com/michaelvescovo/android/itemreaper/widget/ItemWidgetProvider.java
// public class ItemWidgetProvider extends AppWidgetProvider {
// 
//     public static final String ACTION_DATA_UPDATED = "data_updated";
//     public static final String ACTION_EDIT_NEW_ITEM = "action_edit_new_item";
// 
//     @Override
//     public void onReceive(Context context, Intent intent) {
//         super.onReceive(context, intent);
//         if (intent.getAction().equals(ACTION_DATA_UPDATED)) {
//             AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
//             int[] appWidgetIds = appWidgetManager.getAppWidgetIds(
//                     new ComponentName(context, getClass()));
//             appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds, R.id.widget_list);
//         }
//     }
// 
//     @Override
//     public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
//         super.onUpdate(context, appWidgetManager, appWidgetIds);
//         boolean largeScreen = context.getResources().getBoolean(R.bool.large_layout);
//         for (int appWidgetId : appWidgetIds) {
//             RemoteViews rv = new RemoteViews(context.getPackageName(), R.layout.widget);
// 
//             // WidgetListService intent for populating collection views.
//             Intent collectionIntent = new Intent(context, WidgetListService.class);
//             rv.setRemoteAdapter(R.id.widget_list, collectionIntent);
//             rv.setEmptyView(R.id.widget_list, R.id.widget_empty);
// 
//             // Intent for opening the main app from the widget title.
//             Intent itemReaperIntent = new Intent(context, ItemsActivity.class);
//             PendingIntent itemReaperPendingIntent = PendingIntent.getActivity(context, 0,
//                     itemReaperIntent, 0);
//             rv.setOnClickPendingIntent(R.id.widget_title, itemReaperPendingIntent);
// 
//             // Intent for adding an item when clicking the add item button.
//             Intent addItemIntent = largeScreen
//                     ? new Intent(context, ItemsActivity.class)
//                     : new Intent(context, EditItemActivity.class);
//             addItemIntent.putExtra(EXTRA_EDIT_NEW_ITEM, true);
//             addItemIntent.setAction(ACTION_EDIT_NEW_ITEM);
//             PendingIntent addItemPendingIntent = TaskStackBuilder.create(context)
//                     .addNextIntentWithParentStack(addItemIntent)
//                     .getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
//             rv.setOnClickPendingIntent(R.id.widget_add_item, addItemPendingIntent);
// 
//             // Collection for ItemDetailsActivity intent when opening individual list item.
//             Intent clickIntentTemplate = largeScreen
//                     ? new Intent(context, ItemsActivity.class)
//                     : new Intent(context, ItemDetailsActivity.class);
//             PendingIntent clickPendingIntentTemplate = TaskStackBuilder.create(context)
//                     .addNextIntentWithParentStack(clickIntentTemplate)
//                     .getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
//             rv.setPendingIntentTemplate(R.id.widget_list, clickPendingIntentTemplate);
//             appWidgetManager.updateAppWidget(appWidgetId, rv);
//         }
//     }
// 
//     @Override
//     public void onDeleted(Context context, int[] appWidgetIds) {
//         super.onDeleted(context, appWidgetIds);
//         for (int appWidgetId : appWidgetIds) {
//             RemoteViews rv = new RemoteViews(context.getPackageName(), R.layout.widget);
//             rv.removeAllViews(appWidgetId);
//         }
//     }
// }


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import com.google.android.gms.common.SignInButton;
import com.michaelvescovo.android.itemreaper.R;
import com.michaelvescovo.android.itemreaper.widget.ItemWidgetProvider;
import butterknife.BindView;
import butterknife.ButterKnife;
        }
    }

    @Override
    public void showSignInButton(boolean visible) {
        if (visible) {
            mSignInButton.setVisibility(View.VISIBLE);
        } else {
            mSignInButton.setVisibility(View.GONE);
        }
    }

    @Override
    public void showGoogleSignInUi() {
        mPresenter.handleGoogleSignInResult(true);
    }

    @Override
    public void showFailMessage() {
        Snackbar.make(getActivity().findViewById(android.R.id.content),
                getString(R.string.auth_failed), Snackbar.LENGTH_SHORT).show();
    }

    @Override
    public void showFireBaseAuthUi() {
        mPresenter.handleFirebaseSignInResult(true);
    }

    @Override
    public void updateWidget() {
// Path: app/src/main/java/com/michaelvescovo/android/itemreaper/widget/ItemWidgetProvider.java
// public class ItemWidgetProvider extends AppWidgetProvider {
// 
//     public static final String ACTION_DATA_UPDATED = "data_updated";
//     public static final String ACTION_EDIT_NEW_ITEM = "action_edit_new_item";
// 
//     @Override
//     public void onReceive(Context context, Intent intent) {
//         super.onReceive(context, intent);
//         if (intent.getAction().equals(ACTION_DATA_UPDATED)) {
//             AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
//             int[] appWidgetIds = appWidgetManager.getAppWidgetIds(
//                     new ComponentName(context, getClass()));
//             appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds, R.id.widget_list);
//         }
//     }
// 
//     @Override
//     public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
//         super.onUpdate(context, appWidgetManager, appWidgetIds);
//         boolean largeScreen = context.getResources().getBoolean(R.bool.large_layout);
//         for (int appWidgetId : appWidgetIds) {
//             RemoteViews rv = new RemoteViews(context.getPackageName(), R.layout.widget);
// 
//             // WidgetListService intent for populating collection views.
//             Intent collectionIntent = new Intent(context, WidgetListService.class);
//             rv.setRemoteAdapter(R.id.widget_list, collectionIntent);
//             rv.setEmptyView(R.id.widget_list, R.id.widget_empty);
// 
//             // Intent for opening the main app from the widget title.
//             Intent itemReaperIntent = new Intent(context, ItemsActivity.class);
//             PendingIntent itemReaperPendingIntent = PendingIntent.getActivity(context, 0,
//                     itemReaperIntent, 0);
//             rv.setOnClickPendingIntent(R.id.widget_title, itemReaperPendingIntent);
// 
//             // Intent for adding an item when clicking the add item button.
//             Intent addItemIntent = largeScreen
//                     ? new Intent(context, ItemsActivity.class)
//                     : new Intent(context, EditItemActivity.class);
//             addItemIntent.putExtra(EXTRA_EDIT_NEW_ITEM, true);
//             addItemIntent.setAction(ACTION_EDIT_NEW_ITEM);
//             PendingIntent addItemPendingIntent = TaskStackBuilder.create(context)
//                     .addNextIntentWithParentStack(addItemIntent)
//                     .getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
//             rv.setOnClickPendingIntent(R.id.widget_add_item, addItemPendingIntent);
// 
//             // Collection for ItemDetailsActivity intent when opening individual list item.
//             Intent clickIntentTemplate = largeScreen
//                     ? new Intent(context, ItemsActivity.class)
//                     : new Intent(context, ItemDetailsActivity.class);
//             PendingIntent clickPendingIntentTemplate = TaskStackBuilder.create(context)
//                     .addNextIntentWithParentStack(clickIntentTemplate)
//                     .getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
//             rv.setPendingIntentTemplate(R.id.widget_list, clickPendingIntentTemplate);
//             appWidgetManager.updateAppWidget(appWidgetId, rv);
//         }
//     }
// 
//     @Override
//     public void onDeleted(Context context, int[] appWidgetIds) {
//         super.onDeleted(context, appWidgetIds);
//         for (int appWidgetId : appWidgetIds) {
//             RemoteViews rv = new RemoteViews(context.getPackageName(), R.layout.widget);
//             rv.removeAllViews(appWidgetId);
//         }
//     }
// }


// Path: app/src/mock/java/com/michaelvescovo/android/itemreaper/auth/AuthFragment.java
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import com.google.android.gms.common.SignInButton;
import com.michaelvescovo.android.itemreaper.R;
import com.michaelvescovo.android.itemreaper.widget.ItemWidgetProvider;
import butterknife.BindView;
import butterknife.ButterKnife;

        }
    }

    @Override
    public void showSignInButton(boolean visible) {
        if (visible) {
            mSignInButton.setVisibility(View.VISIBLE);
        } else {
            mSignInButton.setVisibility(View.GONE);
        }
    }

    @Override
    public void showGoogleSignInUi() {
        mPresenter.handleGoogleSignInResult(true);
    }

    @Override
    public void showFailMessage() {
        Snackbar.make(getActivity().findViewById(android.R.id.content),
                getString(R.string.auth_failed), Snackbar.LENGTH_SHORT).show();
    }

    @Override
    public void showFireBaseAuthUi() {
        mPresenter.handleFirebaseSignInResult(true);
    }

    @Override
    public void updateWidget() {
        Intent updateWidgetIntent = new Intent(getContext(), ItemWidgetProvider.class);