mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-02 18:31:40 +00:00
Fixed display of long texts in adapters
This commit is contained in:
parent
0cf3eaff17
commit
9295c10dcd
8 changed files with 35 additions and 47 deletions
3
.idea/misc.xml
generated
3
.idea/misc.xml
generated
|
|
@ -4,6 +4,9 @@
|
||||||
<option name="filePathToZoomLevelMap">
|
<option name="filePathToZoomLevelMap">
|
||||||
<map>
|
<map>
|
||||||
<entry key="app/src/main/res/layout/fragment_artist_page.xml" value="0.3229166666666667" />
|
<entry key="app/src/main/res/layout/fragment_artist_page.xml" value="0.3229166666666667" />
|
||||||
|
<entry key="app/src/main/res/layout/item_horizontal_album.xml" value="0.3166496424923391" />
|
||||||
|
<entry key="app/src/main/res/layout/item_horizontal_track.xml" value="0.1" />
|
||||||
|
<entry key="app/src/main/res/layout/item_player_queue_song.xml" value="0.3229166666666667" />
|
||||||
</map>
|
</map>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,6 @@ public class PlayerSongQueueAdapter extends RecyclerView.Adapter<PlayerSongQueue
|
||||||
|
|
||||||
holder.songTitle.setText(MusicUtil.getReadableInfo(song.getTitle()));
|
holder.songTitle.setText(MusicUtil.getReadableInfo(song.getTitle()));
|
||||||
holder.songArtist.setText(MusicUtil.getReadableInfo(song.getArtistName()));
|
holder.songArtist.setText(MusicUtil.getReadableInfo(song.getArtistName()));
|
||||||
holder.songDuration.setText(MusicUtil.getReadableDurationString(song.getDuration(), false));
|
|
||||||
|
|
||||||
CustomGlideRequest.Builder
|
CustomGlideRequest.Builder
|
||||||
.from(context, song.getPrimary(), song.getBlurHash(), CustomGlideRequest.SONG_PIC)
|
.from(context, song.getPrimary(), song.getBlurHash(), CustomGlideRequest.SONG_PIC)
|
||||||
|
|
@ -60,7 +59,6 @@ public class PlayerSongQueueAdapter extends RecyclerView.Adapter<PlayerSongQueue
|
||||||
if (position < MusicPlayerRemote.getPosition()) {
|
if (position < MusicPlayerRemote.getPosition()) {
|
||||||
holder.songTitle.setTextColor(context.getResources().getColor(R.color.songToPlayTextColor, null));
|
holder.songTitle.setTextColor(context.getResources().getColor(R.color.songToPlayTextColor, null));
|
||||||
holder.songArtist.setTextColor(context.getResources().getColor(R.color.songToPlayTextColor, null));
|
holder.songArtist.setTextColor(context.getResources().getColor(R.color.songToPlayTextColor, null));
|
||||||
holder.songDuration.setTextColor(context.getResources().getColor(R.color.songToPlayTextColor, null));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -85,7 +83,6 @@ public class PlayerSongQueueAdapter extends RecyclerView.Adapter<PlayerSongQueue
|
||||||
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||||
TextView songTitle;
|
TextView songTitle;
|
||||||
TextView songArtist;
|
TextView songArtist;
|
||||||
TextView songDuration;
|
|
||||||
ImageView cover;
|
ImageView cover;
|
||||||
|
|
||||||
ViewHolder(View itemView) {
|
ViewHolder(View itemView) {
|
||||||
|
|
@ -93,7 +90,6 @@ public class PlayerSongQueueAdapter extends RecyclerView.Adapter<PlayerSongQueue
|
||||||
|
|
||||||
songTitle = itemView.findViewById(R.id.queue_song_title_text_view);
|
songTitle = itemView.findViewById(R.id.queue_song_title_text_view);
|
||||||
songArtist = itemView.findViewById(R.id.queue_song_artist_text_view);
|
songArtist = itemView.findViewById(R.id.queue_song_artist_text_view);
|
||||||
songDuration = itemView.findViewById(R.id.queue_song_duration_text_view);
|
|
||||||
cover = itemView.findViewById(R.id.queue_song_cover_image_view);
|
cover = itemView.findViewById(R.id.queue_song_cover_image_view);
|
||||||
|
|
||||||
itemView.setOnClickListener(this);
|
itemView.setOnClickListener(this);
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ public class ArtistPageFragment extends Fragment {
|
||||||
|
|
||||||
private void initBackdrop() {
|
private void initBackdrop() {
|
||||||
CustomGlideRequest.Builder
|
CustomGlideRequest.Builder
|
||||||
.from(requireContext(), artistPageViewModel.getArtist().getPrimary(), artistPageViewModel.getArtist().getPrimary(), CustomGlideRequest.ARTIST_PIC)
|
.from(requireContext(), artistPageViewModel.getArtist().getId(), artistPageViewModel.getArtist().getPrimary(), CustomGlideRequest.ARTIST_PIC)
|
||||||
.build()
|
.build()
|
||||||
.into(bind.artistBackdropImageView);
|
.into(bind.artistBackdropImageView);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,12 +57,12 @@ public class PlayingNotification {
|
||||||
|
|
||||||
Intent action = new Intent(service, MainActivity.class);
|
Intent action = new Intent(service, MainActivity.class);
|
||||||
action.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
action.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
final PendingIntent clickIntent = PendingIntent.getActivity(service, 0, action, 0);
|
final PendingIntent clickIntent = PendingIntent.getActivity(service, 0, action, PendingIntent.FLAG_IMMUTABLE);
|
||||||
|
|
||||||
final ComponentName serviceName = new ComponentName(service, MusicService.class);
|
final ComponentName serviceName = new ComponentName(service, MusicService.class);
|
||||||
Intent intent = new Intent(MusicService.ACTION_QUIT);
|
Intent intent = new Intent(MusicService.ACTION_QUIT);
|
||||||
intent.setComponent(serviceName);
|
intent.setComponent(serviceName);
|
||||||
final PendingIntent deleteIntent = PendingIntent.getService(service, 0, intent, 0);
|
final PendingIntent deleteIntent = PendingIntent.getService(service, 0, intent, PendingIntent.FLAG_IMMUTABLE);
|
||||||
|
|
||||||
final int bigNotificationImageSize = service.getResources().getDimensionPixelSize(R.dimen.notification_big_image_size);
|
final int bigNotificationImageSize = service.getResources().getDimensionPixelSize(R.dimen.notification_big_image_size);
|
||||||
service.runOnUiThread(() -> CustomGlideRequest.Builder
|
service.runOnUiThread(() -> CustomGlideRequest.Builder
|
||||||
|
|
@ -130,7 +130,7 @@ public class PlayingNotification {
|
||||||
Intent intent = new Intent(action);
|
Intent intent = new Intent(action);
|
||||||
intent.setComponent(serviceName);
|
intent.setComponent(serviceName);
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
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) {
|
void updateNotifyModeAndPostNotification(Notification notification) {
|
||||||
|
|
|
||||||
|
|
@ -28,11 +28,11 @@
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:focusableInTouchMode="true"
|
android:focusableInTouchMode="true"
|
||||||
android:marqueeRepeatLimit="marquee_forever"
|
android:marqueeRepeatLimit="marquee_forever"
|
||||||
|
android:maxLines="1"
|
||||||
android:paddingStart="12dp"
|
android:paddingStart="12dp"
|
||||||
android:paddingTop="10dp"
|
android:paddingTop="10dp"
|
||||||
android:paddingEnd="12dp"
|
android:paddingEnd="12dp"
|
||||||
android:scrollHorizontally="true"
|
android:scrollHorizontally="true"
|
||||||
android:singleLine="true"
|
|
||||||
android:text="@string/label_placeholder"
|
android:text="@string/label_placeholder"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/album_more_button"
|
app:layout_constraintEnd_toStartOf="@+id/album_more_button"
|
||||||
app:layout_constraintStart_toEndOf="@+id/album_cover_image_view"
|
app:layout_constraintStart_toEndOf="@+id/album_cover_image_view"
|
||||||
|
|
@ -48,6 +48,7 @@
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:focusableInTouchMode="true"
|
android:focusableInTouchMode="true"
|
||||||
android:marqueeRepeatLimit="marquee_forever"
|
android:marqueeRepeatLimit="marquee_forever"
|
||||||
|
android:maxLines="1"
|
||||||
android:paddingStart="12dp"
|
android:paddingStart="12dp"
|
||||||
android:paddingEnd="16dp"
|
android:paddingEnd="16dp"
|
||||||
android:text="@string/label_placeholder"
|
android:text="@string/label_placeholder"
|
||||||
|
|
|
||||||
|
|
@ -28,11 +28,11 @@
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:focusableInTouchMode="true"
|
android:focusableInTouchMode="true"
|
||||||
android:marqueeRepeatLimit="marquee_forever"
|
android:marqueeRepeatLimit="marquee_forever"
|
||||||
|
android:maxLines="1"
|
||||||
android:paddingStart="12dp"
|
android:paddingStart="12dp"
|
||||||
android:paddingTop="10dp"
|
android:paddingTop="10dp"
|
||||||
android:paddingEnd="12dp"
|
android:paddingEnd="12dp"
|
||||||
android:scrollHorizontally="true"
|
android:scrollHorizontally="true"
|
||||||
android:singleLine="true"
|
|
||||||
android:text="@string/label_placeholder"
|
android:text="@string/label_placeholder"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/artist_more_button"
|
app:layout_constraintEnd_toStartOf="@+id/artist_more_button"
|
||||||
app:layout_constraintStart_toEndOf="@+id/artist_cover_image_view"
|
app:layout_constraintStart_toEndOf="@+id/artist_cover_image_view"
|
||||||
|
|
@ -48,6 +48,7 @@
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:focusableInTouchMode="true"
|
android:focusableInTouchMode="true"
|
||||||
android:marqueeRepeatLimit="marquee_forever"
|
android:marqueeRepeatLimit="marquee_forever"
|
||||||
|
android:maxLines="1"
|
||||||
android:paddingStart="12dp"
|
android:paddingStart="12dp"
|
||||||
android:paddingEnd="16dp"
|
android:paddingEnd="16dp"
|
||||||
android:text="@string/label_placeholder"
|
android:text="@string/label_placeholder"
|
||||||
|
|
|
||||||
|
|
@ -38,21 +38,25 @@
|
||||||
app:layout_constraintStart_toEndOf="@+id/song_cover_image_view"
|
app:layout_constraintStart_toEndOf="@+id/song_cover_image_view"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingEnd="12dp"
|
android:paddingEnd="12dp"
|
||||||
|
app:layout_constrainedWidth="true"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/search_result_dowanload_indicator_image_view"
|
app:layout_constraintEnd_toStartOf="@+id/search_result_dowanload_indicator_image_view"
|
||||||
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
app:layout_constraintStart_toEndOf="@+id/song_cover_image_view"
|
app:layout_constraintStart_toEndOf="@+id/song_cover_image_view"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/search_result_song_title_text_view">
|
app:layout_constraintTop_toBottomOf="@+id/search_result_song_title_text_view">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/album_artist_text_view"
|
android:id="@+id/album_artist_text_view"
|
||||||
style="@style/ItemSubtitleTextView"
|
style="@style/ItemSubtitleTextView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
android:paddingStart="12dp"
|
android:paddingStart="12dp"
|
||||||
android:paddingEnd="4dp"
|
android:paddingEnd="4dp"
|
||||||
android:text="@string/label_placeholder" />
|
android:text="@string/label_placeholder" />
|
||||||
|
|
@ -69,6 +73,7 @@
|
||||||
style="@style/ItemSubtitleTextView"
|
style="@style/ItemSubtitleTextView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:maxLines="1"
|
||||||
android:paddingStart="4dp"
|
android:paddingStart="4dp"
|
||||||
android:paddingEnd="12dp"
|
android:paddingEnd="12dp"
|
||||||
android:text="@string/label_placeholder" />
|
android:text="@string/label_placeholder" />
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@color/cardColor"
|
android:background="@color/cardColor"
|
||||||
|
android:clipChildren="false"
|
||||||
android:foreground="?attr/selectableItemBackground"
|
android:foreground="?attr/selectableItemBackground"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingStart="24dp"
|
android:paddingStart="24dp"
|
||||||
|
|
@ -29,50 +30,31 @@
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:focusableInTouchMode="true"
|
android:focusableInTouchMode="true"
|
||||||
android:marqueeRepeatLimit="marquee_forever"
|
android:marqueeRepeatLimit="marquee_forever"
|
||||||
|
android:maxLines="1"
|
||||||
android:paddingStart="12dp"
|
android:paddingStart="12dp"
|
||||||
android:paddingTop="10dp"
|
android:paddingTop="10dp"
|
||||||
android:paddingEnd="12dp"
|
android:paddingEnd="12dp"
|
||||||
android:scrollHorizontally="true"
|
android:scrollHorizontally="true"
|
||||||
android:singleLine="true"
|
|
||||||
android:text="@string/label_placeholder"
|
android:text="@string/label_placeholder"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/queue_song_holder_image"
|
app:layout_constraintEnd_toStartOf="@+id/queue_song_holder_image"
|
||||||
app:layout_constraintStart_toEndOf="@+id/queue_song_cover_image_view"
|
app:layout_constraintStart_toEndOf="@+id/queue_song_cover_image_view"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:paddingEnd="12dp"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/queue_song_holder_image"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/queue_song_cover_image_view"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/queue_song_title_text_view">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/queue_song_artist_text_view"
|
android:id="@+id/queue_song_artist_text_view"
|
||||||
style="@style/ItemSubtitleTextView"
|
style="@style/ItemSubtitleTextView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
android:paddingStart="12dp"
|
android:paddingStart="12dp"
|
||||||
android:paddingEnd="4dp"
|
android:paddingEnd="4dp"
|
||||||
android:text="@string/label_placeholder" />
|
android:text="@string/label_placeholder"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/queue_song_holder_image"
|
||||||
<TextView
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
android:id="@+id/queue_separator_text_view"
|
app:layout_constrainedWidth="true"
|
||||||
style="@style/ItemSubtitleTextView"
|
app:layout_constraintStart_toEndOf="@+id/queue_song_cover_image_view"
|
||||||
android:layout_width="wrap_content"
|
app:layout_constraintTop_toBottomOf="@+id/queue_song_title_text_view" />
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/label_dot_separator" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/queue_song_duration_text_view"
|
|
||||||
style="@style/ItemSubtitleTextView"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingStart="4dp"
|
|
||||||
android:paddingEnd="12dp"
|
|
||||||
android:text="@string/label_placeholder" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/queue_song_holder_image"
|
android:id="@+id/queue_song_holder_image"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue