Skip to content

Commit dd141af

Browse files
Merge pull request #5723 from nextcloud/style/noid/waveform
Make wave form thicker
2 parents 0a9f5c5 + 7e1ba7f commit dd141af

File tree

4 files changed

+38
-28
lines changed

4 files changed

+38
-28
lines changed

app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingVoiceMessageViewHolder.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,14 @@ class OutcomingVoiceMessageViewHolder(outcomingView: View) :
173173
else -> null
174174
}
175175

176-
readStatusDrawableInt?.let { drawableInt ->
177-
AppCompatResources.getDrawable(context!!, drawableInt)?.let {
176+
if (readStatusDrawableInt != null) {
177+
AppCompatResources.getDrawable(context!!, readStatusDrawableInt)?.let {
178178
binding.checkMark.setImageDrawable(it)
179179
viewThemeUtils.talk.themeMessageCheckMark(binding.checkMark)
180180
}
181+
binding.checkMark.visibility = View.VISIBLE
182+
} else {
183+
binding.checkMark.visibility = View.GONE
181184
}
182185

183186
binding.checkMark.contentDescription = readStatusContentDescriptionString

app/src/main/java/com/nextcloud/talk/ui/WaveformSeekBar.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class WaveformSeekBar : AppCompatSeekBar {
9797
val usableWidth = width - paddingLeft - paddingRight
9898
val midpoint = usableHeight / 2f
9999
val maxHeight: Float = usableHeight / MAX_HEIGHT_DIVISOR
100-
val barGap: Float = (usableWidth - waveData.size * DEFAULT_BAR_WIDTH) / (waveData.size - 1).toFloat()
100+
val barGap: Float = (usableWidth - waveData.size * DEFAULT_BAR_WIDTH) / (waveData.size - 1).toFloat() + 1
101101

102102
canvas?.apply {
103103
withSave {
@@ -114,9 +114,9 @@ class WaveformSeekBar : AppCompatSeekBar {
114114
}
115115

116116
companion object {
117-
private const val DEFAULT_BAR_WIDTH: Int = 2
118-
private const val MAX_HEIGHT_DIVISOR: Float = 4.0f
119-
private const val WIDTH_DIVISOR = 20f
117+
private const val DEFAULT_BAR_WIDTH: Int = 3
118+
private const val MAX_HEIGHT_DIVISOR: Float = 2.4f
119+
private const val WIDTH_DIVISOR = 16f
120120
private const val VALUE_100 = 100
121121
private const val MINIMUM_WIDTH = 50
122122
private val Int.dp: Int

app/src/main/res/layout/item_custom_incoming_voice_message.xml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<com.google.android.flexbox.FlexboxLayout
4848
android:id="@id/bubble"
4949
android:layout_width="match_parent"
50-
android:layout_height="match_parent"
50+
android:layout_height="wrap_content"
5151
android:orientation="vertical"
5252
app:alignContent="stretch"
5353
app:alignItems="stretch"
@@ -75,8 +75,8 @@
7575
<com.google.android.material.button.MaterialButton
7676
android:id="@+id/playPauseBtn"
7777
style="@style/Widget.AppTheme.Button.IconButton"
78-
android:layout_width="48dp"
79-
android:layout_height="48dp"
78+
android:layout_width="@dimen/min_size_clickable_area"
79+
android:layout_height="@dimen/min_size_clickable_area"
8080
android:contentDescription="@string/play_pause_voice_message"
8181
android:visibility="visible"
8282
app:cornerRadius="@dimen/button_corner_radius"
@@ -87,21 +87,25 @@
8787
<com.nextcloud.talk.ui.WaveformSeekBar
8888
android:id="@+id/seekbar"
8989
android:layout_width="0dp"
90-
android:layout_height="70dp"
90+
android:layout_height="@dimen/min_size_clickable_area"
9191
android:layout_weight="1"
92+
android:paddingStart="@dimen/standard_half_padding"
93+
android:paddingTop="@dimen/zero"
94+
android:paddingEnd="@dimen/standard_half_padding"
95+
android:paddingBottom="@dimen/zero"
9296
android:thumb="@drawable/voice_message_outgoing_seek_bar_slider"
93-
tools:progress="50" />
97+
tools:progress="0" />
9498

9599
<com.nextcloud.talk.ui.PlaybackSpeedControl
96100
android:id="@+id/playbackSpeedControlBtn"
97101
style="@style/Widget.AppTheme.Button.IconButton"
98102
android:layout_width="wrap_content"
99-
android:layout_height="48dp"
100-
android:layout_marginEnd="@dimen/standard_margin"
103+
android:layout_height="@dimen/min_size_clickable_area"
101104
android:contentDescription="@string/playback_speed_control"
102105
android:textColor="@color/black"
103106
app:cornerRadius="@dimen/button_corner_radius"
104-
app:rippleColor="#1FFFFFFF" />
107+
app:rippleColor="#1FFFFFFF"
108+
tools:text="1,5x" />
105109

106110
</LinearLayout>
107111

app/src/main/res/layout/item_custom_outcoming_voice_message.xml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@
1313
xmlns:tools="http://schemas.android.com/tools"
1414
android:layout_width="match_parent"
1515
android:layout_height="wrap_content"
16-
android:layout_marginLeft="16dp"
16+
android:layout_marginStart="@dimen/zero"
1717
android:layout_marginTop="2dp"
18-
android:layout_marginRight="16dp"
18+
android:layout_marginEnd="@dimen/standard_margin"
1919
android:layout_marginBottom="2dp">
2020

2121
<RelativeLayout
2222
android:layout_width="match_parent"
23-
android:layout_height="match_parent"
23+
android:layout_height="wrap_content"
2424
android:layout_alignParentEnd="true"
2525
android:layout_marginStart="@dimen/message_outcoming_bubble_margin_left">
2626

2727
<com.google.android.flexbox.FlexboxLayout
2828
android:id="@id/bubble"
2929
android:layout_width="match_parent"
30-
android:layout_height="match_parent"
30+
android:layout_height="wrap_content"
3131
app:alignContent="stretch"
3232
app:alignItems="stretch"
3333
app:flexWrap="wrap"
@@ -56,8 +56,8 @@
5656
<com.google.android.material.button.MaterialButton
5757
android:id="@+id/playPauseBtn"
5858
style="@style/Widget.AppTheme.Button.IconButton"
59-
android:layout_width="48dp"
60-
android:layout_height="48dp"
59+
android:layout_width="@dimen/min_size_clickable_area"
60+
android:layout_height="@dimen/min_size_clickable_area"
6161
android:contentDescription="@string/play_pause_voice_message"
6262
android:visibility="visible"
6363
app:cornerRadius="@dimen/button_corner_radius"
@@ -66,25 +66,28 @@
6666
app:iconTint="@color/high_emphasis_text"
6767
app:rippleColor="#1FFFFFFF" />
6868

69-
7069
<com.nextcloud.talk.ui.WaveformSeekBar
7170
android:id="@+id/seekbar"
7271
android:layout_width="0dp"
73-
android:layout_height="70dp"
72+
android:layout_height="@dimen/min_size_clickable_area"
7473
android:layout_weight="1"
74+
android:paddingStart="@dimen/standard_half_padding"
75+
android:paddingTop="@dimen/zero"
76+
android:paddingEnd="@dimen/standard_half_padding"
77+
android:paddingBottom="@dimen/zero"
7578
android:thumb="@drawable/voice_message_outgoing_seek_bar_slider"
76-
tools:progress="50" />
79+
tools:progress="0" />
7780

7881
<com.nextcloud.talk.ui.PlaybackSpeedControl
7982
android:id="@+id/playbackSpeedControlBtn"
8083
style="@style/Widget.AppTheme.Button.IconButton"
8184
android:layout_width="wrap_content"
82-
android:layout_height="48dp"
83-
android:layout_marginEnd="@dimen/standard_margin"
85+
android:layout_height="@dimen/min_size_clickable_area"
8486
android:contentDescription="@string/playback_speed_control"
8587
android:textColor="@color/black"
8688
app:cornerRadius="@dimen/button_corner_radius"
87-
app:rippleColor="#1FFFFFFF" />
89+
app:rippleColor="#1FFFFFFF"
90+
tools:text="1,5x" />
8891

8992
</LinearLayout>
9093

@@ -111,7 +114,7 @@
111114
android:layout_width="wrap_content"
112115
android:layout_height="wrap_content"
113116
android:layout_gravity="center"
114-
android:layout_marginStart="8dp"
117+
android:layout_marginStart="@dimen/standard_half_margin"
115118
android:alpha="0.6"
116119
android:textColor="@color/no_emphasis_text"
117120
tools:text="10:35" />
@@ -121,7 +124,7 @@
121124
android:layout_width="wrap_content"
122125
android:layout_height="@dimen/message_bubble_checkmark_height"
123126
android:layout_gravity="center"
124-
android:layout_marginStart="8dp"
127+
android:layout_marginStart="@dimen/standard_half_margin"
125128
android:contentDescription="@null"
126129
app:tint="@color/high_emphasis_text" />
127130
</LinearLayout>

0 commit comments

Comments
 (0)