mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-14 14:02:49 +00:00
Add a new activity that allows editing key profiles
This commit is contained in:
parent
05cfc0bc5f
commit
07c3e43160
15 changed files with 551 additions and 13 deletions
|
@ -1,5 +1,8 @@
|
|||
package me.impy.aegis;
|
||||
|
||||
import com.amulyakhare.textdrawable.TextDrawable;
|
||||
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.UndeclaredThrowableException;
|
||||
|
||||
|
@ -29,4 +32,16 @@ public class KeyProfile implements Serializable {
|
|||
}
|
||||
return _code;
|
||||
}
|
||||
|
||||
public TextDrawable getDrawable() {
|
||||
String name = _entry.getName();
|
||||
if (name == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
ColorGenerator generator = ColorGenerator.MATERIAL;
|
||||
int color = generator.getColor(name);
|
||||
|
||||
return TextDrawable.builder().buildRound(name.substring(0, 1).toUpperCase(), color);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue