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

Commit e495562d authored by Lucas Dupin's avatar Lucas Dupin Committed by Automerger Merge Worker
Browse files

Merge changes Id6078a02,I4c6e92ed,Iee440308 into rvc-dev am: d5e4aa1a

Change-Id: If0fa07e3a28b1fdbfc2c34e626ff8fb33b7abc47
parents 9cb20eb6 d5e4aa1a
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -49,6 +49,7 @@
            android:layout_height="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentLeft="true"
            android:fontFamily="@*android:string/config_bodyFontFamily"
            android:fontFamily="@*android:string/config_bodyFontFamily"
            android:textColor="@color/media_primary_text"
            android:gravity="left"
            android:gravity="left"
            android:textSize="14sp" />
            android:textSize="14sp" />


@@ -58,6 +59,7 @@
            android:layout_height="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_alignParentRight="true"
            android:fontFamily="@*android:string/config_bodyFontFamily"
            android:fontFamily="@*android:string/config_bodyFontFamily"
            android:textColor="@color/media_primary_text"
            android:gravity="right"
            android:gravity="right"
            android:textSize="14sp" />
            android:textSize="14sp" />
    </FrameLayout>
    </FrameLayout>
@@ -116,6 +118,7 @@
            android:layout_width="@dimen/qs_seamless_icon_size"
            android:layout_width="@dimen/qs_seamless_icon_size"
            android:layout_height="@dimen/qs_seamless_icon_size"
            android:layout_height="@dimen/qs_seamless_icon_size"
            android:layout_marginRight="8dp"
            android:layout_marginRight="8dp"
            android:tint="@color/media_primary_text"
            android:src="@*android:drawable/ic_media_seamless" />
            android:src="@*android:drawable/ic_media_seamless" />


        <TextView
        <TextView
@@ -125,6 +128,7 @@
            android:fontFamily="@*android:string/config_bodyFontFamily"
            android:fontFamily="@*android:string/config_bodyFontFamily"
            android:singleLine="true"
            android:singleLine="true"
            android:text="@*android:string/ext_media_seamless_action"
            android:text="@*android:string/ext_media_seamless_action"
            android:textColor="@color/media_primary_text"
            android:textSize="14sp" />
            android:textSize="14sp" />
    </LinearLayout>
    </LinearLayout>


@@ -138,11 +142,15 @@
        android:maxHeight="3dp"
        android:maxHeight="3dp"
        android:paddingTop="16dp"
        android:paddingTop="16dp"
        android:paddingBottom="16dp"
        android:paddingBottom="16dp"
        android:thumbTint="@color/media_primary_text"
        android:progressTint="@color/media_seekbar_progress"
        android:progressBackgroundTint="@color/media_disabled"
        android:splitTrack="false" />
        android:splitTrack="false" />


    <!-- App name -->
    <!-- App name -->
    <TextView
    <TextView
        android:id="@+id/app_name"
        android:id="@+id/app_name"
        android:textColor="@color/media_primary_text"
        android:layout_width="0dp"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_height="wrap_content"
        android:singleLine="true"
        android:singleLine="true"
@@ -155,6 +163,7 @@
        android:layout_height="wrap_content"
        android:layout_height="wrap_content"
        android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
        android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
        android:singleLine="true"
        android:singleLine="true"
        android:textColor="@color/media_primary_text"
        android:textSize="18sp" />
        android:textSize="18sp" />


    <!-- Artist name -->
    <!-- Artist name -->
@@ -164,10 +173,12 @@
        android:layout_height="wrap_content"
        android:layout_height="wrap_content"
        android:fontFamily="@*android:string/config_bodyFontFamily"
        android:fontFamily="@*android:string/config_bodyFontFamily"
        android:singleLine="true"
        android:singleLine="true"
        android:textColor="@color/media_primary_text"
        android:textSize="14sp" />
        android:textSize="14sp" />


    <com.android.internal.widget.CachingIconView
    <com.android.internal.widget.CachingIconView
        android:id="@+id/icon"
        android:id="@+id/icon"
        android:tint="@color/media_primary_text"
        android:layout_width="16dp"
        android:layout_width="16dp"
        android:layout_height="16dp" />
        android:layout_height="16dp" />


