project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/TeamSelectionActivity.java
equal
deleted
inserted
replaced
89 private void setTeamColor(int position, int color){ |
89 private void setTeamColor(int position, int color){ |
90 View iv = ((RelativeLayout)selectedTeams.getChildAt(position)).findViewById(R.id.teamCount); |
90 View iv = ((RelativeLayout)selectedTeams.getChildAt(position)).findViewById(R.id.teamCount); |
91 setTeamColor(iv, color); |
91 setTeamColor(iv, color); |
92 } |
92 } |
93 private void setTeamColor(View iv, int color){ |
93 private void setTeamColor(View iv, int color){ |
94 iv.setBackgroundColor(color); |
94 iv.setBackgroundColor(0xFF000000 + color); |
95 } |
95 } |
96 |
96 |
97 private void setTeamHogCount(int position, int count){ |
97 private void setTeamHogCount(int position, int count){ |
98 ImageView iv = (ImageView)((RelativeLayout)selectedTeams.getChildAt(position)).findViewById(R.id.teamCount); |
98 ImageView iv = (ImageView)((RelativeLayout)selectedTeams.getChildAt(position)).findViewById(R.id.teamCount); |
99 setTeamHogCount(iv, count); |
99 setTeamHogCount(iv, count); |
181 switch(item.getItemId()){ |
181 switch(item.getItemId()){ |
182 case 0://select |
182 case 0://select |
183 selectAvailableTeamsItem(position); |
183 selectAvailableTeamsItem(position); |
184 return true; |
184 return true; |
185 case 1://delete |
185 case 1://delete |
|
186 File f = new File(String.format("%s/%s/%s.xml", TeamSelectionActivity.this.getFilesDir(), Team.DIRECTORY_TEAMS, availableTeamsList.get(position).get("txt"))); |
|
187 f.delete(); |
186 availableTeamsList.remove(position); |
188 availableTeamsList.remove(position); |
187 ((SimpleAdapter)availableTeams.getAdapter()).notifyDataSetChanged(); |
189 ((SimpleAdapter)availableTeams.getAdapter()).notifyDataSetChanged(); |
188 File f = new File(String.format("%s/%s/%s.xml", TeamSelectionActivity.this.getFilesDir(), Team.DIRECTORY_TEAMS, availableTeamsList.get(position).get("txt"))); |
|
189 f.delete(); |
|
190 return true; |
190 return true; |
191 case 2://edit |
191 case 2://edit |
192 Intent i = new Intent(TeamSelectionActivity.this, TeamCreatorActivity.class); |
192 Intent i = new Intent(TeamSelectionActivity.this, TeamCreatorActivity.class); |
193 Team t = (Team)availableTeamsList.get(position).get("team"); |
193 Team t = (Team)availableTeamsList.get(position).get("team"); |
194 i.putExtra("team", t); |
194 i.putExtra("team", t); |