Skip to content

Commit

Permalink
add getNativeBooleanSetting method
Browse files Browse the repository at this point in the history
  • Loading branch information
akinwale committed Mar 21, 2020
1 parent 4d1f142 commit 5aa0513
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/src/main/java/io/lbry/browser/reactmodules/UtilityModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,16 @@ protected Void doInBackground(Void... params) {
}
}

@ReactMethod
public void getNativeBooleanSetting(String key, boolean defaultValue, Promise promise) {
if (context != null) {
SharedPreferences sp = context.getSharedPreferences(MainActivity.SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
promise.resolve(sp.getBoolean(key, defaultValue));
} else {
promise.resolve(null);
}
}

@ReactMethod
public void setNativeStringSetting(String key, String value) {
if (context != null) {
Expand Down

0 comments on commit 5aa0513

Please sign in to comment.