Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'android/src/com/mapswithme/maps/bookmarks/data/Icon.java')
-rw-r--r--android/src/com/mapswithme/maps/bookmarks/data/Icon.java25
1 files changed, 24 insertions, 1 deletions
diff --git a/android/src/com/mapswithme/maps/bookmarks/data/Icon.java b/android/src/com/mapswithme/maps/bookmarks/data/Icon.java
index 3d89451c12..5ae7ac73ff 100644
--- a/android/src/com/mapswithme/maps/bookmarks/data/Icon.java
+++ b/android/src/com/mapswithme/maps/bookmarks/data/Icon.java
@@ -1,14 +1,35 @@
package com.mapswithme.maps.bookmarks.data;
+import android.support.annotation.IntDef;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
public class Icon
{
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef({ PREDEFINED_COLOR_NONE, PREDEFINED_COLOR_RED, PREDEFINED_COLOR_BLUE,
+ PREDEFINED_COLOR_PURPLE, PREDEFINED_COLOR_YELLOW, PREDEFINED_COLOR_PINK,
+ PREDEFINED_COLOR_BROWN, PREDEFINED_COLOR_GREEN, PREDEFINED_COLOR_ORANGE })
+ public @interface PredefinedColor {}
+
+ public static final int PREDEFINED_COLOR_NONE = 0;
+ public static final int PREDEFINED_COLOR_RED = 1;
+ public static final int PREDEFINED_COLOR_BLUE = 2;
+ public static final int PREDEFINED_COLOR_PURPLE = 3;
+ public static final int PREDEFINED_COLOR_YELLOW = 4;
+ public static final int PREDEFINED_COLOR_PINK = 5;
+ public static final int PREDEFINED_COLOR_BROWN = 6;
+ public static final int PREDEFINED_COLOR_GREEN = 7;
+ public static final int PREDEFINED_COLOR_ORANGE = 8;
+
private final String mName;
+ @PredefinedColor
private final int mColor;
private final int mResId;
private final int mSelectedResId;
- public Icon(String Name, int color, int resId, int selectedResId)
+ public Icon(String Name, @PredefinedColor int color, int resId, int selectedResId)
{
mName = Name;
mColor = color;
@@ -16,6 +37,7 @@ public class Icon
mSelectedResId = selectedResId;
}
+ @PredefinedColor
public int getColor()
{
return mColor;
@@ -46,6 +68,7 @@ public class Icon
}
@Override
+ @PredefinedColor
public int hashCode()
{
return mColor;