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

Commit c11852d4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes Ic4074394,I1be9f1ab

* changes:
  [Media TTT] Add error state.
  [Media TTT] Add the #closeToReceiverToEndCast callback.
parents 7f2d7f6a a0cf5423
Loading
Loading
Loading
Loading
+19 −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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
    <path android:fillColor="@android:color/white" android:pathData="M12,12.5zM1,21L12,2l11,19zM11,15h2v-5h-2zM12,18q0.425,0 0.713,-0.288Q13,17.425 13,17t-0.287,-0.712Q12.425,16 12,16t-0.713,0.288Q11,16.575 11,17t0.287,0.712Q11.575,18 12,18zM4.45,19h15.1L12,6z"/>
</vector>
+17 −6
Original line number Diff line number Diff line
@@ -28,8 +28,8 @@

    <com.android.internal.widget.CachingIconView
        android:id="@+id/app_icon"
        android:layout_width="@dimen/media_ttt_icon_size"
        android:layout_height="@dimen/media_ttt_icon_size"
        android:layout_width="@dimen/media_ttt_app_icon_size"
        android:layout_height="@dimen/media_ttt_app_icon_size"
        android:layout_marginEnd="12dp"
        />

@@ -41,23 +41,34 @@
        android:textColor="?android:attr/textColorPrimary"
        />

    <!-- At most one of [loading, failure_icon, undo] will be visible at a time. -->

    <ProgressBar
        android:id="@+id/loading"
        android:indeterminate="true"
        android:layout_width="@dimen/media_ttt_loading_size"
        android:layout_height="@dimen/media_ttt_loading_size"
        android:layout_marginStart="12dp"
        android:layout_width="@dimen/media_ttt_status_icon_size"
        android:layout_height="@dimen/media_ttt_status_icon_size"
        android:layout_marginStart="@dimen/media_ttt_last_item_start_margin"
        android:indeterminateTint="?androidprv:attr/colorAccentPrimaryVariant"
        style="?android:attr/progressBarStyleSmall"
        />

    <ImageView
        android:id="@+id/failure_icon"
        android:layout_width="@dimen/media_ttt_status_icon_size"
        android:layout_height="@dimen/media_ttt_status_icon_size"
        android:layout_marginStart="@dimen/media_ttt_last_item_start_margin"
        android:src="@drawable/ic_warning"
        android:tint="@color/GM2_red_500"
        />

    <TextView
        android:id="@+id/undo"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/media_transfer_undo"
        android:textColor="?androidprv:attr/textColorOnAccent"
        android:layout_marginStart="12dp"
        android:layout_marginStart="@dimen/media_ttt_last_item_start_margin"
        android:textSize="@dimen/media_ttt_text_size"
        android:paddingStart="@dimen/media_ttt_chip_outer_padding"
        android:paddingEnd="@dimen/media_ttt_chip_outer_padding"
+3 −2
Original line number Diff line number Diff line
@@ -984,10 +984,11 @@
    <!-- Media tap-to-transfer chip for sender device -->
    <dimen name="media_ttt_chip_outer_padding">16dp</dimen>
    <dimen name="media_ttt_text_size">16sp</dimen>
    <dimen name="media_ttt_icon_size">24dp</dimen>
    <dimen name="media_ttt_loading_size">20dp</dimen>
    <dimen name="media_ttt_app_icon_size">24dp</dimen>
    <dimen name="media_ttt_status_icon_size">20dp</dimen>
    <dimen name="media_ttt_undo_button_vertical_padding">8dp</dimen>
    <dimen name="media_ttt_undo_button_vertical_negative_margin">-8dp</dimen>
    <dimen name="media_ttt_last_item_start_margin">12dp</dimen>

    <!-- Media tap-to-transfer chip for receiver device -->
    <dimen name="media_ttt_chip_size_receiver">100dp</dimen>
+4 −0
Original line number Diff line number Diff line
@@ -2158,8 +2158,12 @@
    <string name="media_transfer_undo">Undo</string>
    <!-- Text to ask the user to move their device closer to a different device (deviceName) in order to play media on the different device. [CHAR LIMIT=75] -->
    <string name="media_move_closer_to_start_cast">Move closer to play on <xliff:g id="deviceName" example="My Tablet">%1$s</xliff:g></string>
    <!-- Text to ask the user to move their device closer to a different device (deviceName) in order to transfer media from the different device and back onto the current device. [CHAR LIMIT=75] -->
    <string name="media_move_closer_to_end_cast">Move closer to <xliff:g id="deviceName" example="My Tablet">%1$s</xliff:g> to play here</string>
    <!-- Text informing the user that their media is now playing on a different device (deviceName). [CHAR LIMIT=50] -->
    <string name="media_transfer_playing">Playing on <xliff:g id="deviceName" example="My Tablet">%1$s</xliff:g></string>
    <!-- Text informing the user that the media transfer has failed because something went wrong. [CHAR LIMIT=50] -->
    <string name="media_transfer_failed">Something went wrong</string>

    <!-- Error message indicating that a control timed out while waiting for an update [CHAR_LIMIT=30] -->
    <string name="controls_error_timeout">Inactive, check app</string>
+24 −0
Original line number Diff line number Diff line
@@ -43,4 +43,28 @@ interface IDeviceSenderCallback {
     */
    oneway void closeToReceiverToStartCast(
        in MediaRoute2Info mediaInfo, in DeviceInfo otherDeviceInfo);

    /**
     * Invoke to notify System UI that this device (the sender) is close to a receiver device, so
     * the user can potentially *end* a cast on the receiver device if the user moves this device a
     * bit closer.
     *
     * Important notes:
     *   - When this callback triggers, the device is close enough to inform the user that
     *     transferring is an option, but the device is *not* close enough to actually initiate a
     *     transfer yet.
     *   - This callback is for *ending* a cast. It should be used when media is currently being
     *     played on the receiver device and the media should be transferred to play locally
     *     instead.
     */
    oneway void closeToReceiverToEndCast(
        in MediaRoute2Info mediaInfo, in DeviceInfo otherDeviceInfo);

    /**
     * Invoke to notify System UI that the attempted transfer has failed.
     *
     * This callback will be used for both the transfer that should've *started* playing the media
     * on the receiver and the transfer that should've *ended* the playing on the receiver.
     */
    oneway void transferFailed(in MediaRoute2Info mediaInfo, in DeviceInfo otherDeviceInfo);
}
Loading