add new Tag, Use Style instead of Textformating, implement grade indicator, fix offset #6
1 changed files with 4 additions and 4 deletions
|
@ -9,7 +9,7 @@ public class TagDTO {
|
|||
final DB_Tag.Type type;
|
||||
|
||||
public TagDTO(int grade, DB_Tag.Type type) {
|
||||
this.gradeColor = calcGradient(grade);
|
||||
this.gradeColor = calcGradient(grade, type);
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
@ -21,13 +21,13 @@ public class TagDTO {
|
|||
return type;
|
||||
}
|
||||
|
||||
private static int calcGradient(int grade){
|
||||
private static int calcGradient(int grade, DB_Tag.Type type){
|
||||
if (grade < 1)
|
||||
return 0xaaaaaa;
|
||||
|
||||
return ColorUtil.interpolate(
|
||||
0x00ff00,
|
||||
0xff0000,
|
||||
0xaaaaaa,
|
||||
type.getColor(),
|
||||
computeOffset(0, 10, grade));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue