// Path: app/src/main/java/com/ToxicBakery/app/screenshot_redaction/fragment/FragmentSettings.java
// public class FragmentSettings extends PreferenceFragment implements Preference.OnPreferenceClickListener {
// 
//     public static final String TAG = "FragmentSettings";
//     public static final String PREF_LICENSES = "pref_licenses";
//     public static final String PREF_DICTIONARIES = "pref_dictionaries";
// 
//     @Override
//     public void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
// 
//         addPreferencesFromResource(R.xml.settings);
// 
//         findPreference(PREF_LICENSES).setOnPreferenceClickListener(this);
//         findPreference(PREF_DICTIONARIES).setOnPreferenceClickListener(this);
//     }
// 
//     @Override
//     public boolean onPreferenceClick(Preference preference) {
//         switch (preference.getKey()) {
//             case PREF_LICENSES:
//                 Intent intent = new Intent(getActivity(), ActivityLicenses.class);
//                 startActivity(intent);
//                 return true;
//             case PREF_DICTIONARIES:
//                 new DictionarySelectionDialog().show(getFragmentManager(), DictionarySelectionDialog.TAG);
//                 return true;
//         }
//         return false;
//     }
// 
// }
// 
// Path: app/src/main/java/com/ToxicBakery/app/screenshot_redaction/util/PermissionCheck.java
// public class PermissionCheck {
// 
//     public static boolean hasPermissions(@NonNull Context context,
//                                          @NonNull String[] requiredPermissions) {
// 
//         for (String requiredPermission : requiredPermissions) {
//             int grant = PermissionChecker.checkSelfPermission(context, requiredPermission);
//             if (grant != PermissionChecker.PERMISSION_GRANTED) {
//                 return false;
//             }
//         }
// 
//         return true;
//     }
// 
// }


import android.Manifest;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.ToxicBakery.android.version.Is;
import com.ToxicBakery.app.screenshot_redaction.fragment.FragmentSettings;
import com.ToxicBakery.app.screenshot_redaction.util.PermissionCheck;
import jonathanfinerty.once.Once;
import static com.ToxicBakery.android.version.SdkVersion.MARSHMALLOW;
package com.ToxicBakery.app.screenshot_redaction;





public class ActivitySettings extends AppCompatActivity {

    private static final String KEY_SHOW_TUTORIAL = "KEY_SHOW_TUTORIAL";
    private static final String[] REQUIRED_PERMISSIONS = {
            Manifest.permission.READ_EXTERNAL_STORAGE
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_settings);

        if (savedInstanceState == null) {
            getFragmentManager().beginTransaction()
                    .replace(R.id.container, new FragmentSettings(), FragmentSettings.TAG)
                    .commit();
        }

// Path: app/src/main/java/com/ToxicBakery/app/screenshot_redaction/fragment/FragmentSettings.java
// public class FragmentSettings extends PreferenceFragment implements Preference.OnPreferenceClickListener {
// 
//     public static final String TAG = "FragmentSettings";
//     public static final String PREF_LICENSES = "pref_licenses";
//     public static final String PREF_DICTIONARIES = "pref_dictionaries";
// 
//     @Override
//     public void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
// 
//         addPreferencesFromResource(R.xml.settings);
// 
//         findPreference(PREF_LICENSES).setOnPreferenceClickListener(this);
//         findPreference(PREF_DICTIONARIES).setOnPreferenceClickListener(this);
//     }
// 
//     @Override
//     public boolean onPreferenceClick(Preference preference) {
//         switch (preference.getKey()) {
//             case PREF_LICENSES:
//                 Intent intent = new Intent(getActivity(), ActivityLicenses.class);
//                 startActivity(intent);
//                 return true;
//             case PREF_DICTIONARIES:
//                 new DictionarySelectionDialog().show(getFragmentManager(), DictionarySelectionDialog.TAG);
//                 return true;
//         }
//         return false;
//     }
// 
// }
// 
// Path: app/src/main/java/com/ToxicBakery/app/screenshot_redaction/util/PermissionCheck.java
// public class PermissionCheck {
// 
//     public static boolean hasPermissions(@NonNull Context context,
//                                          @NonNull String[] requiredPermissions) {
// 
//         for (String requiredPermission : requiredPermissions) {
//             int grant = PermissionChecker.checkSelfPermission(context, requiredPermission);
//             if (grant != PermissionChecker.PERMISSION_GRANTED) {
//                 return false;
//             }
//         }
// 
//         return true;
//     }
// 
// }


// Path: app/src/main/java/com/ToxicBakery/app/screenshot_redaction/ActivitySettings.java
import android.Manifest;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.ToxicBakery.android.version.Is;
import com.ToxicBakery.app.screenshot_redaction.fragment.FragmentSettings;
import com.ToxicBakery.app.screenshot_redaction.util.PermissionCheck;
import jonathanfinerty.once.Once;
import static com.ToxicBakery.android.version.SdkVersion.MARSHMALLOW;

package com.ToxicBakery.app.screenshot_redaction;





public class ActivitySettings extends AppCompatActivity {

    private static final String KEY_SHOW_TUTORIAL = "KEY_SHOW_TUTORIAL";
    private static final String[] REQUIRED_PERMISSIONS = {
            Manifest.permission.READ_EXTERNAL_STORAGE
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_settings);

        if (savedInstanceState == null) {
            getFragmentManager().beginTransaction()
                    .replace(R.id.container, new FragmentSettings(), FragmentSettings.TAG)
                    .commit();
        }

        final boolean hasPermissions = PermissionCheck.hasPermissions(this, REQUIRED_PERMISSIONS);