Aegis/app/src/main/java/com/beemdevelopment/aegis/ViewMode.java

49 lines
1.1 KiB
Java
Raw Normal View History

2019-04-01 01:21:12 +02:00
package com.beemdevelopment.aegis;
public enum ViewMode {
NORMAL,
2019-04-02 15:47:07 +02:00
COMPACT,
SMALL;
2019-04-01 01:21:12 +02:00
public static ViewMode fromInteger(int x) {
switch (x) {
2019-04-01 01:21:12 +02:00
case 0:
return NORMAL;
case 1:
return COMPACT;
2019-04-02 15:47:07 +02:00
case 2:
return SMALL;
2019-04-01 01:21:12 +02:00
}
return null;
}
public static int getViewModeNameResource(int x) {
switch (x) {
2019-04-01 01:21:12 +02:00
case 0:
return R.string.normal_viewmode_title;
2019-04-01 01:21:12 +02:00
case 1:
return R.string.compact_mode_title;
2019-04-02 15:47:07 +02:00
case 2:
return R.string.small_mode_title;
2019-04-01 01:21:12 +02:00
}
return R.string.normal_viewmode_title;
2019-04-01 01:21:12 +02:00
}
public static String[] getViewModeNames() {
return new String[]{
2019-04-01 01:21:12 +02:00
"Normal",
2019-04-02 15:47:07 +02:00
"Compact",
"Small"
2019-04-01 01:21:12 +02:00
};
}
public static int[] getViewModeNameResources() {
return new int[] {
R.string.normal_viewmode_title,
R.string.compact_mode_title,
R.string.small_mode_title
};
}
2019-04-01 01:21:12 +02:00
}