Improve animations for video seekbar.
This commit is contained in:
parent
50084f8f73
commit
b7b7a04fad
2 changed files with 11 additions and 10 deletions
|
@ -17,6 +17,7 @@ import com.airbnb.lottie.model.KeyPath
|
|||
import com.google.android.exoplayer2.ui.PlayerControlView
|
||||
import org.thoughtcrime.securesms.R
|
||||
import org.thoughtcrime.securesms.util.MediaUtil
|
||||
import org.thoughtcrime.securesms.util.visible
|
||||
import kotlin.time.DurationUnit
|
||||
import kotlin.time.toDuration
|
||||
|
||||
|
@ -61,7 +62,7 @@ class MediaPreviewPlayerControlView @JvmOverloads constructor(
|
|||
|
||||
@SuppressLint("SetTextI18n")
|
||||
fun setMediaMode(mediaMode: MediaMode) {
|
||||
durationBar.visibility = if (mediaMode == MediaMode.VIDEO) VISIBLE else GONE
|
||||
durationBar.visible = mediaMode == MediaMode.VIDEO
|
||||
videoControls.visibility = if (mediaMode == MediaMode.VIDEO) VISIBLE else INVISIBLE
|
||||
if (mediaMode == MediaMode.VIDEO) {
|
||||
setProgressUpdateListener { position, _ ->
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@color/transparent"
|
||||
android:layoutDirection="ltr"
|
||||
android:orientation="vertical"
|
||||
android:animateLayoutChanges="true"
|
||||
tools:targetApi="28">
|
||||
|
||||
<LinearLayout
|
||||
|
@ -53,9 +53,9 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="11dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginBottom="11dp"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
tools:layout_height="64dp" />
|
||||
|
@ -85,9 +85,9 @@
|
|||
android:id="@+id/exo_button_viewgroup"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="invisible"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
android:visibility="visible">
|
||||
|
||||
<ImageButton
|
||||
android:id="@id/exo_prev"
|
||||
|
@ -100,10 +100,10 @@
|
|||
style="@style/MediaPreviewButton"
|
||||
android:layout_width="@dimen/media_preview_lottie_button_dimen"
|
||||
android:layout_height="@dimen/media_preview_lottie_button_dimen"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:contentDescription="@string/exo_controls_rewind_description"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="@drawable/circle_touch_highlight_background_material3"
|
||||
android:contentDescription="@string/exo_controls_rewind_description"
|
||||
app:lottie_rawRes="@raw/lottie_15s_skip_back"
|
||||
app:tint="@color/signal_colorOnSurface"
|
||||
tools:visibility="visible" />
|
||||
|
@ -135,11 +135,11 @@
|
|||
style="@style/MediaPreviewButton"
|
||||
android:layout_width="@dimen/media_preview_lottie_button_dimen"
|
||||
android:layout_height="@dimen/media_preview_lottie_button_dimen"
|
||||
android:layout_marginStart="16dp"
|
||||
android:contentDescription="@string/exo_controls_fastforward_description"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="16dp"
|
||||
android:background="@drawable/circle_touch_highlight_background_material3"
|
||||
android:backgroundTint="@color/signal_colorOnSurface"
|
||||
android:contentDescription="@string/exo_controls_fastforward_description"
|
||||
app:lottie_rawRes="@raw/lottie_15s_skip_forward"
|
||||
app:tint="@color/signal_colorOnSurface"
|
||||
tools:visibility="visible" />
|
||||
|
|
Loading…
Add table
Reference in a new issue