diff --git a/OCH/sweeper/sweeper-cloud/src/main/res/layout/sweeper_base_fragment.xml b/OCH/sweeper/sweeper-cloud/src/main/res/layout/sweeper_base_fragment.xml index eb7f101fc1..d9833a54ed 100644 --- a/OCH/sweeper/sweeper-cloud/src/main/res/layout/sweeper_base_fragment.xml +++ b/OCH/sweeper/sweeper-cloud/src/main/res/layout/sweeper_base_fragment.xml @@ -97,11 +97,24 @@ app:layout_constraintTop_toTopOf="parent" app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="@dimen/dp_36" - android:layout_marginTop="@dimen/dp_27"> + android:layout_marginTop="@dimen/dp_27" + app:roundLayoutRadius="@dimen/dp_16" + > + + android:layout_width="match_parent" + android:layout_height="@dimen/dp_401" + app:layout_constraintTop_toBottomOf="@+id/sweeper_video_view" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent"/> + android:layout_marginTop="@dimen/dp_27" + app:roundLayoutRadius="@dimen/dp_16" + > + android:layout_height="wrap_content" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent"/> target = new CustomTarget() { + @Override + public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition transition) { + //回调内容 + if (!resource.isRecycled()) { + SweeperVideoView.this.setImageBitmap(resource); + } + } + + @Override + public void onLoadCleared(@Nullable Drawable placeholder) { + //这个方法在target被回收时调用,如果在除了imageView以外的地方引用了imageView中的bitmap,在这里清除引用以避免崩溃 + } + }; + + @Override + public void onSweeperFutianBackCameraVideo(@NonNull byte[] data) { + ThreadUtils.runOnUiThread(new Runnable() { + @Override + public void run() { + GlideApp.with(SweeperVideoView.this) + .asBitmap() + .load(data) + .placeholder(SweeperVideoView.this.getDrawable()) + .apply(requestOptions) + .into(target); + } + }); + } +}