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) {
|
2019-04-04 14:07:36 +02:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2019-04-09 17:53:10 +02:00
|
|
|
public static int getViewModeNameResource(int x) {
|
2019-04-04 14:07:36 +02:00
|
|
|
switch (x) {
|
2019-04-01 01:21:12 +02:00
|
|
|
case 0:
|
2019-04-09 17:53:10 +02:00
|
|
|
return R.string.normal_viewmode_title;
|
2019-04-01 01:21:12 +02:00
|
|
|
case 1:
|
2019-04-09 17:53:10 +02:00
|
|
|
return R.string.compact_mode_title;
|
2019-04-02 15:47:07 +02:00
|
|
|
case 2:
|
2019-04-09 17:53:10 +02:00
|
|
|
return R.string.small_mode_title;
|
2019-04-01 01:21:12 +02:00
|
|
|
}
|
2019-04-09 17:53:10 +02:00
|
|
|
|
|
|
|
return R.string.normal_viewmode_title;
|
2019-04-01 01:21:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public static String[] getViewModeNames() {
|
2019-04-04 14:07:36 +02:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|
2019-04-09 17:53:10 +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
|
|
|
}
|