mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
fix: further eliminate the use of HTML decode in titles and subtitles
This commit is contained in:
parent
052e9d9068
commit
3c2ea38f1e
3 changed files with 10 additions and 10 deletions
|
|
@ -40,7 +40,7 @@ public class ShareHorizontalAdapter extends RecyclerView.Adapter<ShareHorizontal
|
||||||
public void onBindViewHolder(ViewHolder holder, int position) {
|
public void onBindViewHolder(ViewHolder holder, int position) {
|
||||||
Share share = shares.get(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())));
|
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
|
if (share.getEntries() != null && !share.getEntries().isEmpty()) CustomGlideRequest.Builder
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,7 @@ public class AlbumPageFragment extends Fragment implements ClickCallback {
|
||||||
if (albumInfo != null) {
|
if (albumInfo != null) {
|
||||||
if (bind != null) bind.albumNotesTextview.setVisibility(View.VISIBLE);
|
if (bind != null) bind.albumNotesTextview.setVisibility(View.VISIBLE);
|
||||||
if (bind != null)
|
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()) {
|
if (bind != null && albumInfo.getLastFmUrl() != null && !albumInfo.getLastFmUrl().isEmpty()) {
|
||||||
bind.albumNotesTextview.setOnClickListener(v -> {
|
bind.albumNotesTextview.setOnClickListener(v -> {
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
public static String getReadableTrackNumber(Context context, Integer trackNumber) {
|
||||||
if (trackNumber != null) {
|
if (trackNumber != null) {
|
||||||
return String.valueOf(trackNumber);
|
return String.valueOf(trackNumber);
|
||||||
|
|
@ -195,6 +187,14 @@ public class MusicUtil {
|
||||||
return context.getString(R.string.label_placeholder);
|
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) {
|
public static String forceReadableString(String string) {
|
||||||
if (string != null) {
|
if (string != null) {
|
||||||
return getReadableString(string)
|
return getReadableString(string)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue