Improved quota handling

This commit is contained in:
M66B
2021-06-28 11:31:19 +02:00
parent 13f809e3c8
commit bd6defc0fa
5 changed files with 32 additions and 24 deletions

View File

@@ -205,6 +205,14 @@ public class EntityAccount extends EntityOrder implements Serializable {
return id;
}
Integer getQuotaPercentage() {
if (quota_usage == null || quota_limit == null)
return null;
int percent = Math.round(quota_usage * 100f / quota_limit);
return (percent > 100 ? null : percent);
}
@Override
String[] getSortTitle(Context context) {
return new String[]{name, null};