// Path: app/src/main/java/tw/fatminmin/xposed/minminguard/ui/fragments/MainFragment.java
// public class MainFragment extends Fragment
// {
// 
//     public boolean isAlive = false;
//     private MainActivity mainActivity;
//     private FragmentMode mMode;
//     private Button mBtnMode;
//     private AppsAdapter adapter;
//     private SharedPreferences mModPref;
//     private final View.OnClickListener btnModeClick = new View.OnClickListener()
//     {
//         @Override
//         public void onClick(View v)
//         {
//             mModPref.edit().putString(Common.KEY_MODE, Common.getModeString(mMode)).apply();
//             mBtnMode.setVisibility(View.GONE);
//             adapter.notifyDataSetChanged();
//         }
//     };
// 
//     public static MainFragment newInstance(FragmentMode mode)
//     {
//         MainFragment fragment = new MainFragment();
//         Bundle args = new Bundle();
//         args.putInt("mode", mode.ordinal());
//         fragment.setArguments(args);
//         return fragment;
//     }
// 
//     @Override
//     public void onCreate(Bundle savedInstanceState)
//     {
//         super.onCreate(savedInstanceState);
//         setHasOptionsMenu(true);
//     }
// 
//     public void refreshUI()
//     {
//         if (mModPref.getString(Common.KEY_MODE, Common.VALUE_MODE_BLACKLIST).equals(Common.getModeString(mMode)))
//         {
//             mBtnMode.setVisibility(View.GONE);
//         }
//         else
//         {
//             mBtnMode.setVisibility(View.VISIBLE);
//         }
//     }
// 
//     @Override
//     public boolean onOptionsItemSelected(MenuItem item)
//     {
//         return super.onOptionsItemSelected(item);
//     }
// 
//     @Override
//     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
//     {
// 
//         mainActivity = (MainActivity) getActivity();
//         mModPref = mainActivity.modPref;
//         mMode = FragmentMode.values()[getArguments().getInt("mode")];
// 
//         View view = inflater.inflate(R.layout.fragment_main, container, false);
// 
//         TextView mTxtXposedEnabled = view.findViewById(R.id.txt_xposed_enable);
//         mBtnMode = view.findViewById(R.id.btn_mode);
// 
//         RecyclerView mRecyclerView = view.findViewById(R.id.recycler_view);
// 
//         if (!Util.xposedEnabled())
//         {
//             mTxtXposedEnabled.setVisibility(View.VISIBLE);
//         }
// 
//         /* setup apply button */
//         mBtnMode.setOnClickListener(btnModeClick);
//         if (mModPref.getString(Common.KEY_MODE, Common.VALUE_MODE_BLACKLIST).equals(Common.getModeString(mMode)))
//         {
//             mBtnMode.setVisibility(View.GONE);
//         }
// 
//         mRecyclerView.setLayoutManager(new LinearLayoutManager(mainActivity));
//         adapter = new AppsAdapter(getActivity(), mainActivity.masterAppList, mMode);
//         mRecyclerView.setAdapter(adapter);
// 
//         isAlive = true;
//         return view;
//     }
// 
//     public FragmentMode getMode()
//     {
//         return mMode;
//     }
// 
//     public void updateAndNotify(ArrayList<AppDetails> list)
//     {
//         adapter.setAppList(list);
//         adapter.notifyDataSetChanged();
//     }
// 
//     public enum FragmentMode
//     {
//         AUTO, BLACKLIST, WHITELIST
//     }
// }


import tw.fatminmin.xposed.minminguard.ui.fragments.MainFragment;
package tw.fatminmin.xposed.minminguard;


/**
 * Created by fatminmin on 2015/10/1.
 */
public class Common
{
    public final static String PACKAGE_NAME = BuildConfig.APPLICATION_ID;

    public final static String MOD_PREFS = "ModSettings";
    public final static String UI_PREFS = "UI_PREF";

    // UI Pref
    public final static String KEY_FIRST_TIME = "first_time_2_0_alpha_7";
    public final static String KEY_SHOW_SYSTEM_APPS = "show_system_apps";
    public final static String KEY_SHOW_LAUNCHER_ICON = "show_launcher_icon";

    // Xposed Mod Pref
    public final static String KEY_MODE = "mode";
    public final static String VALUE_MODE_AUTO = "auto";
    public final static String VALUE_MODE_BLACKLIST = "blacklist";
    public final static String VALUE_MODE_WHITELIST = "whitelist";

    // Fragment Name
    public final static String FRG_MAIN = "main_fragment";

    // MinMinProvider
    public final static String KEY_PKG_NAME = "PKG_NAME";
    public final static String KEY_NETWORK = "AD_NETWORKS";
    public final static String KEY_BLOCK_NUM = "BLOCK_NUM";

