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

Commit f21a4159 authored by shaoweishen's avatar shaoweishen Committed by Automerger Merge Worker
Browse files

DO NOT MERGE: Downbranch don't need this adjustment am: 19987ee0

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16370478

Change-Id: Ida2e4e542918ad427a721833b0c1d2adb0a49e18
parents 6f922ba0 19987ee0
Loading
Loading
Loading
Loading
+16 −13
Original line number Diff line number Diff line
@@ -13,9 +13,11 @@
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
<inset xmlns:android="http://schemas.android.com/apk/res/android"
       xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
       android:shape="rectangle">
       android:insetBottom="6dp"
       android:insetTop="6dp">
    <shape android:shape="rectangle">
        <stroke
            android:color="?androidprv:attr/colorAccentPrimaryVariant"
            android:width="1dp"/>
@@ -27,3 +29,4 @@
            android:bottom="8dp"/>
        <solid android:color="@android:color/transparent"/>
    </shape>
</inset>
 No newline at end of file
+7 −7
Original line number Diff line number Diff line
@@ -24,9 +24,9 @@

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="96dp"
        android:layout_height="wrap_content"
        android:gravity="start|center_vertical"
        android:paddingStart="16dp"
        android:paddingStart="24dp"
        android:orientation="horizontal">
        <ImageView
            android:id="@+id/header_icon"
@@ -36,7 +36,7 @@

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_height="wrap_content"
            android:paddingStart="16dp"
            android:paddingTop="20dp"
            android:paddingBottom="24dp"
@@ -59,7 +59,7 @@
                android:gravity="center_vertical"
                android:ellipsize="end"
                android:maxLines="1"
                android:textColor="?android:attr/textColorTertiary"
                android:textColor="?android:attr/textColorSecondary"
                android:fontFamily="roboto-regular"
                android:textSize="16sp"/>
        </LinearLayout>
@@ -90,7 +90,7 @@
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:layout_marginStart="24dp"
        android:layout_marginBottom="18dp"
        android:layout_marginBottom="24dp"
        android:layout_marginEnd="24dp"
        android:orientation="horizontal">

@@ -98,7 +98,7 @@
            android:id="@+id/stop"
            style="@style/MediaOutputRoundedOutlinedButton"
            android:layout_width="wrap_content"
            android:layout_height="36dp"
            android:layout_height="wrap_content"
            android:minWidth="0dp"
            android:text="@string/keyboard_key_media_stop"
            android:visibility="gone"/>
@@ -112,7 +112,7 @@
            android:id="@+id/done"
            style="@style/MediaOutputRoundedOutlinedButton"
            android:layout_width="wrap_content"
            android:layout_height="36dp"
            android:layout_height="wrap_content"
            android:minWidth="0dp"
            android:text="@string/inline_done_button"/>
    </LinearLayout>
+2 −8
Original line number Diff line number Diff line
@@ -63,13 +63,14 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements
    View mDialogView;
    private TextView mHeaderTitle;
    private TextView mHeaderSubtitle;
    private ImageView mHeaderIcon;
    private RecyclerView mDevicesRecyclerView;
    private LinearLayout mDeviceListLayout;
    private Button mDoneButton;
    private Button mStopButton;
    private int mListMaxHeight;

    protected ImageView mHeaderIcon;

    MediaOutputBaseAdapter mAdapter;

    private final ViewTreeObserver.OnGlobalLayoutListener mDeviceListLayoutListener = () -> {
@@ -140,7 +141,6 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements
        mMediaOutputController.stop();
    }

    @VisibleForTesting
    void refresh() {
        // Update header icon
        final int iconRes = getHeaderIconRes();
@@ -154,12 +154,6 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements
        } else {
            mHeaderIcon.setVisibility(View.GONE);
        }
        if (mHeaderIcon.getVisibility() == View.VISIBLE) {
            final int size = getHeaderIconSize();
            final int padding = mContext.getResources().getDimensionPixelSize(
                    R.dimen.media_output_dialog_header_icon_padding);
            mHeaderIcon.setLayoutParams(new LinearLayout.LayoutParams(size + padding, size));
        }
        // Update title and subtitle
        mHeaderTitle.setText(getHeaderText());
        final CharSequence subTitle = getHeaderSubtitle();
+10 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.widget.LinearLayout;

import androidx.core.graphics.drawable.IconCompat;

@@ -75,6 +76,15 @@ public class MediaOutputGroupDialog extends MediaOutputBaseDialog {
        return mContext.getString(R.string.media_output_dialog_multiple_devices, size);
    }

    @Override
    void refresh() {
        super.refresh();
        final int size = getHeaderIconSize();
        final int padding = mContext.getResources().getDimensionPixelSize(
                R.dimen.media_output_dialog_header_icon_padding);
        mHeaderIcon.setLayoutParams(new LinearLayout.LayoutParams(size + padding, size));
    }

    @Override
    int getStopButtonVisibility() {
        return View.VISIBLE;