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

Commit 4b510ab9 authored by Selim Cinek's avatar Selim Cinek Committed by Android (Google) Code Review
Browse files

Merge changes from topic "media_refactor" into rvc-dev

* changes:
  Handling multiple players better
  Fixed an issue where GONE Views would show during transitions
  Fixing some issues where view was too short when created
  Made the animation logic more stable
  Measuring the Media Views now properly the first time its created
  When animating between states, animate the view width
  Factored out the media view manager from the hiearchyManager
  Migrated away from view detaching as a signal
  Work back in media uri loading that was changed in the refactor
  Media views now dynamically transition between media hosts
  Changed the quick settings layout for media
  Refactored the Media Player management
  Changing media to MotionLayout
  Made sure that we're only updating the media notification when inflated
parents 954820b0 f418bb02
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -19,4 +19,4 @@
    systemui:rippleMinSize="30dp"
    systemui:rippleMaxSize="135dp"
    systemui:highlight="15"
    systemui:cornerRadius="@dimen/qs_media_corner_radius" />
 No newline at end of file
    systemui:cornerRadius="?android:attr/dialogCornerRadius" />
 No newline at end of file
+0 −105
Original line number Diff line number Diff line
@@ -45,109 +45,4 @@
        android:layout_height="match_parent"
    />

    <!-- Layout for media controls. -->
    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/keyguard_media_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="center"
        android:padding="16dp"
    >
        <ImageView
            android:id="@+id/album_art"
            android:layout_width="@dimen/qs_media_album_size"
            android:layout_height="@dimen/qs_media_album_size"
            android:layout_marginRight="16dp"
            android:layout_weight="0"
        />

        <!-- Media information -->
        <LinearLayout
            android:orientation="vertical"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
        >
            <LinearLayout
                android:orientation="horizontal"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="center"
            >
                <com.android.internal.widget.CachingIconView
                    android:id="@+id/icon"
                    android:layout_width="16dp"
                    android:layout_height="16dp"
                    android:layout_marginEnd="5dp"
                />
                <TextView
                    android:id="@+id/app_name"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textSize="14sp"
                    android:singleLine="true"
                />
            </LinearLayout>

            <!-- Song name -->
            <TextView
                android:id="@+id/header_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:singleLine="true"
                android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
                android:textSize="18sp"
                android:paddingBottom="6dp"
                android:gravity="center"/>

            <!-- Artist name -->
            <TextView
                android:id="@+id/header_artist"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:fontFamily="@*android:string/config_bodyFontFamily"
                android:textSize="14sp"
                android:singleLine="true"
            />
        </LinearLayout>

        <!-- Controls -->
        <LinearLayout
            android:id="@+id/media_actions"
            android:orientation="horizontal"
            android:layoutDirection="ltr"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:gravity="center"
            android:layout_gravity="center"
        >
            <ImageButton
                style="@style/MediaPlayer.Button"
                android:layout_width="48dp"
                android:layout_height="48dp"
                android:gravity="center"
                android:visibility="gone"
                android:id="@+id/action0"
            />
            <ImageButton
                style="@style/MediaPlayer.Button"
                android:layout_width="48dp"
                android:layout_height="48dp"
                android:gravity="center"
                android:visibility="gone"
                android:id="@+id/action1"
            />
            <ImageButton
                style="@style/MediaPlayer.Button"
                android:layout_width="48dp"
                android:layout_height="48dp"
                android:gravity="center"
                android:visibility="gone"
                android:id="@+id/action2"
            />
        </LinearLayout>
    </LinearLayout>

</com.android.systemui.statusbar.notification.stack.MediaHeaderView>
+7 −5
Original line number Diff line number Diff line
@@ -16,20 +16,22 @@
  -->

<!-- Carousel for media controls -->
<HorizontalScrollView
<com.android.systemui.media.UnboundHorizontalScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="@dimen/qs_media_padding"
    android:scrollbars="none"
    android:visibility="gone"
    android:clipChildren="false"
    android:clipToPadding="false"
    >
    <LinearLayout
        android:id="@+id/media_carousel"
        android:layout_width="match_parent"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:clipChildren="false"
        android:clipToPadding="false"
        >
        <!-- QSMediaPlayers will be added here dynamically -->
    </LinearLayout>
</HorizontalScrollView>
</com.android.systemui.media.UnboundHorizontalScrollView>
+0 −90
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2019 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
  -->

<!-- Layout for QQS media controls -->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/qqs_media_controls"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:gravity="center"
    android:paddingTop="16dp"
    android:paddingLeft="16dp"
    android:paddingRight="16dp"
    android:paddingBottom="12dp"
    android:background="@drawable/qs_media_background"
    >
    <!-- Top line: icon + song name -->
    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:clipChildren="false"
        android:gravity="center"
        android:layout_marginBottom="12dp"
        >
        <com.android.internal.widget.CachingIconView
            android:id="@+id/icon"
            android:layout_width="14dp"
            android:layout_height="14dp"
            android:layout_marginEnd="5dp"
        />
        <TextView
            android:id="@+id/header_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
            android:singleLine="true"
        />
    </LinearLayout>

    <!-- Bottom section: controls -->
    <LinearLayout
        android:id="@+id/media_actions"
        android:orientation="horizontal"
        android:layoutDirection="ltr"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
        >
        <ImageButton
            style="@style/MediaPlayer.Button"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:gravity="center"
            android:visibility="gone"
            android:id="@+id/action0"
        />
        <ImageButton
            style="@style/MediaPlayer.Button"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:gravity="center"
            android:visibility="gone"
            android:id="@+id/action1"
        />
        <ImageButton
            style="@style/MediaPlayer.Button"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:gravity="center"
            android:visibility="gone"
            android:id="@+id/action2"
        />
    </LinearLayout>
</LinearLayout>
+0 −10
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@
    android:layout_height="@dimen/qs_footer_height"
    android:layout_marginStart="@dimen/qs_footer_margin"
    android:layout_marginEnd="@dimen/qs_footer_margin"
    android:elevation="4dp"
    android:background="@android:color/transparent"
    android:baselineAligned="false"
    android:clickable="false"
@@ -128,13 +127,4 @@
            </com.android.systemui.statusbar.AlphaOptimizedFrameLayout>
        </com.android.keyguard.AlphaOptimizedLinearLayout>
    </LinearLayout>
    <View
        android:id="@+id/qs_drag_handle_view"
        android:layout_width="48dp"
        android:layout_height="4dp"
        android:layout_marginTop="8dp"
        android:layout_marginBottom="8dp"
        android:layout_gravity="center_horizontal|bottom"
        android:background="@drawable/qs_footer_drag_handle" />

</com.android.systemui.qs.QSFooterImpl>
Loading