From 911fce76cbb5340a82debd11bf3f157efba7ad3f Mon Sep 17 00:00:00 2001 From: andrewlewis Date: Mon, 14 Feb 2022 10:39:05 +0000 Subject: [PATCH] Improve transformer activity layout On Samsung S21 with light theme the debug labels weren't showing up because the player view was visible (with a black background) while the transformation was in progress, matching the debug label text color. Hide the player view until the transformation is complete to fix this. Also tweak the layout slightly to add space between the card border and the labels. #mse-bug-week PiperOrigin-RevId: 428455824 --- .../transformerdemo/TransformerActivity.java | 2 ++ .../main/res/layout/transformer_activity.xml | 17 +++++------------ .../transformer/src/main/res/values/strings.xml | 4 ++-- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/demos/transformer/src/main/java/com/google/android/exoplayer2/transformerdemo/TransformerActivity.java b/demos/transformer/src/main/java/com/google/android/exoplayer2/transformerdemo/TransformerActivity.java index 67605237c0..54e20cdf64 100644 --- a/demos/transformer/src/main/java/com/google/android/exoplayer2/transformerdemo/TransformerActivity.java +++ b/demos/transformer/src/main/java/com/google/android/exoplayer2/transformerdemo/TransformerActivity.java @@ -149,6 +149,7 @@ public final class TransformerActivity extends AppCompatActivity { throw new IllegalStateException(e); } informationTextView.setText(R.string.transformation_started); + playerView.setVisibility(View.GONE); Handler mainHandler = new Handler(getMainLooper()); ProgressHolder progressHolder = new ProgressHolder(); mainHandler.post( @@ -285,6 +286,7 @@ public final class TransformerActivity extends AppCompatActivity { getString( R.string.transformation_completed, transformationStopwatch.elapsed(TimeUnit.SECONDS))); progressViewGroup.setVisibility(View.GONE); + playerView.setVisibility(View.VISIBLE); playMediaItem(MediaItem.fromUri("file://" + filePath)); Log.d(TAG, "Output file path: file://" + filePath); } diff --git a/demos/transformer/src/main/res/layout/transformer_activity.xml b/demos/transformer/src/main/res/layout/transformer_activity.xml index 9899f5146e..67db6f107c 100644 --- a/demos/transformer/src/main/res/layout/transformer_activity.xml +++ b/demos/transformer/src/main/res/layout/transformer_activity.xml @@ -34,10 +34,7 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:orientation="vertical" - android:paddingLeft="8dp" - android:paddingRight="8dp" - android:paddingTop="8dp" - android:paddingBottom="8dp" /> + android:padding="8dp" /> @@ -61,8 +58,6 @@ android:id="@+id/debug_text_view" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingLeft="4dp" - android:paddingRight="4dp" android:textSize="10sp" tools:ignore="SmallSp"/> @@ -70,28 +65,26 @@ android:id="@+id/progress_view_group" android:layout_height="match_parent" android:layout_width="match_parent" + android:padding="8dp" android:orientation="vertical"> + android:layout_height="match_parent"> Transformer Demo Configuration - Choose File + Choose file Remove audio Remove video Flatten for slow motion @@ -30,7 +30,7 @@ Transform [Experimental] HDR editing Debug preview: - No debug preview available + No debug preview available. Transformation started Transformation started %d seconds ago. Transformation completed in %d seconds.