Merge branch 'develop' into feature/ons/increase_dm_test_coverage

This commit is contained in:
Onuray Sahin 2022-12-23 13:38:28 +03:00
commit 2085f7f17d
6 changed files with 41 additions and 19 deletions

1
changelog.d/7821.misc Normal file
View File

@ -0,0 +1 @@
[Voice Broadcast] Replace the player timeline

View File

@ -83,7 +83,7 @@ ext.libs = [
'appdistributionApi' : "com.google.firebase:firebase-appdistribution-api-ktx:$appDistribution",
'appdistribution' : "com.google.firebase:firebase-appdistribution:$appDistribution",
// Phone number https://github.com/google/libphonenumber
'phonenumber' : "com.googlecode.libphonenumber:libphonenumber:8.13.1"
'phonenumber' : "com.googlecode.libphonenumber:libphonenumber:8.13.3"
],
dagger : [
'dagger' : "com.google.dagger:dagger:$dagger",
@ -129,7 +129,7 @@ ext.libs = [
'mavericksTesting' : "com.airbnb.android:mavericks-testing:$mavericks"
],
maplibre : [
'androidSdk' : "org.maplibre.gl:android-sdk:9.5.2",
'androidSdk' : "org.maplibre.gl:android-sdk:9.6.0",
'pluginAnnotation' : "org.maplibre.gl:android-plugin-annotation-v9:1.0.0"
],
mockk : [

View File

@ -3013,7 +3013,11 @@
"begging",
"mercy",
"puppy eyes",
"face"
"face",
"cry",
"tears",
"sad",
"grievance"
]
},
"face-holding-back-tears": {
@ -3060,9 +3064,7 @@
"fearful",
"scared",
"terrified",
"nervous",
"oops",
"huh"
"nervous"
]
},
"anxious-face-with-sweat": {

View File

@ -122,10 +122,14 @@ abstract class MessageVoiceBroadcastListeningItem : AbsMessageVoiceBroadcastItem
private fun bindSeekBar(holder: Holder) {
with(holder) {
durationView.text = formatPlaybackTime(duration)
remainingTimeView.text = formatRemainingTime(duration)
elapsedTimeView.text = formatPlaybackTime(0)
seekBar.max = duration
seekBar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) = Unit
override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
remainingTimeView.text = formatRemainingTime(duration - progress)
elapsedTimeView.text = formatPlaybackTime(progress)
}
override fun onStartTrackingTouch(seekBar: SeekBar) {
isUserSeeking = true
@ -156,6 +160,7 @@ abstract class MessageVoiceBroadcastListeningItem : AbsMessageVoiceBroadcastItem
}
private fun formatPlaybackTime(time: Int) = DateUtils.formatElapsedTime((time / 1000).toLong())
private fun formatRemainingTime(time: Int) = if (time < 1000) formatPlaybackTime(time) else String.format("-%s", formatPlaybackTime(time))
override fun unbind(holder: Holder) {
super.unbind(holder)
@ -177,7 +182,8 @@ abstract class MessageVoiceBroadcastListeningItem : AbsMessageVoiceBroadcastItem
val fastBackwardButton by bind<ImageButton>(R.id.fastBackwardButton)
val fastForwardButton by bind<ImageButton>(R.id.fastForwardButton)
val seekBar by bind<SeekBar>(R.id.seekBar)
val durationView by bind<TextView>(R.id.playbackDuration)
val remainingTimeView by bind<TextView>(R.id.remainingTime)
val elapsedTimeView by bind<TextView>(R.id.elapsedTime)
val broadcasterNameMetadata by bind<VoiceBroadcastMetadataView>(R.id.broadcasterNameMetadata)
val voiceBroadcastMetadata by bind<VoiceBroadcastMetadataView>(R.id.voiceBroadcastMetadata)
val listenersCountMetadata by bind<VoiceBroadcastMetadataView>(R.id.listenersCountMetadata)

View File

@ -140,27 +140,40 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:layout_marginEnd="6dp"
android:paddingStart="0dp"
android:paddingEnd="0dp"
android:progressDrawable="@drawable/bg_seek_bar"
android:thumbTint="?vctr_content_secondary"
android:thumbOffset="3dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/playbackDuration"
android:thumbTint="?vctr_content_secondary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/controllerButtonsFlow"
tools:progress="0" />
tools:progress="50" />
<TextView
android:id="@+id/playbackDuration"
android:id="@+id/elapsedTime"
style="@style/Widget.Vector.TextView.Caption"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginTop="-3dp"
android:textColor="?vctr_content_tertiary"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/seekBar"
tools:ignore="NegativeMargin"
tools:text="0:11" />
<TextView
android:id="@+id/remainingTime"
style="@style/Widget.Vector.TextView.Caption"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-3dp"
android:layout_marginEnd="4dp"
android:textColor="?vctr_content_tertiary"
app:layout_constraintBottom_toBottomOf="@id/seekBar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/seekBar"
tools:text="0:23" />
app:layout_constraintTop_toBottomOf="@id/seekBar"
tools:ignore="NegativeMargin"
tools:text="-0:12" />
</androidx.constraintlayout.widget.ConstraintLayout>

File diff suppressed because one or more lines are too long