fix(Spotify - Custom theme): Override more color resources (#4690)

This commit is contained in:
Nuckyz
2025-04-02 14:14:17 -03:00
committed by GitHub
parent 3c316fa329
commit d7a7a0b982
7 changed files with 222 additions and 62 deletions

View File

@ -9,6 +9,7 @@ import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Color;
import android.net.ConnectivityManager;
import android.os.Build;
import android.os.Bundle;
@ -799,4 +800,14 @@ public class Utils {
builder.getContext().setTheme(editTextDialogStyle);
}
}
/**
* Parse a color resource or hex code to an int representation of the color.
*/
public static int getColorFromString(String colorString) throws IllegalArgumentException, Resources.NotFoundException {
if (colorString.startsWith("#")) {
return Color.parseColor(colorString);
}
return getResourceColor(colorString);
}
}