X-Git-Url: http://pileus.org/git/?p=~andy%2Fspades;a=blobdiff_plain;f=src%2FMain.java;fp=src%2FMain.java;h=09c61809e19ae8a63c2588e46a14b4a670d1135a;hp=362af122c04e825127d2bfc822f61e36609b0f42;hb=944e1df0262f4b37df99964737fae501e3c22ee0;hpb=a4c319d3946b574e75e591e6615826c9fc40de89 diff --git a/src/Main.java b/src/Main.java index 362af12..09c6180 100644 --- a/src/Main.java +++ b/src/Main.java @@ -145,6 +145,12 @@ public class Main extends Activity this.send.setVisibility(running ? View.VISIBLE : View.GONE); } + private void scroll() + { + this.dscroll.smoothScrollTo(0, this.debug.getBottom()); + this.lscroll.smoothScrollTo(0, this.log.getBottom()); + } + /* Private handler methods */ private void onRegister(Task task) { @@ -160,13 +166,13 @@ public class Main extends Activity if (Message.class.isInstance(obj)) this.onMessage((Message)obj); } + this.scroll(); } private void onMessage(Message msg) { // Debug this.debug.append("> " + msg.line + "\n"); - this.dscroll.smoothScrollTo(0, this.debug.getBottom()); // Chat switch (msg.type) { @@ -194,7 +200,6 @@ public class Main extends Activity this.notice("Authentication failed: " + msg.txt); break; } - this.lscroll.smoothScrollTo(0, this.log.getBottom()); // Update title if (this.cards.turn != null && this.cards.turn != "" && @@ -426,6 +431,7 @@ public class Main extends Activity break; case Task.MESSAGE: Main.this.onMessage((Message)msg.obj); + Main.this.scroll(); break; case Task.CONNECT: Main.this.update(true);