make chat compose space multi-line; scroll chat history to bottom on

open
This commit is contained in:
Eric House 2015-08-20 07:15:20 -07:00
parent 07e97107ce
commit 6b455bf743
2 changed files with 12 additions and 2 deletions

View file

@ -9,7 +9,8 @@
<!-- history is kept in a scrolling list of textview elems so <!-- history is kept in a scrolling list of textview elems so
different style can be applied based on whether they're local or different style can be applied based on whether they're local or
remote. Inserted at runtime.... --> remote. Inserted at runtime.... -->
<ScrollView android:orientation="vertical" <ScrollView android:id="@+id/scroll"
android:orientation="vertical"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
@ -29,7 +30,7 @@
<EditText android:id="@+id/chat_edit" <EditText android:id="@+id/chat_edit"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="false"
android:layout_weight="1" android:layout_weight="1"
/> />

View file

@ -30,6 +30,7 @@ import android.view.View;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView; import android.widget.TextView;
import org.eehouse.android.xw4.DlgDelegate.Action; import org.eehouse.android.xw4.DlgDelegate.Action;
@ -67,6 +68,14 @@ public class ChatDelegate extends DelegateBase
} }
} }
final ScrollView scroll = (ScrollView)findViewById( R.id.scroll );
scroll.post(new Runnable() {
@Override
public void run() {
scroll.fullScroll(View.FOCUS_DOWN);
}
});
((Button)findViewById( R.id.send_button )) ((Button)findViewById( R.id.send_button ))
.setOnClickListener( this ); .setOnClickListener( this );