the new spinner adapter override works much better for game config's

spinners
This commit is contained in:
Eric House 2014-05-05 07:38:37 -07:00
parent 96ca4f9946
commit ce77f09588
3 changed files with 2 additions and 17 deletions

View file

@ -235,6 +235,7 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:entries="@array/robot_levels"
/>
<Spinner android:id="@+id/phonies_spinner"
@ -242,6 +243,7 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:entries="@array/phony_names"
/>
<CheckBox android:id="@+id/pick_faceup"

View file

@ -425,10 +425,8 @@ public class GameConfigDelegate extends DelegateBase
m_playerLayout = (LinearLayout)findViewById( R.id.player_list );
m_langSpinner = (Spinner)findViewById( R.id.lang_spinner );
m_phoniesSpinner = (Spinner)findViewById( R.id.phonies_spinner );
Utils.addSpinnerArray( m_phoniesSpinner, R.array.phony_names );
m_boardsizeSpinner = (Spinner)findViewById( R.id.boardsize_spinner );
m_smartnessSpinner = (Spinner)findViewById( R.id.smart_robot );
Utils.addSpinnerArray( m_smartnessSpinner, R.array.robot_levels );
} // onCreate
protected void onStart()

View file

@ -495,21 +495,6 @@ public class Utils {
return result;
}
public static void addSpinnerArray( Spinner spinner, int arrayID )
{
Context context = spinner.getContext();
String[] array = context.getResources().getStringArray( arrayID );
array = LocUtils.xlateStrings( context, array );
int displayID = android.R.layout.simple_spinner_item;
// displayID = android.R.layout.simple_list_item_1;
ArrayAdapter<String> adapter =
new ArrayAdapter<String>( context, displayID/*, array */ );
for ( String item : array ) {
adapter.add( item );
}
spinner.setAdapter( adapter );
}
private static void setFirstBootStatics( Context context )
{
int thisVersion = getAppVersion( context );