    private Common() throws InstantiationException
    {
        throw new InstantiationException("This class is not for instantiation");
    }

// Path: app/src/main/java/tw/fatminmin/xposed/minminguard/ui/fragments/MainFragment.java
// public class MainFragment extends Fragment
// {
// 
//     public boolean isAlive = false;
//     private MainActivity mainActivity;
//     private FragmentMode mMode;
//     private Button mBtnMode;
//     private AppsAdapter adapter;
//     private SharedPreferences mModPref;
//     private final View.OnClickListener btnModeClick = new View.OnClickListener()
//     {
//         @Override
//         public void onClick(View v)
//         {
//             mModPref.edit().putString(Common.KEY_MODE, Common.getModeString(mMode)).apply();
//             mBtnMode.setVisibility(View.GONE);
//             adapter.notifyDataSetChanged();
//         }
//     };
// 
//     public static MainFragment newInstance(FragmentMode mode)
//     {
//         MainFragment fragment = new MainFragment();
//         Bundle args = new Bundle();
//         args.putInt("mode", mode.ordinal());
//         fragment.setArguments(args);
//         return fragment;
//     }
// 
//     @Override
//     public void onCreate(Bundle savedInstanceState)
//     {
//         super.onCreate(savedInstanceState);
//         setHasOptionsMenu(true);
//     }
// 
//     public void refreshUI()
//     {
//         if (mModPref.getString(Common.KEY_MODE, Common.VALUE_MODE_BLACKLIST).equals(Common.getModeString(mMode)))
//         {
//             mBtnMode.setVisibility(View.GONE);
//         }
//         else
//         {
//             mBtnMode.setVisibility(View.VISIBLE);
//         }
//     }
// 
//     @Override
//     public boolean onOptionsItemSelected(MenuItem item)
//     {
//         return super.onOptionsItemSelected(item);
//     }
// 
//     @Override
//     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
//     {
// 
//         mainActivity = (MainActivity) getActivity();
//         mModPref = mainActivity.modPref;
//         mMode = FragmentMode.values()[getArguments().getInt("mode")];
// 
//         View view = inflater.inflate(R.layout.fragment_main, container, false);
// 
//         TextView mTxtXposedEnabled = view.findViewById(R.id.txt_xposed_enable);
//         mBtnMode = view.findViewById(R.id.btn_mode);
// 
//         RecyclerView mRecyclerView = view.findViewById(R.id.recycler_view);
// 
//         if (!Util.xposedEnabled())
//         {
//             mTxtXposedEnabled.setVisibility(View.VISIBLE);
//         }
// 
//         /* setup apply button */
//         mBtnMode.setOnClickListener(btnModeClick);
//         if (mModPref.getString(Common.KEY_MODE, Common.VALUE_MODE_BLACKLIST).equals(Common.getModeString(mMode)))
//         {
//             mBtnMode.setVisibility(View.GONE);
//         }
// 
//         mRecyclerView.setLayoutManager(new LinearLayoutManager(mainActivity));
//         adapter = new AppsAdapter(getActivity(), mainActivity.masterAppList, mMode);
//         mRecyclerView.setAdapter(adapter);
// 
//         isAlive = true;
//         return view;
//     }
// 
//     public FragmentMode getMode()
//     {
//         return mMode;
//     }
// 
//     public void updateAndNotify(ArrayList<AppDetails> list)
//     {
//         adapter.setAppList(list);
//         adapter.notifyDataSetChanged();
//     }
// 
//     public enum FragmentMode
//     {
//         AUTO, BLACKLIST, WHITELIST
//     }
// }


// Path: app/src/main/java/tw/fatminmin/xposed/minminguard/Common.java
import tw.fatminmin.xposed.minminguard.ui.fragments.MainFragment;

package tw.fatminmin.xposed.minminguard;


/**
 * Created by fatminmin on 2015/10/1.
 */
public class Common
{
    public final static String PACKAGE_NAME = BuildConfig.APPLICATION_ID;

    public final static String MOD_PREFS = "ModSettings";
    public final static String UI_PREFS = "UI_PREF";

    // UI Pref
    public final static String KEY_FIRST_TIME = "first_time_2_0_alpha_7";
    public final static String KEY_SHOW_SYSTEM_APPS = "show_system_apps";
    public final static String KEY_SHOW_LAUNCHER_ICON = "show_launcher_icon";

    // Xposed Mod Pref
    public final static String KEY_MODE = "mode";
    public final static String VALUE_MODE_AUTO = "auto";
    public final static String VALUE_MODE_BLACKLIST = "blacklist";
    public final static String VALUE_MODE_WHITELIST = "whitelist";

    // Fragment Name
    public final static String FRG_MAIN = "main_fragment";

    // MinMinProvider
    public final static String KEY_PKG_NAME = "PKG_NAME";
    public final static String KEY_NETWORK = "AD_NETWORKS";
    public final static String KEY_BLOCK_NUM = "BLOCK_NUM";

    private Common() throws InstantiationException
    {
        throw new InstantiationException("This class is not for instantiation");
    }

    public static String getModeString(MainFragment.FragmentMode mode)