mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
Fixed the representation of strings in the playlist adapter
This commit is contained in:
parent
20052ff054
commit
0090896ca0
6 changed files with 20 additions and 81 deletions
|
|
@ -39,8 +39,7 @@ public class PlaylistDialogHorizontalAdapter extends RecyclerView.Adapter<Playli
|
|||
Playlist playlist = playlists.get(position);
|
||||
|
||||
holder.item.playlistDialogTitleTextView.setText(MusicUtil.getReadableString(playlist.getName()));
|
||||
holder.item.playlistDialogCountTextView.setText(holder.itemView.getContext().getString(R.string.playlist_counted_tracks, playlist.getSongCount()));
|
||||
holder.item.playlistDialogDurationTextView.setText(MusicUtil.getReadableDurationString(playlist.getDuration(), false));
|
||||
holder.item.playlistDialogCountTextView.setText(holder.itemView.getContext().getString(R.string.playlist_counted_tracks, playlist.getSongCount(), MusicUtil.getReadableDurationString(playlist.getDuration(), false)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -75,8 +75,7 @@ public class PlaylistHorizontalAdapter extends RecyclerView.Adapter<PlaylistHori
|
|||
Playlist playlist = playlists.get(position);
|
||||
|
||||
holder.item.playlistDialogTitleTextView.setText(MusicUtil.getReadableString(playlist.getName()));
|
||||
holder.item.playlistDialogCountTextView.setText(holder.itemView.getContext().getString(R.string.playlist_counted_tracks, playlist.getSongCount()));
|
||||
holder.item.playlistDialogDurationTextView.setText(MusicUtil.getReadableDurationString(playlist.getDuration(), false));
|
||||
holder.item.playlistDialogCountTextView.setText(holder.itemView.getContext().getString(R.string.playlist_counted_tracks, playlist.getSongCount(), MusicUtil.getReadableDurationString(playlist.getDuration(), false)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -107,7 +107,9 @@ public class PlaylistCatalogueFragment extends Fragment implements ClickCallback
|
|||
bind.playlistCatalogueRecyclerView.setAdapter(playlistHorizontalAdapter);
|
||||
|
||||
if (getActivity() != null) {
|
||||
playlistCatalogueViewModel.getPlaylistList(getViewLifecycleOwner()).observe(getViewLifecycleOwner(), playlists -> playlistHorizontalAdapter.setItems(playlists));
|
||||
playlistCatalogueViewModel.getPlaylistList(getViewLifecycleOwner()).observe(getViewLifecycleOwner(), playlists -> {
|
||||
if (playlists != null) playlistHorizontalAdapter.setItems(playlists);
|
||||
});
|
||||
}
|
||||
|
||||
bind.playlistCatalogueRecyclerView.setOnTouchListener((v, event) -> {
|
||||
|
|
|
|||
|
|
@ -27,52 +27,21 @@
|
|||
android:paddingTop="8dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:singleLine="true"
|
||||
android:text="@string/label_placeholder"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
<TextView
|
||||
android:id="@+id/playlist_dialog_count_text_view"
|
||||
style="@style/LabelSmall"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:ellipsize="marquee"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingBottom="8dp"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/playlist_dialog_title_text_view">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/playlist_dialog_count_text_view"
|
||||
style="@style/LabelSmall"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="4dp"
|
||||
android:text="@string/label_placeholder" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/queue_separator_text_view"
|
||||
style="@style/LabelSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/label_dot_separator" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/playlist_dialog_duration_text_view"
|
||||
style="@style/LabelSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="4dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:text="@string/label_placeholder" />
|
||||
</LinearLayout>
|
||||
app:layout_constraintTop_toBottomOf="@+id/playlist_dialog_title_text_view" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
|
@ -18,50 +18,20 @@
|
|||
android:paddingTop="8dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:singleLine="true"
|
||||
android:text="@string/label_placeholder"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
<TextView
|
||||
android:id="@+id/playlist_dialog_count_text_view"
|
||||
style="@style/LabelSmall"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:ellipsize="marquee"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingBottom="8dp"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/playlist_dialog_title_text_view">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/playlist_dialog_count_text_view"
|
||||
style="@style/LabelSmall"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="4dp"
|
||||
android:text="@string/label_placeholder" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/queue_separator_text_view"
|
||||
style="@style/LabelSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/label_dot_separator" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/playlist_dialog_duration_text_view"
|
||||
style="@style/LabelSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="4dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:text="@string/label_placeholder" />
|
||||
</LinearLayout>
|
||||
app:layout_constraintTop_toBottomOf="@+id/playlist_dialog_title_text_view" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
@ -117,7 +117,7 @@
|
|||
<string name="playlist_chooser_dialog_negative_button">Cancel</string>
|
||||
<string name="playlist_chooser_dialog_neutral_button">Create</string>
|
||||
<string name="playlist_chooser_dialog_title">Add to a playlist</string>
|
||||
<string name="playlist_counted_tracks">%1$d tracks</string>
|
||||
<string name="playlist_counted_tracks">%1$d tracks • %2$s</string>
|
||||
<string name="playlist_duration">Duration • %1$s</string>
|
||||
<string name="playlist_editor_dialog_hint_name">Playlist Name</string>
|
||||
<string name="playlist_editor_dialog_negative_button">Cancel</string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue