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

Commit e9897deb authored by tim peng's avatar tim peng Committed by Android (Google) Code Review
Browse files

Merge changes Icb5a1f24,Idbfc558b,I3086a404,Ida509ed4,I9eb6e3b0

* changes:
  Add a receiver to launch Output Switcher dialog
  Add MediaOutputDialogFactory to create MediaOutputDialog
  Add Media Output Dialog for Output Switcher
  Add MediaOutputAdapter for Media device list
  Add controller for Media operation
parents 2618b23c 6d31848f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -772,5 +772,12 @@
            </intent-filter>
        </receiver>

        <receiver android:name=".media.dialog.MediaOutDialogReceiver"
                  android:exported="true">
            <intent-filter>
                <action android:name="com.android.systemui.action.LAUNCH_MEDIA_OUTPUT_DIALOG" />
            </intent-filter>
        </receiver>

    </application>
</manifest>
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2020 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.
  -->

<inset xmlns:android="http://schemas.android.com/apk/res/android">
    <shape android:shape="rectangle">
        <corners android:radius="8dp" />
        <solid android:color="?android:attr/colorBackground" />
    </shape>
</inset>
+136 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2020 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.
  -->

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/media_output_dialog"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="94dp"
        android:gravity="start|center_vertical"
        android:paddingStart="16dp"
        android:orientation="horizontal">
        <ImageView
            android:id="@+id/header_icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingEnd="16dp"/>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginEnd="16dp"
            android:orientation="vertical">
            <TextView
                android:id="@+id/header_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:ellipsize="end"
                android:maxLines="1"
                android:textColor="?android:attr/textColorPrimary"
                android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
                android:textSize="20sp"/>

            <TextView
                android:id="@+id/header_subtitle"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:ellipsize="end"
                android:maxLines="1"
                android:fontFamily="roboto-regular"
                android:textSize="14sp"/>

        </LinearLayout>
    </LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="?android:attr/listDivider"/>

    <LinearLayout
        android:id="@+id/device_list"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="start|center_vertical"
        android:orientation="vertical">

        <View
            android:layout_width="match_parent"
            android:layout_height="12dp"/>

        <include
            layout="@layout/media_output_list_item"
            android:id="@+id/group_item_controller"
            android:visibility="gone"/>

        <View
            android:id="@+id/group_item_divider"
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="?android:attr/listDivider"
            android:visibility="gone"/>

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/list_result"
            android:scrollbars="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:overScrollMode="never"/>

        <View
            android:id="@+id/list_bottom_padding"
            android:layout_width="match_parent"
            android:layout_height="12dp"/>
    </LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="?android:attr/listDivider"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <Button
            android:id="@+id/stop"
            style="@*android:style/Widget.DeviceDefault.Button.Borderless.Colored"
            android:layout_width="wrap_content"
            android:layout_height="64dp"
            android:text="@string/keyboard_key_media_stop"
            android:visibility="gone"/>

        <Space
            android:layout_weight="1"
            android:layout_width="0dp"
            android:layout_height="match_parent"/>

        <Button
            android:id="@+id/done"
            style="@*android:style/Widget.DeviceDefault.Button.Borderless.Colored"
            android:layout_width="wrap_content"
            android:layout_height="64dp"
            android:layout_marginEnd="0dp"
            android:text="@string/inline_done_button"/>
    </LinearLayout>
</LinearLayout>
 No newline at end of file
+112 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2020 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.
  -->

<FrameLayout
    android:id="@+id/device_container"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="64dp">

    <FrameLayout
        android:layout_width="36dp"
        android:layout_height="36dp"
        android:layout_gravity="center_vertical"
        android:layout_marginStart="16dp">
        <ImageView
            android:id="@+id/title_icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"/>
    </FrameLayout>

    <TextView
        android:id="@+id/title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_marginStart="68dp"
        android:ellipsize="end"
        android:maxLines="1"
        android:textColor="?android:attr/textColorPrimary"
        android:textSize="14sp"/>

    <RelativeLayout
        android:id="@+id/two_line_layout"
        android:layout_width="wrap_content"
        android:layout_height="48dp"
        android:layout_marginStart="52dp"
        android:layout_marginEnd="69dp"
        android:layout_marginTop="10dp">
        <TextView
            android:id="@+id/two_line_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:layout_marginEnd="15dp"
            android:ellipsize="end"
            android:maxLines="1"
            android:textColor="?android:attr/textColorPrimary"
            android:textSize="14sp"/>
        <TextView
            android:id="@+id/subtitle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:layout_marginEnd="15dp"
            android:layout_marginBottom="7dp"
            android:layout_alignParentBottom="true"
            android:ellipsize="end"
            android:maxLines="1"
            android:textColor="?android:attr/textColorSecondary"
            android:textSize="12sp"
            android:fontFamily="roboto-regular"
            android:visibility="gone"/>
        <ProgressBar
            android:id="@+id/volume_indeterminate_progress"
            style="@*android:style/Widget.Material.ProgressBar.Horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:layout_marginEnd="15dp"
            android:layout_marginBottom="1dp"
            android:layout_alignParentBottom="true"
            android:indeterminate="true"
            android:indeterminateOnly="true"
            android:visibility="gone"/>
        <SeekBar
            android:id="@+id/volume_seekbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"/>
    </RelativeLayout>

    <View
        android:layout_width="1dp"
        android:layout_height="36dp"
        android:layout_marginEnd="68dp"
        android:layout_gravity="right|center_vertical"
        android:background="?android:attr/listDivider"
        android:visibility="gone"/>

    <ImageView
        android:id="@+id/end_icon"
        android:layout_width="24dp"
        android:layout_height="24dp"
        android:layout_gravity="right|center_vertical"
        android:layout_marginEnd="24dp"
        android:visibility="gone"/>
</FrameLayout>
 No newline at end of file
+7 −0
Original line number Diff line number Diff line
@@ -1366,4 +1366,11 @@
    <dimen name="config_rounded_mask_size">@*android:dimen/rounded_corner_radius</dimen>
    <dimen name="config_rounded_mask_size_top">@*android:dimen/rounded_corner_radius_top</dimen>
    <dimen name="config_rounded_mask_size_bottom">@*android:dimen/rounded_corner_radius_bottom</dimen>

    <!-- Output switcher panel related dimensions -->
    <dimen name="media_output_dialog_padding_top">11dp</dimen>
    <dimen name="media_output_dialog_list_max_height">364dp</dimen>
    <dimen name="media_output_dialog_header_album_icon_size">52dp</dimen>
    <dimen name="media_output_dialog_header_back_icon_size">36dp</dimen>
    <dimen name="media_output_dialog_icon_corner_radius">16dp</dimen>
</resources>
Loading