|
@@ -126,7 +126,7 @@ public class SigninFragment extends EasyFragment implements View.OnClickListener
|
|
|
companyY = Double.parseDouble(jsonObject.containsKey("latitude") ? (StringUtils.isEmpty(jsonObject.getString("latitude")) ? "0" : jsonObject.getString("latitude")) : "0");
|
|
companyY = Double.parseDouble(jsonObject.containsKey("latitude") ? (StringUtils.isEmpty(jsonObject.getString("latitude")) ? "0" : jsonObject.getString("latitude")) : "0");
|
|
|
CommonUtil.setSharedPreferences(ct, "companyX", (float) companyX);
|
|
CommonUtil.setSharedPreferences(ct, "companyX", (float) companyX);
|
|
|
CommonUtil.setSharedPreferences(ct, "companyY", (float) companyY);
|
|
CommonUtil.setSharedPreferences(ct, "companyY", (float) companyY);
|
|
|
- CommonUtil.setSharedPreferences(ct, "distance", companyDistance);
|
|
|
|
|
|
|
+ CommonUtil.setSharedPreferences(ct, "distance", companyDistance);
|
|
|
unoffice_mm.setText(setDistance());
|
|
unoffice_mm.setText(setDistance());
|
|
|
}
|
|
}
|
|
|
if (jsonObject.getBoolean("success")) {
|
|
if (jsonObject.getBoolean("success")) {
|
|
@@ -230,7 +230,7 @@ public class SigninFragment extends EasyFragment implements View.OnClickListener
|
|
|
default:
|
|
default:
|
|
|
JsonValidator validator = new JsonValidator();
|
|
JsonValidator validator = new JsonValidator();
|
|
|
if (validator.validate(message)) {
|
|
if (validator.validate(message)) {
|
|
|
- ViewUtil.ToastMessage(ct,message,Style.holoRedLight,3000);
|
|
|
|
|
|
|
+ ViewUtil.ToastMessage(ct, message, Style.holoRedLight, 3000);
|
|
|
}
|
|
}
|
|
|
if (loginNum < 3 && StringUtils.isInclude(message, getResources().getString(R.string.session_out)) || StringUtils.isInclude(message, "程序错误")) {
|
|
if (loginNum < 3 && StringUtils.isInclude(message, getResources().getString(R.string.session_out)) || StringUtils.isInclude(message, "程序错误")) {
|
|
|
returnLogin();
|
|
returnLogin();
|
|
@@ -280,7 +280,7 @@ public class SigninFragment extends EasyFragment implements View.OnClickListener
|
|
|
if (poi == null) return;
|
|
if (poi == null) return;
|
|
|
loaction = poi.name == null ? "" : poi.name;
|
|
loaction = poi.name == null ? "" : poi.name;
|
|
|
addr = poi.address == null ? "" : poi.address;
|
|
addr = poi.address == null ? "" : poi.address;
|
|
|
- office_addr.setText(Html.fromHtml("<font color=\'#575757\'>当前位置 " + "</font><font color=\'#000000\'>" + addr + "</font>"));
|
|
|
|
|
|
|
+ office_addr.setText(addr);
|
|
|
latitude = poi.location.latitude;
|
|
latitude = poi.location.latitude;
|
|
|
longitude = poi.location.longitude;
|
|
longitude = poi.location.longitude;
|
|
|
unoffice_mm.setText(setDistance());
|
|
unoffice_mm.setText(setDistance());
|
|
@@ -306,7 +306,7 @@ public class SigninFragment extends EasyFragment implements View.OnClickListener
|
|
|
case R.id.signin_btn:
|
|
case R.id.signin_btn:
|
|
|
if (isPlay()) {
|
|
if (isPlay()) {
|
|
|
if (!CommonUtil.isNetWorkConnected(ct)) {
|
|
if (!CommonUtil.isNetWorkConnected(ct)) {
|
|
|
- Crouton.makeText(ct, "当前网络不可用,请检查网络连接",Style.holoRedLight,2000);
|
|
|
|
|
|
|
+ Crouton.makeText(ct, "当前网络不可用,请检查网络连接", Style.holoRedLight, 2000);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
//TODO 上传文件
|
|
//TODO 上传文件
|
|
@@ -330,7 +330,7 @@ public class SigninFragment extends EasyFragment implements View.OnClickListener
|
|
|
case R.id.title:
|
|
case R.id.title:
|
|
|
showDateDialog();
|
|
showDateDialog();
|
|
|
break;
|
|
break;
|
|
|
- case R.id.unoffice_mm:
|
|
|
|
|
|
|
+ case R.id.unoffice_:
|
|
|
intent = new Intent(ct, LocationMapActivity.class);
|
|
intent = new Intent(ct, LocationMapActivity.class);
|
|
|
intent.putExtra("action", "SigninFragment");
|
|
intent.putExtra("action", "SigninFragment");
|
|
|
//已选择此时定位到的地点传递
|
|
//已选择此时定位到的地点传递
|
|
@@ -338,7 +338,7 @@ public class SigninFragment extends EasyFragment implements View.OnClickListener
|
|
|
startActivityForResult(intent, 0x14);
|
|
startActivityForResult(intent, 0x14);
|
|
|
break;
|
|
break;
|
|
|
default:
|
|
default:
|
|
|
- Crouton.makeText(ct, "系统没有找到你的排班信息,请联系管理员处理",Style.holoRedLight,2000);
|
|
|
|
|
|
|
+ Crouton.makeText(ct, "系统没有找到你的排班信息,请联系管理员处理", Style.holoRedLight, 2000);
|
|
|
ct.finish();
|
|
ct.finish();
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
@@ -379,7 +379,7 @@ public class SigninFragment extends EasyFragment implements View.OnClickListener
|
|
|
back.setOnClickListener(this);
|
|
back.setOnClickListener(this);
|
|
|
signin_btn.setOnClickListener(this);
|
|
signin_btn.setOnClickListener(this);
|
|
|
title.setOnClickListener(this);
|
|
title.setOnClickListener(this);
|
|
|
- unoffice_mm.setOnClickListener(this);
|
|
|
|
|
|
|
+ findViewById(R.id.unoffice_).setOnClickListener(this);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void init() {
|
|
private void init() {
|
|
@@ -406,7 +406,7 @@ public class SigninFragment extends EasyFragment implements View.OnClickListener
|
|
|
setBaiduLocation();
|
|
setBaiduLocation();
|
|
|
} else {
|
|
} else {
|
|
|
if (resultCode == 62) {
|
|
if (resultCode == 62) {
|
|
|
- Crouton.makeText(ct, "定位失败,请查看是否开启定位权限", Style.holoRedLight,2000);
|
|
|
|
|
|
|
+ Crouton.makeText(ct, "定位失败,请查看是否开启定位权限", Style.holoRedLight, 2000);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -436,7 +436,7 @@ public class SigninFragment extends EasyFragment implements View.OnClickListener
|
|
|
loaction = MyApplication.getInstance().getBdLocationHelper().getName();
|
|
loaction = MyApplication.getInstance().getBdLocationHelper().getName();
|
|
|
addr = MyApplication.getInstance().getBdLocationHelper().getAddress();
|
|
addr = MyApplication.getInstance().getBdLocationHelper().getAddress();
|
|
|
unoffice_mm.setText(setDistance());
|
|
unoffice_mm.setText(setDistance());
|
|
|
- office_addr.setText(Html.fromHtml("<font color=\'#575757\'>当前位置 " + "</font><font color=\'#000000\'>" + addr + "</font>"));
|
|
|
|
|
|
|
+ office_addr.setText(addr);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void initView() {
|
|
private void initView() {
|
|
@@ -444,7 +444,7 @@ public class SigninFragment extends EasyFragment implements View.OnClickListener
|
|
|
listview.setLayoutManager(new LinearLayoutManager(ct));
|
|
listview.setLayoutManager(new LinearLayoutManager(ct));
|
|
|
adapter = new SigninAdapter(ct);
|
|
adapter = new SigninAdapter(ct);
|
|
|
listview.setAdapter(adapter);
|
|
listview.setAdapter(adapter);
|
|
|
- office_addr.setText(Html.fromHtml("<font color=\'#575757\'>当前位置 " + "</font><font color=\'#000000\'>" + addr + "</font>"));
|
|
|
|
|
|
|
+ office_addr.setText(addr);
|
|
|
loadNetData(System.currentTimeMillis());//获取打卡班次信息
|
|
loadNetData(System.currentTimeMillis());//获取打卡班次信息
|
|
|
getMacByNet();
|
|
getMacByNet();
|
|
|
//判断是否有定位权限
|
|
//判断是否有定位权限
|
|
@@ -573,7 +573,7 @@ public class SigninFragment extends EasyFragment implements View.OnClickListener
|
|
|
try {
|
|
try {
|
|
|
if (!StringUtils.isEmpty(dis)) {
|
|
if (!StringUtils.isEmpty(dis)) {
|
|
|
distance = (int) Double.parseDouble(dis);
|
|
distance = (int) Double.parseDouble(dis);
|
|
|
- re = Html.fromHtml("<font color=\'#575757\'>距离考勤地点" + (distance == -1 ? -1 : distance) + "米     " + "</font><font color=\'#000000\'><U>地点微调</U></font>");
|
|
|
|
|
|
|
+ re = Html.fromHtml("<font color=\'#575757\'>约" + (distance == -1 ? -1 : distance) + "米     " + "</font><font color=\'#000000\'></font>");
|
|
|
}
|
|
}
|
|
|
} catch (ClassCastException e) {
|
|
} catch (ClassCastException e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|