incremental loading of all the images in teamcreation on android, this should really be rewritten though..
authorXeli
Mon, 20 Feb 2012 21:55:59 +0100
changeset 6727 b3160a49f02e
parent 6726 31582be2ddbc
child 6728 ce2b24995ab2
incremental loading of all the images in teamcreation on android, this should really be rewritten though..
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/TeamCreatorActivity.java
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/TeamCreatorActivity.java	Mon Feb 20 21:50:56 2012 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/TeamCreatorActivity.java	Mon Feb 20 21:55:59 2012 +0100
@@ -157,35 +157,52 @@
 
 	public void run(){
 		final ArrayList<HashMap<String, ?>> gravesDataNew = FrontendDataUtils.getGraves(this);
-		final ArrayList<HashMap<String, ?>> flagsDataNew = FrontendDataUtils.getFlags(this);
-		final ArrayList<HashMap<String, ?>> typesDataNew = FrontendDataUtils.getTypes(this);
-		final ArrayList<HashMap<String, ?>> hatsDataNew = FrontendDataUtils.getHats(this);
-		final ArrayList<String> voicesDataNew = FrontendDataUtils.getVoices(this);
-		final ArrayList<String> fortsDataNew = FrontendDataUtils.getForts(this);
-		
-		
 		this.runOnUiThread(new Runnable(){
 			public void run() {
 				copy(gravesData, gravesDataNew);
 				((SimpleAdapter)grave.getAdapter()).notifyDataSetChanged();
-				
+			}
+		});
+		
+		final ArrayList<HashMap<String, ?>> flagsDataNew = FrontendDataUtils.getFlags(this);
+		this.runOnUiThread(new Runnable(){
+			public void run() {
 				copy(flagsData, flagsDataNew);
 				((SimpleAdapter)flag.getAdapter()).notifyDataSetChanged();
-				
+			}
+		});
+		
+		final ArrayList<HashMap<String, ?>> typesDataNew = FrontendDataUtils.getTypes(this);
+		this.runOnUiThread(new Runnable(){
+			public void run() {
 				copy(typesData, typesDataNew);
 				((SimpleAdapter)difficulty.getAdapter()).notifyDataSetChanged();
-				
+			}
+		});
+		
+		final ArrayList<HashMap<String, ?>> hatsDataNew = FrontendDataUtils.getHats(this);
+		this.runOnUiThread(new Runnable(){
+			public void run() {
 				copy(hatsData, hatsDataNew);
 				((SimpleAdapter)hogHat.get(0).getAdapter()).notifyDataSetChanged();
-				
+			}
+		});
+		
+		final ArrayList<String> voicesDataNew = FrontendDataUtils.getVoices(this);
+		this.runOnUiThread(new Runnable(){
+			public void run() {
 				copy(voicesData, voicesDataNew);
 				((ArrayAdapter<String>)voice.getAdapter()).notifyDataSetChanged();
-				
+			}
+		});
+		
+		final ArrayList<String> fortsDataNew = FrontendDataUtils.getForts(this);
+		this.runOnUiThread(new Runnable(){
+			public void run() {
 				copy(fortsData, fortsDataNew);
-				((ArrayAdapter<String>)fort.getAdapter()).notifyDataSetChanged();			
+				((ArrayAdapter<String>)fort.getAdapter()).notifyDataSetChanged();
 			}
-		});		
-
+		});
 	}
 	
 	private static <T> void copy(List<T> dest, List<T> src){