Skip to content

Commit

Permalink
Add enabling/disabling Tweak Store
Browse files Browse the repository at this point in the history
  • Loading branch information
Blanka Kulik committed Sep 5, 2017
1 parent 82f68a0 commit d141155
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class TweakStore {
public static final String SHARED_PREFERENCES = "sharedPreferences";
private static TweakStore tweakStore;
private final String tweakStoreName;
private Boolean isEnabled = false;
private final List<Collection> collections = new ArrayList<>();
private final SharedPreferences sharedPreferences;
private final List<Callback> callbacks = new ArrayList<>();
Expand All @@ -38,6 +39,14 @@ public static TweakStore getInstance(Context context, String tweakStoreName) {
return tweakStore;
}

public void setEnabled(Boolean value) {
isEnabled = value;
}

public Boolean isEnabled() {
return isEnabled;
}

public void setValue(TweakBoolean tweakBoolean, Boolean value) {
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean(getTweakBooleanKey(tweakBoolean), value);
Expand Down

0 comments on commit d141155

Please sign in to comment.