diff --git a/res/layout/conversation_activity_attachment_editor_stub.xml b/res/layout/conversation_activity_attachment_editor_stub.xml index c5831c03e8..12da06a249 100644 --- a/res/layout/conversation_activity_attachment_editor_stub.xml +++ b/res/layout/conversation_activity_attachment_editor_stub.xml @@ -41,7 +41,8 @@ android:paddingBottom="15dp" app:widgetBackground="?conversation_item_bubble_background" app:foregroundTintColor="?android:colorControlNormal" - app:backgroundTintColor="?conversation_item_bubble_background"/> + app:backgroundTintColor="?conversation_item_bubble_background" + app:waveformFillColor="?conversation_item_audio_seek_bar_color"/> diff --git a/res/layout/conversation_item_sent_audio.xml b/res/layout/conversation_item_sent_audio.xml index 22cae85604..7a28a82dad 100644 --- a/res/layout/conversation_item_sent_audio.xml +++ b/res/layout/conversation_item_sent_audio.xml @@ -7,4 +7,5 @@ android:layout_height="wrap_content" app:foregroundTintColor="?android:colorControlNormal" app:backgroundTintColor="?message_sent_background_color" + app:waveformFillColor="?conversation_item_audio_seek_bar_color" android:visibility="gone"/> diff --git a/res/layout/message_audio_view.xml b/res/layout/message_audio_view.xml index c2d2d31700..09e5c9549d 100644 --- a/res/layout/message_audio_view.xml +++ b/res/layout/message_audio_view.xml @@ -78,7 +78,6 @@ android:layout_gravity="center_vertical" android:layout_marginStart="4dp" android:layout_marginEnd="4dp" - app:bar_progress_color="?conversation_item_audio_seek_bar_color" app:bar_gravity="center" app:bar_width="4dp" app:bar_corner_radius="2dp" diff --git a/res/values/attrs.xml b/res/values/attrs.xml index 362f3b9807..207ec30a95 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -174,6 +174,7 @@ + diff --git a/src/org/thoughtcrime/securesms/loki/views/MessageAudioView.kt b/src/org/thoughtcrime/securesms/loki/views/MessageAudioView.kt index 29b160ccba..b3f054031c 100644 --- a/src/org/thoughtcrime/securesms/loki/views/MessageAudioView.kt +++ b/src/org/thoughtcrime/securesms/loki/views/MessageAudioView.kt @@ -117,7 +117,8 @@ class MessageAudioView: FrameLayout, AudioSlidePlayer.Listener { if (attrs != null) { val typedArray = context.theme.obtainStyledAttributes(attrs, R.styleable.MessageAudioView, 0, 0) setTint(typedArray.getColor(R.styleable.MessageAudioView_foregroundTintColor, Color.WHITE), - typedArray.getColor(R.styleable.MessageAudioView_backgroundTintColor, Color.WHITE)) + typedArray.getColor(R.styleable.MessageAudioView_backgroundTintColor, Color.WHITE), + typedArray.getColor(R.styleable.MessageAudioView_waveformFillColor, Color.WHITE)) container.setBackgroundColor(typedArray.getColor(R.styleable.MessageAudioView_widgetBackground, Color.TRANSPARENT)) typedArray.recycle() } @@ -181,7 +182,7 @@ class MessageAudioView: FrameLayout, AudioSlidePlayer.Listener { downloadListener = listener } - fun setTint(@ColorInt foregroundTint: Int, @ColorInt backgroundTint: Int) { + fun setTint(@ColorInt foregroundTint: Int, @ColorInt backgroundTint: Int, @ColorInt waveformFill: Int) { playButton.backgroundTintList = ColorStateList.valueOf(foregroundTint) playButton.imageTintList = ColorStateList.valueOf(backgroundTint) pauseButton.backgroundTintList = ColorStateList.valueOf(foregroundTint) @@ -192,6 +193,7 @@ class MessageAudioView: FrameLayout, AudioSlidePlayer.Listener { totalDuration.setTextColor(foregroundTint) // Seek bar's progress color is set from the XML template. Whereas the background is computed. + seekBar.barProgressColor = waveformFill seekBar.barBackgroundColor = ColorUtils.blendARGB(foregroundTint, backgroundTint, 0.75f) }