# HG changeset patch # User Xeli # Date 1329771359 -3600 # Node ID b3160a49f02e5373887b9f89c0abb3214c927693 # Parent 31582be2ddbcb85ba9d82d355d6a69293c1dbc87 incremental loading of all the images in teamcreation on android, this should really be rewritten though.. diff -r 31582be2ddbc -r b3160a49f02e 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> gravesDataNew = FrontendDataUtils.getGraves(this); - final ArrayList> flagsDataNew = FrontendDataUtils.getFlags(this); - final ArrayList> typesDataNew = FrontendDataUtils.getTypes(this); - final ArrayList> hatsDataNew = FrontendDataUtils.getHats(this); - final ArrayList voicesDataNew = FrontendDataUtils.getVoices(this); - final ArrayList fortsDataNew = FrontendDataUtils.getForts(this); - - this.runOnUiThread(new Runnable(){ public void run() { copy(gravesData, gravesDataNew); ((SimpleAdapter)grave.getAdapter()).notifyDataSetChanged(); - + } + }); + + final ArrayList> flagsDataNew = FrontendDataUtils.getFlags(this); + this.runOnUiThread(new Runnable(){ + public void run() { copy(flagsData, flagsDataNew); ((SimpleAdapter)flag.getAdapter()).notifyDataSetChanged(); - + } + }); + + final ArrayList> typesDataNew = FrontendDataUtils.getTypes(this); + this.runOnUiThread(new Runnable(){ + public void run() { copy(typesData, typesDataNew); ((SimpleAdapter)difficulty.getAdapter()).notifyDataSetChanged(); - + } + }); + + final ArrayList> hatsDataNew = FrontendDataUtils.getHats(this); + this.runOnUiThread(new Runnable(){ + public void run() { copy(hatsData, hatsDataNew); ((SimpleAdapter)hogHat.get(0).getAdapter()).notifyDataSetChanged(); - + } + }); + + final ArrayList voicesDataNew = FrontendDataUtils.getVoices(this); + this.runOnUiThread(new Runnable(){ + public void run() { copy(voicesData, voicesDataNew); ((ArrayAdapter)voice.getAdapter()).notifyDataSetChanged(); - + } + }); + + final ArrayList fortsDataNew = FrontendDataUtils.getForts(this); + this.runOnUiThread(new Runnable(){ + public void run() { copy(fortsData, fortsDataNew); - ((ArrayAdapter)fort.getAdapter()).notifyDataSetChanged(); + ((ArrayAdapter)fort.getAdapter()).notifyDataSetChanged(); } - }); - + }); } private static void copy(List dest, List src){