fix: further eliminate the use of HTML decode in titles and subtitles

This commit is contained in:
CappielloAntonio
2024-08-30 15:27:16 +02:00
parent 052e9d9068
commit 3c2ea38f1e
3 changed files with 10 additions and 10 deletions

View File

@@ -40,7 +40,7 @@ public class ShareHorizontalAdapter extends RecyclerView.Adapter<ShareHorizontal
public void onBindViewHolder(ViewHolder holder, int position) {
Share share = shares.get(position);
holder.item.shareTitleTextView.setText(MusicUtil.getReadableString(share.getDescription()));
holder.item.shareTitleTextView.setText(share.getDescription());
holder.item.shareSubtitleTextView.setText(holder.itemView.getContext().getString(R.string.share_subtitle_item, UIUtil.getReadableDate(share.getExpires())));
if (share.getEntries() != null && !share.getEntries().isEmpty()) CustomGlideRequest.Builder

View File

@@ -182,7 +182,7 @@ public class AlbumPageFragment extends Fragment implements ClickCallback {
if (albumInfo != null) {
if (bind != null) bind.albumNotesTextview.setVisibility(View.VISIBLE);
if (bind != null)
bind.albumNotesTextview.setText(MusicUtil.getReadableString(albumInfo.getNotes()));
bind.albumNotesTextview.setText(MusicUtil.forceReadableString(albumInfo.getNotes()));
if (bind != null && albumInfo.getLastFmUrl() != null && !albumInfo.getLastFmUrl().isEmpty()) {
bind.albumNotesTextview.setOnClickListener(v -> {

View File

@@ -179,14 +179,6 @@ public class MusicUtil {
}
}
public static String getReadableString(String string) {
if (string != null) {
return Html.fromHtml(string, Html.FROM_HTML_MODE_COMPACT).toString();
}
return "";
}
public static String getReadableTrackNumber(Context context, Integer trackNumber) {
if (trackNumber != null) {
return String.valueOf(trackNumber);
@@ -195,6 +187,14 @@ public class MusicUtil {
return context.getString(R.string.label_placeholder);
}
public static String getReadableString(String string) {
if (string != null) {
return Html.fromHtml(string, Html.FROM_HTML_MODE_COMPACT).toString();
}
return "";
}
public static String forceReadableString(String string) {
if (string != null) {
return getReadableString(string)