Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a75e5637 authored by Beth Thibodeau's avatar Beth Thibodeau
Browse files

Add pagination arrows to media player layout

When there are multiple media players in the carousel, display arrows on
either side of the player card to page to the next one. Arrow buttons
are disabled when they would page past either end of the carousel.

Bug: 383974508
Flag: com.android.systemui.media_carousel_arrows
Test: atest MediaCarouselControllerTest MediaControlPanelTest
Test: manual

Change-Id: Ib94394b99ee543b1afbeac6bd9c686b2dd774f34
parent e3131a9b
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1249,6 +1249,16 @@ flag {
  bug: "397989775"
}

flag {
    name:"media_carousel_arrows"
    namespace: "systemui"
    description: "Show arrow buttons to page the media carousel"
    bug: "383974508"
    metadata {
      purpose: PURPOSE_BUGFIX
    }
}

flag {
  namespace: "systemui"
  name: "enable_view_capture_tracing"
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2025 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_enabled="true"
        android:color="@color/media_on_background"
        android:alpha="1.0" />
    <item android:state_enabled="false"
        android:color="@color/media_on_background"
        android:alpha="?android:attr/disabledAlpha" />
</selector>
+19 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2025 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="48dp" android:viewportHeight="960" android:viewportWidth="960" android:width="48dp" android:autoMirrored="true">
    <path android:fillColor="@color/media_player_action_color" android:pathData="M560,720 L320,480l240,-240 56,56 -184,184 184,184 -56,56Z"/>
</vector>
+19 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2025 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="48dp" android:viewportHeight="960" android:viewportWidth="960" android:width="48dp" android:autoMirrored="true">
    <path android:fillColor="@color/media_player_action_color" android:pathData="M504,480 L320,296l56,-56 240,240 -240,240 -56,-56 184,-184Z"/>
</vector>
+26 −0
Original line number Diff line number Diff line
@@ -95,6 +95,32 @@
        android:orientation="vertical"
        app:layout_constraintGuide_end="@dimen/qs_media_session_collapsed_legacy_guideline" />

    <!-- Carousel pagination -->
    <ImageButton
        android:id="@+id/page_left"
        android:src="@drawable/ic_chevron_left"
        style="@style/MediaPlayer.PageButton"
        android:layout_width="48dp"
        android:layout_height="48dp"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        android:minHeight="48dp"
        android:visibility="gone"
        />
    <ImageButton
        android:id="@+id/page_right"
        android:src="@drawable/ic_chevron_right"
        style="@style/MediaPlayer.PageButton"
        android:layout_width="48dp"
        android:layout_height="48dp"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        android:minHeight="48dp"
        android:visibility="gone"
        />

    <!-- App icon -->
    <com.android.internal.widget.CachingIconView
        android:id="@+id/icon"
Loading