Skip to content
Snippets Groups Projects
Commit b8c4dd16 authored by Roee Hershberg's avatar Roee Hershberg Committed by Adrien Béraud
Browse files

ConversationAdapter: fix selected messages color tint

Fix selected messages color tint always being blue_900. Instead, apply
an alpha tint to the selected conversation color.

Change-Id: I37625af662162144c95d5befc36ac6f87e4603c6
parent b198580f
Branches
Tags
No related merge requests found
...@@ -64,6 +64,7 @@ import androidx.vectordrawable.graphics.drawable.Animatable2Compat ...@@ -64,6 +64,7 @@ import androidx.vectordrawable.graphics.drawable.Animatable2Compat
import androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat import androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions.withCrossFade import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions.withCrossFade
import com.google.android.material.color.MaterialColors
import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.dialog.MaterialAlertDialogBuilder
import cx.ring.R import cx.ring.R
import cx.ring.client.MediaViewerActivity import cx.ring.client.MediaViewerActivity
...@@ -108,6 +109,7 @@ class ConversationAdapter( ...@@ -108,6 +109,7 @@ class ConversationAdapter(
private var currentSelectionId: String? = null private var currentSelectionId: String? = null
private var mCurrentLongItem: RecyclerViewContextMenuInfo? = null private var mCurrentLongItem: RecyclerViewContextMenuInfo? = null
@ColorInt private var convColor = 0 @ColorInt private var convColor = 0
@ColorInt private var convColorTint = 0
private var expandedItemPosition = -1 private var expandedItemPosition = -1
private var lastDeliveredPosition = -1 private var lastDeliveredPosition = -1
private val timestampUpdateTimer: Observable<Long> = Observable.interval(10, TimeUnit.SECONDS, DeviceUtils.uiScheduler) private val timestampUpdateTimer: Observable<Long> = Observable.interval(10, TimeUnit.SECONDS, DeviceUtils.uiScheduler)
...@@ -420,6 +422,7 @@ class ConversationAdapter( ...@@ -420,6 +422,7 @@ class ConversationAdapter(
fun setPrimaryColor(@ColorInt color: Int) { fun setPrimaryColor(@ColorInt color: Int) {
convColor = color convColor = color
convColorTint = MaterialColors.compositeARGBWithAlpha(color, (MaterialColors.ALPHA_LOW * 255).toInt())
notifyDataSetChanged() notifyDataSetChanged()
} }
...@@ -835,7 +838,7 @@ class ConversationAdapter( ...@@ -835,7 +838,7 @@ class ConversationAdapter(
if (textMessage.isIncoming) { if (textMessage.isIncoming) {
longPressView.background.setTint(res.getColor(R.color.grey_500)) longPressView.background.setTint(res.getColor(R.color.grey_500))
} else { } else {
longPressView.background.setTint(res.getColor(R.color.blue_900)) longPressView.background.setTint(convColorTint)
} }
mCurrentLongItem = RecyclerViewContextMenuInfo( mCurrentLongItem = RecyclerViewContextMenuInfo(
convViewHolder.bindingAdapterPosition, convViewHolder.bindingAdapterPosition,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment