From cea9cded1837fbe9d1fafbf5689db10b2296116e Mon Sep 17 00:00:00 2001 From: sjtufs Date: Tue, 3 Sep 2013 16:07:42 +0800 Subject: game version. tested well today --- client/Piztor/res/layout/activity_login.xml | 2 ++ client/Piztor/src/com/macaroon/piztor/AlertMaker.java | 1 + client/Piztor/src/com/macaroon/piztor/Login.java | 13 ++++++++++--- client/Piztor/src/com/macaroon/piztor/Main.java | 19 ++++++++----------- client/Piztor/src/com/macaroon/piztor/MapMaker.java | 4 ++-- client/Piztor/src/com/macaroon/piztor/myApp.java | 4 ++-- 6 files changed, 25 insertions(+), 18 deletions(-) (limited to 'client') diff --git a/client/Piztor/res/layout/activity_login.xml b/client/Piztor/res/layout/activity_login.xml index 16b11a0..078dccf 100644 --- a/client/Piztor/res/layout/activity_login.xml +++ b/client/Piztor/res/layout/activity_login.xml @@ -30,12 +30,14 @@ android:gravity="center" android:text="@string/app_name" android:textSize="30dip" + android:id="@+id/login_app_name" android:textColor="#FFFFFF"/> diff --git a/client/Piztor/src/com/macaroon/piztor/AlertMaker.java b/client/Piztor/src/com/macaroon/piztor/AlertMaker.java index a8d1138..ed376c3 100644 --- a/client/Piztor/src/com/macaroon/piztor/AlertMaker.java +++ b/client/Piztor/src/com/macaroon/piztor/AlertMaker.java @@ -79,6 +79,7 @@ public class AlertMaker { public void onClick(DialogInterface dialog, int which) { Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); context.startActivity(intent); + dialog.cancel(); } }); gpsDialog.show(); diff --git a/client/Piztor/src/com/macaroon/piztor/Login.java b/client/Piztor/src/com/macaroon/piztor/Login.java index e86b543..6cdd966 100644 --- a/client/Piztor/src/com/macaroon/piztor/Login.java +++ b/client/Piztor/src/com/macaroon/piztor/Login.java @@ -16,6 +16,7 @@ import android.view.animation.Animation; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; +import android.widget.TextView; import android.widget.Toast; public class Login extends PiztorAct { @@ -108,12 +109,18 @@ public class Login extends PiztorAct { id = "login"; super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); - ImageView imageView = (ImageView) findViewById(R.id.login_img); + TextView textView = (TextView) findViewById(R.id.login_app_name); AlphaAnimation alphaUp = new AlphaAnimation(0.0f, 1.0f); alphaUp.setDuration(2000); - alphaUp.setStartOffset(500); + alphaUp.setStartOffset(200); alphaUp.setFillAfter(true); - imageView.startAnimation(alphaUp); + textView.startAnimation(alphaUp); + TextView textView1 = (TextView) findViewById(R.id.login_game_version); + AlphaAnimation alphaUp1 = new AlphaAnimation(0.0f, 1.0f); + alphaUp1.setDuration(2000); + alphaUp1.setStartOffset(1000); + alphaUp1.setFillAfter(true); + textView1.startAnimation(alphaUp1); } @Override diff --git a/client/Piztor/src/com/macaroon/piztor/Main.java b/client/Piztor/src/com/macaroon/piztor/Main.java index bd6d709..f62ed0c 100644 --- a/client/Piztor/src/com/macaroon/piztor/Main.java +++ b/client/Piztor/src/com/macaroon/piztor/Main.java @@ -156,11 +156,11 @@ public class Main extends PiztorAct { break; case -1: EException e = (EException) m.obj; - if (e.Etype == EException.EPushFailedException) - out.receiveMessage("网络不稳定~"); - else if (e.Etype == EException.ECheckinFailedException) + if (e.Etype == EException.ECheckinFailedException) out.receiveMessage("路点已过期!"); - else out.actMgr.trigger(AppMgr.logout); + else if (e.Etype == EException.EStatusFailedException) + out.appMgr.trigger(AppMgr.logout); + else out.receiveMessage("网络不稳定~"); default: break; } @@ -205,7 +205,7 @@ public class Main extends PiztorAct { void receiveMessage(String msg) { Toast toast = Toast.makeText(getApplicationContext(), msg, 5000); - toast.setGravity(Gravity.TOP, 0, 80); + toast.setGravity(Gravity.TOP, 0, 100); toast.show(); } @@ -252,19 +252,19 @@ public class Main extends PiztorAct { int TMP = location.getLocType(); if (TMP == 61) { Toast toast = Toast.makeText(Main.this, - "Piztor : 由GPS更新 (刷新时间" + GPSrefreshrate + "s)", 2000); + "Piztor : 由GPS更新 (刷新时间" + GPSrefreshrate + "s)", 1000); toast.setGravity(Gravity.TOP, 0, 80); toast.show(); } if (TMP == 161) { Toast toast = Toast.makeText(Main.this, - "Piztor : 由网络更新 (刷新时间" + GPSrefreshrate + "s)", 2000); + "Piztor : 由网络更新 (刷新时间" + GPSrefreshrate + "s)", 1000); toast.setGravity(Gravity.TOP, 0, 80); toast.show(); } if (TMP == 65) { Toast toast = Toast.makeText(Main.this, - "Piztor : 由缓存更新 (刷新时间" + GPSrefreshrate + "s)",2000); + "Piztor : 由缓存更新 (刷新时间" + GPSrefreshrate + "s)",1000); toast.setGravity(Gravity.TOP, 0, 80); toast.show(); } @@ -334,8 +334,6 @@ public class Main extends PiztorAct { mid = i.markerId; } } - //TODO - if (minDis > 15.0 || mid == -1) { Toast toast = Toast.makeText(Main.this, String.format("请靠近路标,现在距离%.2f米",minDis), 4000); @@ -425,7 +423,6 @@ public class Main extends PiztorAct { if (app.mapInfo.myInfo.level >= 2 && !app.gameStarted) { app.gameStarted = true; settingsText.setText("得分"); - //TODO ReqGameStart req = new ReqGameStart(app.token, app.username, System.currentTimeMillis(), 10 * 1000); transam.send(req); } diff --git a/client/Piztor/src/com/macaroon/piztor/MapMaker.java b/client/Piztor/src/com/macaroon/piztor/MapMaker.java index 18eb524..1951ea9 100644 --- a/client/Piztor/src/com/macaroon/piztor/MapMaker.java +++ b/client/Piztor/src/com/macaroon/piztor/MapMaker.java @@ -137,8 +137,8 @@ public class MapMaker { OverlayItem item = getItem(index); UserInfo tmpInfo = app.mapInfo.getUserInfo(itemToUser .get(item)); - String itemInfo = tmpInfo.company + "连" + tmpInfo.section - + "班 " + tmpInfo.nickname; + String itemInfo = tmpInfo.section + + "队 " + tmpInfo.nickname; popupText.setText(itemInfo); Bitmap bitmap = BMapUtil.getBitmapFromView(popupInfo); popLay.showPopup(bitmap, item.getPoint(), 32); diff --git a/client/Piztor/src/com/macaroon/piztor/myApp.java b/client/Piztor/src/com/macaroon/piztor/myApp.java index d8cdc9c..ba36eb0 100644 --- a/client/Piztor/src/com/macaroon/piztor/myApp.java +++ b/client/Piztor/src/com/macaroon/piztor/myApp.java @@ -14,8 +14,8 @@ public class myApp extends Application { BMapManager mBMapManager; boolean isExiting = false; boolean isLogout = false; - String ip = "202.120.7.4"; -// static String ip = "69.85.86.42"; +// String ip = "202.120.7.4"; + static String ip = "69.85.86.42"; // static String ip = "192.168.1.171"; int port = 2224; String token = null; -- cgit v1.2.3-70-g09d2