Moving Bitmessage context into a foreground service (work in progress)

This commit is contained in:
2015-10-23 22:40:09 +02:00
parent 9b1bf6bdb3
commit f5bf5c8bca
14 changed files with 441 additions and 143 deletions

View File

@ -25,9 +25,9 @@ public class NetworkNotification extends AbstractNotification {
private final BitmessageContext bmc;
private NotificationCompat.Builder builder;
public NetworkNotification(Context ctx) {
super(ctx);
bmc = Singleton.getBitmessageContext(ctx);
public NetworkNotification(Context ctx, BitmessageContext bmc) {
super(ctx.getApplicationContext());
this.bmc = bmc;
builder = new NotificationCompat.Builder(ctx);
builder.setSmallIcon(R.drawable.ic_notification_full_node)
.setContentTitle(ctx.getString(R.string.bitmessage_full_node))

View File

@ -21,6 +21,7 @@ import ch.dissem.bitmessage.entity.Plaintext;
import static ch.dissem.apps.abit.util.Drawables.toBitmap;
public class NewMessageNotification extends AbstractNotification {
public static final int NEW_MESSAGE_NOTIFICATION_ID = 1;
private static final StyleSpan SPAN_EMPHASIS = new StyleSpan(Typeface.BOLD);
public NewMessageNotification(Context ctx) {
@ -76,6 +77,6 @@ public class NewMessageNotification extends AbstractNotification {
@Override
protected int getNotificationId() {
return 1;
return NEW_MESSAGE_NOTIFICATION_ID;
}
}