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 com.google.android.exoplayer2.ui.PlayerControlView
|
||||||
import org.thoughtcrime.securesms.R
|
import org.thoughtcrime.securesms.R
|
||||||
import org.thoughtcrime.securesms.util.MediaUtil
|
import org.thoughtcrime.securesms.util.MediaUtil
|
||||||
|
import org.thoughtcrime.securesms.util.visible
|
||||||
import kotlin.time.DurationUnit
|
import kotlin.time.DurationUnit
|
||||||
import kotlin.time.toDuration
|
import kotlin.time.toDuration
|
||||||
|
|
||||||
|
@ -61,7 +62,7 @@ class MediaPreviewPlayerControlView @JvmOverloads constructor(
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
fun setMediaMode(mediaMode: MediaMode) {
|
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
|
videoControls.visibility = if (mediaMode == MediaMode.VIDEO) VISIBLE else INVISIBLE
|
||||||
if (mediaMode == MediaMode.VIDEO) {
|
if (mediaMode == MediaMode.VIDEO) {
|
||||||
setProgressUpdateListener { position, _ ->
|
setProgressUpdateListener { position, _ ->
|
||||||
|
|
|
@ -4,10 +4,10 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom"
|
|
||||||
android:background="@color/transparent"
|
android:background="@color/transparent"
|
||||||
android:layoutDirection="ltr"
|
android:layoutDirection="ltr"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
|
android:animateLayoutChanges="true"
|
||||||
tools:targetApi="28">
|
tools:targetApi="28">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="55dp"
|
android:layout_height="55dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
app:touch_target_height="55dp"/>
|
app:touch_target_height="55dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@id/exo_duration"
|
android:id="@id/exo_duration"
|
||||||
|
@ -53,9 +53,9 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginBottom="11dp"
|
|
||||||
android:layout_marginStart="12dp"
|
android:layout_marginStart="12dp"
|
||||||
android:layout_marginEnd="12dp"
|
android:layout_marginEnd="12dp"
|
||||||
|
android:layout_marginBottom="11dp"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:layout_height="64dp" />
|
tools:layout_height="64dp" />
|
||||||
|
@ -85,9 +85,9 @@
|
||||||
android:id="@+id/exo_button_viewgroup"
|
android:id="@+id/exo_button_viewgroup"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="invisible"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal"
|
||||||
|
android:visibility="visible">
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@id/exo_prev"
|
android:id="@id/exo_prev"
|
||||||
|
@ -100,10 +100,10 @@
|
||||||
style="@style/MediaPreviewButton"
|
style="@style/MediaPreviewButton"
|
||||||
android:layout_width="@dimen/media_preview_lottie_button_dimen"
|
android:layout_width="@dimen/media_preview_lottie_button_dimen"
|
||||||
android:layout_height="@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_gravity="center_vertical"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
android:background="@drawable/circle_touch_highlight_background_material3"
|
android:background="@drawable/circle_touch_highlight_background_material3"
|
||||||
|
android:contentDescription="@string/exo_controls_rewind_description"
|
||||||
app:lottie_rawRes="@raw/lottie_15s_skip_back"
|
app:lottie_rawRes="@raw/lottie_15s_skip_back"
|
||||||
app:tint="@color/signal_colorOnSurface"
|
app:tint="@color/signal_colorOnSurface"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
@ -135,11 +135,11 @@
|
||||||
style="@style/MediaPreviewButton"
|
style="@style/MediaPreviewButton"
|
||||||
android:layout_width="@dimen/media_preview_lottie_button_dimen"
|
android:layout_width="@dimen/media_preview_lottie_button_dimen"
|
||||||
android:layout_height="@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_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
android:background="@drawable/circle_touch_highlight_background_material3"
|
android:background="@drawable/circle_touch_highlight_background_material3"
|
||||||
android:backgroundTint="@color/signal_colorOnSurface"
|
android:backgroundTint="@color/signal_colorOnSurface"
|
||||||
|
android:contentDescription="@string/exo_controls_fastforward_description"
|
||||||
app:lottie_rawRes="@raw/lottie_15s_skip_forward"
|
app:lottie_rawRes="@raw/lottie_15s_skip_forward"
|
||||||
app:tint="@color/signal_colorOnSurface"
|
app:tint="@color/signal_colorOnSurface"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
Loading…
Add table
Reference in a new issue