File tree Expand file tree Collapse file tree
app/src/main/java/com/nextcloud/talk/ui/chat Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88package com.nextcloud.talk.ui.chat
99
1010import android.text.format.DateUtils
11+ import androidx.compose.animation.core.animateIntAsState
1112import androidx.compose.foundation.layout.Column
1213import androidx.compose.foundation.layout.Row
1314import androidx.compose.foundation.layout.fillMaxWidth
@@ -42,6 +43,8 @@ import com.nextcloud.talk.ui.WAVEFORM_SIZE
4243import com.nextcloud.talk.utils.AudioUtils
4344
4445private const val SEEKBAR_MAX = 100
46+ private const val START_WAVE_FORM_HEIGHT = 10
47+ private const val END_WAVE_FORM_HEIGHT = 56
4548
4649@OptIn(ExperimentalMaterial3Api ::class )
4750@Suppress(" Detekt.LongMethod" , " LongParameterList" )
@@ -75,6 +78,11 @@ fun VoiceMessage(
7578 }
7679 }
7780
81+ val animValue by animateIntAsState(
82+ if (waveformData.average() > 0 ) END_WAVE_FORM_HEIGHT else START_WAVE_FORM_HEIGHT ,
83+ label = " size"
84+ )
85+
7886 Column {
7987 Row (
8088 verticalAlignment = Alignment .CenterVertically ,
@@ -105,7 +113,7 @@ fun VoiceMessage(
105113 onSeek(message.id, progressI)
106114 },
107115 modifier = Modifier
108- .height(56 .dp)
116+ .height(animValue .dp)
109117 .fillMaxWidth()
110118 .padding(8 .dp), // or weight(1f),
111119 waveformData
You can’t perform that action at this time.
0 commit comments