mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-28 18:57:43 +00:00
User pic placeholder colors tweaks.
Use proper username for settings activity placeholder.
This commit is contained in:
parent
18c4358d7d
commit
3e82c8f9ea
@ -108,11 +108,10 @@
|
||||
<color name="default_background_end">#171717</color>
|
||||
|
||||
<array name="user_pic_placeholder_primary">
|
||||
<item>#18da80</item>
|
||||
<item>#ee8917</item>
|
||||
<item>#2bca81</item>
|
||||
<item>#ee7117</item>
|
||||
<item>#239edf</item>
|
||||
<item>#c33fe9</item>
|
||||
<item>#83b433</item>
|
||||
<item>#bb35e9</item>
|
||||
</array>
|
||||
|
||||
</resources>
|
||||
|
@ -79,7 +79,7 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
|
||||
glide = GlideApp.with(this)
|
||||
profilePictureView.glide = glide
|
||||
profilePictureView.publicKey = hexEncodedPublicKey
|
||||
profilePictureView.displayName = displayNameToBeUploaded
|
||||
profilePictureView.displayName = origUserDisplayName
|
||||
profilePictureView.isLarge = true
|
||||
profilePictureView.update()
|
||||
profilePictureView.setOnClickListener { showEditProfilePictureUI() }
|
||||
|
@ -29,7 +29,7 @@ object AvatarPlaceholderGenerator {
|
||||
// Do not cache color array, it may be different depends on the current theme.
|
||||
val colorArray = context.resources.getIntArray(R.array.user_pic_placeholder_primary)
|
||||
val colorPrimary = colorArray[(hash % colorArray.size).toInt()]
|
||||
val colorSecondary = changeColorHueBy(colorPrimary, 16f)
|
||||
val colorSecondary = changeColorHueBy(colorPrimary, 12f)
|
||||
|
||||
val labelText = when {
|
||||
!TextUtils.isEmpty(displayName) -> extractLabel(displayName!!)
|
||||
@ -41,8 +41,7 @@ object AvatarPlaceholderGenerator {
|
||||
val canvas = Canvas(bitmap)
|
||||
|
||||
// Draw background/frame
|
||||
val paint = Paint()
|
||||
paint.isAntiAlias = true
|
||||
val paint = Paint(Paint.ANTI_ALIAS_FLAG)
|
||||
paint.shader = LinearGradient(0f, 0f, 0f, pixelSize.toFloat(),
|
||||
colorPrimary,
|
||||
colorSecondary,
|
||||
@ -50,9 +49,8 @@ object AvatarPlaceholderGenerator {
|
||||
canvas.drawCircle(pixelSize.toFloat() / 2, pixelSize.toFloat() / 2, pixelSize.toFloat() / 2, paint)
|
||||
|
||||
// Draw text
|
||||
val textPaint = TextPaint()
|
||||
val textPaint = TextPaint(Paint.ANTI_ALIAS_FLAG)
|
||||
textPaint.typeface = Typeface.create(Typeface.DEFAULT, Typeface.NORMAL)
|
||||
textPaint.isAntiAlias = true
|
||||
textPaint.textSize = pixelSize * 0.5f
|
||||
textPaint.color = Color.WHITE
|
||||
val areaRect = Rect(0, 0, pixelSize, pixelSize)
|
||||
|
Loading…
x
Reference in New Issue
Block a user