author | Xeli |
Mon, 20 Feb 2012 21:50:56 +0100 | |
changeset 6726 | 31582be2ddbc |
parent 6700 | e04da46ee43c |
child 6727 | b3160a49f02e |
permissions | -rw-r--r-- |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
1 |
/* |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
2 |
* Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game |
6700 | 3 |
* Copyright (c) 2011-2012 Richard Deurwaarder <xeli@xelification.com> |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
4 |
* |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License as published by |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
7 |
* the Free Software Foundation; version 2 of the License |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
8 |
* |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
13 |
* |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
17 |
*/ |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
18 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
19 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
20 |
package org.hedgewars.hedgeroid; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
21 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
22 |
import java.io.File; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
23 |
import java.io.FileNotFoundException; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
24 |
import java.io.FileOutputStream; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
25 |
import java.io.IOException; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
26 |
import java.util.ArrayList; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
27 |
import java.util.HashMap; |
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
28 |
import java.util.List; |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
29 |
|
6488
c356ddebab84
android: moved the different objects representing the different game parameters to a different package
Xeli
parents:
6448
diff
changeset
|
30 |
import org.hedgewars.hedgeroid.Datastructures.FrontendDataUtils; |
c356ddebab84
android: moved the different objects representing the different game parameters to a different package
Xeli
parents:
6448
diff
changeset
|
31 |
import org.hedgewars.hedgeroid.Datastructures.Team; |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
32 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
33 |
import android.app.Activity; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
34 |
import android.graphics.Bitmap; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
35 |
import android.graphics.drawable.Drawable; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
36 |
import android.media.MediaPlayer; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
37 |
import android.os.Bundle; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
38 |
import android.view.View; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
39 |
import android.view.View.OnClickListener; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
40 |
import android.view.View.OnFocusChangeListener; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
41 |
import android.widget.AdapterView; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
42 |
import android.widget.AdapterView.OnItemSelectedListener; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
43 |
import android.widget.ArrayAdapter; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
44 |
import android.widget.EditText; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
45 |
import android.widget.ImageButton; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
46 |
import android.widget.ImageView; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
47 |
import android.widget.LinearLayout; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
48 |
import android.widget.RelativeLayout; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
49 |
import android.widget.ScrollView; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
50 |
import android.widget.SimpleAdapter; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
51 |
import android.widget.Spinner; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
52 |
import android.widget.TextView; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
53 |
import android.widget.Toast; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
54 |
|
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
55 |
public class TeamCreatorActivity extends Activity implements Runnable{ |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
56 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
57 |
private TextView name; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
58 |
private Spinner difficulty, grave, flag, voice, fort; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
59 |
private ImageView imgFort; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
60 |
private ArrayList<ImageButton> hogDice = new ArrayList<ImageButton>(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
61 |
private ArrayList<Spinner> hogHat = new ArrayList<Spinner>(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
62 |
private ArrayList<EditText> hogName = new ArrayList<EditText>(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
63 |
private ImageButton back, save, voiceButton; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
64 |
private ScrollView scroller; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
65 |
private MediaPlayer mp = null; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
66 |
private boolean settingsChanged = false; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
67 |
private boolean saved = false; |
6432
ffb18b44415d
Use proper names when storing custom teams, also fixes the bug which created new teams when you editted one of the default ones
Xeli
parents:
6350
diff
changeset
|
68 |
private String fileName = null; |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
69 |
|
6567
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
70 |
private final List<HashMap<String, ?>> flagsData = new ArrayList<HashMap<String, ?>>(); |
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
71 |
private final List<HashMap<String, ?>> typesData = new ArrayList<HashMap<String, ?>>(); |
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
72 |
private final List<HashMap<String, ?>> gravesData = new ArrayList<HashMap<String, ?>>(); |
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
73 |
private final List<HashMap<String, ?>> hatsData = new ArrayList<HashMap<String, ?>>(); |
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
74 |
private final List<String> voicesData = new ArrayList<String>(); |
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
75 |
private final List<String> fortsData = new ArrayList<String>(); |
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
76 |
|
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
77 |
public void onCreate(Bundle savedInstanceState) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
78 |
super.onCreate(savedInstanceState); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
79 |
setContentView(R.layout.team_creation); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
80 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
81 |
name = (TextView) findViewById(R.id.txtName); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
82 |
difficulty = (Spinner) findViewById(R.id.spinType); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
83 |
grave = (Spinner) findViewById(R.id.spinGrave); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
84 |
flag = (Spinner) findViewById(R.id.spinFlag); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
85 |
voice = (Spinner) findViewById(R.id.spinVoice); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
86 |
fort = (Spinner) findViewById(R.id.spinFort); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
87 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
88 |
imgFort = (ImageView) findViewById(R.id.imgFort); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
89 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
90 |
back = (ImageButton) findViewById(R.id.btnBack); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
91 |
save = (ImageButton) findViewById(R.id.btnSave); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
92 |
voiceButton = (ImageButton) findViewById(R.id.btnPlay); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
93 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
94 |
scroller = (ScrollView) findViewById(R.id.scroller); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
95 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
96 |
save.setOnClickListener(saveClicker); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
97 |
back.setOnClickListener(backClicker); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
98 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
99 |
LinearLayout ll = (LinearLayout) findViewById(R.id.HogsContainer); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
100 |
for (int i = 0; i < ll.getChildCount(); i++) { |
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
101 |
RelativeLayout team_creation_entry = (RelativeLayout) ll.getChildAt(i); |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
102 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
103 |
hogHat.add((Spinner) team_creation_entry |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
104 |
.findViewById(R.id.spinTeam1)); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
105 |
hogDice.add((ImageButton) team_creation_entry |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
106 |
.findViewById(R.id.btnTeam1)); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
107 |
hogName.add((EditText) team_creation_entry |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
108 |
.findViewById(R.id.txtTeam1)); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
109 |
} |
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
110 |
|
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
111 |
SimpleAdapter sa = new SimpleAdapter(this, gravesData, |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
112 |
R.layout.spinner_textimg_entry, new String[] { "txt", "img" }, |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
113 |
new int[] { R.id.spinner_txt, R.id.spinner_img }); |
6350 | 114 |
sa.setDropDownViewResource(R.layout.spinner_textimg_dropdown_entry); |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
115 |
sa.setViewBinder(viewBinder); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
116 |
grave.setAdapter(sa); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
117 |
grave.setOnFocusChangeListener(focusser); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
118 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
119 |
sa = new SimpleAdapter(this, flagsData, R.layout.spinner_textimg_entry, |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
120 |
new String[] { "txt", "img" }, new int[] { R.id.spinner_txt, |
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
121 |
R.id.spinner_img }); |
6350 | 122 |
sa.setDropDownViewResource(R.layout.spinner_textimg_dropdown_entry); |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
123 |
sa.setViewBinder(viewBinder); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
124 |
flag.setAdapter(sa); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
125 |
flag.setOnFocusChangeListener(focusser); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
126 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
127 |
sa = new SimpleAdapter(this, typesData, R.layout.spinner_textimg_entry, |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
128 |
new String[] { "txt", "img" }, new int[] { R.id.spinner_txt, |
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
129 |
R.id.spinner_img }); |
6350 | 130 |
sa.setDropDownViewResource(R.layout.spinner_textimg_dropdown_entry); |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
131 |
difficulty.setAdapter(sa); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
132 |
difficulty.setOnFocusChangeListener(focusser); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
133 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
134 |
sa = new SimpleAdapter(this, hatsData, R.layout.spinner_textimg_entry, |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
135 |
new String[] { "txt", "img" }, new int[] { R.id.spinner_txt, |
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
136 |
R.id.spinner_img }); |
6350 | 137 |
sa.setDropDownViewResource(R.layout.spinner_textimg_dropdown_entry); |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
138 |
sa.setViewBinder(viewBinder); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
139 |
for (Spinner spin : hogHat) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
140 |
spin.setAdapter(sa); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
141 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
142 |
|
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
143 |
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.listview_item, voicesData); |
6350 | 144 |
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
145 |
voice.setAdapter(adapter); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
146 |
voice.setOnFocusChangeListener(focusser); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
147 |
voiceButton.setOnClickListener(voiceClicker); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
148 |
|
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
149 |
adapter = new ArrayAdapter<String>(this, R.layout.listview_item, fortsData); |
6350 | 150 |
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
151 |
fort.setAdapter(adapter); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
152 |
fort.setOnItemSelectedListener(fortSelector); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
153 |
fort.setOnFocusChangeListener(focusser); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
154 |
|
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
155 |
new Thread(this).start(); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
156 |
} |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
157 |
|
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
158 |
public void run(){ |
6567
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
159 |
final ArrayList<HashMap<String, ?>> gravesDataNew = FrontendDataUtils.getGraves(this); |
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
160 |
final ArrayList<HashMap<String, ?>> flagsDataNew = FrontendDataUtils.getFlags(this); |
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
161 |
final ArrayList<HashMap<String, ?>> typesDataNew = FrontendDataUtils.getTypes(this); |
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
162 |
final ArrayList<HashMap<String, ?>> hatsDataNew = FrontendDataUtils.getHats(this); |
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
163 |
final ArrayList<String> voicesDataNew = FrontendDataUtils.getVoices(this); |
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
164 |
final ArrayList<String> fortsDataNew = FrontendDataUtils.getForts(this); |
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
165 |
|
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
166 |
|
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
167 |
this.runOnUiThread(new Runnable(){ |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
168 |
public void run() { |
6567
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
169 |
copy(gravesData, gravesDataNew); |
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
170 |
((SimpleAdapter)grave.getAdapter()).notifyDataSetChanged(); |
6567
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
171 |
|
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
172 |
copy(flagsData, flagsDataNew); |
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
173 |
((SimpleAdapter)flag.getAdapter()).notifyDataSetChanged(); |
6567
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
174 |
|
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
175 |
copy(typesData, typesDataNew); |
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
176 |
((SimpleAdapter)difficulty.getAdapter()).notifyDataSetChanged(); |
6567
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
177 |
|
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
178 |
copy(hatsData, hatsDataNew); |
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
179 |
((SimpleAdapter)hogHat.get(0).getAdapter()).notifyDataSetChanged(); |
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
180 |
|
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
181 |
copy(voicesData, voicesDataNew); |
6726
31582be2ddbc
fixed a nullpointer exception when creating a new team
Xeli
parents:
6700
diff
changeset
|
182 |
((ArrayAdapter<String>)voice.getAdapter()).notifyDataSetChanged(); |
6567
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
183 |
|
54e19cefcdac
Load the TeamCreationmenu's contents in a different thread
Xeli
parents:
6488
diff
changeset
|
184 |
copy(fortsData, fortsDataNew); |
6726
31582be2ddbc
fixed a nullpointer exception when creating a new team
Xeli
parents:
6700
diff
changeset
|
185 |
((ArrayAdapter<String>)fort.getAdapter()).notifyDataSetChanged(); |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
186 |
} |
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
187 |
}); |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
188 |
|
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
189 |
} |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
190 |
|
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
191 |
private static <T> void copy(List<T> dest, List<T> src){ |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
192 |
for(T t: src) dest.add(t); |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
193 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
194 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
195 |
public void onDestroy() { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
196 |
super.onDestroy(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
197 |
if (mp != null) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
198 |
mp.release(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
199 |
mp = null; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
200 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
201 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
202 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
203 |
private OnFocusChangeListener focusser = new OnFocusChangeListener() { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
204 |
public void onFocusChange(View v, boolean hasFocus) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
205 |
settingsChanged = true; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
206 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
207 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
208 |
}; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
209 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
210 |
public void onBackPressed() { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
211 |
onFinishing(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
212 |
super.onBackPressed(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
213 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
214 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
215 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
216 |
private OnClickListener backClicker = new OnClickListener() { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
217 |
public void onClick(View v) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
218 |
onFinishing(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
219 |
finish(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
220 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
221 |
}; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
222 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
223 |
private void onFinishing() { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
224 |
if (settingsChanged) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
225 |
setResult(RESULT_OK); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
226 |
} else { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
227 |
setResult(RESULT_CANCELED); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
228 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
229 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
230 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
231 |
private OnClickListener saveClicker = new OnClickListener() { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
232 |
public void onClick(View v) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
233 |
Toast.makeText(TeamCreatorActivity.this, R.string.saved, Toast.LENGTH_SHORT).show(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
234 |
saved = true; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
235 |
Team team = new Team(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
236 |
team.name = name.getText().toString(); |
6432
ffb18b44415d
Use proper names when storing custom teams, also fixes the bug which created new teams when you editted one of the default ones
Xeli
parents:
6350
diff
changeset
|
237 |
HashMap<String, Object> hashmap = (HashMap<String, Object>) flag.getSelectedItem(); |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
238 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
239 |
team.flag = (String) hashmap.get("txt"); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
240 |
team.fort = fort.getSelectedItem().toString(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
241 |
hashmap = (HashMap<String, Object>) grave.getSelectedItem(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
242 |
team.grave = hashmap.get("txt").toString(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
243 |
team.hash = "0"; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
244 |
team.voice = voice.getSelectedItem().toString(); |
6432
ffb18b44415d
Use proper names when storing custom teams, also fixes the bug which created new teams when you editted one of the default ones
Xeli
parents:
6350
diff
changeset
|
245 |
team.file = fileName; |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
246 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
247 |
hashmap = ((HashMap<String, Object>) difficulty.getSelectedItem()); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
248 |
String levelString = hashmap.get("txt").toString(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
249 |
int levelInt; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
250 |
if (levelString.equals(getString(R.string.human))) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
251 |
levelInt = 0; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
252 |
} else if (levelString.equals(getString(R.string.bot5))) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
253 |
levelInt = 1; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
254 |
} else if (levelString.equals(getString(R.string.bot4))) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
255 |
levelInt = 2; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
256 |
} else if (levelString.equals(getString(R.string.bot3))) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
257 |
levelInt = 3; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
258 |
} else if (levelString.equals(getString(R.string.bot2))) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
259 |
levelInt = 4; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
260 |
} else { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
261 |
levelInt = 5; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
262 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
263 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
264 |
for (int i = 0; i < hogName.size(); i++) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
265 |
team.hogNames[i] = hogName.get(i).getText().toString(); |
6432
ffb18b44415d
Use proper names when storing custom teams, also fixes the bug which created new teams when you editted one of the default ones
Xeli
parents:
6350
diff
changeset
|
266 |
hashmap = (HashMap<String, Object>) hogHat.get(i).getSelectedItem(); |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
267 |
team.hats[i] = hashmap.get("txt").toString(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
268 |
team.levels[i] = levelInt; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
269 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
270 |
try { |
6432
ffb18b44415d
Use proper names when storing custom teams, also fixes the bug which created new teams when you editted one of the default ones
Xeli
parents:
6350
diff
changeset
|
271 |
File teamsDir = new File(getFilesDir().getAbsolutePath() + '/' + Team.DIRECTORY_TEAMS); |
ffb18b44415d
Use proper names when storing custom teams, also fixes the bug which created new teams when you editted one of the default ones
Xeli
parents:
6350
diff
changeset
|
272 |
if (!teamsDir.exists()) teamsDir.mkdir(); |
ffb18b44415d
Use proper names when storing custom teams, also fixes the bug which created new teams when you editted one of the default ones
Xeli
parents:
6350
diff
changeset
|
273 |
if(team.file == null){ |
ffb18b44415d
Use proper names when storing custom teams, also fixes the bug which created new teams when you editted one of the default ones
Xeli
parents:
6350
diff
changeset
|
274 |
team.setFileName(TeamCreatorActivity.this); |
ffb18b44415d
Use proper names when storing custom teams, also fixes the bug which created new teams when you editted one of the default ones
Xeli
parents:
6350
diff
changeset
|
275 |
} |
ffb18b44415d
Use proper names when storing custom teams, also fixes the bug which created new teams when you editted one of the default ones
Xeli
parents:
6350
diff
changeset
|
276 |
FileOutputStream fos = new FileOutputStream(String.format("%s/%s", teamsDir.getAbsolutePath(), team.file)); |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
277 |
team.writeToXml(fos); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
278 |
} catch (FileNotFoundException e) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
279 |
e.printStackTrace(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
280 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
281 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
282 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
283 |
}; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
284 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
285 |
private OnItemSelectedListener fortSelector = new OnItemSelectedListener() { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
286 |
public void onItemSelected(AdapterView<?> arg0, View arg1, |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
287 |
int position, long arg3) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
288 |
settingsChanged = true; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
289 |
String fortName = (String) arg0.getAdapter().getItem(position); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
290 |
Drawable fortIconDrawable = Drawable.createFromPath(Utils |
6350 | 291 |
.getDataPath(TeamCreatorActivity.this) |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
292 |
+ "Forts/" |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
293 |
+ fortName + "L.png"); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
294 |
imgFort.setImageDrawable(fortIconDrawable); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
295 |
scroller.fullScroll(ScrollView.FOCUS_DOWN);// Scroll the scrollview |
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
296 |
// to the bottom, work |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
297 |
// around for scollview |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
298 |
// invalidation (scrolls |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
299 |
// back to top) |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
300 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
301 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
302 |
public void onNothingSelected(AdapterView<?> arg0) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
303 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
304 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
305 |
}; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
306 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
307 |
private OnClickListener voiceClicker = new OnClickListener() { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
308 |
public void onClick(View v) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
309 |
try { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
310 |
File dir = new File(String.format("%sSounds/voices/%s", |
6350 | 311 |
Utils.getDataPath(TeamCreatorActivity.this), |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
312 |
voice.getSelectedItem())); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
313 |
String file = ""; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
314 |
File[] dirs = dir.listFiles(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
315 |
File f = dirs[(int) Math.round(Math.random() * dirs.length)]; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
316 |
if (f.getName().endsWith(".ogg")) |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
317 |
file = f.getAbsolutePath(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
318 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
319 |
if (mp == null) |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
320 |
mp = new MediaPlayer(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
321 |
else |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
322 |
mp.reset(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
323 |
mp.setDataSource(file); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
324 |
mp.prepare(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
325 |
mp.start(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
326 |
} catch (IllegalArgumentException e) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
327 |
e.printStackTrace(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
328 |
} catch (IllegalStateException e) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
329 |
e.printStackTrace(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
330 |
} catch (IOException e) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
331 |
e.printStackTrace(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
332 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
333 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
334 |
}; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
335 |
|
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
336 |
private void setTeamValues(Team t){ |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
337 |
|
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
338 |
if (t != null) { |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
339 |
name.setText(t.name); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
340 |
int position = ((ArrayAdapter<String>) voice.getAdapter()).getPosition(t.voice); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
341 |
voice.setSelection(position); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
342 |
|
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
343 |
position = ((ArrayAdapter<String>) fort.getAdapter()).getPosition(t.fort); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
344 |
fort.setSelection(position); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
345 |
|
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
346 |
position = 0; |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
347 |
for (HashMap<String, ?> hashmap : typesData) { |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
348 |
if (hashmap.get("txt").equals(t.levels[0])) { |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
349 |
difficulty.setSelection(position); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
350 |
break; |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
351 |
} |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
352 |
} |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
353 |
|
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
354 |
position = 0; |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
355 |
for (HashMap<String, ?> hashmap : gravesData) { |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
356 |
if (hashmap.get("txt").equals(t.grave)) { |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
357 |
grave.setSelection(position); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
358 |
break; |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
359 |
} |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
360 |
} |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
361 |
|
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
362 |
position = 0; |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
363 |
for (HashMap<String, ?> hashmap : typesData) { |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
364 |
if (hashmap.get("txt").equals(t.flag)) { |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
365 |
flag.setSelection(position); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
366 |
break; |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
367 |
} |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
368 |
} |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
369 |
|
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
370 |
for (int i = 0; i < Team.maxNumberOfHogs; i++) { |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
371 |
position = 0; |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
372 |
for (HashMap<String, ?> hashmap : hatsData) { |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
373 |
if (hashmap.get("txt").equals(t.hats[i])) { |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
374 |
hogHat.get(i).setSelection(position); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
375 |
} |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
376 |
} |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
377 |
|
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
378 |
hogName.get(i).setText(t.hogNames[i]); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
379 |
} |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
380 |
this.fileName = t.file; |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
381 |
} |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
382 |
} |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
383 |
|
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
384 |
|
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
385 |
private SimpleAdapter.ViewBinder viewBinder = new SimpleAdapter.ViewBinder() { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
386 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
387 |
public boolean setViewValue(View view, Object data, |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
388 |
String textRepresentation) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
389 |
if (view instanceof ImageView && data instanceof Bitmap) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
390 |
ImageView v = (ImageView) view; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
391 |
v.setImageBitmap((Bitmap) data); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
392 |
return true; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
393 |
} else { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
394 |
return false; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
395 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
396 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
397 |
}; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
398 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
399 |
} |