From 2803cc88dba0fd04a600456a81a7d7ec6dafd41c Mon Sep 17 00:00:00 2001 From: sjtufs Date: Mon, 2 Sep 2013 14:16:22 +0800 Subject: fix #44 and update beta version --- .../res/drawable/footbar_btn_focus_style.xml | 4 +- client/Piztor/res/drawable/footbar_fetch.png | Bin 742 -> 3093 bytes client/Piztor/res/drawable/footbar_focus.png | Bin 0 -> 1601 bytes client/Piztor/res/drawable/footbar_focus_1.png | Bin 0 -> 486 bytes client/Piztor/res/layout/activity_login.xml | 3 +- client/Piztor/res/layout/activity_settings.xml | 96 +++++++++++++++------ client/Piztor/res/layout/subscribe_settings.xml | 6 +- client/Piztor/res/values/strings.xml | 9 +- .../Piztor/src/com/macaroon/piztor/AlertMaker.java | 1 + client/Piztor/src/com/macaroon/piztor/Login.java | 12 ++- client/Piztor/src/com/macaroon/piztor/Main.java | 9 +- .../Piztor/src/com/macaroon/piztor/Settings.java | 46 ++++++++-- .../src/com/macaroon/piztor/SubscribeSettings.java | 2 +- 13 files changed, 136 insertions(+), 52 deletions(-) create mode 100644 client/Piztor/res/drawable/footbar_focus.png create mode 100644 client/Piztor/res/drawable/footbar_focus_1.png 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 @@ - - + + diff --git a/client/Piztor/res/drawable/footbar_fetch.png b/client/Piztor/res/drawable/footbar_fetch.png index 71d1a20..b21b50f 100644 Binary files a/client/Piztor/res/drawable/footbar_fetch.png and b/client/Piztor/res/drawable/footbar_fetch.png 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 Binary files /dev/null and b/client/Piztor/res/drawable/footbar_focus.png 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 Binary files /dev/null and b/client/Piztor/res/drawable/footbar_focus_1.png 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"> + - - + + + + + + + - - - + android:layout_gravity="center" + android:gravity="center"> + + + + + + android:layout_marginTop="10dip"> + android:layout_marginBottom="10dip" + android:layout_marginLeft="10dip"/> Hello world! 设置 搜索 - 上传 + 更新 签到 - 聚焦 + 定位 按性别 Male Female @@ -34,11 +34,14 @@ 连队 班级 添加 - GPS刷新率 每 + 定位刷新率 每 旧密码 新密码 提交 着色方式 保存 + 定位方式 + GPS优先 + 网络优先 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); } -- cgit v1.2.3-70-g09d2