mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-30 10:26:58 +01:00
the new spinner adapter override works much better for game config's
spinners
This commit is contained in:
parent
96ca4f9946
commit
ce77f09588
3 changed files with 2 additions and 17 deletions
|
@ -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"
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue