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

Commit 4835e873 authored by changbetty's avatar changbetty Committed by SongFerngWang
Browse files

[LE Audio] Broadcast UI for Media output broadcast dialog

- Create the new dialog for broadcast that extands from
  MediaOutputBaseDialog and add the QR code view area.

- Create the edit dialog for the user to update broadcast name and
  broadcast code.

- Create the dialog for notifying the user that the broadcast feature is
  avaliable.

- We will add the test case for the Broadcast Dialog in next change
  list. This change list only for the UI part, and the Metadata will
  pass into the Broadcast Dialog in b/222674827.

- About the AndroidLint warning for contentDescription, we filed a bug
  b/226271667 for tracking the warning with the UX designer.

Bug: 214493779
Test: manual test
Change-Id: I37a6c0a3319560fb8f81ac45be3cb6465202dd13
parent fd45ea35
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
<!--
Copyright (C) 2022 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:width="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24"
    android:tint="?attr/colorControlNormal">
  <path
      android:fillColor="@android:color/white"
      android:pathData="M12,16Q13.875,16 15.188,14.688Q16.5,13.375 16.5,11.5Q16.5,9.625 15.188,8.312Q13.875,7 12,7Q10.125,7 8.812,8.312Q7.5,9.625 7.5,11.5Q7.5,13.375 8.812,14.688Q10.125,16 12,16ZM12,14.2Q10.875,14.2 10.088,13.412Q9.3,12.625 9.3,11.5Q9.3,10.375 10.088,9.587Q10.875,8.8 12,8.8Q13.125,8.8 13.913,9.587Q14.7,10.375 14.7,11.5Q14.7,12.625 13.913,13.412Q13.125,14.2 12,14.2ZM12,19Q8.35,19 5.35,16.962Q2.35,14.925 1,11.5Q2.35,8.075 5.35,6.037Q8.35,4 12,4Q15.65,4 18.65,6.037Q21.65,8.075 23,11.5Q21.65,14.925 18.65,16.962Q15.65,19 12,19ZM12,11.5Q12,11.5 12,11.5Q12,11.5 12,11.5Q12,11.5 12,11.5Q12,11.5 12,11.5Q12,11.5 12,11.5Q12,11.5 12,11.5Q12,11.5 12,11.5Q12,11.5 12,11.5ZM12,17Q14.825,17 17.188,15.512Q19.55,14.025 20.8,11.5Q19.55,8.975 17.188,7.487Q14.825,6 12,6Q9.175,6 6.812,7.487Q4.45,8.975 3.2,11.5Q4.45,14.025 6.812,15.512Q9.175,17 12,17Z"/>
