Limit tickertext length and put the board name before generated titles

captchafix
Florens Douwes 11 years ago
parent 9fe61a3af6
commit 72c4312b54
  1. 2
      Clover/app/src/main/java/org/floens/chan/core/manager/WatchManager.java
  2. 2
      Clover/app/src/main/java/org/floens/chan/ui/service/WatchNotifier.java

@ -52,7 +52,7 @@ public class WatchManager implements ChanApplication.ForegroundChangedListener {
if (!TextUtils.isEmpty(post.subject)) {
return post.subject;
} else if (!TextUtils.isEmpty(post.comment)) {
return post.comment.subSequence(0, Math.min(post.comment.length(), 100)).toString();
return "/" + post.board + "/ - " + post.comment.subSequence(0, Math.min(post.comment.length(), 100)).toString();
} else {
return "/" + post.board + "/" + post.no;
}

@ -207,7 +207,7 @@ public class WatchNotifier extends Service {
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
builder.setContentIntent(pendingIntent);
builder.setTicker(tickerText);
builder.setTicker(tickerText.subSequence(0, Math.min(tickerText.length(), 50)));
builder.setContentTitle(title);
builder.setContentText(content);
builder.setContentInfo(count);

Loading…
Cancel
Save