author | koda |
Thu, 29 Dec 2011 09:29:56 +0100 | |
changeset 6538 | 5a1f49d84d95 |
parent 6488 | c356ddebab84 |
child 6567 | 54e19cefcdac |
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 |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
3 |
* Copyright (c) 2011 Richard Deurwaarder <xeli@xelification.com> |
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 |
|
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
70 |
private List<HashMap<String, ?>> flagsData, typesData, gravesData, hatsData; |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
71 |
private List<String> voicesData, fortsData; |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
72 |
|
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
73 |
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
|
74 |
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
|
75 |
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
|
76 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
77 |
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
|
78 |
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
|
79 |
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
|
80 |
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
|
81 |
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
|
82 |
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
|
83 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
84 |
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
|
85 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
86 |
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
|
87 |
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
|
88 |
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
|
89 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
90 |
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
|
91 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
92 |
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
|
93 |
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
|
94 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
95 |
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
|
96 |
for (int i = 0; i < ll.getChildCount(); i++) { |
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
97 |
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
|
98 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
99 |
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
|
100 |
.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
|
101 |
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
|
102 |
.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
|
103 |
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
|
104 |
.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
|
105 |
} |
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
106 |
|
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
107 |
gravesData = new ArrayList<HashMap<String, ?>>(); |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
108 |
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
|
109 |
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
|
110 |
new int[] { R.id.spinner_txt, R.id.spinner_img }); |
6350 | 111 |
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
|
112 |
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
|
113 |
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
|
114 |
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
|
115 |
|
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
116 |
flagsData = new ArrayList<HashMap<String, ?>>(); |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
117 |
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
|
118 |
new String[] { "txt", "img" }, new int[] { R.id.spinner_txt, |
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
119 |
R.id.spinner_img }); |
6350 | 120 |
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
|
121 |
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
|
122 |
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
|
123 |
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
|
124 |
|
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
125 |
typesData = new ArrayList<HashMap<String, ?>>(); |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
126 |
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
|
127 |
new String[] { "txt", "img" }, new int[] { R.id.spinner_txt, |
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
128 |
R.id.spinner_img }); |
6350 | 129 |
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
|
130 |
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
|
131 |
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
|
132 |
|
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
133 |
hatsData = new ArrayList<HashMap<String, ?>>(); |
6047
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 |
voicesData = new ArrayList<String>(); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
144 |
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.listview_item, voicesData); |
6350 | 145 |
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
|
146 |
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
|
147 |
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
|
148 |
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
|
149 |
|
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
150 |
fortsData = new ArrayList<String>(); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
151 |
adapter = new ArrayAdapter<String>(this, R.layout.listview_item, fortsData); |
6350 | 152 |
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
|
153 |
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
|
154 |
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
|
155 |
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
|
156 |
|
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
157 |
new Thread(this).start(); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
158 |
} |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
159 |
|
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
160 |
public void run(){ |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
161 |
ArrayList<HashMap<String, ?>> gravesData = FrontendDataUtils.getGraves(this); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
162 |
ArrayList<HashMap<String, ?>> flagsData = FrontendDataUtils.getFlags(this); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
163 |
ArrayList<HashMap<String, ?>> typesData = FrontendDataUtils.getTypes(this); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
164 |
ArrayList<HashMap<String, ?>> hatsData = FrontendDataUtils.getHats(this); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
165 |
ArrayList<String> voicesData = FrontendDataUtils.getVoices(this); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
166 |
ArrayList<String> fortsData = FrontendDataUtils.getForts(this); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
167 |
|
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
168 |
copy(this.gravesData, gravesData); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
169 |
copy(this.flagsData, flagsData); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
170 |
copy(this.typesData, typesData); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
171 |
copy(this.hatsData, hatsData); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
172 |
copy(this.voicesData, voicesData); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
173 |
copy(this.fortsData, fortsData); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
174 |
|
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
175 |
this.runOnUiThread(new Runnable(){ |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
176 |
public void run() { |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
177 |
((SimpleAdapter)grave.getAdapter()).notifyDataSetChanged(); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
178 |
((SimpleAdapter)flag.getAdapter()).notifyDataSetChanged(); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
179 |
((SimpleAdapter)difficulty.getAdapter()).notifyDataSetChanged(); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
180 |
((SimpleAdapter)hogHat.get(0).getAdapter()).notifyDataSetChanged(); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
181 |
((ArrayAdapter<String>)fort.getAdapter()).notifyDataSetChanged(); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
182 |
((ArrayAdapter<String>)voice.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
|
183 |
} |
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
184 |
}); |
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
185 |
|
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
186 |
} |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
187 |
|
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
188 |
private static <T> void copy(List<T> dest, List<T> src){ |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
189 |
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
|
190 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
191 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
192 |
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
|
193 |
super.onDestroy(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
194 |
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
|
195 |
mp.release(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
196 |
mp = null; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
197 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
198 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
199 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
200 |
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
|
201 |
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
|
202 |
settingsChanged = true; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
203 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
204 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
205 |
}; |
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 |
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
|
208 |
onFinishing(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
209 |
super.onBackPressed(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
210 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
211 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
212 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
213 |
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
|
214 |
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
|
215 |
onFinishing(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
216 |
finish(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
217 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
218 |
}; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
219 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
220 |
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
|
221 |
if (settingsChanged) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
222 |
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
|
223 |
} else { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
224 |
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
|
225 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
226 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
227 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
228 |
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
|
229 |
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
|
230 |
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
|
231 |
saved = true; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
232 |
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
|
233 |
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
|
234 |
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
|
235 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
236 |
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
|
237 |
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
|
238 |
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
|
239 |
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
|
240 |
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
|
241 |
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
|
242 |
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
|
243 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
244 |
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
|
245 |
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
|
246 |
int levelInt; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
247 |
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
|
248 |
levelInt = 0; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
249 |
} 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
|
250 |
levelInt = 1; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
251 |
} 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
|
252 |
levelInt = 2; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
253 |
} 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
|
254 |
levelInt = 3; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
255 |
} 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
|
256 |
levelInt = 4; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
257 |
} else { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
258 |
levelInt = 5; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
259 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
260 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
261 |
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
|
262 |
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
|
263 |
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
|
264 |
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
|
265 |
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
|
266 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
267 |
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
|
268 |
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
|
269 |
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
|
270 |
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
|
271 |
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
|
272 |
} |
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 |
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
|
274 |
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
|
275 |
} 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
|
276 |
e.printStackTrace(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
277 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
278 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
279 |
|
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 |
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
|
283 |
@SuppressWarnings("unchecked") |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
284 |
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
|
285 |
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
|
286 |
settingsChanged = true; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
287 |
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
|
288 |
Drawable fortIconDrawable = Drawable.createFromPath(Utils |
6350 | 289 |
.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
|
290 |
+ "Forts/" |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
291 |
+ 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
|
292 |
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
|
293 |
scroller.fullScroll(ScrollView.FOCUS_DOWN);// Scroll the scrollview |
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
294 |
// to the bottom, work |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
295 |
// around for scollview |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
296 |
// invalidation (scrolls |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
297 |
// 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
|
298 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
299 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
300 |
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
|
301 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
302 |
|
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 |
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
|
306 |
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
|
307 |
try { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
308 |
File dir = new File(String.format("%sSounds/voices/%s", |
6350 | 309 |
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
|
310 |
voice.getSelectedItem())); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
311 |
String file = ""; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
312 |
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
|
313 |
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
|
314 |
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
|
315 |
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
|
316 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
317 |
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
|
318 |
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
|
319 |
else |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
320 |
mp.reset(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
321 |
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
|
322 |
mp.prepare(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
323 |
mp.start(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
324 |
} 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
|
325 |
e.printStackTrace(); |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
326 |
} 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
|
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 (IOException 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 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
331 |
} |
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 |
|
6447
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
334 |
private void setTeamValues(Team t){ |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
335 |
|
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
336 |
if (t != null) { |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
337 |
name.setText(t.name); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
338 |
int position = ((ArrayAdapter<String>) voice.getAdapter()).getPosition(t.voice); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
339 |
voice.setSelection(position); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
340 |
|
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
341 |
position = ((ArrayAdapter<String>) fort.getAdapter()).getPosition(t.fort); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
342 |
fort.setSelection(position); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
343 |
|
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
344 |
position = 0; |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
345 |
for (HashMap<String, ?> hashmap : typesData) { |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
346 |
if (hashmap.get("txt").equals(t.levels[0])) { |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
347 |
difficulty.setSelection(position); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
348 |
break; |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
349 |
} |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
350 |
} |
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 |
position = 0; |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
353 |
for (HashMap<String, ?> hashmap : gravesData) { |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
354 |
if (hashmap.get("txt").equals(t.grave)) { |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
355 |
grave.setSelection(position); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
356 |
break; |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
357 |
} |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
358 |
} |
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 |
position = 0; |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
361 |
for (HashMap<String, ?> hashmap : typesData) { |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
362 |
if (hashmap.get("txt").equals(t.flag)) { |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
363 |
flag.setSelection(position); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
364 |
break; |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
365 |
} |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
366 |
} |
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 |
for (int i = 0; i < Team.maxNumberOfHogs; i++) { |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
369 |
position = 0; |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
370 |
for (HashMap<String, ?> hashmap : hatsData) { |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
371 |
if (hashmap.get("txt").equals(t.hats[i])) { |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
372 |
hogHat.get(i).setSelection(position); |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
373 |
} |
0bb16bc5c8b4
android: load graphics multithreaded for superduper loadtimes
Xeli
parents:
6432
diff
changeset
|
374 |
} |
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 |
hogName.get(i).setText(t.hogNames[i]); |
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 |
this.fileName = t.file; |
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 |
} |
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 |
|
6047
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
383 |
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
|
384 |
|
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
385 |
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
|
386 |
String textRepresentation) { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
387 |
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
|
388 |
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
|
389 |
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
|
390 |
return true; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
391 |
} else { |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
392 |
return false; |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
393 |
} |
10011f051f9c
Changed package name from org.hedgewars.mobile to org.hedgewars.hedgeroid to upload it to the market
Xeli
parents:
diff
changeset
|
394 |
} |
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 |
} |