视频编辑器时间轴视图 android

问题描述 投票:0回答:0

我正在尝试创建这种类型的视图

您会注意到视频时间轴的移动就像视频搜索栏一样,您还可以水平和垂直滚动,这就是我创建的

我使用 ExoPlayer 播放和控制视频并为时间线内的帧创建自定义视图并在 Recyclerview 内实现自定义视图

现在视图可以水平和垂直滚动,但我根本无法让 recyclerview 充当视频的搜索栏,我不知道该怎么做

这是我的 Recyclerview 布局管理器

val layoutManager = LinearLayoutManager(this, RecyclerView.VERTICAL, false)

这是我在适配器内部膨胀的 CustomView 布局

<HorizontalScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <com.example.example.customViews.ui.CustomSeekBar2
        android:id="@+id/customVideoSeekBar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>

我想过使用

while(videoIsPlaying) recyclerview.scrollTo()
之类的东西,但我不能这样做,因为水平滚动来自膨胀布局而不是 recyclerview 本身

android kotlin android-custom-view
© www.soinside.com 2019 - 2024. All rights reserved.