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

Commit 497e0b2d authored by narinder Rana's avatar narinder Rana
Browse files

Merge branch '38_ui_improvements' into 'main'

38 ui improvements

See merge request !47
parents 4b55a012 5a6e656d
Loading
Loading
Loading
Loading
Loading
+1.56 KiB (114 KiB)

File changed.

No diff preview for this file type.

+2 −2
Original line number Original line Diff line number Diff line
#Wed Mar 09 07:51:50 IST 2022
#Thu Mar 17 12:40:57 IST 2022
distributionBase=GRADLE_USER_HOME
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionPath=wrapper/dists
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStoreBase=GRADLE_USER_HOME
+11 −7
Original line number Original line Diff line number Diff line
@@ -24,6 +24,7 @@ import android.util.TypedValue
import android.view.ContextThemeWrapper
import android.view.ContextThemeWrapper
import android.view.View
import android.view.View
import android.widget.FrameLayout
import android.widget.FrameLayout
import androidx.core.content.ContextCompat
import com.bumptech.glide.signature.ObjectKey
import com.bumptech.glide.signature.ObjectKey
import com.moez.QKSMS.R
import com.moez.QKSMS.R
import com.moez.QKSMS.common.Navigator
import com.moez.QKSMS.common.Navigator
@@ -36,6 +37,7 @@ import com.moez.QKSMS.model.Recipient
import com.moez.QKSMS.util.GlideApp
import com.moez.QKSMS.util.GlideApp
import com.moez.QKSMS.util.Preferences
import com.moez.QKSMS.util.Preferences
import kotlinx.android.synthetic.main.avatar_view.view.*
import kotlinx.android.synthetic.main.avatar_view.view.*
import kotlinx.android.synthetic.main.compose_activity.*
import javax.inject.Inject
import javax.inject.Inject


class AvatarView @JvmOverloads constructor(
class AvatarView @JvmOverloads constructor(
@@ -50,17 +52,17 @@ class AvatarView @JvmOverloads constructor(
    private var fullName: String? = null
    private var fullName: String? = null
    private var photoUri: String? = null
    private var photoUri: String? = null
    private var lastUpdated: Long? = null
    private var lastUpdated: Long? = null
    private var theme: Colors.Theme
    //private var theme: Colors.Theme


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


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


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


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

        updateView()
        updateView()
    }
    }


@@ -86,10 +89,11 @@ class AvatarView @JvmOverloads constructor(


    private fun updateView() {
    private fun updateView() {
        // Apply theme
        // Apply theme
        setBackgroundTint(theme.theme)
       // setBackgroundTint(theme.theme)
        initial.setTextColor(theme.textPrimary)
        icon.setTint(theme.textPrimary)


        initial.setTextColor(ContextCompat.getColor(context, R.color.avatar_icon_color))
        icon.clearColorFilter()
        icon.setTint(ContextCompat.getColor(context,  R.color.avatar_icon_color))
        val initials = fullName
        val initials = fullName
                ?.substringBefore(',')
                ?.substringBefore(',')
                ?.split(" ").orEmpty()
                ?.split(" ").orEmpty()
+1 −1
Original line number Original line Diff line number Diff line
@@ -80,7 +80,7 @@ class PreferenceView @JvmOverloads constructor(
        orientation = HORIZONTAL
        orientation = HORIZONTAL
        gravity = Gravity.CENTER_VERTICAL
        gravity = Gravity.CENTER_VERTICAL


        icon.setColorFilter(context.getColor(R.color.tools_theme))
        icon.setColorFilter(context.getColor(R.color.color_default_icon))


        context.obtainStyledAttributes(attrs, R.styleable.PreferenceView).run {
        context.obtainStyledAttributes(attrs, R.styleable.PreferenceView).run {
            title = getString(R.styleable.PreferenceView_title)
            title = getString(R.styleable.PreferenceView_title)
+3 −3
Original line number Original line Diff line number Diff line
@@ -35,6 +35,7 @@ import android.view.Menu
import android.view.MenuItem
import android.view.MenuItem
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AlertDialog
import androidx.core.app.ActivityCompat
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import androidx.core.view.isVisible
import androidx.core.view.isVisible
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.ViewModelProviders
import androidx.lifecycle.ViewModelProviders
@@ -148,8 +149,7 @@ class ComposeActivity : QkThemedActivity(), ComposeView {


        theme
        theme
                .doOnNext { loading.setTint(it.theme) }
                .doOnNext { loading.setTint(it.theme) }
                .doOnNext { attach.setBackgroundTint(it.theme) }
                .doOnNext { attach.setTint(ContextCompat.getColor(this, R.color.colorPrimaryDark)) }
                .doOnNext { attach.setTint(it.textPrimary) }
                .doOnNext { messageAdapter.theme = it }
                .doOnNext { messageAdapter.theme = it }
                .autoDisposable(scope())
                .autoDisposable(scope())
                .subscribe()
                .subscribe()
@@ -238,7 +238,7 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
        simIndex.text = state.subscription?.simSlotIndex?.plus(1)?.toString()
        simIndex.text = state.subscription?.simSlotIndex?.plus(1)?.toString()


        send.isEnabled = state.canSend
        send.isEnabled = state.canSend
        send.imageAlpha = if (state.canSend) 255 else 128

    }
    }


    override fun clearSelection() = messageAdapter.clearSelection()
    override fun clearSelection() = messageAdapter.clearSelection()
Loading