summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/Piztor/res/layout/subscribe_settings.xml4
-rw-r--r--client/Piztor/src/com/macaroon/piztor/Main.java7
-rw-r--r--client/Piztor/src/com/macaroon/piztor/Transam.java4
3 files changed, 8 insertions, 7 deletions
diff --git a/client/Piztor/res/layout/subscribe_settings.xml b/client/Piztor/res/layout/subscribe_settings.xml
index 1bfd975..a90837c 100644
--- a/client/Piztor/res/layout/subscribe_settings.xml
+++ b/client/Piztor/res/layout/subscribe_settings.xml
@@ -19,7 +19,7 @@
android:gravity="center"
android:orientation="horizontal">
<EditText
- android:layout_width="120dip"
+ android:layout_width="80dip"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="10dip"
@@ -28,7 +28,7 @@
android:phoneNumber="true"
android:id="@+id/subscribe_company"/>
<EditText
- android:layout_width="120dip"
+ android:layout_width="80dip"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:layout_toRightOf="@+id/subscribe_company"
diff --git a/client/Piztor/src/com/macaroon/piztor/Main.java b/client/Piztor/src/com/macaroon/piztor/Main.java
index 97d2f7b..5951db1 100644
--- a/client/Piztor/src/com/macaroon/piztor/Main.java
+++ b/client/Piztor/src/com/macaroon/piztor/Main.java
@@ -55,7 +55,7 @@ public class Main extends PiztorAct {
public MyLocationListener myListener = new MyLocationListener();
boolean isFirstLocation = true;
public static int GPSrefreshrate = 20;
- private final int checkinRadius = 10;
+ private final double checkinRadius = 10.0;
ImageButton btnCheckin, btnFetch, btnFocus, btnSettings;
@@ -334,11 +334,11 @@ public class Main extends PiztorAct {
(int) (locData.longitude * 1E6));
double disFromMarker = DistanceUtil.getDistance(curPoint,
mapMaker.getMakerLocation());
- if (disFromMarker < locData.accuracy) {
+ if (disFromMarker < Math.max(Math.min(locData.accuracy, 20.0), (float)checkinRadius) ) {
alertMaker.showCheckinAlter();
} else {
Toast toast = Toast.makeText(Main.this,
- "请靠近路标", 2000);
+ String.format("请靠近路标,现在距离%.2f米", disFromMarker), 2000);
toast.setGravity(Gravity.TOP, 0, 80);
toast.show();
}
@@ -376,6 +376,7 @@ public class Main extends PiztorAct {
mLocClient.registerLocationListener(myListener);
LocationClientOption option = new LocationClientOption();
option.setOpenGps(true);
+ option.setPriority(LocationClientOption.GpsFirst);
option.setCoorType("bd09ll");
option.setScanSpan(GPSrefreshrate * 1000);
mLocClient.setLocOption(option);
diff --git a/client/Piztor/src/com/macaroon/piztor/Transam.java b/client/Piztor/src/com/macaroon/piztor/Transam.java
index 6660899..df2194f 100644
--- a/client/Piztor/src/com/macaroon/piztor/Transam.java
+++ b/client/Piztor/src/com/macaroon/piztor/Transam.java
@@ -55,10 +55,10 @@ public class Transam implements Runnable {
Timer pushtimer;
boolean running = false;
boolean pushing = false;
- int cnt = 5; //retry times
+ int cnt = 3; //retry times
int tcnt; //current remain retry times
int rcnt; //current remain retry times (push)
- int retime = 5000; //timeout time
+ int retime = 10000; //timeout time
Req req;
int p; //port
String i; //ip