add new Tag, Use Style instead of Textformating, implement grade indicator, fix offset #6

Merged
hiajen merged 3 commits from #4-#3-add_new_tag_and_implement_grade_indication into master 2021-06-25 22:07:33 +02:00
Showing only changes of commit df9060798d - Show all commits

View file

@ -9,7 +9,7 @@ public class TagDTO {
final DB_Tag.Type type; final DB_Tag.Type type;
public TagDTO(int grade, DB_Tag.Type type) { public TagDTO(int grade, DB_Tag.Type type) {
this.gradeColor = calcGradient(grade); this.gradeColor = calcGradient(grade, type);
this.type = type; this.type = type;
} }
@ -21,13 +21,13 @@ public class TagDTO {
return type; return type;
} }
private static int calcGradient(int grade){ private static int calcGradient(int grade, DB_Tag.Type type){
if (grade < 1) if (grade < 1)
return 0xaaaaaa; return 0xaaaaaa;
return ColorUtil.interpolate( return ColorUtil.interpolate(
0x00ff00, 0xaaaaaa,
0xff0000, type.getColor(),
computeOffset(0, 10, grade)); computeOffset(0, 10, grade));
} }
} }