+3 −0
Original line number Original line Diff line number Diff line
@@ -36,6 +36,7 @@
            android:layout_height="18dp"
            android:layout_height="18dp"
            android:id="@+id/remove_icon"
            android:id="@+id/remove_icon"
            android:layout_marginEnd="16dp"
            android:layout_marginEnd="16dp"
            android:tint="@color/media_primary_text"
            android:src="@drawable/ic_clear"/>
            android:src="@drawable/ic_clear"/>
        <TextView
        <TextView
            android:layout_width="wrap_content"
            android:layout_width="wrap_content"
@@ -43,6 +44,7 @@
            android:id="@+id/remove_text"
            android:id="@+id/remove_text"
            android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
            android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
            android:singleLine="true"
            android:singleLine="true"
            android:textColor="@color/media_primary_text"
            android:text="@string/controls_media_close_session" />
            android:text="@string/controls_media_close_session" />
    </LinearLayout>
    </LinearLayout>
    <TextView
    <TextView
@@ -54,5 +56,6 @@
        android:layout_gravity="end|bottom"
        android:layout_gravity="end|bottom"
        android:gravity="bottom"
        android:gravity="bottom"
        android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
        android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
        android:textColor="@android:color/white"
        android:text="@string/cancel" />
        android:text="@string/cancel" />
</LinearLayout>
</LinearLayout>
+5 −0
Original line number Original line Diff line number Diff line
@@ -239,6 +239,11 @@


    <color name="magnification_border_color">#FF9900</color>
    <color name="magnification_border_color">#FF9900</color>


    <!-- media -->
    <color name="media_primary_text">@android:color/white</color>
    <color name="media_seekbar_progress">#c0ffffff</color>
    <color name="media_disabled">#80ffffff</color>

    <!-- controls -->
    <!-- controls -->
    <color name="control_primary_text">#E6FFFFFF</color>
    <color name="control_primary_text">#E6FFFFFF</color>
    <color name="control_secondary_text">#99FFFFFF</color>
    <color name="control_secondary_text">#99FFFFFF</color>
+1 −0
Original line number Original line Diff line number Diff line
@@ -622,6 +622,7 @@


    <style name="MediaPlayer.Button" parent="@android:style/Widget.Material.Button.Borderless.Small">
    <style name="MediaPlayer.Button" parent="@android:style/Widget.Material.Button.Borderless.Small">
        <item name="android:background">@null</item>
        <item name="android:background">@null</item>
        <item name="android:tint">@android:color/white</item>
    </style>
    </style>


    <!-- Used to style charging animation AVD animation -->
    <!-- Used to style charging animation AVD animation -->
