Use wrapper for interacting with shared preferences (#2288)

* Use wrapper for accessing shared preferences across the app

* Use Json kv store for storing place object

* Fix tests

* Fix test failure

* Fix UI tests
This commit is contained in:
Vivek Maskara 2019-01-14 00:13:21 +05:30 committed by Ashish Kumar
parent 1b7b909107
commit d4fa9cfa45
61 changed files with 908 additions and 585 deletions

View file

@ -1,12 +1,10 @@
package fr.free.nrw.commons;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.customtabs.CustomTabsIntent;
import android.support.v4.content.ContextCompat;
@ -165,15 +163,6 @@ public class Utils {
return title;
}
/**
* Tells whether dark theme is active or not
* @param context Activity context
* @return The state of dark theme
*/
public static boolean isDarkTheme(Context context) {
return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("theme", false);
}
/**
* Launches intent to rate app
* @param context