You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
NotificationManager: add support for icons
This commit is contained in:
@@ -51,6 +51,7 @@ public class Notification {
|
||||
String title;
|
||||
List<Action> actions = new ArrayList<Action>();
|
||||
PendingIntent intent;
|
||||
String iconPath;
|
||||
|
||||
public String toString() {
|
||||
return "Notification [" + title + ", " + text + ", " + actions + "]";
|
||||
@@ -65,7 +66,10 @@ public class Notification {
|
||||
|
||||
public Builder setWhen(long when) {return this;}
|
||||
|
||||
public Builder setSmallIcon(int icon, int level) {return this;}
|
||||
public Builder setSmallIcon(int icon, int level) {
|
||||
notification.iconPath = Context.this_application.getString(icon);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setContent(RemoteViews contentView) {return this;}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ public class NotificationManager {
|
||||
actionName = notification.intent.intent.getAction();
|
||||
className = notification.intent.intent.getComponent() != null ? notification.intent.intent.getComponent().getClassName() : null;
|
||||
}
|
||||
nativeShowNotification(builder, id, notification.title, notification.text, intentType, actionName, className);
|
||||
nativeShowNotification(builder, id, notification.title, notification.text, notification.iconPath, intentType, actionName, className);
|
||||
}
|
||||
|
||||
public void notify(int id, Notification notification) {
|
||||
@@ -55,5 +55,5 @@ public class NotificationManager {
|
||||
|
||||
protected native long nativeInitBuilder();
|
||||
protected native void nativeAddAction(long builder, String title, int intentType, String action, String className);
|
||||
protected native void nativeShowNotification(long builder, int id, String title, String text, int intentType, String action, String className);
|
||||
protected native void nativeShowNotification(long builder, int id, String title, String text, String iconPath, int intentType, String action, String className);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user