mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-25 08:16:07 +00:00
This fixes the following bugs: - Sort category is forgotten after lock/unlock - The sort mode is not respected for new entries I got a little carried away while working on this patch and also included the following other enhancements: - Simplify the SortCategory, Theme and ViewMode enums - Simplify usage of string resources - Don't call notifyDataSetChanged and runLayoutAnimation unnecessarily
33 lines
679 B
Java
33 lines
679 B
Java
package com.beemdevelopment.aegis;
|
|
|
|
import androidx.annotation.LayoutRes;
|
|
|
|
public enum ViewMode {
|
|
NORMAL,
|
|
COMPACT,
|
|
SMALL;
|
|
|
|
private static ViewMode[] _values;
|
|
|
|
static {
|
|
_values = values();
|
|
}
|
|
|
|
public static ViewMode fromInteger(int x) {
|
|
return _values[x];
|
|
}
|
|
|
|
@LayoutRes
|
|
public int getLayoutId() {
|
|
switch (this) {
|
|
case NORMAL:
|
|
return R.layout.card_entry;
|
|
case COMPACT:
|
|
return R.layout.card_entry_compact;
|
|
case SMALL:
|
|
return R.layout.card_entry_small;
|
|
default:
|
|
return R.layout.card_entry;
|
|
}
|
|
}
|
|
}
|