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

Commit 50cde569 authored by Alex Shabalin's avatar Alex Shabalin
Browse files

Remove the Output Switcher dead code.

Bug: 384738509
Flag: EXEMPT refactor
Test: atest MediaOutputAdapterTest
Change-Id: Ia6c91cff810c95427bc599fc4b100ccbbb5b2c7b
parent ae9c64be
Loading
Loading
Loading
Loading
+0 −30
Original line number Diff line number Diff line
@@ -119,36 +119,6 @@
            android:layout_height="wrap_content"/>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/cast_app_section"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:layout_marginStart="@dimen/dialog_side_padding"
        android:layout_marginEnd="@dimen/dialog_side_padding"
        android:layout_marginBottom="@dimen/dialog_bottom_padding"
        android:orientation="vertical"
        android:visibility="gone">
        <TextView
            android:id="@+id/launch_app_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical|start"
            android:ellipsize="end"
            android:textColor="?android:attr/textColorPrimary"
            android:text="@string/media_output_dialog_launch_app_text"
            android:maxLines="1"
            android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
            android:textSize="16sp"/>

        <Button
            android:id="@+id/launch_app_button"
            style="@style/Widget.Dialog.Button.BorderButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:drawablePadding="5dp"/>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
+0 −1
Original line number Diff line number Diff line
@@ -1514,7 +1514,6 @@
    <dimen name="media_output_dialog_header_icon_padding">16dp</dimen>
    <dimen name="media_output_dialog_icon_corner_radius">16dp</dimen>
    <dimen name="media_output_dialog_title_anim_y_delta">12.5dp</dimen>
    <dimen name="media_output_dialog_app_tier_icon_size">20dp</dimen>
    <dimen name="media_output_dialog_background_radius">16dp</dimen>
    <dimen name="media_output_dialog_active_background_radius">30dp</dimen>
    <dimen name="media_output_dialog_default_margin_end">16dp</dimen>
+0 −2
Original line number Diff line number Diff line
@@ -3192,8 +3192,6 @@
    <string name="media_output_dialog_connect_failed">Can\'t switch. Tap to try again.</string>
    <!-- Title for connecting item [CHAR LIMIT=60] -->
    <string name="media_output_dialog_pairing_new">Connect a device</string>
    <!-- Title for launch app [CHAR LIMIT=60] -->
    <string name="media_output_dialog_launch_app_text">To cast this session, please open the app.</string>
    <!-- App name when can't get app name [CHAR LIMIT=60] -->
    <string name="media_output_dialog_unknown_launch_app_name">Unknown app</string>
    <!-- Button text for stopping casting [CHAR LIMIT=60] -->
+13 −15
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
                ((MediaGroupDividerViewHolder) viewHolder).onBind(currentMediaItem.getTitle());
                break;
            case MediaItem.MediaItemType.TYPE_PAIR_NEW_DEVICE:
                ((MediaDeviceViewHolder) viewHolder).onBind(CUSTOMIZED_ITEM_PAIR_NEW);
                ((MediaDeviceViewHolder) viewHolder).onBindPairNewDevice();
                break;
            case MediaItem.MediaItemType.TYPE_DEVICE:
                ((MediaDeviceViewHolder) viewHolder).onBind(
@@ -418,9 +418,8 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
            updateIconAreaClickListener(listener);
        }

        @Override
        void onBind(int customizedItem) {
            if (customizedItem == CUSTOMIZED_ITEM_PAIR_NEW) {
        /** Binds a ViewHolder for a "Connect a device" item. */
        void onBindPairNewDevice() {
            mTitleText.setTextColor(mController.getColorItemContent());
            mCheckBox.setVisibility(View.GONE);
            setSingleLineLayout(mContext.getText(R.string.media_output_dialog_pairing_new));
@@ -432,7 +431,6 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
                    ColorStateList.valueOf(mController.getColorItemBackground()));
            mContainerLayout.setOnClickListener(mController::launchBluetoothPairing);
        }
        }

        private void onGroupActionTriggered(boolean isChecked, MediaDevice device) {
            disableSeekBar();
+0 −33
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import static com.android.systemui.media.dialog.MediaOutputSeekbar.VOLUME_PERCEN

import android.animation.Animator;
import android.animation.ValueAnimator;
import android.annotation.DrawableRes;
import android.app.WallpaperColors;
import android.content.Context;
import android.content.res.ColorStateList;
@@ -60,10 +59,6 @@ import java.util.List;
public abstract class MediaOutputBaseAdapter extends
        RecyclerView.Adapter<RecyclerView.ViewHolder> {

    static final int CUSTOMIZED_ITEM_PAIR_NEW = 1;
    static final int CUSTOMIZED_ITEM_GROUP = 2;
    static final int CUSTOMIZED_ITEM_DYNAMIC_GROUP = 3;

    protected final MediaSwitchingController mController;

    private static final int UNMUTE_DEFAULT_VOLUME = 2;
@@ -197,8 +192,6 @@ public abstract class MediaOutputBaseAdapter extends
                    ColorStateList.valueOf(mController.getColorSeekbarProgress()));
        }

        abstract void onBind(int customizedItem);

        void setSingleLineLayout(CharSequence title) {
            setSingleLineLayout(title, false, false, false, false);
        }
@@ -456,32 +449,6 @@ public abstract class MediaOutputBaseAdapter extends
                    ColorStateList.valueOf(mController.getColorConnectedItemBackground()));
        }

        private void animateCornerAndVolume(int fromProgress, int toProgress) {
            final GradientDrawable layoutBackgroundDrawable =
                    (GradientDrawable) mItemLayout.getBackground();
            final ClipDrawable clipDrawable =
                    (ClipDrawable) ((LayerDrawable) mSeekBar.getProgressDrawable())
                            .findDrawableByLayerId(android.R.id.progress);
            final GradientDrawable targetBackgroundDrawable =
                    (GradientDrawable) (mIconAreaLayout.getBackground());
            mCornerAnimator.addUpdateListener(animation -> {
                float value = (float) animation.getAnimatedValue();
                layoutBackgroundDrawable.setCornerRadius(value);
                if (toProgress == 0) {
                    targetBackgroundDrawable.setCornerRadius(value);
                } else {
                    targetBackgroundDrawable.setCornerRadii(new float[]{
                            value,
                            value,
                            0, 0, 0, 0, value, value
                    });
                }
            });
            mVolumeAnimator.setIntValues(fromProgress, toProgress);
            mVolumeAnimator.start();
            mCornerAnimator.start();
        }

        private void initAnimator() {
            mCornerAnimator = ValueAnimator.ofFloat(mController.getInactiveRadius(),
                    mController.getActiveRadius());
Loading