Skip to content

Instantly share code, notes, and snippets.

@Nazmul56
Created December 16, 2016 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nazmul56/0bfe02be9539c4314d6ccfdb8a40686f to your computer and use it in GitHub Desktop.
Save Nazmul56/0bfe02be9539c4314d6ccfdb8a40686f to your computer and use it in GitHub Desktop.
public Bitmap getTileBitmap(int id, int size) {
String string = tileUrls.get(id);
if (string.contains(Themes.URI_DRAWABLE)) {
String drawableResourceName = string.substring(Themes.URI_DRAWABLE.length());
int drawableResourceId = Shared.context.getResources().getIdentifier(drawableResourceName, "drawable", Shared.context.getPackageName());
Bitmap bitmap = Utils.scaleDown(drawableResourceId, size, size);
return Utils.crop(bitmap, size, size);
}
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment