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

Commit 3feb2954 authored by cecilia's avatar cecilia
Browse files

Make the recommendation card's title to be one line, and the blur

overlay for the cutting off text.

Screenshots:
- Largest text: http://screen/57TPBhdhhv2w2t4;
- Default text: http://screen/NqWZZLoctPs7ZGw.

The shorter app name like Spotify has no-op for default sizes:
http://screen/8ft8thSA3yrtZXs.

Fixes: 193503292
Test: Local builds

Change-Id: Ie4a02e28f20092db68c14b420ef88a5314c4940a
parent 98fa7d14
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2021 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.
-->

<shape
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <corners android:radius="24dp"/>
    <gradient
        android:angle="0"
        android:startColor="#00000000"
        android:endColor="#ff000000"
        android:type="linear" />
</shape>
+25 −4
Original line number Diff line number Diff line
@@ -48,20 +48,41 @@
        android:id="@+id/recommendation_card_icon"
        android:layout_width="@dimen/qs_media_icon_size"
        android:layout_height="@dimen/qs_media_icon_size"
        android:layout_marginTop="@dimen/qs_media_padding"
        android:src="@drawable/ic_headset"
        style="@style/MediaPlayer.AppIcon"/>
        style="@style/MediaPlayer.AppIcon"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toStartOf="@id/media_vertical_start_guideline"
        app:layout_constraintHorizontal_bias="0"/>

    <TextView
        android:id="@+id/recommendation_card_text"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:maxLines="2"
        android:maxLines="1"
        android:text="@string/controls_media_smartspace_rec_title"
        android:fontFamily="google-sans-medium"
        android:textDirection="locale"
        android:textSize="@dimen/qq_aa_media_rec_header_text_size"
        android:breakStrategy="balanced"
        android:hyphenationFrequency="none"/>
        android:hyphenationFrequency="none"
        app:layout_constraintTop_toBottomOf="@id/recommendation_card_icon"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toStartOf="@id/media_vertical_start_guideline"
        app:layout_constraintHorizontal_bias="0"/>

    <View
        android:id="@+id/recommendation_gradient_view"
        android:layout_width="@dimen/qs_aa_media_gradient_bg_width"
        android:layout_height="0dp"
        android:clipToPadding="false"
        android:clipChildren="false"
        android:background="@drawable/qs_media_recommendation_bg_gradient"
        app:layout_constraintTop_toTopOf="@id/recommendation_card_text"
        app:layout_constraintBottom_toBottomOf="@id/recommendation_card_text"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toStartOf="@id/media_vertical_start_guideline"
        app:layout_constraintHorizontal_bias="1"/>

    <FrameLayout
        android:id="@+id/media_cover1_container"
+1 −0
Original line number Diff line number Diff line
@@ -1304,6 +1304,7 @@
    <!-- Size of Smartspace media recommendations cards in the QSPanel carousel -->
    <dimen name="qs_aa_media_rec_album_size_collapsed">72dp</dimen>
    <dimen name="qs_aa_media_rec_album_size_expanded">76dp</dimen>
    <dimen name="qs_aa_media_gradient_bg_width">32dp</dimen>
    <dimen name="qs_aa_media_rec_album_margin">8dp</dimen>
    <dimen name="qs_aa_media_rec_album_margin_vert">4dp</dimen>
    <dimen name="qq_aa_media_rec_header_text_size">16sp</dimen>
+0 −19
Original line number Diff line number Diff line
@@ -18,25 +18,6 @@
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <Constraint
        android:id="@+id/recommendation_card_icon"
        android:layout_width="@dimen/qs_media_icon_size"
        android:layout_height="@dimen/qs_media_icon_size"
        android:layout_marginTop="@dimen/qs_media_padding"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toStartOf="@id/media_vertical_start_guideline"
        app:layout_constraintHorizontal_bias="0" />

    <Constraint
        android:id="@+id/recommendation_card_text"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toBottomOf="@id/recommendation_card_icon"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toStartOf="@id/media_vertical_start_guideline"
        app:layout_constraintHorizontal_bias="0" />

    <Constraint
        android:id="@+id/media_cover1_container"
        android:layout_width="0dp"
+0 −19
Original line number Diff line number Diff line
@@ -18,25 +18,6 @@
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <Constraint
        android:id="@+id/recommendation_card_icon"
        android:layout_width="@dimen/qs_media_icon_size"
        android:layout_height="@dimen/qs_media_icon_size"
        android:layout_marginTop="@dimen/qs_media_padding"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toStartOf="@id/media_vertical_start_guideline"
        app:layout_constraintHorizontal_bias="0" />

    <Constraint
        android:id="@+id/recommendation_card_text"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toBottomOf="@id/recommendation_card_icon"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toStartOf="@id/media_vertical_start_guideline"
        app:layout_constraintHorizontal_bias="0" />

    <Constraint
        android:id="@+id/media_cover1_container"
        android:layout_width="0dp"
Loading