|
@@ -1,9 +1,11 @@
|
|
package com.zhilin.patrol.ui.fragment;
|
|
package com.zhilin.patrol.ui.fragment;
|
|
|
|
|
|
import android.Manifest;
|
|
import android.Manifest;
|
|
|
|
+import android.annotation.SuppressLint;
|
|
import android.annotation.TargetApi;
|
|
import android.annotation.TargetApi;
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
import android.content.pm.PackageManager;
|
|
import android.content.pm.PackageManager;
|
|
|
|
+import android.graphics.Color;
|
|
import android.os.Build;
|
|
import android.os.Build;
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
import android.os.Environment;
|
|
import android.os.Environment;
|
|
@@ -21,16 +23,22 @@ import android.widget.EditText;
|
|
import android.widget.LinearLayout;
|
|
import android.widget.LinearLayout;
|
|
import android.widget.TextView;
|
|
import android.widget.TextView;
|
|
|
|
|
|
|
|
+import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
|
|
|
+import com.bigkoo.pickerview.listener.OnOptionsSelectListener;
|
|
|
|
+import com.bigkoo.pickerview.view.OptionsPickerView;
|
|
|
|
+import com.google.gson.Gson;
|
|
import com.zhilin.patrol.R;
|
|
import com.zhilin.patrol.R;
|
|
import com.zhilin.patrol.bean.AddressAreaEntity;
|
|
import com.zhilin.patrol.bean.AddressAreaEntity;
|
|
import com.zhilin.patrol.bean.LoginEntity;
|
|
import com.zhilin.patrol.bean.LoginEntity;
|
|
import com.zhilin.patrol.bean.MapLocationInfo;
|
|
import com.zhilin.patrol.bean.MapLocationInfo;
|
|
import com.zhilin.patrol.bean.PatrolFormEntity;
|
|
import com.zhilin.patrol.bean.PatrolFormEntity;
|
|
import com.zhilin.patrol.bean.PointFormEntity;
|
|
import com.zhilin.patrol.bean.PointFormEntity;
|
|
|
|
+import com.zhilin.patrol.bean.PointInfoEntity;
|
|
import com.zhilin.patrol.bean.QuestionKindEntity;
|
|
import com.zhilin.patrol.bean.QuestionKindEntity;
|
|
import com.zhilin.patrol.http.HttpUrl;
|
|
import com.zhilin.patrol.http.HttpUrl;
|
|
import com.zhilin.patrol.tool.CheckPermissionUtils;
|
|
import com.zhilin.patrol.tool.CheckPermissionUtils;
|
|
import com.zhilin.patrol.tool.DialogUtil;
|
|
import com.zhilin.patrol.tool.DialogUtil;
|
|
|
|
+import com.zhilin.patrol.tool.GetJsonDataUtil;
|
|
import com.zhilin.patrol.tool.IpUtils;
|
|
import com.zhilin.patrol.tool.IpUtils;
|
|
import com.zhilin.patrol.tool.JsonUtils;
|
|
import com.zhilin.patrol.tool.JsonUtils;
|
|
import com.zhilin.patrol.tool.LocationUtils;
|
|
import com.zhilin.patrol.tool.LocationUtils;
|
|
@@ -44,6 +52,8 @@ import com.zhilin.patrol.views.CustomProgressDialog;
|
|
import com.zhy.http.okhttp.OkHttpUtils;
|
|
import com.zhy.http.okhttp.OkHttpUtils;
|
|
import com.zhy.http.okhttp.callback.Callback;
|
|
import com.zhy.http.okhttp.callback.Callback;
|
|
|
|
|
|
|
|
+import org.json.JSONArray;
|
|
|
|
+
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
@@ -63,17 +73,21 @@ public class PointRecordFragment extends Fragment {
|
|
@BindView(R.id.et_content)
|
|
@BindView(R.id.et_content)
|
|
EditText mRemarkEt;//备注
|
|
EditText mRemarkEt;//备注
|
|
@BindView(R.id.et_district)
|
|
@BindView(R.id.et_district)
|
|
- EditText mDistrictEt;
|
|
|
|
|
|
+ TextView mDistrictEt;
|
|
@BindView(R.id.et_stree)
|
|
@BindView(R.id.et_stree)
|
|
- EditText mStreeEt;
|
|
|
|
|
|
+ TextView mStreeEt;
|
|
@BindView(R.id.tv_default_community)
|
|
@BindView(R.id.tv_default_community)
|
|
TextView mDefCommTv;
|
|
TextView mDefCommTv;
|
|
@BindView(R.id.tv_actual_point)
|
|
@BindView(R.id.tv_actual_point)
|
|
TextView mActualTv;
|
|
TextView mActualTv;
|
|
@BindView(R.id.et_shequ)
|
|
@BindView(R.id.et_shequ)
|
|
- EditText mShequEt;
|
|
|
|
|
|
+ TextView mShequEt;
|
|
@BindView(R.id.et_community)
|
|
@BindView(R.id.et_community)
|
|
EditText mCummEt;
|
|
EditText mCummEt;
|
|
|
|
+ @BindView(R.id.et_area)
|
|
|
|
+ EditText mAreaEt;
|
|
|
|
+ @BindView(R.id.ll_area)
|
|
|
|
+ LinearLayout llAreaEt;
|
|
@BindView(R.id.tv_default_address)
|
|
@BindView(R.id.tv_default_address)
|
|
TextView mAddressTv;
|
|
TextView mAddressTv;
|
|
@BindView(R.id.tv_content_num)
|
|
@BindView(R.id.tv_content_num)
|
|
@@ -94,6 +108,10 @@ public class PointRecordFragment extends Fragment {
|
|
/** 附近小区集合 */
|
|
/** 附近小区集合 */
|
|
private ArrayList mAddressAreaList;
|
|
private ArrayList mAddressAreaList;
|
|
private LocationUtils mLocationUtils;
|
|
private LocationUtils mLocationUtils;
|
|
|
|
+ private List<PointInfoEntity.InfoListBean> infoList;
|
|
|
|
+ private List<String> options1Items=new ArrayList<>(); //区
|
|
|
|
+ private ArrayList<ArrayList<String>> options2Items = new ArrayList<>();//街道
|
|
|
|
+ private ArrayList<ArrayList<ArrayList<String>>> options3Items = new ArrayList<>();//社区
|
|
private CustomProgressDialog mProgressDialog;
|
|
private CustomProgressDialog mProgressDialog;
|
|
/** 选中的小区 */
|
|
/** 选中的小区 */
|
|
private AddressAreaEntity.InfoListBean mListBean;
|
|
private AddressAreaEntity.InfoListBean mListBean;
|
|
@@ -105,8 +123,11 @@ public class PointRecordFragment extends Fragment {
|
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
super.onCreate(savedInstanceState);
|
|
Bundle arguments = getArguments();
|
|
Bundle arguments = getArguments();
|
|
|
|
+
|
|
mType = arguments.getInt(TYPE);
|
|
mType = arguments.getInt(TYPE);
|
|
Log.i("111","aaarrra"+mType);
|
|
Log.i("111","aaarrra"+mType);
|
|
|
|
+ initData();
|
|
|
|
+// requestInfo();
|
|
}
|
|
}
|
|
@Nullable
|
|
@Nullable
|
|
@Override
|
|
@Override
|
|
@@ -255,7 +276,6 @@ public class PointRecordFragment extends Fragment {
|
|
// mDefCommTv.setText(addressdefault);
|
|
// mDefCommTv.setText(addressdefault);
|
|
init();
|
|
init();
|
|
}else{
|
|
}else{
|
|
-
|
|
|
|
Log.i(TAG,"默认小区地址");
|
|
Log.i(TAG,"默认小区地址");
|
|
mDefCommTv.setText(addressdefault+" "+mindDistancenumber+"m");
|
|
mDefCommTv.setText(addressdefault+" "+mindDistancenumber+"m");
|
|
mAddressTv.setText(mListBean.toStingTv());
|
|
mAddressTv.setText(mListBean.toStingTv());
|
|
@@ -263,7 +283,7 @@ public class PointRecordFragment extends Fragment {
|
|
mAddressTv.setVisibility(View.VISIBLE);
|
|
mAddressTv.setVisibility(View.VISIBLE);
|
|
}
|
|
}
|
|
mShequEt.setText(mListBean.getArea());
|
|
mShequEt.setText(mListBean.getArea());
|
|
- mDistrictEt.setText(mListBean.getDisName());
|
|
|
|
|
|
+ mDistrictEt.setText(mListBean.getDisName()+"/"+mListBean.getStreet()+"/"+mListBean.getArea());
|
|
mStreeEt.setText(mListBean.getStreet());
|
|
mStreeEt.setText(mListBean.getStreet());
|
|
// mCummEt.setText(mListBean.getAddress());
|
|
// mCummEt.setText(mListBean.getAddress());
|
|
init();
|
|
init();
|
|
@@ -373,7 +393,7 @@ public class PointRecordFragment extends Fragment {
|
|
mAddressTv.setVisibility(View.VISIBLE);
|
|
mAddressTv.setVisibility(View.VISIBLE);
|
|
}
|
|
}
|
|
mShequEt.setText(mListBean.getArea());
|
|
mShequEt.setText(mListBean.getArea());
|
|
- mDistrictEt.setText(mListBean.getDisName());
|
|
|
|
|
|
+ mDistrictEt.setText(mListBean.getDisName()+"/"+mListBean.getStreet()+"/"+mListBean.getArea());
|
|
mStreeEt.setText(mListBean.getStreet());
|
|
mStreeEt.setText(mListBean.getStreet());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -405,60 +425,75 @@ public class PointRecordFragment extends Fragment {
|
|
Log.i("111","aaaa"+mMapLocationInfo.toStringTv());
|
|
Log.i("111","aaaa"+mMapLocationInfo.toStringTv());
|
|
mProgressDialog.dismiss();
|
|
mProgressDialog.dismiss();
|
|
|
|
|
|
- mDistrictEt.setText(mMapLocationInfo.getDistrict());
|
|
|
|
- mStreeEt.setText(mMapLocationInfo.getStreet());
|
|
|
|
|
|
+// mDistrictEt.setText(mMapLocationInfo.getDistrict()+"/"+mMapLocationInfo.getStreet());
|
|
|
|
+// mStreeEt.setText(mMapLocationInfo.getStreet());
|
|
}
|
|
}
|
|
else if(mType==2){
|
|
else if(mType==2){
|
|
mPointLayout.setVisibility(View.GONE);
|
|
mPointLayout.setVisibility(View.GONE);
|
|
mActualTv.setText("新增点位信息:");
|
|
mActualTv.setText("新增点位信息:");
|
|
Log.i("111","aaaa"+mMapLocationInfo.toStringTv());
|
|
Log.i("111","aaaa"+mMapLocationInfo.toStringTv());
|
|
mProgressDialog.dismiss();
|
|
mProgressDialog.dismiss();
|
|
- mDistrictEt.setText(mMapLocationInfo.getDistrict());
|
|
|
|
- mStreeEt.setText(mMapLocationInfo.getStreet());
|
|
|
|
|
|
+// mDistrictEt.setText(mMapLocationInfo.getDistrict()+"/"+mMapLocationInfo.getStreet());
|
|
|
|
+// mStreeEt.setText(mMapLocationInfo.getStreet());
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
- @OnClick({R.id.tv_default_community,R.id.btn_submit})
|
|
|
|
|
|
+ @SuppressLint("WrongConstant")
|
|
|
|
+ @OnClick({R.id.tv_default_community,R.id.btn_submit,R.id.et_district})//R.id.et_stree,R.id.et_shequ
|
|
public void onClick(View view) {
|
|
public void onClick(View view) {
|
|
if (view.getId() == R.id.tv_default_community) {//选择小区
|
|
if (view.getId() == R.id.tv_default_community) {//选择小区
|
|
Log.i("1","1");
|
|
Log.i("1","1");
|
|
toAddressSelect();
|
|
toAddressSelect();
|
|
}
|
|
}
|
|
|
|
+ if(view.getId() ==R.id.et_district){//||view.getId() ==R.id.et_stree||view.getId() ==R.id.et_shequ
|
|
|
|
+ showPickerView();
|
|
|
|
+ }
|
|
if (view.getId() == R.id.btn_submit) {//提交
|
|
if (view.getId() == R.id.btn_submit) {//提交
|
|
String cummEt = mCummEt.getText().toString().trim();
|
|
String cummEt = mCummEt.getText().toString().trim();
|
|
- String shequEt=mShequEt.getText().toString().trim();
|
|
|
|
- String streetEt=mStreeEt.getText().toString().trim();
|
|
|
|
|
|
+// String shequEt=mShequEt.getText().toString().trim();
|
|
|
|
+// String streetEt=mStreeEt.getText().toString().trim();
|
|
String districtEt=mDistrictEt.getText().toString().trim();
|
|
String districtEt=mDistrictEt.getText().toString().trim();
|
|
|
|
+ String areaEt=mAreaEt.getText().toString().trim();
|
|
if (TextUtils.isEmpty(districtEt)) {
|
|
if (TextUtils.isEmpty(districtEt)) {
|
|
- Utils.showToast(getActivity(), "请输入区名");
|
|
|
|
|
|
+ Utils.showToast(getActivity(), "请选择区/街道/社区");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- if (TextUtils.isEmpty(streetEt)) {
|
|
|
|
- Utils.showToast(getActivity(), "请输入街道名");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- if (TextUtils.isEmpty(shequEt)) {
|
|
|
|
- Utils.showToast(getActivity(), "请输入社区名");
|
|
|
|
- return;
|
|
|
|
|
|
+// if (TextUtils.isEmpty(shequEt)) {
|
|
|
|
+// Utils.showToast(getActivity(), "请输入社区名");
|
|
|
|
+// return;
|
|
|
|
+// }
|
|
|
|
+ if(llAreaEt.getVisibility()!=8){//选了其他社区
|
|
|
|
+ if (TextUtils.isEmpty(areaEt)) {
|
|
|
|
+ Utils.showToast(getActivity(), "请输入社区名");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if (TextUtils.isEmpty(cummEt)) {
|
|
if (TextUtils.isEmpty(cummEt)) {
|
|
Utils.showToast(getActivity(), "请输入小区名");
|
|
Utils.showToast(getActivity(), "请输入小区名");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+
|
|
postPoint();
|
|
postPoint();
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
private void postPoint(){
|
|
private void postPoint(){
|
|
mProgressDialog.showDialog("正在提交...");
|
|
mProgressDialog.showDialog("正在提交...");
|
|
|
|
+ String areaText=mShequEt.getText().toString();
|
|
|
|
+ if (mShequEt.getText().toString().equals("其他")){
|
|
|
|
+ areaText=mAreaEt.getText().toString().trim();
|
|
|
|
+ }
|
|
|
|
+
|
|
if(mType==1){
|
|
if(mType==1){
|
|
OkHttpUtils.post()
|
|
OkHttpUtils.post()
|
|
.url(HttpUrl.ADDADDRESS_POST)
|
|
.url(HttpUrl.ADDADDRESS_POST)
|
|
|
|
+ //用户名,能看见谁提交的,备注,
|
|
|
|
+ .addParams("userCode",mUserInfo.getUserCode())
|
|
.addParams("district", mListBean == null ? "" : mListBean.getDisName())
|
|
.addParams("district", mListBean == null ? "" : mListBean.getDisName())
|
|
.addParams("street", mListBean == null ? "" : mListBean.getStreet())
|
|
.addParams("street", mListBean == null ? "" : mListBean.getStreet())
|
|
- .addParams("area", mListBean == null ? "" : mListBean.getArea())
|
|
|
|
|
|
+ .addParams("area", areaText+"")
|
|
.addParams("addrCode", mListBean == null ? "" : mListBean.getAddrCode())
|
|
.addParams("addrCode", mListBean == null ? "" : mListBean.getAddrCode())
|
|
.addParams("longitude", mMapLocationInfo.getLongitude() + "")
|
|
.addParams("longitude", mMapLocationInfo.getLongitude() + "")
|
|
.addParams("latitude", mMapLocationInfo.getLatitude() + "")
|
|
.addParams("latitude", mMapLocationInfo.getLatitude() + "")
|
|
@@ -494,9 +529,11 @@ public class PointRecordFragment extends Fragment {
|
|
}else if(mType==2){
|
|
}else if(mType==2){
|
|
OkHttpUtils.post()
|
|
OkHttpUtils.post()
|
|
.url(HttpUrl.ADDADDRESS_POST)
|
|
.url(HttpUrl.ADDADDRESS_POST)
|
|
- .addParams("district", mDistrictEt.getText().toString().trim()+"")
|
|
|
|
- .addParams("street", mStreeEt.getText().toString().trim()+"")
|
|
|
|
- .addParams("area", mShequEt.getText().toString().trim()+"")
|
|
|
|
|
|
+ ////用户名,能看见谁提交的,备注,
|
|
|
|
+ .addParams("userCode",mUserInfo.getUserCode())
|
|
|
|
+ .addParams("district", mListBean == null ? "" : mListBean.getDisName())
|
|
|
|
+ .addParams("street", mListBean == null ? "" : mListBean.getStreet())
|
|
|
|
+ .addParams("area", areaText+"")
|
|
.addParams("longitude", mMapLocationInfo.getLongitude() + "")
|
|
.addParams("longitude", mMapLocationInfo.getLongitude() + "")
|
|
.addParams("latitude", mMapLocationInfo.getLatitude() + "")
|
|
.addParams("latitude", mMapLocationInfo.getLatitude() + "")
|
|
.addParams("address", mCummEt.getText().toString().trim()+"")
|
|
.addParams("address", mCummEt.getText().toString().trim()+"")
|
|
@@ -539,4 +576,132 @@ public class PointRecordFragment extends Fragment {
|
|
return fragment;
|
|
return fragment;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void requestInfo(){
|
|
|
|
+ OkHttpUtils.post()
|
|
|
|
+ .url(HttpUrl.FINDPOINT_POST)
|
|
|
|
+
|
|
|
|
+ .build().execute(new Callback<PointInfoEntity>() {
|
|
|
|
+ @Override
|
|
|
|
+ public PointInfoEntity parseNetworkResponse(Response response, int id) throws Exception {
|
|
|
|
+ String jsonStr = response.body().string();
|
|
|
|
+ return (PointInfoEntity) JsonUtils.parseJson2Obj(jsonStr, PointInfoEntity.class);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onError(Call call, Exception e, int id) {
|
|
|
|
+ mProgressDialog.dismiss();
|
|
|
|
+ DialogUtil.showNetFailDialog(getActivity());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onResponse(PointInfoEntity entity, int id) {
|
|
|
|
+ mProgressDialog.dismiss();
|
|
|
|
+ if (entity == null) {
|
|
|
|
+ DialogUtil.showErrDialog(getActivity(), "返回信息为空");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (!"1000".endsWith(entity.getReturnCode())) {
|
|
|
|
+ DialogUtil.showErrDialog(getActivity(), entity.getReturnMsg());
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ infoList = entity.getInfoList();
|
|
|
|
+// initData(infoList);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+// private void initData(List<PointInfoEntity.InfoListBean> jsonBean) {
|
|
|
|
+
|
|
|
|
+ private void initData() {
|
|
|
|
+ /**
|
|
|
|
+ * 注意:assets 目录下的Json文件仅供参考,实际使用可自行替换文件
|
|
|
|
+ * 关键逻辑在于循环体
|
|
|
|
+ * */
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+// String JsonData = new GetJsonDataUtil().getJson(getActivity(), "pointInfo.json");//获取assets目录下的json文件数据
|
|
|
|
+// ArrayList<PointInfoEntity.InfoListBean> jsonBean = parseData(JsonData);//用Gson 转成实体
|
|
|
|
+ String jsonStr = new GetJsonDataUtil().getJson(getActivity(), "pointInfo.json");
|
|
|
|
+
|
|
|
|
+ PointInfoEntity pointEntity = (PointInfoEntity) JsonUtils.parseJson2Obj(jsonStr, PointInfoEntity.class);//序列化
|
|
|
|
+ ArrayList<PointInfoEntity.InfoListBean> jsonBean = (ArrayList<PointInfoEntity.InfoListBean>) pointEntity.getInfoList();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 添加省份数据
|
|
|
|
+ * 注意:如果是添加的JavaBean实体,则实体类需要实现 IPickerViewData 接口,
|
|
|
|
+ * PickerView会通过getPickerViewText方法获取字符串显示出来。
|
|
|
|
+ */
|
|
|
|
+// options1Items = jsonBean;//
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < jsonBean.size(); i++) {//遍历区
|
|
|
|
+ ArrayList<String> streetList = new ArrayList<>();//该区的街道列表(第二级)
|
|
|
|
+ ArrayList<ArrayList<String>> district_sheQuList = new ArrayList<>();//该区所有社区列表(第三级)
|
|
|
|
+ Log.i("111",jsonBean.get(i).getName()+"****-");
|
|
|
|
+
|
|
|
|
+ options1Items.add(jsonBean.get(i).getName());
|
|
|
|
+ for (int c = 0; c < jsonBean.get(i).getStreetList().size(); c++) {//遍历该区所有街道
|
|
|
|
+ String streetName = jsonBean.get(i).getStreetList().get(c).getName();
|
|
|
|
+ streetList.add(streetName);//添加街道
|
|
|
|
+ ArrayList<String> street_sheQuList = new ArrayList<>();//该街道所有社区列表
|
|
|
|
+
|
|
|
|
+ //如果无地区数据,建议添加空字符串,防止数据为null 导致三个选项长度不匹配造成崩溃
|
|
|
|
+ if (jsonBean.get(i).getStreetList().get(c).getArea() == null
|
|
|
|
+ || jsonBean.get(i).getStreetList().get(c).getArea().size() == 0) {
|
|
|
|
+ street_sheQuList.add("");
|
|
|
|
+ } else {
|
|
|
|
+ street_sheQuList.addAll(jsonBean.get(i).getStreetList().get(c).getArea());
|
|
|
|
+ }
|
|
|
|
+ district_sheQuList.add(street_sheQuList);//添加该省所有地区数据
|
|
|
|
+ }
|
|
|
|
+ //添加城市数据
|
|
|
|
+ options2Items.add(streetList);
|
|
|
|
+ //添加地区数据
|
|
|
|
+ options3Items.add(district_sheQuList);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ public ArrayList<PointInfoEntity.InfoListBean> parseData(String result) {//Gson 解析
|
|
|
|
+ ArrayList<PointInfoEntity.InfoListBean> detail = new ArrayList<>();
|
|
|
|
+ try {
|
|
|
|
+ JSONArray data = new JSONArray(result);
|
|
|
|
+ Gson gson = new Gson();
|
|
|
|
+ for (int i = 0; i < data.length(); i++) {
|
|
|
|
+ PointInfoEntity entity = gson.fromJson(data.optJSONObject(i).toString(), PointInfoEntity.class);
|
|
|
|
+ detail.add(entity.getInfoList().get(i));
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ return detail;
|
|
|
|
+ }
|
|
|
|
+ private void showPickerView() {
|
|
|
|
+ OptionsPickerView pvOptions = new OptionsPickerBuilder(getActivity(), new OnOptionsSelectListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onOptionsSelect(int options1, int options2, int options3, View v) {
|
|
|
|
+ //返回的分别是三个级别的选中位置
|
|
|
|
+
|
|
|
|
+ mDistrictEt.setText(options1Items.get(options1)+"/"+options2Items.get(options1).get(options2)+"/"+options3Items.get(options1).get(options2).get(options3));
|
|
|
|
+ mStreeEt.setText(options2Items.get(options1).get(options2));
|
|
|
|
+ mShequEt.setText(options3Items.get(options1).get(options2).get(options3));
|
|
|
|
+ if (mShequEt.getText().toString().equals("其他")){
|
|
|
|
+ llAreaEt.setVisibility(View.VISIBLE);
|
|
|
|
+ }else {
|
|
|
|
+ llAreaEt.setVisibility(View.GONE);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .setTitleText("位置选择")
|
|
|
|
+ .setTitleBgColor(Color.WHITE)//设置标题的背景颜色
|
|
|
|
+ .setDividerColor(Color.BLACK)//设置分割线的颜色
|
|
|
|
+ .setTextColorCenter(Color.BLACK) //设置选中项文字颜色
|
|
|
|
+ .setContentTextSize(20)
|
|
|
|
+ .build();
|
|
|
|
+ pvOptions.setPicker(options1Items, options2Items, options3Items);//三级选择器
|
|
|
|
+ pvOptions.show();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|