project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/MainActivity.java
equal
deleted
inserted
replaced
19 package org.hedgewars.hedgeroid; |
19 package org.hedgewars.hedgeroid; |
20 |
20 |
21 import org.hedgewars.hedgeroid.Downloader.DownloadAssets; |
21 import org.hedgewars.hedgeroid.Downloader.DownloadAssets; |
22 import org.hedgewars.hedgeroid.Downloader.DownloadListActivity; |
22 import org.hedgewars.hedgeroid.Downloader.DownloadListActivity; |
23 import org.hedgewars.hedgeroid.netplay.LobbyActivity; |
23 import org.hedgewars.hedgeroid.netplay.LobbyActivity; |
|
24 import org.hedgewars.hedgeroid.netplay.TestActivity; |
24 |
25 |
25 import android.app.AlertDialog; |
26 import android.app.AlertDialog; |
26 import android.app.Dialog; |
27 import android.app.Dialog; |
27 import android.app.ProgressDialog; |
28 import android.app.ProgressDialog; |
28 import android.content.DialogInterface; |
29 import android.content.DialogInterface; |
50 |
51 |
51 downloader.setOnClickListener(downloadClicker); |
52 downloader.setOnClickListener(downloadClicker); |
52 startGame.setOnClickListener(startGameClicker); |
53 startGame.setOnClickListener(startGameClicker); |
53 joinLobby.setOnClickListener(new OnClickListener() { |
54 joinLobby.setOnClickListener(new OnClickListener() { |
54 public void onClick(View v) { |
55 public void onClick(View v) { |
55 startActivity(new Intent(getApplicationContext(), LobbyActivity.class)); |
56 startActivity(new Intent(getApplicationContext(), TestActivity.class)); |
56 } |
57 } |
57 }); |
58 }); |
58 |
59 |
59 if(!Utils.isDataPathAvailable()){ |
60 if(!Utils.isDataPathAvailable()){ |
60 showDialog(0); |
61 showDialog(0); |
67 } |
68 } |
68 boolean assetsCopied = PreferenceManager.getDefaultSharedPreferences(this).getInt("latestAssets", 0) >= versionCode; |
69 boolean assetsCopied = PreferenceManager.getDefaultSharedPreferences(this).getInt("latestAssets", 0) >= versionCode; |
69 |
70 |
70 if(!assetsCopied){ |
71 if(!assetsCopied){ |
71 DownloadAssets assetsAsyncTask = new DownloadAssets(this); |
72 DownloadAssets assetsAsyncTask = new DownloadAssets(this); |
72 assetsDialog = ProgressDialog.show(this, "Please wait a moment", "Moving assets..."); |
73 assetsDialog = ProgressDialog.show(this, "Please wait a moment", "Moving assets to SD card..."); |
73 assetsAsyncTask.execute((Object[])null); |
74 assetsAsyncTask.execute(); |
74 } |
75 } |
75 } |
76 } |
76 } |
77 } |
77 |
78 |
78 public Dialog onCreateDialog(int id, Bundle args){ |
79 public Dialog onCreateDialog(int id, Bundle args){ |