1 |
package dk.thoerup.traininfo; |
package dk.thoerup.traininfo; |
2 |
|
|
|
import dk.thoerup.traininfo.util.MessageBox; |
|
3 |
import android.app.Activity; |
import android.app.Activity; |
4 |
import android.content.Intent; |
import android.content.Intent; |
5 |
|
import android.net.Uri; |
6 |
import android.os.Bundle; |
import android.os.Bundle; |
7 |
|
import android.os.Handler; |
8 |
|
import android.os.Message; |
9 |
import android.view.View; |
import android.view.View; |
10 |
import android.view.Window; |
import android.view.Window; |
11 |
import android.view.View.OnClickListener; |
import android.view.View.OnClickListener; |
12 |
import android.widget.Button; |
import android.widget.Button; |
13 |
|
|
14 |
|
import com.nullwire.trace.ExceptionHandler; |
15 |
|
|
16 |
|
import dk.thoerup.checkupdates.CheckUpdates; |
17 |
|
|
18 |
public class WelcomeScreen extends Activity{ |
public class WelcomeScreen extends Activity{ |
19 |
public enum ListType { |
public enum ListType { |
20 |
ListNearest, |
ListNearest, |
22 |
ListFavorites |
ListFavorites |
23 |
} |
} |
24 |
|
|
25 |
|
Handler handler = new Handler(); |
26 |
|
|
27 |
@Override |
@Override |
28 |
public void onCreate(Bundle savedInstanceState) { |
public void onCreate(Bundle savedInstanceState) { |
29 |
requestWindowFeature( Window.FEATURE_NO_TITLE ); |
requestWindowFeature( Window.FEATURE_NO_TITLE ); |
41 |
|
|
42 |
Button aboutButton = (Button) findViewById(R.id.about); |
Button aboutButton = (Button) findViewById(R.id.about); |
43 |
aboutButton.setOnClickListener( new AboutListener() ); |
aboutButton.setOnClickListener( new AboutListener() ); |
44 |
|
|
45 |
|
ExceptionHandler.register(this, "http://t-hoerup.dk/android/trace.php"); |
46 |
|
|
47 |
|
CheckUpdates update = new CheckUpdates(); |
48 |
|
update.checkForUpdates(this, "http://t-hoerup.dk/android/traininfo/version.txt", "TrainInfo DK"); |
49 |
|
/* |
50 |
|
Runnable r = new Runnable() { |
51 |
|
@Override |
52 |
|
public void run() { |
53 |
|
View splash = findViewById(R.id.splash); |
54 |
|
splash.setVisibility(View.GONE); |
55 |
|
} |
56 |
|
}; |
57 |
|
handler.postDelayed(r, 1500); |
58 |
|
*/ |
59 |
} |
} |
60 |
|
|
61 |
class AboutListener implements OnClickListener { |
class AboutListener implements OnClickListener { |
62 |
|
|
63 |
@Override |
@Override |
64 |
public void onClick(View v) { |
public void onClick(View v) { |
65 |
|
/* |
66 |
String ver = WelcomeScreen.this.getResources().getString(R.string.app_version); |
String appName = WelcomeScreen.this.getResources().getString(R.string.app_name); |
67 |
|
String ver = WelcomeScreen.this.getResources().getString(R.string.app_version); |
68 |
|
|
69 |
StringBuffer message = new StringBuffer(); |
StringBuffer message = new StringBuffer(); |
70 |
message.append("TrainInfo DK v").append(ver).append("\n"); |
message.append(appName); |
71 |
|
message.append(" v").append(ver).append("\n"); |
72 |
message.append("By Torben H. Nielsen\n"); |
message.append("By Torben H. Nielsen\n"); |
73 |
|
|
74 |
MessageBox.showMessage(WelcomeScreen.this, message.toString()); |
MessageBox.showMessage(WelcomeScreen.this, message.toString());*/ |
75 |
|
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.t-hoerup.dk/android/traininfo/")); |
76 |
|
startActivity(browserIntent); |
77 |
} |
} |
78 |
|
|
79 |
} |
} |