Fixed display of long texts in adapters

This commit is contained in:
CappielloAntonio 2021-08-02 15:37:29 +02:00
parent 0cf3eaff17
commit 9295c10dcd
8 changed files with 35 additions and 47 deletions

View file

@ -50,7 +50,6 @@ public class PlayerSongQueueAdapter extends RecyclerView.Adapter<PlayerSongQueue
holder.songTitle.setText(MusicUtil.getReadableInfo(song.getTitle()));
holder.songArtist.setText(MusicUtil.getReadableInfo(song.getArtistName()));
holder.songDuration.setText(MusicUtil.getReadableDurationString(song.getDuration(), false));
CustomGlideRequest.Builder
.from(context, song.getPrimary(), song.getBlurHash(), CustomGlideRequest.SONG_PIC)
@ -60,7 +59,6 @@ public class PlayerSongQueueAdapter extends RecyclerView.Adapter<PlayerSongQueue
if (position < MusicPlayerRemote.getPosition()) {
holder.songTitle.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 {
TextView songTitle;
TextView songArtist;
TextView songDuration;
ImageView cover;
ViewHolder(View itemView) {
@ -93,7 +90,6 @@ public class PlayerSongQueueAdapter extends RecyclerView.Adapter<PlayerSongQueue
songTitle = itemView.findViewById(R.id.queue_song_title_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);
itemView.setOnClickListener(this);

View file

@ -115,7 +115,7 @@ public class ArtistPageFragment extends Fragment {
private void initBackdrop() {
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()
.into(bind.artistBackdropImageView);
}

View file

@ -57,12 +57,12 @@ public class PlayingNotification {
Intent action = new Intent(service, MainActivity.class);
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);
Intent intent = new Intent(MusicService.ACTION_QUIT);
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);
service.runOnUiThread(() -> 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) {