summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsjtufs <sjtu_fs@outlook.com>2013-09-02 14:16:22 +0800
committersjtufs <sjtu_fs@outlook.com>2013-09-02 14:16:22 +0800
commit2803cc88dba0fd04a600456a81a7d7ec6dafd41c (patch)
treeb8fe38beba86abcd3034eed806f6f104076876bd
parentd017fb4ca8c9a5d0b6c5533f2549d13aa224e623 (diff)
fix #44 and update beta version
-rw-r--r--client/Piztor/res/drawable/footbar_btn_focus_style.xml4
-rw-r--r--client/Piztor/res/drawable/footbar_fetch.pngbin742 -> 3093 bytes
-rw-r--r--client/Piztor/res/drawable/footbar_focus.pngbin0 -> 1601 bytes
-rw-r--r--client/Piztor/res/drawable/footbar_focus_1.pngbin0 -> 486 bytes
-rw-r--r--client/Piztor/res/layout/activity_login.xml3
-rw-r--r--client/Piztor/res/layout/activity_settings.xml96
-rw-r--r--client/Piztor/res/layout/subscribe_settings.xml6
-rw-r--r--client/Piztor/res/values/strings.xml9
-rw-r--r--client/Piztor/src/com/macaroon/piztor/AlertMaker.java1
-rw-r--r--client/Piztor/src/com/macaroon/piztor/Login.java12
-rw-r--r--client/Piztor/src/com/macaroon/piztor/Main.java9
-rw-r--r--client/Piztor/src/com/macaroon/piztor/Settings.java46
-rw-r--r--client/Piztor/src/com/macaroon/piztor/SubscribeSettings.java2
13 files changed, 136 insertions, 52 deletions
diff --git a/client/Piztor/res/drawable/footbar_btn_focus_style.xml b/client/Piztor/res/drawable/footbar_btn_focus_style.xml
index 5932f2f..ec25aa3 100644
--- a/client/Piztor/res/drawable/footbar_btn_focus_style.xml
+++ b/client/Piztor/res/drawable/footbar_btn_focus_style.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
- <item android:state_pressed="true" android:drawable="@drawable/footbar_marker_1"></item>
- <item android:state_pressed="false" android:drawable="@drawable/footbar_marker"></item>
+ <item android:state_pressed="true" android:drawable="@drawable/footbar_focus_1"></item>
+ <item android:state_pressed="false" android:drawable="@drawable/footbar_focus"></item>
</selector>
diff --git a/client/Piztor/res/drawable/footbar_fetch.png b/client/Piztor/res/drawable/footbar_fetch.png
index 71d1a20..b21b50f 100644
--- a/client/Piztor/res/drawable/footbar_fetch.png
+++ b/client/Piztor/res/drawable/footbar_fetch.png
Binary files differ
diff --git a/client/Piztor/res/drawable/footbar_focus.png b/client/Piztor/res/drawable/footbar_focus.png
new file mode 100644
index 0000000..8d59e71
--- /dev/null
+++ b/client/Piztor/res/drawable/footbar_focus.png
Binary files differ
diff --git a/client/Piztor/res/drawable/footbar_focus_1.png b/client/Piztor/res/drawable/footbar_focus_1.png
new file mode 100644
index 0000000..ff7b368
--- /dev/null
+++ b/client/Piztor/res/drawable/footbar_focus_1.png
Binary files differ
diff --git a/client/Piztor/res/layout/activity_login.xml b/client/Piztor/res/layout/activity_login.xml
index cb27495..dac2d35 100644
--- a/client/Piztor/res/layout/activity_login.xml
+++ b/client/Piztor/res/layout/activity_login.xml
@@ -18,7 +18,7 @@
android:layout_marginTop="16dip">
<ImageView
- android:id="@+id/main_headbar_img"
+ android:id="@+id/login_img"
android:layout_width="180dp"
android:layout_height="200dp"
android:layout_gravity="center_horizontal"
@@ -31,6 +31,7 @@
android:text="@string/app_name"
android:textSize="30dip"
android:textColor="#FFFFFF"/>
+
</LinearLayout>
<LinearLayout
diff --git a/client/Piztor/res/layout/activity_settings.xml b/client/Piztor/res/layout/activity_settings.xml
index ba67683..18d037a 100644
--- a/client/Piztor/res/layout/activity_settings.xml
+++ b/client/Piztor/res/layout/activity_settings.xml
@@ -122,34 +122,76 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center">
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textSize="20dip"
- android:text="@string/colormode"
- android:textColor="#FFFFFF"/>
- <RadioGroup
- android:id="@+id/radioGroup"
- android:contentDescription="@string/colormode"
- android:layout_width="wrap_content"
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="20dip"
+ android:text="@string/colormode"
+ android:textColor="#FFFFFF"/>
+ <RadioGroup
+ android:id="@+id/colorRadioGroup"
+ android:contentDescription="@string/colormode"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dip"
+ android:orientation="horizontal">
+ <RadioButton
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:id="@+id/show_by_team"
+ android:textSize="18dip"
+ android:text="@string/show_team"
+ android:checked="true"/>
+ <RadioButton
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dip"
+ android:id="@+id/show_by_sex"
+ android:textSize="18dip"
+ android:text="@string/show_sex"/>
+ </RadioGroup>
+ </LinearLayout>
+ <View
+ android:layout_width="fill_parent"
+ android:layout_height="1.0px"
+ android:layout_marginTop="20dip"
+ android:layout_marginBottom="20dip"
+ android:layout_marginLeft="20dip"
+ android:layout_marginRight="20dip"
+ android:background="#ffc0c3c4" />
+ <LinearLayout
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginLeft="10dip"
- android:orientation="horizontal">
- <RadioButton
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:id="@+id/show_by_team"
- android:textSize="18dip"
- android:text="@string/show_team"
- android:checked="true"/>
- <RadioButton
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="10dip"
- android:id="@+id/show_by_sex"
- android:textSize="18dip"
- android:text="@string/show_sex"/>
- </RadioGroup>
+ android:layout_gravity="center"
+ android:gravity="center">
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="20dip"
+ android:text="@string/locatemode"
+ android:textColor="#FFFFFF"/>
+ <RadioGroup
+ android:id="@+id/locateRadioGroup"
+ android:contentDescription="@string/locatemode"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dip"
+ android:orientation="horizontal">
+ <RadioButton
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:id="@+id/gps_first"
+ android:textSize="18dip"
+ android:text="@string/gps_first"
+ android:checked="true"/>
+ <RadioButton
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dip"
+ android:id="@+id/network_first"
+ android:textSize="18dip"
+ android:text="@string/network_first"/>
+ </RadioGroup>
</LinearLayout>
<View
android:layout_width="fill_parent"
diff --git a/client/Piztor/res/layout/subscribe_settings.xml b/client/Piztor/res/layout/subscribe_settings.xml
index a90837c..92b905b 100644
--- a/client/Piztor/res/layout/subscribe_settings.xml
+++ b/client/Piztor/res/layout/subscribe_settings.xml
@@ -3,15 +3,17 @@
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
- >
+ android:layout_marginTop="10dip">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView1"
android:text="TextView"
+ android:textSize="20dip"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
- android:layout_marginBottom="10dp"/>
+ android:layout_marginBottom="10dip"
+ android:layout_marginLeft="10dip"/>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
diff --git a/client/Piztor/res/values/strings.xml b/client/Piztor/res/values/strings.xml
index 25e980a..8fe47a3 100644
--- a/client/Piztor/res/values/strings.xml
+++ b/client/Piztor/res/values/strings.xml
@@ -6,9 +6,9 @@
<string name="hello_world">Hello world!</string>
<string name="settings">设置</string>
<string name="search">搜索</string>
- <string name="fetch">上传</string>
+ <string name="fetch">更新</string>
<string name="checkin">签到</string>
- <string name="focus">聚焦</string>
+ <string name="focus">定位</string>
<string name="show_sex">按性别</string>
<string name="male">Male</string>
<string name="female">Female</string>
@@ -34,11 +34,14 @@
<string name="company">连队</string>
<string name="section">班级</string>
<string name="add">添加</string>
- <string name="GPSrefreshrate">GPS刷新率 每</string>
+ <string name="GPSrefreshrate">定位刷新率 每</string>
<string name="old_password">旧密码</string>
<string name="new_password">新密码</string>
<string name="submit">提交</string>
<string name="colormode">着色方式</string>
<string name="save">保存</string>
+ <string name="locatemode">定位方式</string>
+ <string name="gps_first">GPS优先</string>
+ <string name="network_first">网络优先</string>
</resources>
diff --git a/client/Piztor/src/com/macaroon/piztor/AlertMaker.java b/client/Piztor/src/com/macaroon/piztor/AlertMaker.java
index 16e15db..0ee1bd9 100644
--- a/client/Piztor/src/com/macaroon/piztor/AlertMaker.java
+++ b/client/Piztor/src/com/macaroon/piztor/AlertMaker.java
@@ -84,6 +84,7 @@ public class AlertMaker {
gpsDialog.setNegativeButton("不使用GPS",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
+ Main.locateMode = LocationClientOption.NetWorkFirst;
dialog.cancel();
}
});
diff --git a/client/Piztor/src/com/macaroon/piztor/Login.java b/client/Piztor/src/com/macaroon/piztor/Login.java
index 22c8c91..a359c6a 100644
--- a/client/Piztor/src/com/macaroon/piztor/Login.java
+++ b/client/Piztor/src/com/macaroon/piztor/Login.java
@@ -9,8 +9,10 @@ import android.view.KeyEvent;
import android.view.Menu;
import android.view.View;
import android.view.Window;
+import android.view.animation.AlphaAnimation;
import android.widget.Button;
import android.widget.EditText;
+import android.widget.ImageView;
import android.widget.Toast;
public class Login extends PiztorAct {
@@ -87,11 +89,13 @@ public class Login extends PiztorAct {
protected void onCreate(Bundle savedInstanceState) {
id = "login";
super.onCreate(savedInstanceState);
- requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
- requestWindowFeature(Window.FEATURE_PROGRESS);
setContentView(R.layout.activity_login);
- setProgressBarIndeterminateVisibility(true);
- setProgressBarVisibility(true);
+ ImageView imageView = (ImageView) findViewById(R.id.login_img);
+ AlphaAnimation alphaUp = new AlphaAnimation(0.0f, 1.0f);
+ alphaUp.setDuration(2000);
+ alphaUp.setStartOffset(500);
+ alphaUp.setFillAfter(true);
+ imageView.startAnimation(alphaUp);
}
@Override
diff --git a/client/Piztor/src/com/macaroon/piztor/Main.java b/client/Piztor/src/com/macaroon/piztor/Main.java
index 98b08a0..c6eb747 100644
--- a/client/Piztor/src/com/macaroon/piztor/Main.java
+++ b/client/Piztor/src/com/macaroon/piztor/Main.java
@@ -36,7 +36,7 @@ public class Main extends PiztorAct {
final static int FailedFetch = 5;
final static int mapViewtouched = 7;
- MapMaker mapMaker = null;
+ static MapMaker mapMaker = null;
MapView mMapView;
AlertMaker alertMaker;
GeoPoint markerPoint = null;
@@ -44,11 +44,12 @@ public class Main extends PiztorAct {
public static int colorMode = 1;
public static int show_by_team = 1;
public static int show_by_sex = 2;
+ public static int locateMode = LocationClientOption.GpsFirst;
/**
* Locating component
*/
- LocationManager locationManager;
+ static LocationManager locationManager;
boolean isGPSEnabled;
LocationClient mLocClient;
LocationData locData = null;
@@ -249,7 +250,7 @@ public class Main extends PiztorAct {
LocationClientOption option = new LocationClientOption();
option.setOpenGps(true);
option.setCoorType("bd09ll");
- option.setPriority(LocationClientOption.GpsFirst);
+ option.setPriority(locateMode);
option.setScanSpan(GPSrefreshrate * 1000);
mLocClient.setLocOption(option);
}
@@ -380,7 +381,7 @@ public class Main extends PiztorAct {
mLocClient.registerLocationListener(myListener);
LocationClientOption option = new LocationClientOption();
option.setOpenGps(true);
- option.setPriority(LocationClientOption.GpsFirst);
+ option.setPriority(locateMode);
option.setCoorType("bd09ll");
option.setScanSpan(GPSrefreshrate * 1000);
mLocClient.setLocOption(option);
diff --git a/client/Piztor/src/com/macaroon/piztor/Settings.java b/client/Piztor/src/com/macaroon/piztor/Settings.java
index 276d4f6..e3a098c 100644
--- a/client/Piztor/src/com/macaroon/piztor/Settings.java
+++ b/client/Piztor/src/com/macaroon/piztor/Settings.java
@@ -3,6 +3,7 @@ package com.macaroon.piztor;
import java.lang.ref.WeakReference;
import java.util.Vector;
+import com.baidu.location.LocationClientOption;
import com.baidu.platform.comapi.basestruct.GeoPoint;
import android.annotation.SuppressLint;
@@ -28,8 +29,10 @@ public class Settings extends PiztorAct {
MapInfo mapInfo;
Transam transam;
private int currentRate;
- OnCheckedChangeListener radioButtonListener = null;
- RadioGroup radioGroup;
+ OnCheckedChangeListener colorButtonListener = null;
+ OnCheckedChangeListener locateButtonListener = null;
+ static RadioGroup colorRadioGroup;
+ static RadioGroup locateRadioGroup;
// Event
final static int logoutButtonPressed = 10;
@@ -183,10 +186,10 @@ public class Settings extends PiztorAct {
actMgr.add(start, logoutButtonPressed, logout);
actMgr.add(logout, logoutFailed, start);
setContentView(R.layout.activity_settings);
- radioGroup = (RadioGroup)this.findViewById(R.id.radioGroup);
- if (Main.colorMode == Main.show_by_sex) radioGroup.check(R.id.show_by_sex);
- else radioGroup.check(R.id.show_by_team);
- radioButtonListener = new OnCheckedChangeListener() {
+ colorRadioGroup = (RadioGroup)this.findViewById(R.id.colorRadioGroup);
+ if (Main.colorMode == Main.show_by_sex) colorRadioGroup.check(R.id.show_by_sex);
+ else colorRadioGroup.check(R.id.show_by_team);
+ colorButtonListener = new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
@@ -199,8 +202,35 @@ public class Settings extends PiztorAct {
}
}
};
- radioGroup.setOnCheckedChangeListener(radioButtonListener);
-
+ colorRadioGroup.setOnCheckedChangeListener(colorButtonListener);
+
+ locateRadioGroup = (RadioGroup)this.findViewById(R.id.locateRadioGroup);
+ if (Main.locateMode == LocationClientOption.GpsFirst) locateRadioGroup.check(R.id.gps_first);
+ else locateRadioGroup.check(R.id.network_first);
+ locateButtonListener = new OnCheckedChangeListener() {
+
+ @Override
+ public void onCheckedChanged(RadioGroup group, int checkedId) {
+ if (checkedId == R.id.gps_first){
+ boolean isGPSEnabled = Main.locationManager
+ .isProviderEnabled(Main.locationManager.GPS_PROVIDER);
+ if (isGPSEnabled)
+ Main.locateMode = LocationClientOption.GpsFirst;
+ else {
+ AlertMaker alertMaker = new AlertMaker(Settings.this, Main.mapMaker);
+ alertMaker.showSettingsAlert();
+ isGPSEnabled = Main.locationManager
+ .isProviderEnabled(Main.locationManager.GPS_PROVIDER);
+ if (! isGPSEnabled) group.check(R.id.network_first);
+ }
+ }
+ if (checkedId == R.id.network_first){
+ Main.locateMode = LocationClientOption.NetWorkFirst;
+ }
+ }
+ };
+ locateRadioGroup.setOnCheckedChangeListener(locateButtonListener);
+
}
@Override
diff --git a/client/Piztor/src/com/macaroon/piztor/SubscribeSettings.java b/client/Piztor/src/com/macaroon/piztor/SubscribeSettings.java
index ed019dc..d895203 100644
--- a/client/Piztor/src/com/macaroon/piztor/SubscribeSettings.java
+++ b/client/Piztor/src/com/macaroon/piztor/SubscribeSettings.java
@@ -101,7 +101,7 @@ public class SubscribeSettings extends PiztorAct {
EException eException = (EException) m.obj;
/////////////////TODO
if (eException.Etype == EException.ESubscribeFailedException) {
- out.receiveMessage("关注信息无效");
+ out.receiveMessage("关注信息无效,可能暂无此连队或班级信息");
for (RGroup i : out.listGroup) {
Log.d("sub", i.company + " " + i.section);
}