Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/main/java/com/marianhello/bgloc/ResourceResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public Integer getDrawable(String resourceName) {
return getAppResource(resourceName, "drawable");
}

public Integer getMipMap(String resourceName) {
return getAppResource(resourceName, "mipmap");
}

public String getString(String name) {
return getApplicationContext().getString(getAppResource(name, "string"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ public Notification getNotification(String title, String text, String largeIcon,
builder.setContentTitle(title);
builder.setContentText(text);
if (smallIcon != null && !smallIcon.isEmpty()) {
builder.setSmallIcon(mResolver.getDrawable(smallIcon));
builder.setSmallIcon(mResolver.getMipMap(smallIcon));
} else {
builder.setSmallIcon(android.R.drawable.ic_menu_mylocation);
}
if (largeIcon != null && !largeIcon.isEmpty()) {
builder.setLargeIcon(BitmapFactory.decodeResource(appContext.getResources(), mResolver.getDrawable(largeIcon)));
builder.setLargeIcon(BitmapFactory.decodeResource(appContext.getResources(), mResolver.getMipMap(largeIcon)));
}
if (color != null && !color.isEmpty()) {
builder.setColor(this.parseNotificationIconColor(color));
Expand Down