make the log view always show the bottom of the log

sigsegv_dump
Greg Alexander 10 years ago
parent 4581a224ac
commit 52a1093dde

@ -3,14 +3,17 @@
android:orientation="vertical" android:orientation="vertical"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent"> android:layout_height="fill_parent">
<TextView android:id="@+id/log" <EditText android:id="@+id/log"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_weight="1" android:layout_weight="1"
android:ellipsize="start" android:ellipsize="start"
android:editable="false"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:typeface="monospace" android:typeface="monospace"
android:singleLine="false" /> android:gravity="top"
android:singleLine="false"
android:background="#00000000" />
<Button android:id="@+id/startstop" <Button android:id="@+id/startstop"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

@ -19,7 +19,7 @@ import java.io.BufferedReader;
public class SimpleSSHD extends Activity public class SimpleSSHD extends Activity
{ {
private TextView log_view; private EditText log_view;
private Button startstop_view; private Button startstop_view;
public static SimpleSSHD curr = null; public static SimpleSSHD curr = null;
private UpdaterThread updater = null; private UpdaterThread updater = null;
@ -28,7 +28,7 @@ public class SimpleSSHD extends Activity
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
Prefs.init(this); Prefs.init(this);
setContentView(R.layout.main); setContentView(R.layout.main);
log_view = (TextView)findViewById(R.id.log); log_view = (EditText)findViewById(R.id.log);
startstop_view = (Button)findViewById(R.id.startstop); startstop_view = (Button)findViewById(R.id.startstop);
} }
@ -116,5 +116,6 @@ public class SimpleSSHD extends Activity
i %= lines.length; i %= lines.length;
} while (i != curr_line); } while (i != curr_line);
log_view.setText(output); log_view.setText(output);
log_view.setSelection(output.length());
} }
} }

Loading…
Cancel
Save