From 18d72d727c74a3f970e6c1b7c00b17ba234842fb Mon Sep 17 00:00:00 2001 From: Christian Basler Date: Thu, 23 Feb 2017 17:37:15 +0100 Subject: [PATCH 1/3] Fixed notification title for when there are more than 5 messages --- .../dissem/apps/abit/notification/NewMessageNotification.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/src/main/java/ch/dissem/apps/abit/notification/NewMessageNotification.java b/app/src/main/java/ch/dissem/apps/abit/notification/NewMessageNotification.java index 06e4c02..3bddc2e 100644 --- a/app/src/main/java/ch/dissem/apps/abit/notification/NewMessageNotification.java +++ b/app/src/main/java/ch/dissem/apps/abit/notification/NewMessageNotification.java @@ -92,14 +92,12 @@ public class NewMessageNotification extends AbstractNotification { numberOfUnacknowledgedMessages) { NotificationCompat.Builder builder = new NotificationCompat.Builder(ctx); builder.setSmallIcon(R.drawable.ic_notification_new_message) - .setContentTitle(ctx.getString(R.string.n_new_messages, unacknowledged.size())) + .setContentTitle(ctx.getString(R.string.n_new_messages, numberOfUnacknowledgedMessages)) .setContentText(ctx.getString(R.string.app_name)); NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle(); //noinspection SynchronizationOnLocalVariableOrMethodParameter synchronized (unacknowledged) { - inboxStyle.setBigContentTitle(ctx.getString(R.string.n_new_messages, - numberOfUnacknowledgedMessages)); for (Plaintext msg : unacknowledged) { Spannable sb = new SpannableString(msg.getFrom() + " " + msg.getSubject()); sb.setSpan(SPAN_EMPHASIS, 0, String.valueOf(msg.getFrom()).length(), Spannable From 65c03bd6380eeb2fb9d8e5c5446d09e0be300803 Mon Sep 17 00:00:00 2001 From: Christian Basler Date: Thu, 23 Feb 2017 17:38:00 +0100 Subject: [PATCH 2/3] Load lists asynchronously --- .../ch/dissem/apps/abit/MainActivity.java | 156 +++++++++++------- .../dissem/apps/abit/MessageListFragment.java | 63 +++++-- .../ch/dissem/apps/abit/SettingsFragment.java | 8 +- 3 files changed, 148 insertions(+), 79 deletions(-) diff --git a/app/src/main/java/ch/dissem/apps/abit/MainActivity.java b/app/src/main/java/ch/dissem/apps/abit/MainActivity.java index 812f6cf..7b98637 100644 --- a/app/src/main/java/ch/dissem/apps/abit/MainActivity.java +++ b/app/src/main/java/ch/dissem/apps/abit/MainActivity.java @@ -18,6 +18,7 @@ package ch.dissem.apps.abit; import android.content.Intent; import android.graphics.Point; +import android.os.AsyncTask; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v7.app.AppCompatActivity; @@ -53,8 +54,9 @@ import org.slf4j.LoggerFactory; import java.io.Serializable; import java.lang.ref.WeakReference; import java.util.ArrayList; -import java.util.Collection; +import java.util.Collections; import java.util.List; +import java.util.Objects; import ch.dissem.apps.abit.dialog.AddIdentityDialogFragment; import ch.dissem.apps.abit.dialog.FullNodeDialogActivity; @@ -125,12 +127,6 @@ public class MainActivity extends AppCompatActivity super.onCreate(savedInstanceState); instance = new WeakReference<>(this); bmc = Singleton.getBitmessageContext(this); - List