mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
feat: as an option show the item's rating and whether it is marked as a favorite
This commit is contained in:
parent
4b9eaa8c3d
commit
58d540b939
12 changed files with 70 additions and 14 deletions
|
|
@ -195,6 +195,21 @@ public class MusicUtil {
|
|||
return context.getString(R.string.label_placeholder);
|
||||
}
|
||||
|
||||
public static String getRatingNumber(Integer ratingNumber) {
|
||||
if (ratingNumber == null || !Preferences.showItemRating()) return "";
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
builder.append("•");
|
||||
builder.append(" ");
|
||||
|
||||
for (int i = 0; i < ratingNumber; i++) {
|
||||
builder.append("★");
|
||||
}
|
||||
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
public static String forceReadableString(String string) {
|
||||
if (string != null) {
|
||||
return getReadableString(string)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue