Don't use EditWClear; fix spinner size

This commit is contained in:
Eric House 2020-09-25 11:12:07 -07:00
parent b0c1c5ac1b
commit 9b12f60dbf
2 changed files with 13 additions and 13 deletions

View file

@ -35,15 +35,16 @@ public class NewWithKnowns extends LinearLayout {
void setNames( String[] knowns, String gameName )
{
final ArrayAdapter<String> adapter =
new ArrayAdapter<>( getContext(), android.R.layout.simple_spinner_item );
for ( String msg : knowns ) {
adapter.add( msg );
}
ArrayAdapter<String> adapter = new
ArrayAdapter<String>( getContext(),
android.R.layout.simple_spinner_item,
knowns );
adapter.setDropDownViewResource( android.R.layout
.simple_spinner_dropdown_item );
Spinner spinner = (Spinner)findViewById( R.id.names );
spinner.setAdapter( adapter );
EditWClear et = (EditWClear)findViewById( R.id.name_edit );
EditText et = (EditText)findViewById( R.id.name_edit );
et.setText( gameName );
}
@ -55,7 +56,7 @@ public class NewWithKnowns extends LinearLayout {
String gameName()
{
EditWClear et = (EditWClear)findViewById( R.id.name_edit );
EditText et = (EditText)findViewById( R.id.name_edit );
return et.getText().toString();
}
}

View file

@ -16,6 +16,7 @@
<Spinner android:id="@+id/names"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
/>
<TextView android:layout_width="fill_parent"
@ -23,9 +24,7 @@
android:text="Name your game"
/>
<org.eehouse.android.xw4.EditWClear
style="@style/edit_w_clear"
android:id="@+id/name_edit"
<EditText android:id="@+id/name_edit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>