mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-14 07:05:40 -04:00
Chore[profile]: remove old commented code
This commit is contained in:
parent
209bd9d22a
commit
565e760b20
@ -88,39 +88,4 @@ public class ProfileIconCache {
|
||||
if(!dataEncoding.equals("base64")) return null;
|
||||
return Base64.decode(inputString.substring(commaAfterSemicolon+1), 0);
|
||||
}
|
||||
|
||||
|
||||
/*public static void initDefault(Context context) {
|
||||
if(sDefaultIcon != null) return;
|
||||
sDefaultIcon = ResourcesCompat.getDrawable(context.getResources(), R.mipmap.ic_launcher_foreground, null);
|
||||
if(sDefaultIcon != null) sDefaultIcon.setBounds(0, 0, 10, 10);
|
||||
}
|
||||
|
||||
public static Drawable getCachedIcon(String key) {
|
||||
return sIconCache.get(key);
|
||||
}
|
||||
|
||||
public static Drawable submitIcon(Resources resources, String key, String base64) {
|
||||
byte[] pngBytes = Base64.decode(base64, Base64.DEFAULT);
|
||||
Drawable drawable = new BitmapDrawable(resources, BitmapFactory.decodeByteArray(pngBytes, 0, pngBytes.length));
|
||||
sIconCache.put(key, drawable);
|
||||
return drawable;
|
||||
}
|
||||
|
||||
public static Drawable tryResolveIcon(Resources resources, String profileName, String b64Icon) {
|
||||
Drawable icon;
|
||||
if (b64Icon != null && b64Icon.startsWith(BASE64_PNG_HEADER)) {
|
||||
icon = ProfileIconCache.submitIcon(resources, profileName, b64Icon.substring(BASE64_PNG_HEADER.length()));
|
||||
}else{
|
||||
Log.i("IconParser","Unsupported icon: "+b64Icon);
|
||||
icon = ProfileIconCache.pushDefaultIcon(profileName);
|
||||
}
|
||||
return icon;
|
||||
}
|
||||
|
||||
public static Drawable pushDefaultIcon(String key) {
|
||||
sIconCache.put(key, sDefaultIcon);
|
||||
|
||||
return sDefaultIcon;
|
||||
}*/
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user