@yuborama/avatar-view 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,7 +6,7 @@ import android.graphics.Typeface
|
|
|
6
6
|
import android.graphics.drawable.GradientDrawable
|
|
7
7
|
import android.view.Gravity
|
|
8
8
|
import android.util.TypedValue
|
|
9
|
-
import
|
|
9
|
+
import android.widget.TextView
|
|
10
10
|
import expo.modules.kotlin.AppContext
|
|
11
11
|
import expo.modules.kotlin.views.ExpoView
|
|
12
12
|
import kotlin.math.max
|
|
@@ -15,7 +15,7 @@ class AvatarView(context: Context, appContext: AppContext) : ExpoView(context, a
|
|
|
15
15
|
private var avatarSizeDp: Float = 120f
|
|
16
16
|
private var avatarColor: Int = generateRandomColor()
|
|
17
17
|
|
|
18
|
-
private val initialsView =
|
|
18
|
+
private val initialsView = TextView(context).apply {
|
|
19
19
|
gravity = Gravity.CENTER
|
|
20
20
|
setTextColor(Color.WHITE)
|
|
21
21
|
typeface = Typeface.create(Typeface.DEFAULT, Typeface.NORMAL)
|
|
@@ -74,4 +74,4 @@ class AvatarView(context: Context, appContext: AppContext) : ExpoView(context, a
|
|
|
74
74
|
dp,
|
|
75
75
|
context.resources.displayMetrics
|
|
76
76
|
).toInt()
|
|
77
|
-
}
|
|
77
|
+
}
|