mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-14 22:12:55 +00:00
Drop AddProfileActivity in favor of EditProfileActivity
Also automatically update the TextDrawable on name changes in EditProfileActivity
This commit is contained in:
parent
22c5237129
commit
ca210de78e
9 changed files with 63 additions and 298 deletions
|
@ -0,0 +1,20 @@
|
|||
package me.impy.aegis.helpers;
|
||||
|
||||
import com.amulyakhare.textdrawable.TextDrawable;
|
||||
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
||||
|
||||
public class TextDrawableHelper {
|
||||
private TextDrawableHelper() {
|
||||
|
||||
}
|
||||
|
||||
public static TextDrawable generate(String s) {
|
||||
if (s == null || s.length() <= 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
ColorGenerator generator = ColorGenerator.MATERIAL;
|
||||
int color = generator.getColor(s);
|
||||
return TextDrawable.builder().buildRound(s.substring(0, 1).toUpperCase(), color);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue