Fix constraints for collapsed layout
The missing constraints for the time views would cause the play/pause button to be laid out incorrectly in RTL mode. Added values to match the prev/next buttons (same as the expanded layout). Also removed code that was changing visibility of these in code since the time views will always be GONE in the collapsed layout Fixes: 237730543 Test: manual (video in bug) Change-Id: I6a9e29de550c4bba05d6fc38e3be3798f0b525b6
This commit is contained in:
@@ -150,7 +150,7 @@
|
||||
|
||||
<!-- See comment in media_session_collapsed.xml for how these barriers are used -->
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/media_action_barrier"
|
||||
android:id="@+id/media_action_barrier_start"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="vertical"
|
||||
@@ -172,6 +172,7 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
|
||||
<!-- This barrier is used in expanded view to constrain the bottom row of actions -->
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/media_action_barrier_top"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<Constraint
|
||||
android:id="@+id/media_action_barrier"
|
||||
android:id="@+id/media_action_barrier_start"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/media_seamless"
|
||||
@@ -91,12 +91,16 @@
|
||||
app:layout_constraintRight_toLeftOf="@id/media_progress_bar"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/media_seamless"
|
||||
app:layout_constraintLeft_toRightOf="@id/media_action_barrier" />
|
||||
app:layout_constraintLeft_toRightOf="@id/media_action_barrier_start" />
|
||||
|
||||
<!-- Showing time while scrubbing isn't available in collapsed mode. -->
|
||||
<Constraint
|
||||
android:id="@+id/media_scrubbing_elapsed_time"
|
||||
android:visibility="gone" />
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toLeftOf="@id/media_progress_bar"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/media_seamless"
|
||||
app:layout_constraintLeft_toRightOf="@id/media_action_barrier_start" />
|
||||
|
||||
<Constraint
|
||||
android:id="@+id/media_progress_bar"
|
||||
@@ -124,7 +128,12 @@
|
||||
<!-- Showing time while scrubbing isn't available in collapsed mode. -->
|
||||
<Constraint
|
||||
android:id="@+id/media_scrubbing_total_time"
|
||||
android:visibility="gone" />
|
||||
android:visibility="gone"
|
||||
app:layout_constraintVertical_bias="1"
|
||||
app:layout_constraintLeft_toRightOf="@id/media_progress_bar"
|
||||
app:layout_constraintRight_toLeftOf="@id/action0"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/media_seamless" />
|
||||
|
||||
<Constraint
|
||||
android:id="@+id/action0"
|
||||
|
||||
@@ -1005,16 +1005,13 @@ public class MediaControlPanel {
|
||||
|
||||
private void bindScrubbingTime(MediaData data) {
|
||||
ConstraintSet expandedSet = mMediaViewController.getExpandedLayout();
|
||||
ConstraintSet collapsedSet = mMediaViewController.getCollapsedLayout();
|
||||
int elapsedTimeId = mMediaViewHolder.getScrubbingElapsedTimeView().getId();
|
||||
int totalTimeId = mMediaViewHolder.getScrubbingTotalTimeView().getId();
|
||||
|
||||
boolean visible = scrubbingTimeViewsEnabled(data.getSemanticActions()) && mIsScrubbing;
|
||||
setVisibleAndAlpha(expandedSet, elapsedTimeId, visible);
|
||||
setVisibleAndAlpha(expandedSet, totalTimeId, visible);
|
||||
// Never show in collapsed
|
||||
setVisibleAndAlpha(collapsedSet, elapsedTimeId, false);
|
||||
setVisibleAndAlpha(collapsedSet, totalTimeId, false);
|
||||
// Collapsed view is always GONE as set in XML, so doesn't need to be updated dynamically
|
||||
}
|
||||
|
||||
private boolean scrubbingTimeViewsEnabled(@Nullable MediaButton semanticActions) {
|
||||
|
||||
Reference in New Issue
Block a user