diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingVoiceMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingVoiceMessageViewHolder.kt index e06604763..8546dea0d 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingVoiceMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingVoiceMessageViewHolder.kt @@ -48,6 +48,7 @@ import com.nextcloud.talk.application.NextcloudTalkApplication import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication import com.nextcloud.talk.databinding.ItemCustomIncomingVoiceMessageBinding import com.nextcloud.talk.models.json.chat.ChatMessage +import com.nextcloud.talk.ui.theme.ViewThemeUtils import com.nextcloud.talk.utils.ApiUtils import com.nextcloud.talk.utils.DisplayUtils import com.nextcloud.talk.utils.preferences.AppPreferences @@ -66,6 +67,9 @@ class IncomingVoiceMessageViewHolder(incomingView: View, payload: Any) : Message @Inject var context: Context? = null + @Inject + lateinit var viewThemeUtils: ViewThemeUtils + @JvmField @Inject var appPreferences: AppPreferences? = null @@ -93,6 +97,7 @@ class IncomingVoiceMessageViewHolder(incomingView: View, payload: Any) : Message updateDownloadState(message) binding.seekbar.max = message.voiceMessageDuration + viewThemeUtils.themeHorizontalSeekBar(binding.seekbar) if (message.isPlayingVoiceMessage) { showPlayButton() diff --git a/app/src/main/java/com/nextcloud/talk/ui/theme/ViewThemeUtils.kt b/app/src/main/java/com/nextcloud/talk/ui/theme/ViewThemeUtils.kt index 5769c2ca3..3abf3bcfd 100644 --- a/app/src/main/java/com/nextcloud/talk/ui/theme/ViewThemeUtils.kt +++ b/app/src/main/java/com/nextcloud/talk/ui/theme/ViewThemeUtils.kt @@ -25,13 +25,17 @@ import android.content.Context import android.content.res.ColorStateList import android.content.res.Configuration import android.graphics.Color +import android.graphics.PorterDuff import android.graphics.drawable.Drawable import android.view.View import android.widget.CheckBox import android.widget.EditText import android.widget.ImageView +import android.widget.ProgressBar import android.widget.RadioButton +import android.widget.SeekBar import android.widget.TextView +import androidx.annotation.ColorInt import androidx.appcompat.content.res.AppCompatResources import androidx.appcompat.widget.SwitchCompat import androidx.core.content.ContextCompat @@ -82,6 +86,20 @@ class ViewThemeUtils @Inject constructor(private val theme: ServerTheme) { } } + fun themeHorizontalSeekBar(seekBar: SeekBar) { + withElementColor(seekBar) { color -> + themeHorizontalProgressBar(seekBar, color) + seekBar.thumb.setColorFilter(color, PorterDuff.Mode.SRC_IN) + } + } + + fun themeHorizontalProgressBar(progressBar: ProgressBar?, @ColorInt color: Int) { + if (progressBar != null) { + progressBar.indeterminateDrawable.setColorFilter(color, PorterDuff.Mode.SRC_IN) + progressBar.progressDrawable.setColorFilter(color, PorterDuff.Mode.SRC_IN) + } + } + fun colorTextViewElement(textView: TextView) { withElementColor(textView) { color -> textView.setTextColor(color)