+11 −21
Original line number Original line Diff line number Diff line
@@ -26,6 +26,7 @@ import android.content.pm.ResolveInfo;
import android.content.res.ColorStateList;
import android.content.res.ColorStateList;
import android.graphics.Bitmap;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.GradientDrawable;
@@ -98,7 +99,6 @@ public class MediaControlPanel {
    private PlayerViewHolder mViewHolder;
    private PlayerViewHolder mViewHolder;
    private MediaSession.Token mToken;
    private MediaSession.Token mToken;
    private MediaController mController;
    private MediaController mController;
    private int mForegroundColor;
    private int mBackgroundColor;
    private int mBackgroundColor;
    private MediaDevice mDevice;
    private MediaDevice mDevice;
    protected ComponentName mServiceComponent;
    protected ComponentName mServiceComponent;
@@ -243,7 +243,6 @@ public class MediaControlPanel {
            return;
            return;
        }
        }
        MediaSession.Token token = data.getToken();
        MediaSession.Token token = data.getToken();
        mForegroundColor = data.getForegroundColor();
        mBackgroundColor = data.getBackgroundColor();
        mBackgroundColor = data.getBackgroundColor();
        if (mToken == null || !mToken.equals(token)) {
        if (mToken == null || !mToken.equals(token)) {
            if (mQSMediaBrowser != null) {
            if (mQSMediaBrowser != null) {
@@ -304,24 +303,19 @@ public class MediaControlPanel {


        // App icon
        // App icon
        ImageView appIcon = mViewHolder.getAppIcon();
        ImageView appIcon = mViewHolder.getAppIcon();
        Drawable iconDrawable = data.getAppIcon().mutate();
        appIcon.setImageDrawable(data.getAppIcon());
        iconDrawable.setTint(mForegroundColor);
        appIcon.setImageDrawable(iconDrawable);


        // Song name
        // Song name
        TextView titleText = mViewHolder.getTitleText();
        TextView titleText = mViewHolder.getTitleText();
        titleText.setText(data.getSong());
        titleText.setText(data.getSong());
        titleText.setTextColor(data.getForegroundColor());


        // App title
        // App title
        TextView appName = mViewHolder.getAppName();
        TextView appName = mViewHolder.getAppName();
        appName.setText(data.getApp());
        appName.setText(data.getApp());
        appName.setTextColor(mForegroundColor);


        // Artist name
        // Artist name
        TextView artistText = mViewHolder.getArtistText();
        TextView artistText = mViewHolder.getArtistText();
        artistText.setText(data.getArtist());
        artistText.setText(data.getArtist());
        artistText.setTextColor(mForegroundColor);


        // Transfer chip
        // Transfer chip
        if (mLocalMediaManager != null) {
        if (mLocalMediaManager != null) {
@@ -329,6 +323,10 @@ public class MediaControlPanel {
            setVisibleAndAlpha(collapsedSet, R.id.media_seamless, true /*visible */);
            setVisibleAndAlpha(collapsedSet, R.id.media_seamless, true /*visible */);
            setVisibleAndAlpha(expandedSet, R.id.media_seamless, true /*visible */);
            setVisibleAndAlpha(expandedSet, R.id.media_seamless, true /*visible */);
            updateDevice(mLocalMediaManager.getCurrentConnectedDevice());
            updateDevice(mLocalMediaManager.getCurrentConnectedDevice());
            if (mViewHolder.getBackground().getBackground() instanceof IlluminationDrawable) {
                    ((IlluminationDrawable) mViewHolder.getBackground().getBackground())
                            .setupTouch(mViewHolder.getSeamless(), mViewHolder.getPlayer());
            }
            mViewHolder.getSeamless().setOnClickListener(v -> {
            mViewHolder.getSeamless().setOnClickListener(v -> {
                final Intent intent = new Intent()
                final Intent intent = new Intent()
                        .setAction(MediaOutputSliceConstants.ACTION_MEDIA_OUTPUT)
                        .setAction(MediaOutputSliceConstants.ACTION_MEDIA_OUTPUT)
@@ -358,7 +356,6 @@ public class MediaControlPanel {
            MediaAction mediaAction = actionIcons.get(i);
            MediaAction mediaAction = actionIcons.get(i);
            button.setImageDrawable(mediaAction.getDrawable());
            button.setImageDrawable(mediaAction.getDrawable());
            button.setContentDescription(mediaAction.getContentDescription());
            button.setContentDescription(mediaAction.getContentDescription());
            button.setImageTintList(ColorStateList.valueOf(mForegroundColor));
            PendingIntent actionIntent = mediaAction.getIntent();
            PendingIntent actionIntent = mediaAction.getIntent();


            if (mViewHolder.getBackground().getBackground() instanceof IlluminationDrawable) {
            if (mViewHolder.getBackground().getBackground() instanceof IlluminationDrawable) {
@@ -389,8 +386,7 @@ public class MediaControlPanel {


        // Seek Bar
        // Seek Bar
        final MediaController controller = getController();
        final MediaController controller = getController();
        mBackgroundExecutor.execute(
        mBackgroundExecutor.execute(() -> mSeekBarViewModel.updateController(controller));
                () -> mSeekBarViewModel.updateController(controller, data.getForegroundColor()));


        // Set up long press menu
        // Set up long press menu
        // TODO: b/156036025 bring back media guts
        // TODO: b/156036025 bring back media guts
@@ -541,32 +537,27 @@ public class MediaControlPanel {
        if (mViewHolder == null) {
        if (mViewHolder == null) {
            return;
            return;
        }
        }
        ColorStateList fgTintList = ColorStateList.valueOf(mForegroundColor);
        ImageView iconView = mViewHolder.getSeamlessIcon();
        TextView deviceName = mViewHolder.getSeamlessText();


        // Update the outline color
        // Update the outline color
        LinearLayout viewLayout = (LinearLayout) mViewHolder.getSeamless();
        LinearLayout viewLayout = (LinearLayout) mViewHolder.getSeamless();
        RippleDrawable bkgDrawable = (RippleDrawable) viewLayout.getBackground();
        RippleDrawable bkgDrawable = (RippleDrawable) viewLayout.getBackground();
        GradientDrawable rect = (GradientDrawable) bkgDrawable.getDrawable(0);
        GradientDrawable rect = (GradientDrawable) bkgDrawable.getDrawable(0);
        rect.setStroke(2, mForegroundColor);
        rect.setStroke(2, deviceName.getCurrentTextColor());
        rect.setColor(mBackgroundColor);
        rect.setColor(Color.TRANSPARENT);

        ImageView iconView = mViewHolder.getSeamlessIcon();
        TextView deviceName = mViewHolder.getSeamlessText();
        deviceName.setTextColor(fgTintList);


        if (mIsRemotePlayback) {
        if (mIsRemotePlayback) {
            mViewHolder.getSeamless().setEnabled(false);
            mViewHolder.getSeamless().setEnabled(false);
            mViewHolder.getSeamless().setAlpha(0.38f);
            mViewHolder.getSeamless().setAlpha(0.38f);
            iconView.setImageResource(R.drawable.ic_hardware_speaker);
            iconView.setImageResource(R.drawable.ic_hardware_speaker);
            iconView.setVisibility(View.VISIBLE);
            iconView.setVisibility(View.VISIBLE);
            iconView.setImageTintList(fgTintList);
            deviceName.setText(R.string.media_seamless_remote_device);
            deviceName.setText(R.string.media_seamless_remote_device);
        } else if (device != null) {
        } else if (device != null) {
            mViewHolder.getSeamless().setEnabled(true);
            mViewHolder.getSeamless().setEnabled(true);
            mViewHolder.getSeamless().setAlpha(1f);
            mViewHolder.getSeamless().setAlpha(1f);
            Drawable icon = device.getIcon();
            Drawable icon = device.getIcon();
            iconView.setVisibility(View.VISIBLE);
            iconView.setVisibility(View.VISIBLE);
            iconView.setImageTintList(fgTintList);


            if (icon instanceof AdaptiveIcon) {
            if (icon instanceof AdaptiveIcon) {
                AdaptiveIcon aIcon = (AdaptiveIcon) icon;
                AdaptiveIcon aIcon = (AdaptiveIcon) icon;
@@ -639,7 +630,6 @@ public class MediaControlPanel {
            mQSMediaBrowser.restart();
            mQSMediaBrowser.restart();
        });
        });
        btn.setImageDrawable(mContext.getResources().getDrawable(R.drawable.lb_ic_play));
        btn.setImageDrawable(mContext.getResources().getDrawable(R.drawable.lb_ic_play));
        btn.setImageTintList(ColorStateList.valueOf(mForegroundColor));
        setVisibleAndAlpha(expandedSet, ACTION_IDS[0], true /*visible */);
        setVisibleAndAlpha(expandedSet, ACTION_IDS[0], true /*visible */);
        setVisibleAndAlpha(collapsedSet, ACTION_IDS[0], true /*visible */);
        setVisibleAndAlpha(collapsedSet, ACTION_IDS[0], true /*visible */);


Loading