Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1549a076 authored by narinder Rana's avatar narinder Rana
Browse files

update Avatar

parent 7dc92cbc
Loading
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -52,17 +52,17 @@ class AvatarView @JvmOverloads constructor(
    private var fullName: String? = null
    private var photoUri: String? = null
    private var lastUpdated: Long? = null
    private var theme: Colors.Theme
    //private var theme: Colors.Theme

    init {
        if (!isInEditMode) {
            appComponent.inject(this)
        }

        theme = colors.theme()
     //   theme = colors.theme()

        View.inflate(context, R.layout.avatar_view, this)
        setBackgroundResource(R.drawable.circle)
        setBackgroundResource(R.drawable.circle_avatar_view)
        clipToOutline = true
    }

@@ -74,7 +74,7 @@ class AvatarView @JvmOverloads constructor(
        fullName = recipient?.contact?.name
        photoUri = recipient?.contact?.photoUri
        lastUpdated = recipient?.contact?.lastUpdate
        theme = colors.theme(recipient)
       // theme = colors.theme(recipient)
        updateView()
    }

@@ -88,9 +88,9 @@ class AvatarView @JvmOverloads constructor(

    private fun updateView() {
        // Apply theme
        setBackgroundTint(theme.theme)
        initial.setTextColor(ContextCompat.getColor(context, R.color.colorPrimaryDark))
        icon.setTint(ContextCompat.getColor(context, R.color.colorPrimaryDark))
       // setBackgroundTint(theme.theme)
        initial.setTextColor(ContextCompat.getColor(context, R.color.textPrimary))
        icon.setTint(ContextCompat.getColor(context,  R.color.textPrimary))
        val initials = fullName
                ?.substringBefore(',')
                ?.split(" ").orEmpty()
+26 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2019 Moez Bhatti <moez.bhatti@gmail.com>
  ~
  ~ This file is part of QKSMS.
  ~
  ~ QKSMS is free software: you can redistribute it and/or modify
  ~ it under the terms of the GNU General Public License as published by
  ~ the Free Software Foundation, either version 3 of the License, or
  ~ (at your option) any later version.
  ~
  ~ QKSMS is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~ GNU General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License
  ~ along with QKSMS.  If not, see <http://www.gnu.org/licenses/>.
  -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">

    <corners android:radius="1000dp" />
    <solid android:color="@color/foreground_color" />

</shape>