我正在尝试使用运动布局制作动画,并希望将 scrollView 设置为运动场景 onSwipe Transition 的 targetAnchor,但它不起作用。也许我对 onSwipe 过渡一无所知。
这是我的布局文件
<androidx.constraintlayout.motion.widget.MotionLayout 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="match_parent"
android:background="@color/main_background_color"
app:layoutDescription="@xml/base_scroll_scene">
<ImageView
android:id="@+id/background_image"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="@dimen/scrollable_background_image_margin_bottom"
android:scaleType="centerCrop"
android:src="@drawable/lift_bg"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="@dimen/top_gradient_mask_height"
android:background="@drawable/top_gradient_mask"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/ski_more_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/ski_more_logo_margin_top"
android:src="@drawable/ic_skimore_logo"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/locked_icon"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginTop="@dimen/locked_icon_margin_top"
android:src="@drawable/ic_lock"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ski_more_logo" />
<FrameLayout
android:id="@+id/bottom_gradient_mask"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@drawable/bottom_gradient_mask"
app:layout_constraintBottom_toBottomOf="@+id/background_image" />
<ScrollView
android:id="@+id/content_scroll_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:overScrollMode="never"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent">
<FrameLayout
android:id="@+id/content_container_view"
android:layout_width="match_parent"
android:clickable="false"
android:layout_height="match_parent" />
</ScrollView>
</androidx.constraintlayout.motion.widget.MotionLayout>
Run Code Online (Sandbox Code Playgroud)
在滚动视图中,我以编程方式添加了一些高度较大的内容,这些内容将是可滚动的。
这是我的动作场景 …
我正在尝试使用 mediaCodec 从 openGl ES 表面创建 mp4 视频。我有一个eglSurface,该eglSurface 的源表面是MediaCodec 输入表面。
我可以为eglSurface 设置不同的尺寸,当一种尺寸(宽度或高度)太大时:例如宽度= 5000 且高度= 512,MediaCodec 崩溃。
这是崩溃日志
android.media.MediaCodec$CodecException: Error 0xfffffc0e
at android.media.MediaCodec.native_configure(Native Method)
at android.media.MediaCodec.configure(MediaCodec.java:588)
Run Code Online (Sandbox Code Playgroud)
....
在某些设备(Galaxy s7 edge)上它不会崩溃,但生成 videoView 后不会播放视频。
对于小尺寸(例如屏幕尺寸),它可以在所有设备上正常工作