From 9dea519d0cd6d23afbaa1b4fba9e213e18aed28c Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 9 Jul 2021 18:05:41 +0200 Subject: [PATCH] Fix issue with play / pause button alignment --- .../room/detail/composer/VoiceMessageRecorderView.kt | 4 ++-- .../room/detail/timeline/item/MessageVoiceItem.kt | 4 ++-- vector/src/main/res/drawable/ic_play_pause_pause.xml | 12 ++++++++++++ vector/src/main/res/drawable/ic_play_pause_play.xml | 9 +++++++++ vector/src/main/res/drawable/ic_voice_pause.xml | 12 ------------ vector/src/main/res/drawable/ic_voice_play.xml | 9 --------- .../res/layout/item_timeline_event_voice_stub.xml | 7 +++---- .../main/res/layout/view_voice_message_recorder.xml | 7 +++---- 8 files changed, 31 insertions(+), 33 deletions(-) create mode 100644 vector/src/main/res/drawable/ic_play_pause_pause.xml create mode 100644 vector/src/main/res/drawable/ic_play_pause_play.xml delete mode 100644 vector/src/main/res/drawable/ic_voice_pause.xml delete mode 100644 vector/src/main/res/drawable/ic_voice_play.xml diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/VoiceMessageRecorderView.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/VoiceMessageRecorderView.kt index 13679da52b..25bc41e497 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/VoiceMessageRecorderView.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/VoiceMessageRecorderView.kt @@ -359,12 +359,12 @@ class VoiceMessageRecorderView @JvmOverloads constructor( this.amplitudeList = state.amplitudeList } is VoiceMessagePlaybackTracker.Listener.State.Playing -> { - views.voicePlaybackControlButton.setImageResource(R.drawable.ic_voice_pause) + views.voicePlaybackControlButton.setImageResource(R.drawable.ic_play_pause_pause) val formattedTimerText = DateUtils.formatElapsedTime((state.playbackTime / 1000).toLong()) views.voicePlaybackTime.setText(formattedTimerText) } is VoiceMessagePlaybackTracker.Listener.State.Idle -> { - views.voicePlaybackControlButton.setImageResource(R.drawable.ic_voice_play) + views.voicePlaybackControlButton.setImageResource(R.drawable.ic_play_pause_play) } } } diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageVoiceItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageVoiceItem.kt index 9202d7f72a..a369ed1df7 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageVoiceItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageVoiceItem.kt @@ -92,7 +92,7 @@ abstract class MessageVoiceItem : AbsMessageItem() { } private fun handleIdleState(holder: Holder, state: VoiceMessagePlaybackTracker.Listener.State.Idle) { - holder.voicePlaybackControlButton.setImageResource(R.drawable.ic_voice_play) + holder.voicePlaybackControlButton.setImageResource(R.drawable.ic_play_pause_play) if (state.playbackTime > 0) { holder.voicePlaybackTime.text = formatPlaybackTime(state.playbackTime) } else { @@ -101,7 +101,7 @@ abstract class MessageVoiceItem : AbsMessageItem() { } private fun handlePlayingState(holder: Holder, state: VoiceMessagePlaybackTracker.Listener.State.Playing) { - holder.voicePlaybackControlButton.setImageResource(R.drawable.ic_voice_pause) + holder.voicePlaybackControlButton.setImageResource(R.drawable.ic_play_pause_pause) if (state.playbackTime > 0) { holder.voicePlaybackTime.text = formatPlaybackTime(state.playbackTime) } else { diff --git a/vector/src/main/res/drawable/ic_play_pause_pause.xml b/vector/src/main/res/drawable/ic_play_pause_pause.xml new file mode 100644 index 0000000000..d8cfafbcf5 --- /dev/null +++ b/vector/src/main/res/drawable/ic_play_pause_pause.xml @@ -0,0 +1,12 @@ + + + + diff --git a/vector/src/main/res/drawable/ic_play_pause_play.xml b/vector/src/main/res/drawable/ic_play_pause_play.xml new file mode 100644 index 0000000000..84056219ec --- /dev/null +++ b/vector/src/main/res/drawable/ic_play_pause_play.xml @@ -0,0 +1,9 @@ + + + diff --git a/vector/src/main/res/drawable/ic_voice_pause.xml b/vector/src/main/res/drawable/ic_voice_pause.xml deleted file mode 100644 index af74dec46c..0000000000 --- a/vector/src/main/res/drawable/ic_voice_pause.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/vector/src/main/res/drawable/ic_voice_play.xml b/vector/src/main/res/drawable/ic_voice_play.xml deleted file mode 100644 index ad90006799..0000000000 --- a/vector/src/main/res/drawable/ic_voice_play.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/vector/src/main/res/layout/item_timeline_event_voice_stub.xml b/vector/src/main/res/layout/item_timeline_event_voice_stub.xml index eed7ae4495..2e10ad1550 100644 --- a/vector/src/main/res/layout/item_timeline_event_voice_stub.xml +++ b/vector/src/main/res/layout/item_timeline_event_voice_stub.xml @@ -27,12 +27,11 @@ android:layout_height="32dp" android:background="@drawable/bg_voice_play_pause_button" android:backgroundTint="?vctr_voice_message_play_pause_button_background" - android:paddingStart="3dp" - android:paddingEnd="0dp" - android:src="@drawable/ic_voice_play" + android:src="@drawable/ic_play_pause_play" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" - app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toTopOf="parent" + app:tint="?vctr_content_secondary" /> + app:layout_constraintTop_toTopOf="parent" + app:tint="?vctr_content_secondary" />