mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-14 22:12:55 +00:00
MainActivity is now using CircleImageView too
This commit is contained in:
parent
34b6cf944f
commit
97eb3490d8
5 changed files with 20 additions and 14 deletions
|
@ -1,5 +1,7 @@
|
|||
package me.impy.aegis.helpers;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import com.amulyakhare.textdrawable.TextDrawable;
|
||||
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
||||
|
||||
|
@ -8,7 +10,7 @@ public class TextDrawableHelper {
|
|||
|
||||
}
|
||||
|
||||
public static TextDrawable generate(String s) {
|
||||
public static TextDrawable generate(String s, View view) {
|
||||
if (s == null || s.length() <= 1) {
|
||||
return null;
|
||||
}
|
||||
|
@ -16,7 +18,7 @@ public class TextDrawableHelper {
|
|||
ColorGenerator generator = ColorGenerator.MATERIAL;
|
||||
int color = generator.getColor(s);
|
||||
return TextDrawable.builder().beginConfig()
|
||||
.width(100)
|
||||
.height(100).endConfig().buildRect(s.substring(0, 1).toUpperCase(), color);
|
||||
.width(view.getWidth())
|
||||
.height(view.getHeight()).endConfig().buildRect(s.substring(0, 1).toUpperCase(), color);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue