From e962b84db615005d073b0fb4b5240093a826408f Mon Sep 17 00:00:00 2001 From: goblin911 Date: Sun, 25 Aug 2013 15:31:29 +0800 Subject: hahahahhahahahaha --- client/Piztor/AndroidManifest.xml | 24 +++-- client/Piztor/bin/AndroidManifest.xml | 24 +++-- .../bin/classes/com/macaroon/piztor/ActMgr.class | Bin 2616 -> 2650 bytes .../classes/com/macaroon/piztor/ActStatus.class | Bin 328 -> 328 bytes .../macaroon/piztor/AppMgr$ActivityStatus.class | Bin 1412 -> 1412 bytes .../bin/classes/com/macaroon/piztor/AppMgr.class | Bin 2846 -> 4546 bytes .../classes/com/macaroon/piztor/EmptyStatus.class | Bin 471 -> 471 bytes .../bin/classes/com/macaroon/piztor/InitAct.class | Bin 804 -> 1134 bytes .../classes/com/macaroon/piztor/R$drawable.class | Bin 410 -> 1399 bytes .../bin/classes/com/macaroon/piztor/R$id.class | Bin 396 -> 2291 bytes .../bin/classes/com/macaroon/piztor/R$layout.class | Bin 406 -> 823 bytes .../bin/classes/com/macaroon/piztor/R$menu.class | Bin 419 -> 479 bytes .../bin/classes/com/macaroon/piztor/R$string.class | Bin 518 -> 937 bytes .../bin/classes/com/macaroon/piztor/R$style.class | Bin 434 -> 434 bytes client/Piztor/gen/com/macaroon/piztor/R.java | 104 ++++++++++++++++++++- client/Piztor/res/values/strings.xml | 18 +++- client/Piztor/src/com/macaroon/piztor/ActMgr.java | 3 +- client/Piztor/src/com/macaroon/piztor/AppMgr.java | 33 ++++++- client/Piztor/src/com/macaroon/piztor/InitAct.java | 20 +++- 19 files changed, 191 insertions(+), 35 deletions(-) diff --git a/client/Piztor/AndroidManifest.xml b/client/Piztor/AndroidManifest.xml index 63cb8ff..b18d8e2 100644 --- a/client/Piztor/AndroidManifest.xml +++ b/client/Piztor/AndroidManifest.xml @@ -12,9 +12,9 @@ android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" - android:theme="@style/AppTheme" > + android:theme="@android:style/Theme.Black.NoTitleBar" > @@ -23,14 +23,20 @@ - - - - - + android:name="com.macaroon.piztor.Login" + android:label="@string/title_activity_login" > + + + + + + + diff --git a/client/Piztor/bin/AndroidManifest.xml b/client/Piztor/bin/AndroidManifest.xml index 63cb8ff..b18d8e2 100644 --- a/client/Piztor/bin/AndroidManifest.xml +++ b/client/Piztor/bin/AndroidManifest.xml @@ -12,9 +12,9 @@ android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" - android:theme="@style/AppTheme" > + android:theme="@android:style/Theme.Black.NoTitleBar" > @@ -23,14 +23,20 @@ - - - - - + android:name="com.macaroon.piztor.Login" + android:label="@string/title_activity_login" > + + + + + + + diff --git a/client/Piztor/bin/classes/com/macaroon/piztor/ActMgr.class b/client/Piztor/bin/classes/com/macaroon/piztor/ActMgr.class index 1b1c693..a219c2d 100644 Binary files a/client/Piztor/bin/classes/com/macaroon/piztor/ActMgr.class and b/client/Piztor/bin/classes/com/macaroon/piztor/ActMgr.class differ diff --git a/client/Piztor/bin/classes/com/macaroon/piztor/ActStatus.class b/client/Piztor/bin/classes/com/macaroon/piztor/ActStatus.class index 1f3df48..296a7d5 100644 Binary files a/client/Piztor/bin/classes/com/macaroon/piztor/ActStatus.class and b/client/Piztor/bin/classes/com/macaroon/piztor/ActStatus.class differ diff --git a/client/Piztor/bin/classes/com/macaroon/piztor/AppMgr$ActivityStatus.class b/client/Piztor/bin/classes/com/macaroon/piztor/AppMgr$ActivityStatus.class index 496344b..f11e546 100644 Binary files a/client/Piztor/bin/classes/com/macaroon/piztor/AppMgr$ActivityStatus.class and b/client/Piztor/bin/classes/com/macaroon/piztor/AppMgr$ActivityStatus.class differ diff --git a/client/Piztor/bin/classes/com/macaroon/piztor/AppMgr.class b/client/Piztor/bin/classes/com/macaroon/piztor/AppMgr.class index 107bcad..61aa240 100644 Binary files a/client/Piztor/bin/classes/com/macaroon/piztor/AppMgr.class and b/client/Piztor/bin/classes/com/macaroon/piztor/AppMgr.class differ diff --git a/client/Piztor/bin/classes/com/macaroon/piztor/EmptyStatus.class b/client/Piztor/bin/classes/com/macaroon/piztor/EmptyStatus.class index c656689..8b48ad5 100644 Binary files a/client/Piztor/bin/classes/com/macaroon/piztor/EmptyStatus.class and b/client/Piztor/bin/classes/com/macaroon/piztor/EmptyStatus.class differ diff --git a/client/Piztor/bin/classes/com/macaroon/piztor/InitAct.class b/client/Piztor/bin/classes/com/macaroon/piztor/InitAct.class index 6a8e04d..d03ee93 100644 Binary files a/client/Piztor/bin/classes/com/macaroon/piztor/InitAct.class and b/client/Piztor/bin/classes/com/macaroon/piztor/InitAct.class differ diff --git a/client/Piztor/bin/classes/com/macaroon/piztor/R$drawable.class b/client/Piztor/bin/classes/com/macaroon/piztor/R$drawable.class index 5444d98..b31a626 100644 Binary files a/client/Piztor/bin/classes/com/macaroon/piztor/R$drawable.class and b/client/Piztor/bin/classes/com/macaroon/piztor/R$drawable.class differ diff --git a/client/Piztor/bin/classes/com/macaroon/piztor/R$id.class b/client/Piztor/bin/classes/com/macaroon/piztor/R$id.class index 8577179..e08c969 100644 Binary files a/client/Piztor/bin/classes/com/macaroon/piztor/R$id.class and b/client/Piztor/bin/classes/com/macaroon/piztor/R$id.class differ diff --git a/client/Piztor/bin/classes/com/macaroon/piztor/R$layout.class b/client/Piztor/bin/classes/com/macaroon/piztor/R$layout.class index fab7556..de25e3c 100644 Binary files a/client/Piztor/bin/classes/com/macaroon/piztor/R$layout.class and b/client/Piztor/bin/classes/com/macaroon/piztor/R$layout.class differ diff --git a/client/Piztor/bin/classes/com/macaroon/piztor/R$menu.class b/client/Piztor/bin/classes/com/macaroon/piztor/R$menu.class index cec6e5a..7f7cacb 100644 Binary files a/client/Piztor/bin/classes/com/macaroon/piztor/R$menu.class and b/client/Piztor/bin/classes/com/macaroon/piztor/R$menu.class differ diff --git a/client/Piztor/bin/classes/com/macaroon/piztor/R$string.class b/client/Piztor/bin/classes/com/macaroon/piztor/R$string.class index a78c834..65d1b80 100644 Binary files a/client/Piztor/bin/classes/com/macaroon/piztor/R$string.class and b/client/Piztor/bin/classes/com/macaroon/piztor/R$string.class differ diff --git a/client/Piztor/bin/classes/com/macaroon/piztor/R$style.class b/client/Piztor/bin/classes/com/macaroon/piztor/R$style.class index 42ddcce..052dd30 100644 Binary files a/client/Piztor/bin/classes/com/macaroon/piztor/R$style.class and b/client/Piztor/bin/classes/com/macaroon/piztor/R$style.class differ diff --git a/client/Piztor/gen/com/macaroon/piztor/R.java b/client/Piztor/gen/com/macaroon/piztor/R.java index 9821c7f..3d07e1d 100644 --- a/client/Piztor/gen/com/macaroon/piztor/R.java +++ b/client/Piztor/gen/com/macaroon/piztor/R.java @@ -21,23 +21,117 @@ public final class R { public static final int activity_vertical_margin=0x7f040001; } public static final class drawable { - public static final int ic_launcher=0x7f020000; + public static final int bottom_img=0x7f020000; + public static final int footbar_background=0x7f020001; + public static final int footbar_btn_checkin_style=0x7f020002; + public static final int footbar_btn_fetch_style=0x7f020003; + public static final int footbar_btn_focus_style=0x7f020004; + public static final int footbar_btn_search_style=0x7f020005; + public static final int footbar_btn_settings_style=0x7f020006; + public static final int footbar_checkin=0x7f020007; + public static final int footbar_checkin_1=0x7f020008; + public static final int footbar_fetch=0x7f020009; + public static final int footbar_fetch_1=0x7f02000a; + public static final int footbar_marker=0x7f02000b; + public static final int footbar_marker_1=0x7f02000c; + public static final int footbar_search=0x7f02000d; + public static final int footbar_search_1=0x7f02000e; + public static final int footbar_select_bg=0x7f02000f; + public static final int footbar_settings=0x7f020010; + public static final int footbar_settings_1=0x7f020011; + public static final int footbar_unselect_bg=0x7f020012; + public static final int horizontal_line=0x7f020013; + public static final int ic_launcher=0x7f020014; + public static final int navigation_back=0x7f020015; + public static final int navigation_back_1=0x7f020016; + public static final int title_logo=0x7f020017; + public static final int topbar_background=0x7f020018; } public static final class id { - public static final int action_settings=0x7f080000; + public static final int action_settings=0x7f08002c; + public static final int footbar_btn_checkin=0x7f08001f; + public static final int footbar_btn_checkin_layout=0x7f08001e; + public static final int footbar_btn_checkin_text=0x7f080020; + public static final int footbar_btn_fetch=0x7f08001c; + public static final int footbar_btn_fetch_layout=0x7f08001b; + public static final int footbar_btn_fetch_text=0x7f08001d; + public static final int footbar_btn_focus=0x7f080022; + public static final int footbar_btn_focus_layout=0x7f080021; + public static final int footbar_btn_focus_text=0x7f080023; + public static final int footbar_btn_search=0x7f080019; + public static final int footbar_btn_search_layout=0x7f080018; + public static final int footbar_btn_search_text=0x7f08001a; + public static final int footbar_btn_settings=0x7f080025; + public static final int footbar_btn_settings_layout=0x7f080024; + public static final int footbar_btn_settings_text=0x7f080027; + public static final int gather_footbar_layout=0x7f080001; + public static final int gather_timer=0x7f080026; + public static final int gather_timer_layout=0x7f080000; + public static final int headbar_appname=0x7f080029; + public static final int headbar_logo=0x7f080028; + public static final int login_btn_login=0x7f080007; + public static final int main_footbar_layout=0x7f080009; + public static final int main_headbar_img=0x7f080002; + public static final int main_headbar_layout=0x7f080008; + public static final int settings_GPSrefreshrate=0x7f08000c; + public static final int settings_GPSrefreshrate_text=0x7f08000b; + public static final int settings_btn_back=0x7f08002a; + public static final int settings_headbar_layout=0x7f08000a; + public static final int settings_headbar_text=0x7f08002b; + public static final int settings_seperator1=0x7f08000d; + public static final int settings_seperator2=0x7f080012; + public static final int settings_seperator3=0x7f080017; + public static final int settings_sex_layout=0x7f08000e; + public static final int settings_sex_text=0x7f08000f; + public static final int settings_show_female=0x7f080011; + public static final int settings_show_male=0x7f080010; + public static final int settings_team_all=0x7f080016; + public static final int settings_team_layout=0x7f080013; + public static final int settings_team_mine=0x7f080015; + public static final int settings_team_text=0x7f080014; + public static final int user_id=0x7f080004; + public static final int user_id_text=0x7f080003; + public static final int user_pass=0x7f080006; + public static final int user_pass_text=0x7f080005; } public static final class layout { - public static final int activity_init=0x7f030000; + public static final int activity_gather=0x7f030000; + public static final int activity_init=0x7f030001; + public static final int activity_login=0x7f030002; + public static final int activity_main=0x7f030003; + public static final int activity_setting=0x7f030004; + public static final int activity_settings=0x7f030005; + public static final int gather_footbar=0x7f030006; + public static final int gather_timer=0x7f030007; + public static final int login_bottom=0x7f030008; + public static final int main_footbar=0x7f030009; + public static final int main_headbar=0x7f03000a; + public static final int settings_headbar=0x7f03000b; } public static final class menu { public static final int init=0x7f070000; - public static final int main=0x7f070001; + public static final int login=0x7f070001; + public static final int main=0x7f070002; + public static final int setting=0x7f070003; } public static final class string { public static final int action_settings=0x7f050001; + public static final int all=0x7f05000c; public static final int app_name=0x7f050000; + public static final int checkin=0x7f050006; + public static final int female=0x7f05000a; + public static final int fetch=0x7f050005; + public static final int focus=0x7f050007; public static final int hello_world=0x7f050002; - public static final int title_activity_init=0x7f050003; + public static final int male=0x7f050009; + public static final int mine=0x7f05000d; + public static final int search=0x7f050004; + public static final int settings=0x7f050003; + public static final int show_sex=0x7f050008; + public static final int show_team=0x7f05000b; + public static final int title_activity_login=0x7f05000e; + public static final int title_activity_main=0x7f05000f; + public static final int title_activity_setting=0x7f050010; } public static final class style { /** diff --git a/client/Piztor/res/values/strings.xml b/client/Piztor/res/values/strings.xml index 8e76dc0..5a5ccc4 100644 --- a/client/Piztor/res/values/strings.xml +++ b/client/Piztor/res/values/strings.xml @@ -1,9 +1,21 @@ - - Piztor + piztor Settings Hello world! - InitAct + Settings + Search + Fetch + Checkin + Focus + Show sex: + Male + Female + Show team: + All + Mine + Login + Main + Setting diff --git a/client/Piztor/src/com/macaroon/piztor/ActMgr.java b/client/Piztor/src/com/macaroon/piztor/ActMgr.java index 81fa6f2..4df6bae 100644 --- a/client/Piztor/src/com/macaroon/piztor/ActMgr.java +++ b/client/Piztor/src/com/macaroon/piztor/ActMgr.java @@ -21,8 +21,7 @@ public class ActMgr { } void trigger(int event) { - for (Integer i : mp.get(nowStatus).keySet()) - System.out.println(i); + System.out.println(act.id + " : " + event); if (mp.get(nowStatus).containsKey(event)) { nowStatus.leave(event); nowStatus = mp.get(nowStatus).get(event); diff --git a/client/Piztor/src/com/macaroon/piztor/AppMgr.java b/client/Piztor/src/com/macaroon/piztor/AppMgr.java index 9259786..2e5e2b3 100644 --- a/client/Piztor/src/com/macaroon/piztor/AppMgr.java +++ b/client/Piztor/src/com/macaroon/piztor/AppMgr.java @@ -4,6 +4,7 @@ import java.util.HashMap; import android.annotation.SuppressLint; import android.content.Intent; +import android.os.Handler; @SuppressLint("UseSparseArrays") public class AppMgr { @@ -13,7 +14,17 @@ public class AppMgr { } static ActivityStatus status; static PiztorAct nowAct; - + //TODO fix + static Handler fromTransam, fromGPS; + static Transam transam = null; + static Tracker tracker = null; + static Thread tTransam, tGPS; + //Event + + final static int noToken = 101; + final static int loginSuccess = 102; + + static HashMap, HashMap>> mp; static void setStatus(ActivityStatus st) { @@ -21,8 +32,12 @@ public class AppMgr { } static void trigger(int event) { - Intent i = new Intent(); + System.out.println(nowAct.id + " : " + event); + if (mp.get(nowAct.getClass()) == null) + System.out.println("first"); + else if (mp.get(nowAct.getClass()) == null) + System.out.println("second"); i.setClass(nowAct, mp.get(nowAct.getClass()).get(event)); nowAct.startActivity(i); } @@ -55,8 +70,20 @@ public class AppMgr { static void init() { mp = new HashMap, HashMap>>(); + fromTransam = new Handler(); + transam = new Transam(UserInfo.ip, UserInfo.port, fromTransam); + fromGPS = new Handler(); + tracker = new Tracker(nowAct.getApplicationContext(), fromGPS); + tTransam = new Thread(transam); + tTransam.start(); + tGPS = new Thread(tracker); + tGPS.start(); + System.out.println("!!!!!!"); addStatus(InitAct.class); - + addStatus(Login.class); + addStatus(Main.class); + addTransition(InitAct.class, noToken, Login.class); + addTransition(Login.class, loginSuccess, Main.class); } } diff --git a/client/Piztor/src/com/macaroon/piztor/InitAct.java b/client/Piztor/src/com/macaroon/piztor/InitAct.java index 1ce492c..d5a6059 100644 --- a/client/Piztor/src/com/macaroon/piztor/InitAct.java +++ b/client/Piztor/src/com/macaroon/piztor/InitAct.java @@ -1,20 +1,32 @@ package com.macaroon.piztor; +import android.content.Intent; import android.os.Bundle; -import android.app.Activity; +import android.os.Handler; import android.view.Menu; -public class InitAct extends Activity { - +public class InitAct extends PiztorAct { + @Override protected void onCreate(Bundle savedInstanceState) { + id = "initAct"; super.onCreate(savedInstanceState); + AppMgr.init(); setContentView(R.layout.activity_init); } + + @Override + protected void onStart() { + super.onStart(); + if (UserInfo.token == -1) + AppMgr.trigger(AppMgr.noToken); + else { + //TODO jump to main + } + } @Override public boolean onCreateOptionsMenu(Menu menu) { - // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.init, menu); return true; } -- cgit v1.2.3-70-g09d2