Niedzielski has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/223988

Change subject: Hygiene: add missing @StringRes in PrefsIoUtil
......................................................................

Hygiene: add missing @StringRes in PrefsIoUtil

Add missing @StringRes annotations throughout PrefsIoUtil and shorten
resource ID parameters to "id".

Change-Id: I5b165e63493f6344d3ae7fc1f480dedc7ca52305
---
M wikipedia/src/main/java/org/wikipedia/settings/PrefsIoUtil.java
1 file changed, 21 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/88/223988/1

diff --git a/wikipedia/src/main/java/org/wikipedia/settings/PrefsIoUtil.java 
b/wikipedia/src/main/java/org/wikipedia/settings/PrefsIoUtil.java
index c3fdf72..67069db 100644
--- a/wikipedia/src/main/java/org/wikipedia/settings/PrefsIoUtil.java
+++ b/wikipedia/src/main/java/org/wikipedia/settings/PrefsIoUtil.java
@@ -6,6 +6,7 @@
 import android.preference.PreferenceManager;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
+import android.support.annotation.StringRes;
 
 import org.wikipedia.WikipediaApp;
 
@@ -14,36 +15,35 @@
  * resources as keys, and unifies SP access. */
 /*package*/ final class PrefsIoUtil {
     @Nullable
-    public static String getString(int keyResourceId, @Nullable String 
defaultValue) {
-        return getString(getKey(keyResourceId), defaultValue);
+    public static String getString(@StringRes int id, @Nullable String 
defaultValue) {
+        return getString(getKey(id), defaultValue);
     }
 
-    public static void setString(int keyResourceId, @Nullable String value) {
-        setString(getKey(keyResourceId), value);
+    public static void setString(@StringRes int id, @Nullable String value) {
+        setString(getKey(id), value);
     }
 
-    public static long getLong(int keyResourceId, long defaultValue) {
-        return getLong(getKey(keyResourceId), defaultValue);
+    public static long getLong(@StringRes int id, long defaultValue) {
+        return getLong(getKey(id), defaultValue);
     }
 
-    public static void setLong(int keyResourceId, long value) {
-        setLong(getKey(keyResourceId), value);
+    public static void setLong(@StringRes int id, long value) {
+        setLong(getKey(id), value);
     }
-
     public static int getInt(int keyResourceId, int defaultValue) {
         return getInt(getKey(keyResourceId), defaultValue);
     }
 
-    public static void setInt(int keyResourceId, int value) {
-        setInt(getKey(keyResourceId), value);
+    public static void setInt(@StringRes int id, int value) {
+        setInt(getKey(id), value);
     }
 
-    public static boolean getBoolean(int keyResourceId, boolean defaultValue) {
-        return getBoolean(getKey(keyResourceId), defaultValue);
+    public static boolean getBoolean(@StringRes int id, boolean defaultValue) {
+        return getBoolean(getKey(id), defaultValue);
     }
 
-    public static void setBoolean(int keyResourceId, boolean value) {
-        setBoolean(getKey(keyResourceId), value);
+    public static void setBoolean(@StringRes int id, boolean value) {
+        setBoolean(getKey(id), value);
     }
 
     @Nullable
@@ -79,16 +79,16 @@
         edit().putBoolean(key, value).apply();
     }
 
-    public static void remove(int keyResourceId) {
-        remove(getKey(keyResourceId));
+    public static void remove(@StringRes int id) {
+        remove(getKey(id));
     }
 
     public static void remove(String key) {
         edit().remove(key).apply();
     }
 
-    public static boolean contains(int keyResourceId) {
-        return getPreferences().contains(getKey(keyResourceId));
+    public static boolean contains(@StringRes int id) {
+        return getPreferences().contains(getKey(id));
     }
 
     public static boolean contains(String key) {
@@ -97,7 +97,7 @@
 
     /** @return Key String resource from preference_keys.xml. */
     @NonNull
-    public static String getKey(int id, Object... formatArgs) {
+    public static String getKey(@StringRes int id, Object... formatArgs) {
         return getResources().getString(id, formatArgs);
     }
 
@@ -122,4 +122,4 @@
     }
 
     private PrefsIoUtil() { }
-}
\ No newline at end of file
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/223988
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b165e63493f6344d3ae7fc1f480dedc7ca52305
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski <sniedziel...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to