From 9295c10dcdcc6e670c6b428d867bdee3261232de Mon Sep 17 00:00:00 2001 From: CappielloAntonio Date: Mon, 2 Aug 2021 15:37:29 +0200 Subject: [PATCH] Fixed display of long texts in adapters --- .idea/misc.xml | 3 ++ .../play/adapter/PlayerSongQueueAdapter.java | 4 -- .../play/ui/fragment/ArtistPageFragment.java | 2 +- .../ui/notification/PlayingNotification.java | 6 +-- .../main/res/layout/item_horizontal_album.xml | 5 +- .../res/layout/item_horizontal_artist.xml | 5 +- .../main/res/layout/item_horizontal_track.xml | 11 +++-- .../res/layout/item_player_queue_song.xml | 46 ++++++------------- 8 files changed, 35 insertions(+), 47 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index eb4be65d..ae0c8d86 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -4,6 +4,9 @@ diff --git a/app/src/main/java/com/cappielloantonio/play/adapter/PlayerSongQueueAdapter.java b/app/src/main/java/com/cappielloantonio/play/adapter/PlayerSongQueueAdapter.java index ff2d8ccf..2bcb4ede 100644 --- a/app/src/main/java/com/cappielloantonio/play/adapter/PlayerSongQueueAdapter.java +++ b/app/src/main/java/com/cappielloantonio/play/adapter/PlayerSongQueueAdapter.java @@ -50,7 +50,6 @@ public class PlayerSongQueueAdapter extends RecyclerView.Adapter CustomGlideRequest.Builder @@ -130,7 +130,7 @@ public class PlayingNotification { Intent intent = new Intent(action); intent.setComponent(serviceName); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); - return PendingIntent.getService(service, 0, intent, 0); + return PendingIntent.getService(service, 0, intent, PendingIntent.FLAG_IMMUTABLE); } void updateNotifyModeAndPostNotification(Notification notification) { diff --git a/app/src/main/res/layout/item_horizontal_album.xml b/app/src/main/res/layout/item_horizontal_album.xml index 9275ab0a..9abcafa4 100644 --- a/app/src/main/res/layout/item_horizontal_album.xml +++ b/app/src/main/res/layout/item_horizontal_album.xml @@ -28,11 +28,11 @@ android:focusable="true" android:focusableInTouchMode="true" android:marqueeRepeatLimit="marquee_forever" + android:maxLines="1" android:paddingStart="12dp" android:paddingTop="10dp" android:paddingEnd="12dp" android:scrollHorizontally="true" - android:singleLine="true" android:text="@string/label_placeholder" app:layout_constraintEnd_toStartOf="@+id/album_more_button" app:layout_constraintStart_toEndOf="@+id/album_cover_image_view" @@ -48,12 +48,13 @@ android:focusable="true" android:focusableInTouchMode="true" android:marqueeRepeatLimit="marquee_forever" + android:maxLines="1" android:paddingStart="12dp" android:paddingEnd="16dp" android:text="@string/label_placeholder" app:layout_constraintEnd_toStartOf="@+id/album_more_button" app:layout_constraintStart_toEndOf="@+id/album_cover_image_view" - app:layout_constraintTop_toBottomOf="@+id/album_title_text_view"/> + app:layout_constraintTop_toBottomOf="@+id/album_title_text_view" /> + app:layout_constraintTop_toBottomOf="@+id/artist_name_text_view" /> - @@ -69,6 +73,7 @@ style="@style/ItemSubtitleTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:maxLines="1" android:paddingStart="4dp" android:paddingEnd="12dp" android:text="@string/label_placeholder" /> diff --git a/app/src/main/res/layout/item_player_queue_song.xml b/app/src/main/res/layout/item_player_queue_song.xml index b24705d5..abd03a06 100644 --- a/app/src/main/res/layout/item_player_queue_song.xml +++ b/app/src/main/res/layout/item_player_queue_song.xml @@ -3,6 +3,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/cardColor" + android:clipChildren="false" android:foreground="?attr/selectableItemBackground" android:orientation="horizontal" android:paddingStart="24dp" @@ -29,50 +30,31 @@ android:focusable="true" android:focusableInTouchMode="true" android:marqueeRepeatLimit="marquee_forever" + android:maxLines="1" android:paddingStart="12dp" android:paddingTop="10dp" android:paddingEnd="12dp" android:scrollHorizontally="true" - android:singleLine="true" android:text="@string/label_placeholder" app:layout_constraintEnd_toStartOf="@+id/queue_song_holder_image" app:layout_constraintStart_toEndOf="@+id/queue_song_cover_image_view" app:layout_constraintTop_toTopOf="parent" /> - - - - - - - - + app:layout_constraintTop_toBottomOf="@+id/queue_song_title_text_view" />