diff options
Diffstat (limited to 'client/.metadata/.plugins/org.eclipse.core.resources/.history/70')
4 files changed, 0 insertions, 329 deletions
diff --git a/client/.metadata/.plugins/org.eclipse.core.resources/.history/70/501f63f7750d00131719b896d543f08c b/client/.metadata/.plugins/org.eclipse.core.resources/.history/70/501f63f7750d00131719b896d543f08c deleted file mode 100644 index 3d2621d..0000000 --- a/client/.metadata/.plugins/org.eclipse.core.resources/.history/70/501f63f7750d00131719b896d543f08c +++ /dev/null @@ -1,168 +0,0 @@ -package com.macaroon.piztor; - -import android.annotation.SuppressLint; -import android.location.Location; -import android.os.Bundle; -import android.os.Handler; -import android.os.Message; -import android.view.Menu; -import android.view.View; -import android.widget.ImageButton; - -public class Main extends PiztorAct { - - final static int SearchButtonPress = 1; - final static int FetchButtonPress = 2; - final static int FocuseButtonPress = 3; - final static int SuccessFetch = 4; - final static int FailedFetch = 5; - final static int TimerFlush = 6; - ActMgr actMgr; - ImageButton btnSearch, btnFetch, btnFocus, btnSettings; - @SuppressLint("HandlerLeak") - Handler fromGPS = new Handler() { - @Override - public void handleMessage(Message m) { - if (m.what != 0) { - Location l = (Location) m.obj; - ReqUpdate r = new ReqUpdate(UserInfo.token, l.getLatitude(), - l.getLongitude(), System.currentTimeMillis(), 1000); - AppMgr.transam.send(r); - } - } - }; - - Handler fromTransam = new Handler() { - @Override - public void handleMessage(Message m) { - switch (m.what) { - case value: - - break; - - default: - break; - } - - } - }; - - String cause(int t) { - switch (t) { - case SearchButtonPress: - return "Search Button Press"; - case FetchButtonPress: - return "Fetch Button Press"; - case FocuseButtonPress: - return "Focuse Button Press"; - case SuccessFetch: - return "Success Fetch"; - case FailedFetch: - return "Failed Fetch"; - case TimerFlush: - return "TimerFlush"; - default: - return "Fuck!!!"; - } - } - - class StartStatus extends ActStatus { - - @Override - void enter(int e) { - System.out.println("enter start status!!!!"); - if (e == SuccessFetch) { - - } - } - - @Override - void leave(int e) { - System.out.println("leave start status!!!! because" + cause(e)); - } - - } - - class FetchStatus extends ActStatus { - - @Override - void enter(int e) { - System.out.println("enter Fetch status!!!!"); - if (e == FetchButtonPress) { - ReqLocation r = new ReqLocation(UserInfo.token, 1, - System.currentTimeMillis(), 1000); - AppMgr.transam.send(r); - } - } - - @Override - void leave(int e) { - System.out.println("leave fetch status!!!! because" + cause(e)); - } - - } - - class FocusStatus extends ActStatus { - - @Override - void enter(int e) { - System.out.println("enter focus status!!!!"); - - } - - @Override - void leave(int e) { - System.out.println("leave focus status!!!! because" + cause(e)); - - } - - } - - @Override - protected void onCreate(Bundle savedInstanceState) { - id = "Main"; - super.onCreate(savedInstanceState); - AppMgr.tracker.setHandler(fromGPS); - ActStatus[] r = new ActStatus[3]; - r[0] = new StartStatus(); - r[1] = new FetchStatus(); - r[2] = new FocusStatus(); - actMgr = new ActMgr(this, r[0], r); - actMgr.add(r[0], FocuseButtonPress, r[2]); - actMgr.add(r[0], FetchButtonPress, r[1]); - actMgr.add(r[1], FetchButtonPress, r[0]); - actMgr.add(r[1], FailedFetch, r[0]); - actMgr.add(r[2], FocuseButtonPress, r[0]); - actMgr.add(r[0], TimerFlush, r[0]); - setContentView(R.layout.activity_main); - } - - @Override - protected void onStart() { - super.onStart(); - btnFetch = (ImageButton) findViewById(R.id.footbar_btn_fetch); - btnFocus = (ImageButton) findViewById(R.id.footbar_btn_focus); - btnSearch = (ImageButton) findViewById(R.id.footbar_btn_search); - btnSettings = (ImageButton) findViewById(R.id.footbar_btn_settings); - btnFetch.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View arg0) { - actMgr.trigger(FetchButtonPress); - } - }); - btnFocus.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - actMgr.trigger(FocuseButtonPress); - } - }); - } - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - // Inflate the menu; this adds items to the action bar if it is present. - getMenuInflater().inflate(R.menu.main, menu); - return true; - } - -} diff --git a/client/.metadata/.plugins/org.eclipse.core.resources/.history/70/803f3d632b0d00131249f322b63acde8 b/client/.metadata/.plugins/org.eclipse.core.resources/.history/70/803f3d632b0d00131249f322b63acde8 deleted file mode 100644 index 294cae3..0000000 --- a/client/.metadata/.plugins/org.eclipse.core.resources/.history/70/803f3d632b0d00131249f322b63acde8 +++ /dev/null @@ -1,16 +0,0 @@ -package com.macaroon.piztor; - -//--------------------------------------// -// authentication // -//--------------------------------------// - -public class ReqLogin extends Req{ - String user; //username - String pass; //password - - ReqLogin(String u,String p,long time,long alive){ - super(0,0,time,alive); //for type 0 - user = u; - pass = p; - } -}
\ No newline at end of file diff --git a/client/.metadata/.plugins/org.eclipse.core.resources/.history/70/c00737b35b0d00131719b896d543f08c b/client/.metadata/.plugins/org.eclipse.core.resources/.history/70/c00737b35b0d00131719b896d543f08c deleted file mode 100644 index 4556ca2..0000000 --- a/client/.metadata/.plugins/org.eclipse.core.resources/.history/70/c00737b35b0d00131719b896d543f08c +++ /dev/null @@ -1,53 +0,0 @@ -package com.macaroon.piztor; - -import android.annotation.SuppressLint; -import android.location.Location; -import android.os.Bundle; -import android.os.Handler; -import android.os.Message; -import android.view.Menu; - -public class Main extends PiztorAct { - - ActMgr actMgr; - - @SuppressLint("HandlerLeak") - Handler handler = new Handler() { - @Override - public void handleMessage(Message m) { - if (m.what != 0) { - Location l = (Location) m.obj; - if (l == null) - System.out.println("fuck!!!"); - ReqUpdate r = new ReqUpdate(UserInfo.token, l.getLatitude(), - l.getLongitude(), System.currentTimeMillis(), 1000); - AppMgr.transam.send(r); - } - } - }; - - @Override - protected void onCreate(Bundle savedInstanceState) { - id = "Main"; - super.onCreate(savedInstanceState); - AppMgr.tracker.setHandler(handler); - EmptyStatus[] r = new EmptyStatus[1]; - r[0] = new EmptyStatus(); - actMgr = new ActMgr(this, r[0], r); - setContentView(R.layout.activity_main); - } - - @Override - protected void onStart() { - super.onStart(); - - } - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - // Inflate the menu; this adds items to the action bar if it is present. - getMenuInflater().inflate(R.menu.main, menu); - return true; - } - -} diff --git a/client/.metadata/.plugins/org.eclipse.core.resources/.history/70/e041e862500d00131719b896d543f08c b/client/.metadata/.plugins/org.eclipse.core.resources/.history/70/e041e862500d00131719b896d543f08c deleted file mode 100644 index 7b27646..0000000 --- a/client/.metadata/.plugins/org.eclipse.core.resources/.history/70/e041e862500d00131719b896d543f08c +++ /dev/null @@ -1,92 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="fill_parent" - android:background="@android:color/black" - android:orientation="vertical"> - -<LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="@android:color/black" - android:gravity="center_horizontal" - android:orientation="vertical" > - - <ImageView - android:id="@+id/main_headbar_img" - android:layout_width="180dp" - android:layout_height="240dp" - android:layout_gravity="center_horizontal" - android:src="@drawable/title_logo" /> - - <LinearLayout - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:orientation="vertical" - android:layout_gravity="center"> - - <TableLayout - android:layout_width="match_parent" - android:layout_height="wrap_content"> - - <TableRow - android:layout_marginBottom="15dp" - android:layout_marginTop="15dp"> - <TextView - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="0.25" - android:gravity="right" - android:id="@+id/user_id_text" - android:text="User ID" - android:textColor="@android:color/white" - /> - - <EditText - android:layout_width="0dp" - android:layout_weight="0.75" - android:id="@+id/user_id" - android:textColor="@android:color/white" - android:singleLine="true"/> - <requestFocus/> - </TableRow> - - <TableRow> - <TextView - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="0.25" - android:gravity="right" - android:id="@+id/user_pass_text" - android:text="Password" - android:textColor="@android:color/white" - /> - - <EditText - android:layout_width="0dp" - android:layout_weight="0.75" - android:id="@+id/user_pass" - android:password="true" - android:textColor="@android:color/white" - android:singleLine="true"/> - </TableRow> - </TableLayout> - </LinearLayout> - - <LinearLayout - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center" - android:orientation="vertical" - > - <Button - android:id="@+id/login_btn_login" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:gravity="center" - android:text="Login" - android:textColor="@android:color/white" /> - </LinearLayout> - -</LinearLayout> -</RelativeLayout> |