Skip to content
Browse files

Limit scrolling text messages to 10 screens worth, to stop huge text …

…files eating all the memory!
  • Loading branch information...
1 parent 3572fe0 commit 2b86ab4f702012223919e317fe695c87a7f04975 @benjymous committed
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/org/metawatch/manager/NotificationBuilder.java
View
5 src/org/metawatch/manager/NotificationBuilder.java
@@ -468,6 +468,8 @@ static Bitmap smartLines(Context context, Bitmap icon, String header, String[] l
int scroll = textHeight-font.size;
boolean more = true;
+ int pages = 0;
+
while (more) {
more = false;
Bitmap bitmap = Bitmap.createBitmap(96, 96, Bitmap.Config.RGB_565);
@@ -491,8 +493,9 @@ static Bitmap smartLines(Context context, Bitmap icon, String header, String[] l
if (y>0)
canvas.drawBitmap(Utils.getBitmap(context, "arrow_up.bmp"), arrowUpLeft, arrowUpTop, null);
- if((h-y)>(displayHeight)) {
+ if((h-y)>(displayHeight) && pages<10) {
more = true;
+ pages++;
canvas.drawBitmap(Utils.getBitmap(context, "arrow_down.bmp"), arrowDownLeft, arrowDownTop, null);
}

0 comments on commit 2b86ab4

Please sign in to comment.
Something went wrong with that request. Please try again.