</vector>
+140 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2022 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/broadcast_info_area"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="start|center_vertical"
    android:orientation="vertical">

    <View
        style="@style/BroadcastDialog.Divider.Horizontal"
        android:layout_marginBottom="6dp"/>

    <LinearLayout
        android:id="@+id/broadcast_qrcode_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >
        <ImageView
            android:id="@+id/qrcode_view"
            android:layout_width="@dimen/media_output_qrcode_size"
            android:layout_height="@dimen/media_output_qrcode_size"
            android:src="@android:color/transparent"
            android:gravity="start|center_vertical"
            android:layout_marginStart="82dp"/>
        <ImageView
            android:id="@+id/broadcast_info"
            android:layout_width="@dimen/media_output_broadcast_info"
            android:layout_height="@dimen/media_output_broadcast_info"
            android:src="@drawable/ic_info_outline"
            android:tint="?android:attr/textColorTertiary"
            android:clickable="true"
            android:layout_marginTop="168dp"
            android:layout_marginStart="31dp"/>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/broadcast_name_layout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingStart="@dimen/media_output_broadcast_info_item_padding_start"
        android:paddingEnd="@dimen/media_output_broadcast_info_item_padding_end"
        android:orientation="horizontal">
        <LinearLayout
            android:layout_width="0dp"
            android:layout_weight="1"
            android:orientation="vertical"
            style="@style/BroadcastDialog.InfoItem" >
            <TextView
                android:id="@+id/broadcast_name_title"
                android:text="@string/media_output_broadcast_name"
                style="@style/BroadcastDialog.InfoItem.Title" />
            <TextView
                android:id="@+id/broadcast_name_summary"
                style="@style/BroadcastDialog.InfoItem.Summary" />
        </LinearLayout>

        <View
            style="@style/BroadcastDialog.Divider.Vertical" />

        <FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="end|center_vertical">
            <ImageView
                android:id="@+id/broadcast_name_edit"
                style="@style/BroadcastDialog.InfoItem.Edit" />
        </FrameLayout>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/broadcast_code_layout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingStart="@dimen/media_output_broadcast_info_item_padding_start"
        android:paddingEnd="@dimen/media_output_broadcast_info_item_padding_end"
        android:orientation="horizontal" >
        <LinearLayout
            android:layout_width="0dp"
            android:layout_weight="1"
            android:orientation="vertical"
            style="@style/BroadcastDialog.InfoItem" >
            <TextView
                android:id="@+id/broadcast_code_title"
                android:text="@string/media_output_broadcast_code"
                style="@style/BroadcastDialog.InfoItem.Title" />
            <TextView
                android:id="@+id/broadcast_code_summary"
                style="@style/BroadcastDialog.InfoItem.Summary" />
        </LinearLayout>

        <FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="end|center_vertical"
            android:layout_marginEnd="26dp">
            <ImageView
                android:id="@+id/broadcast_code_eye"
                android:layout_width="20dp"
                android:layout_height="16dp"
                android:background="?android:attr/selectableItemBackground"
                android:clickable="true"
                android:focusable="true"
                android:src="@drawable/ic_broadcast_code_eye"
                android:tint="?android:attr/textColorPrimary"/>
        </FrameLayout>

        <View
            style="@style/BroadcastDialog.Divider.Vertical" />

        <FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="end|center_vertical">
            <ImageView
                android:id="@+id/broadcast_code_edit"
                style="@style/BroadcastDialog.InfoItem.Edit" />
        </FrameLayout>
    </LinearLayout>

    <View
        style="@style/BroadcastDialog.Divider.Horizontal"
        android:layout_marginTop="14dp"
        android:layout_marginBottom="20dp"/>
</LinearLayout>
 No newline at end of file
+29 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2022 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:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingLeft="?android:attr/dialogPreferredPadding"
    android:paddingRight="?android:attr/dialogPreferredPadding">
    <EditText
        android:id="@+id/broadcast_edit_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="48dp"
        android:textAlignment="viewStart"/>
</LinearLayout>
 No newline at end of file
+7 −0
Original line number Diff line number Diff line
@@ -71,6 +71,13 @@
        </LinearLayout>
    </LinearLayout>

    <ViewStub
        android:id="@+id/broadcast_qrcode"
        android:layout="@layout/media_output_broadcast_area"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </ViewStub>

    <LinearLayout
        android:id="@+id/device_list"
        android:layout_width="match_parent"
+11 −0
Original line number Diff line number Diff line
@@ -1429,4 +1429,15 @@
    <dimen name="dream_overlay_complication_margin">0dp</dimen>

    <dimen name="status_view_margin_horizontal">0dp</dimen>

    <!-- Media output broadcast dialog QR code picture size -->
    <dimen name="media_output_qrcode_size">216dp</dimen>
    <dimen name="media_output_broadcast_info">21dp</dimen>
    <dimen name="media_output_broadcast_info_item_width">256dp</dimen>
    <dimen name="media_output_broadcast_info_item_height">56dp</dimen>
    <dimen name="media_output_broadcast_info_item_padding_start">43dp</dimen>
    <dimen name="media_output_broadcast_info_item_padding_end">31dp</dimen>
    <dimen name="media_output_broadcast_info_title_height">24dp</dimen>
    <dimen name="media_output_broadcast_info_summary_height">20dp</dimen>
    <dimen name="media_output_broadcast_info_edit">18dp</dimen>
</resources>
Loading