project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/StartGameActivity.java
branchhedgeroid
changeset 5627 ce2d92589cbc
parent 5625 9add7b92c5f0
equal deleted inserted replaced
5625:9add7b92c5f0 5627:ce2d92589cbc
    46 	public static final int ACTIVITY_TEAM_SELECTOR = 0;
    46 	public static final int ACTIVITY_TEAM_SELECTOR = 0;
    47 
    47 
    48 	private GameConfig config = null;
    48 	private GameConfig config = null;
    49 	private ImageButton start, back, team;
    49 	private ImageButton start, back, team;
    50 	private Spinner maps, gameplay, gamescheme, weapons, themes;
    50 	private Spinner maps, gameplay, gamescheme, weapons, themes;
    51 	private ImageView themeIcon, mapPreview;
    51 	private ImageView themeIcon, mapPreview, teamCount;
    52 
    52 
    53 	public void onCreate(Bundle savedInstanceState){
    53 	public void onCreate(Bundle savedInstanceState){
    54 		super.onCreate(savedInstanceState);
    54 		super.onCreate(savedInstanceState);
    55 
    55 
    56 		//SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
    56 		//SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
    73 		weapons = (Spinner) findViewById(R.id.spinweapons);
    73 		weapons = (Spinner) findViewById(R.id.spinweapons);
    74 		themes = (Spinner) findViewById(R.id.spinTheme);
    74 		themes = (Spinner) findViewById(R.id.spinTheme);
    75 
    75 
    76 		themeIcon = (ImageView) findViewById(R.id.imgTheme);
    76 		themeIcon = (ImageView) findViewById(R.id.imgTheme);
    77 		mapPreview = (ImageView) findViewById(R.id.mapPreview);
    77 		mapPreview = (ImageView) findViewById(R.id.mapPreview);
    78 
    78 		teamCount = (ImageView) findViewById(R.id.imgTeamsCount);
       
    79 		
    79 		start.setOnClickListener(startClicker);
    80 		start.setOnClickListener(startClicker);
    80 		back.setOnClickListener(backClicker);
    81 		back.setOnClickListener(backClicker);
    81 		team.setOnClickListener(teamClicker);
    82 		team.setOnClickListener(teamClicker);
    82 
    83 
    83 		ArrayAdapter<?> adapter = new ArrayAdapter<Map>(this, R.layout.listview_item, FrontendDataUtils.getMaps(this));
    84 		ArrayAdapter<?> adapter = new ArrayAdapter<Map>(this, R.layout.listview_item, FrontendDataUtils.getMaps(this));
   120 				Parcelable[] parcelables = (Parcelable[])data.getParcelableArrayExtra("teams");
   121 				Parcelable[] parcelables = (Parcelable[])data.getParcelableArrayExtra("teams");
   121 				config.teams.clear();
   122 				config.teams.clear();
   122 				for(Parcelable t : parcelables){
   123 				for(Parcelable t : parcelables){
   123 					config.teams.add((Team)t);
   124 					config.teams.add((Team)t);
   124 				}
   125 				}
   125 
   126                 teamCount.getDrawable().setLevel(config.teams.size());
   126 			}
   127 			}
   127 			break;
   128 			break;
   128 		}
   129 		}
   129 	}
   130 	}
   130 
   131