Skip to content

Commit

Permalink
Move SettingsHelper to outer package
Browse files Browse the repository at this point in the history
  • Loading branch information
renyuneyun committed Feb 20, 2018
1 parent 01cc52c commit 179fc32
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 1 addition & 2 deletions app/src/main/java/ryey/easer/EaserApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ public void onCreate() {

Logger.addLogAdapter(new AndroidLogAdapter());

if (PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).
getBoolean(getString(R.string.key_pref_logging), false)) {
if (SettingsHelper.logging(this)) {
if (ContextCompat.checkSelfPermission(getApplicationContext(),
Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
Logger.addLogAdapter(new DiskLogAdapter());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ryey.easer.core;
package ryey.easer;

import android.content.Context;
import android.preference.PreferenceManager;
Expand All @@ -18,4 +18,9 @@ public static boolean passiveMode(Context context) {
.getBoolean(context.getString(R.string.key_pref_passive_mode), true);
}

public static boolean logging(Context context) {
return PreferenceManager.getDefaultSharedPreferences(context).
getBoolean(context.getString(R.string.key_pref_logging), false);
}

}
1 change: 1 addition & 0 deletions app/src/main/java/ryey/easer/core/EHService.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import ryey.easer.SettingsHelper;
import ryey.easer.core.data.EventTree;
import ryey.easer.core.data.storage.EventDataStorage;

Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/ryey/easer/core/Lotus.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.util.Locale;
import java.util.concurrent.ExecutorService;

import ryey.easer.SettingsHelper;
import ryey.easer.commons.plugindef.eventplugin.AbstractSlot;
import ryey.easer.commons.plugindef.eventplugin.EventData;
import ryey.easer.commons.plugindef.eventplugin.EventPlugin;
Expand Down

0 comments on commit 179fc32

Please sign in to comment.