Drop AddProfileActivity in favor of EditProfileActivity

Also automatically update the TextDrawable on name changes in EditProfileActivity
This commit is contained in:
Alexander Bakker 2018-01-02 21:50:07 +01:00
parent 22c5237129
commit ca210de78e
9 changed files with 63 additions and 298 deletions

View file

@ -8,6 +8,7 @@ import java.lang.reflect.UndeclaredThrowableException;
import me.impy.aegis.crypto.otp.OTP;
import me.impy.aegis.db.DatabaseEntry;
import me.impy.aegis.helpers.TextDrawableHelper;
public class KeyProfile implements Serializable {
private String _code;
@ -38,14 +39,6 @@ public class KeyProfile implements Serializable {
}
public TextDrawable getDrawable() {
String name = _entry.getName();
if (name == null || name.length() <= 1) {
return null;
}
ColorGenerator generator = ColorGenerator.MATERIAL;
int color = generator.getColor(name);
return TextDrawable.builder().buildRound(name.substring(0, 1).toUpperCase(), color);
return TextDrawableHelper.generate(getEntry().getName());
}
}