// Path: app/src/main/java/com/ryansteckler/inappbilling/Purchase.java
// public class Purchase {
//     String mItemType;  // ITEM_TYPE_INAPP or ITEM_TYPE_SUBS
//     String mOrderId;
//     String mPackageName;
//     String mSku;
//     long mPurchaseTime;
//     int mPurchaseState;
//     String mDeveloperPayload;
//     String mToken;
//     String mOriginalJson;
//     String mSignature;
// 
//     public Purchase(String itemType, String jsonPurchaseInfo, String signature) throws JSONException {
//         mItemType = itemType;
//         mOriginalJson = jsonPurchaseInfo;
//         JSONObject o = new JSONObject(mOriginalJson);
//         mOrderId = o.optString("orderId");
//         mPackageName = o.optString("packageName");
//         mSku = o.optString("productId");
//         mPurchaseTime = o.optLong("purchaseTime");
//         mPurchaseState = o.optInt("purchaseState");
//         mDeveloperPayload = o.optString("developerPayload");
//         mToken = o.optString("token", o.optString("purchaseToken"));
//         mSignature = signature;
//     }
// 
//     public String getItemType() { return mItemType; }
//     public String getOrderId() { return mOrderId; }
//     public String getPackageName() { return mPackageName; }
//     public String getSku() { return mSku; }
//     public long getPurchaseTime() { return mPurchaseTime; }
//     public int getPurchaseState() { return mPurchaseState; }
//     public String getDeveloperPayload() { return mDeveloperPayload; }
//     public String getToken() { return mToken; }
//     public String getOriginalJson() { return mOriginalJson; }
//     public String getSignature() { return mSignature; }
// 
//     @Override
//     public String toString() { return "PurchaseInfo(type:" + mItemType + "):" + mOriginalJson; }
// }
// 
// Path: app/src/main/java/com/ryansteckler/nlpunbounce/helpers/ThemeHelper.java
// public class ThemeHelper {
// 
//     private static int sTheme = -1;
//     public final static int THEME_DEFAULT = 0;
//     public final static int THEME_DARK = 1;
//     /**
//      * Set the theme of the Activity, and restart it by creating a new Activity of the same type.
//      */
//     public static void changeToTheme(Activity activity, int theme)
//     {
//         sTheme = theme;
//         activity.finish();
//         activity.startActivity(new Intent(activity, activity.getClass()));
//     }
//     /** Set the theme of the activity, according to the configuration. */
//     public static int onActivityCreateSetTheme(Activity activity)
//     {
//         if (sTheme == -1) {
//             // Load from prefs
//             SharedPreferences prefs = activity.getSharedPreferences("com.ryansteckler.nlpunbounce" + "_preferences", Context.MODE_WORLD_READABLE);
//             sTheme = prefs.getString("theme", "default").equals("default") ? THEME_DEFAULT : THEME_DARK;
//         }
// 
//         switch (sTheme)
//         {
//             default:
//             case THEME_DEFAULT:
//                 activity.setTheme(R.style.UnbounceThemeLight);
//                 break;
//             case THEME_DARK:
//                 activity.setTheme(R.style.UnbounceThemeDark);
//                 break;
//         }
//         return sTheme;
//     }
//     public static int onActivityResumeVerifyTheme(Activity activity, int curTheme)
//     {
//         if (curTheme != sTheme) {
//             changeToTheme(activity, sTheme);
//         }
// 
//         return sTheme;
//     }
// 
//     public static int getTheme() {
//         return sTheme;
//     }
// 
// }


import android.animation.ArgbEvaluator;
import android.animation.ValueAnimator;
import android.app.ActionBar;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.FragmentManager;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.text.method.LinkMovementMethod;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.ryansteckler.inappbilling.IabHelper;
import com.ryansteckler.inappbilling.IabResult;
import com.ryansteckler.inappbilling.Inventory;
import com.ryansteckler.inappbilling.Purchase;
import com.ryansteckler.nlpunbounce.helpers.LocaleHelper;
import com.ryansteckler.nlpunbounce.helpers.ThemeHelper;
package com.ryansteckler.nlpunbounce;




public class MaterialSettingsActivity extends Activity
        implements NavigationDrawerFragment.NavigationDrawerCallbacks,
        WakelocksFragment.OnFragmentInteractionListener,
        BaseDetailFragment.FragmentInteractionListener,
        HomeFragment.OnFragmentInteractionListener,
        AlarmsFragment.OnFragmentInteractionListener,
        ServicesFragment.OnFragmentInteractionListener
    {

    /**
     * Fragment managing the behaviors, interactions and presentation of the navigation drawer.
     */
    private NavigationDrawerFragment mNavigationDrawerFragment;

    IabHelper mHelper;

// Path: app/src/main/java/com/ryansteckler/inappbilling/Purchase.java
// public class Purchase {
//     String mItemType;  // ITEM_TYPE_INAPP or ITEM_TYPE_SUBS
//     String mOrderId;
//     String mPackageName;
//     String mSku;
//     long mPurchaseTime;
//     int mPurchaseState;
//     String mDeveloperPayload;
//     String mToken;
//     String mOriginalJson;
//     String mSignature;
// 
//     public Purchase(String itemType, String jsonPurchaseInfo, String signature) throws JSONException {
//         mItemType = itemType;
//         mOriginalJson = jsonPurchaseInfo;
//         JSONObject o = new JSONObject(mOriginalJson);
//         mOrderId = o.optString("orderId");
//         mPackageName = o.optString("packageName");
//         mSku = o.optString("productId");
//         mPurchaseTime = o.optLong("purchaseTime");
//         mPurchaseState = o.optInt("purchaseState");
//         mDeveloperPayload = o.optString("developerPayload");
//         mToken = o.optString("token", o.optString("purchaseToken"));
//         mSignature = signature;
//     }
// 
//     public String getItemType() { return mItemType; }
//     public String getOrderId() { return mOrderId; }
//     public String getPackageName() { return mPackageName; }
//     public String getSku() { return mSku; }
//     public long getPurchaseTime() { return mPurchaseTime; }
//     public int getPurchaseState() { return mPurchaseState; }
//     public String getDeveloperPayload() { return mDeveloperPayload; }
//     public String getToken() { return mToken; }
//     public String getOriginalJson() { return mOriginalJson; }
//     public String getSignature() { return mSignature; }
// 
//     @Override
//     public String toString() { return "PurchaseInfo(type:" + mItemType + "):" + mOriginalJson; }
// }
// 
// Path: app/src/main/java/com/ryansteckler/nlpunbounce/helpers/ThemeHelper.java
// public class ThemeHelper {
// 
//     private static int sTheme = -1;
//     public final static int THEME_DEFAULT = 0;
//     public final static int THEME_DARK = 1;
//     /**
//      * Set the theme of the Activity, and restart it by creating a new Activity of the same type.
//      */
//     public static void changeToTheme(Activity activity, int theme)
//     {
//         sTheme = theme;
//         activity.finish();
//         activity.startActivity(new Intent(activity, activity.getClass()));
//     }
//     /** Set the theme of the activity, according to the configuration. */
//     public static int onActivityCreateSetTheme(Activity activity)
//     {
//         if (sTheme == -1) {
//             // Load from prefs
//             SharedPreferences prefs = activity.getSharedPreferences("com.ryansteckler.nlpunbounce" + "_preferences", Context.MODE_WORLD_READABLE);
//             sTheme = prefs.getString("theme", "default").equals("default") ? THEME_DEFAULT : THEME_DARK;
//         }
// 
//         switch (sTheme)
//         {
//             default:
//             case THEME_DEFAULT:
//                 activity.setTheme(R.style.UnbounceThemeLight);
//                 break;
//             case THEME_DARK:
//                 activity.setTheme(R.style.UnbounceThemeDark);
//                 break;
//         }
//         return sTheme;
//     }
//     public static int onActivityResumeVerifyTheme(Activity activity, int curTheme)
//     {
//         if (curTheme != sTheme) {
//             changeToTheme(activity, sTheme);
//         }
// 
//         return sTheme;
//     }
// 
//     public static int getTheme() {
//         return sTheme;
//     }
// 
// }


// Path: app/src/main/java/com/ryansteckler/nlpunbounce/MaterialSettingsActivity.java
import android.animation.ArgbEvaluator;
import android.animation.ValueAnimator;
import android.app.ActionBar;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.FragmentManager;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.text.method.LinkMovementMethod;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.ryansteckler.inappbilling.IabHelper;
import com.ryansteckler.inappbilling.IabResult;
import com.ryansteckler.inappbilling.Inventory;
import com.ryansteckler.inappbilling.Purchase;
import com.ryansteckler.nlpunbounce.helpers.LocaleHelper;
import com.ryansteckler.nlpunbounce.helpers.ThemeHelper;

package com.ryansteckler.nlpunbounce;




public class MaterialSettingsActivity extends Activity
        implements NavigationDrawerFragment.NavigationDrawerCallbacks,
        WakelocksFragment.OnFragmentInteractionListener,
        BaseDetailFragment.FragmentInteractionListener,
        HomeFragment.OnFragmentInteractionListener,
        AlarmsFragment.OnFragmentInteractionListener,
        ServicesFragment.OnFragmentInteractionListener
    {

    /**
     * Fragment managing the behaviors, interactions and presentation of the navigation drawer.
     */
    private NavigationDrawerFragment mNavigationDrawerFragment;

    IabHelper mHelper;

    int mCurTheme = ThemeHelper.THEME_DEFAULT;