Fix queue changing

This commit is contained in:
h4h13 2020-05-04 00:54:11 +05:30
parent 69c76556a2
commit 891f1bce34
34 changed files with 1007 additions and 132 deletions

View file

@ -91,7 +91,7 @@ public class CalendarUtil {
year--;
}
elapsed += getDaysInMonth(year, month) * MS_PER_DAY;
elapsed += getDaysInMonth(month) * MS_PER_DAY;
}
return elapsed;
@ -109,7 +109,7 @@ public class CalendarUtil {
int month = calendar.get(Calendar.MONTH) - 1;
int year = calendar.get(Calendar.YEAR);
while (month > Calendar.JANUARY) {
elapsed += getDaysInMonth(year, month) * MS_PER_DAY;
elapsed += getDaysInMonth(month) * MS_PER_DAY;
month--;
}
@ -120,11 +120,10 @@ public class CalendarUtil {
/**
* Gets the number of days for the given month in the given year.
*
* @param year The year.
* @param month The month (1 - 12).
* @return The days in that month/year.
*/
private int getDaysInMonth(int year, int month) {
private int getDaysInMonth(int month) {
final Calendar monthCal = new GregorianCalendar(calendar.get(Calendar.YEAR), month, 1);
return monthCal.getActualMaximum(Calendar.DAY_OF_MONTH);
}

View file

@ -373,8 +373,8 @@ public class MusicUtil {
if (artistName.equals(Artist.UNKNOWN_ARTIST_DISPLAY_NAME)) {
return true;
}
artistName = artistName.trim().toLowerCase();
return artistName.equals("unknown") || artistName.equals("<unknown>");
String tempName = artistName.trim().toLowerCase();
return tempName.equals("unknown") || tempName.equals("<unknown>");
}
public static boolean isFavorite(@NonNull final Context context, @NonNull final Song song) {

View file

@ -194,10 +194,11 @@ public class RetroColorUtil {
@ColorInt
public static int shiftBackgroundColorForDarkText(@ColorInt int backgroundColor) {
int color = backgroundColor;
while (!ColorUtil.INSTANCE.isColorLight(backgroundColor)) {
backgroundColor = ColorUtil.INSTANCE.lightenColor(backgroundColor);
color = ColorUtil.INSTANCE.lightenColor(backgroundColor);
}
return backgroundColor;
return color;
}
private static class SwatchComparator implements Comparator<Palette.Swatch> {