修改银行卡添加模糊查询
This commit is contained in:
parent
4c84731bee
commit
a9295e1c92
@ -167,7 +167,8 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
httpParams.put("grant_type", "password");
|
||||
httpParams.put("datetime", time);
|
||||
showLoadingDialog();
|
||||
OkGoBuilder.getInstance().Builder(this)
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(this)
|
||||
.url(HttpInterface.USER_LOGIN_OAUTH_TOKEN)
|
||||
.cls(LoginOauthTokenBean.class)
|
||||
.params(httpParams)
|
||||
@ -197,7 +198,6 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
dismissLoadingDialog();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
@ -207,7 +207,6 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void initGetUserInfo() {
|
||||
@ -271,15 +270,12 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
Toast.makeText(LoginActivity.this, response.getMessage()+"", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
Toast.makeText(LoginActivity.this, e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -132,7 +132,6 @@ public class MainActivity extends BaseActivity {
|
||||
initPermission();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDenied(List<String> permissions, boolean never) {
|
||||
if (never) {
|
||||
@ -145,7 +144,6 @@ public class MainActivity extends BaseActivity {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -210,7 +208,6 @@ public class MainActivity extends BaseActivity {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
@ -114,7 +114,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
private Timer timer;
|
||||
private TimerTask timerTask;
|
||||
private int videoIndex = -1;
|
||||
private int oration;
|
||||
private int oration;
|
||||
private ImageView ivPicImage;
|
||||
private SystemTTS systemTTS;
|
||||
|
||||
@ -154,6 +154,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
btnSwitch.setOnClickListener(this);
|
||||
//相机记录器
|
||||
CameraLogger.setLogLevel(CameraLogger.LEVEL_VERBOSE);
|
||||
|
||||
ivZoomAdd = findViewById(R.id.iv_zoom_add);
|
||||
ivZoomAdd.setOnClickListener(this);
|
||||
ivZoomDel = findViewById(R.id.iv_zoom_del);
|
||||
@ -175,13 +176,11 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
if (isChecked) {
|
||||
if (poi_video_type != 2) {
|
||||
capturePicture.setText("暂停采集");
|
||||
}
|
||||
capturePicture.setText("暂停采集"); }
|
||||
startTimer();
|
||||
} else {
|
||||
if (poi_video_type != 2) {
|
||||
capturePicture.setText("开始采集");
|
||||
}
|
||||
capturePicture.setText("开始采集"); }
|
||||
stopTimer();
|
||||
}
|
||||
}
|
||||
@ -219,7 +218,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
public void onPictureTaken(@NonNull PictureResult result) {
|
||||
super.onPictureTaken(result);
|
||||
if (oration == 0) { // oblation为0时,拍摄视频必须为横屏
|
||||
// 如果当前手机是竖向,则不允许拍摄
|
||||
// 如果当前手机是竖向,则不
|
||||
if (Objects.requireNonNull(camera.getPictureSize()).getWidth() < camera.getPictureSize().getHeight()) {
|
||||
Toast.makeText(PicturesActivity.this, "不允许竖向拍摄...", Toast.LENGTH_SHORT).show();
|
||||
stopTimer();
|
||||
@ -278,9 +277,10 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.road_arrows);
|
||||
}
|
||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
||||
|
||||
// 构造 PolylineOnions
|
||||
PolylineOptions polylineOptions = new PolylineOptions()
|
||||
.addAll(latLineString)
|
||||
PolylineOptions polylineOptions
|
||||
= new PolylineOptions().addAll(latLineString)
|
||||
// 折线设置圆形线头
|
||||
.lineCap(true)
|
||||
// 折线的颜色为绿色
|
||||
@ -332,18 +332,18 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
break;
|
||||
case R.id.iv_location://定位:
|
||||
if (Constant.currentLocation != null) {
|
||||
CameraUpdate cameraSigma = CameraUpdateFactory.newCameraPosition(new CameraPosition(
|
||||
new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()), //中心点坐标,地图目标经纬度
|
||||
tencentMap.getCameraPosition().zoom, //目标缩放级别
|
||||
0, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0)
|
||||
0)); //目标旋转角 0~360° (正北方为0)
|
||||
CameraUpdate cameraSigma = CameraUpdateFactory
|
||||
.newCameraPosition(new CameraPosition(new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()), //中心点坐标,地图目标经纬度
|
||||
tencentMap.getCameraPosition().zoom, //目标缩放级别
|
||||
0, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0)
|
||||
0)); //目标旋转角 0~360° (正北方为0)
|
||||
tencentMap.animateCamera(cameraSigma);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Bitmap getBitMap() {
|
||||
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.location);
|
||||
int width = bitmap.getWidth();
|
||||
@ -358,13 +358,12 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 设置定位图标样式
|
||||
*/
|
||||
private void setLocMarkerStyle(int type) {
|
||||
tencentMap.setLocationSource(new MyTecentLocationSource(this));
|
||||
tencentMap.setMyLocationEnabled(true);
|
||||
|
||||
MyLocationStyle locationStyle = new MyLocationStyle();
|
||||
//LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER
|
||||
locationStyle = locationStyle.myLocationType(type);
|
||||
@ -417,7 +416,6 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
ivZoomDel.setVisibility(View.GONE);
|
||||
ivLocation.setVisibility(View.GONE);
|
||||
setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE);
|
||||
|
||||
}
|
||||
|
||||
//大图
|
||||
@ -452,6 +450,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
obtain.what = Constant.PICTURE_VIDEO_WORD;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -479,7 +478,6 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onEventMessageMainThread(Message msg) {
|
||||
if (msg.what == Constant.EVENT_WHAT_LOCATION_CHANGE) { // 用户位置更新
|
||||
@ -549,14 +547,17 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
|
||||
public void initMarker() {
|
||||
LatLng latLng = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
|
||||
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.circle);
|
||||
Marker marker = tencentMap.addMarker(new MarkerOptions(latLng).icon(pileDescriptor).alpha(0.9f)
|
||||
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory
|
||||
.fromResource(R.drawable.circle);
|
||||
Marker marker = tencentMap
|
||||
.addMarker(new MarkerOptions(latLng)
|
||||
.icon(pileDescriptor)
|
||||
.alpha(0.9f)
|
||||
.flat(true)
|
||||
.clockwise(false));
|
||||
removables.add(marker);
|
||||
}
|
||||
|
||||
|
||||
private void startTimer() {
|
||||
if (timer == null) {
|
||||
timer = new Timer();
|
||||
@ -583,14 +584,17 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
}
|
||||
|
||||
private void stopTimer() {
|
||||
|
||||
if (timer != null) {
|
||||
timer.cancel();
|
||||
timer = null;
|
||||
}
|
||||
|
||||
if (timerTask != null) {
|
||||
timerTask.cancel();
|
||||
timerTask = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -77,7 +77,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
btnAttestation.setOnClickListener(this);
|
||||
Button btnGathering = findViewById(R.id.btn_gathering);
|
||||
btnGathering.setOnClickListener(this);
|
||||
if (Constant.ID_NUMBER!=null){
|
||||
if (Constant.ID_NUMBER != null) {
|
||||
btnGathering.setText("已绑定");
|
||||
}
|
||||
region = findViewById(R.id.region);
|
||||
@ -94,24 +94,22 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
userSave.setOnClickListener(this);
|
||||
Button btnWeChat = findViewById(R.id.btn_weChat_binding);
|
||||
btnWeChat.setOnClickListener(this);
|
||||
if (Constant.MOBILE!=null){
|
||||
if (Constant.MOBILE != null) {
|
||||
etPhone.setText(Constant.MOBILE);
|
||||
}
|
||||
if (Constant.QQ!=null){
|
||||
if (Constant.QQ != null) {
|
||||
etQq.setText(Constant.QQ);
|
||||
}
|
||||
String regions = navInfo.getString("region", null);
|
||||
if (regions!=null){
|
||||
if (regions != null) {
|
||||
region.setText(regions);
|
||||
}
|
||||
if (Constant.AUDIOTAPES ==1){
|
||||
if (Constant.AUDIOTAPES == 1) {
|
||||
btnAttestation.setText("已认证");
|
||||
}
|
||||
if (Constant.ID_NUMBER!=null){
|
||||
if (Constant.ID_NUMBER != null) {
|
||||
btnGathering.setText("已绑定");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -121,14 +119,14 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
finish();
|
||||
break;
|
||||
case R.id.btn_gathering:
|
||||
if (Constant.AUDIOTAPES ==-1){
|
||||
if (Constant.AUDIOTAPES == -1) {
|
||||
Toast.makeText(this, "请先实名认证", Toast.LENGTH_SHORT).show();
|
||||
}else if (Constant.AUDIOTAPES ==1){//认证通过
|
||||
} else if (Constant.AUDIOTAPES == 1) {//认证通过
|
||||
Intent gatheringIntent = new Intent(this, FragmentManagement.class);
|
||||
gatheringIntent.putExtra("tag", 24);
|
||||
startActivity(gatheringIntent);
|
||||
}else if (Constant.AUDIOTAPES ==0){
|
||||
Toast.makeText(this, Constant.AUDITING +"", Toast.LENGTH_SHORT).show();
|
||||
} else if (Constant.AUDIOTAPES == 0) {
|
||||
Toast.makeText(this, Constant.AUDITING + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
case R.id.btn_attestations:
|
||||
@ -143,54 +141,52 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
// qq();
|
||||
break;
|
||||
case R.id.edit_mailbox:
|
||||
|
||||
break;
|
||||
case R.id.btn_save:
|
||||
if (Constant.ID_NUM==null){
|
||||
if (Constant.ID_NUM == null) {
|
||||
Toast.makeText(this, "请先实名认证", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (Constant.ID_NUMBER==null){
|
||||
if (Constant.ID_NUMBER == null) {
|
||||
Toast.makeText(this, "请先绑定银行卡", Toast.LENGTH_SHORT).show();
|
||||
|
||||
}
|
||||
String userphone = etPhone.getText().toString().trim();
|
||||
String userqq = etQq.getText().toString().trim();
|
||||
String usermailbox = etMailbox.getText().toString().trim();
|
||||
HttpParams httpParams = new HttpParams();
|
||||
httpParams.put("pid",Constant.USHERED);
|
||||
httpParams.put("pid", Constant.USHERED);
|
||||
long time = System.currentTimeMillis();
|
||||
httpParams.put("datetime", time);
|
||||
boolean isQQNum_matcher = userqq.matches("[1-9][0-9]{4,14}");
|
||||
// 邮箱匹配结果
|
||||
boolean isEmail_matcher = usermailbox.matches( "^[\\w-\\+]+(\\.[\\w]+)*@[\\w-]+(\\.[\\w]+)*(\\.[a-z]{2,})$");
|
||||
boolean isEmail_matcher = usermailbox.matches("^[\\w-\\+]+(\\.[\\w]+)*@[\\w-]+(\\.[\\w]+)*(\\.[a-z]{2,})$");
|
||||
//user.length() < 11 && user.length() > 5
|
||||
if (TextUtils.isEmpty(userphone) || TextUtils.isEmpty(userqq) || TextUtils.isEmpty(usermailbox)|| TextUtils.isEmpty(region_id)) {
|
||||
if (TextUtils.isEmpty(userphone) || TextUtils.isEmpty(userqq) || TextUtils.isEmpty(usermailbox) || TextUtils.isEmpty(region_id)) {
|
||||
if (region_id == null || region_id.equals("")) {
|
||||
Toast.makeText(this, "所在地区为空,请重新输入", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}else {
|
||||
httpParams.put("regionId",region_id);
|
||||
return;
|
||||
} else {
|
||||
httpParams.put("regionId", region_id);
|
||||
}
|
||||
|
||||
if (!RegexUtil.isPhone(userphone)) {
|
||||
Toast.makeText(this, "手机号输入错误", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}else {
|
||||
} else {
|
||||
httpParams.put("mobile", userphone);
|
||||
}
|
||||
if (!userqq.equals("")) {
|
||||
if (!isQQNum_matcher) {
|
||||
Toast.makeText(this, "QQ号输入错误", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}else {
|
||||
} else {
|
||||
httpParams.put("qq", userqq);
|
||||
}
|
||||
}
|
||||
if (!usermailbox.equals("")){
|
||||
if (!usermailbox.equals("")) {
|
||||
if (!isEmail_matcher) {
|
||||
Toast.makeText(this, "邮箱格式错误", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
} else {
|
||||
httpParams.put("mail", usermailbox); //邮箱
|
||||
}
|
||||
return;
|
||||
@ -219,20 +215,21 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
public void onSuccess(UserBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
Log.d("TAG", "onSuccess: " + response.toString());
|
||||
if (response.getCode()==200) {
|
||||
MessageDialog.show(UserActivity.this, "提示","是否保存", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
if (response.getCode() == 200) {
|
||||
MessageDialog.show(UserActivity.this, "提示", "是否保存", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
navInfoEditor.putString("region",region.getText().toString());
|
||||
navInfoEditor.putString("region", region.getText().toString());
|
||||
navInfoEditor.commit();
|
||||
finish();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Toast.makeText(UserActivity.this, response.getMessage()+"", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(UserActivity.this, response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
@ -243,11 +240,11 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
}
|
||||
|
||||
|
||||
// public static boolean isEmail(String email) {
|
||||
// if (null == email || "".equals(email)) return false;
|
||||
// Matcher m = compile.matcher(email);
|
||||
// return m.matches();
|
||||
// }
|
||||
/*public static boolean isEmail(String email) {
|
||||
if (null == email || "".equals(email)) return false;
|
||||
Matcher m = compile.matcher(email);
|
||||
return m.matches();
|
||||
}*/
|
||||
|
||||
private void showPickerView() {// 弹出选择器(省市区三级联动)
|
||||
OptionsPickerView pvOptions = new OptionsPickerBuilder(UserActivity.this, new OnOptionsSelectListener() {
|
||||
@ -293,18 +290,15 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
|
||||
|
||||
private void initJsonData() {//解析数据 (省市区三级联动)
|
||||
/**
|
||||
/*
|
||||
* 注意:assets 目录下的Json文件仅供参考,实际使用可自行替换文件
|
||||
* 关键逻辑在于循环体
|
||||
*
|
||||
* */
|
||||
*/
|
||||
String JsonData = new GetJsonDataUtil().getJson(UserActivity.this, "prov_city_county.json");//获取assets目录下的json文件数据
|
||||
|
||||
ArrayList<JsonBean> jsonBean = parseData(JsonData);//用Gson 转成实体
|
||||
ArrayList<JsonBean> jsonBean = parseData(JsonData);//用GOON 转成实体
|
||||
|
||||
/*
|
||||
* 添加省份数据
|
||||
*
|
||||
* 注意:如果是添加的JavaBean实体,则实体类需要实现 IPickerViewData 接口,
|
||||
* PickerView会通过getPickerViewText方法获取字符串显示出来。
|
||||
*/
|
||||
@ -314,13 +308,11 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
ArrayList<String> CityList = new ArrayList<>();//该省的城市列表(第二级)
|
||||
ArrayList<ArrayList<CityBean>> city_AreaList = new ArrayList<>();//该省的所有地区列表(第三级)
|
||||
ArrayList<ArrayList<String>> Province_AreaList = new ArrayList<>();//该省的所有地区列表(第三级)
|
||||
|
||||
for (int c = 0; c < jsonBean.get(i).getCitys().size(); c++) {//遍历该省份的所有城市
|
||||
String CityName = jsonBean.get(i).getCitys().get(c).getCity();
|
||||
CityList.add(CityName);//添加城市
|
||||
ArrayList<CityBean> AreaList = new ArrayList<>();//该城市的所有地区列表
|
||||
ArrayList<String> City_AreaList = new ArrayList<>();//该城市的所有地区列表
|
||||
|
||||
//如果无地区数据,建议添加空字符串,防止数据为null 导致三个选项长度不匹配造成崩溃
|
||||
if (jsonBean.get(i).getCitys().get(c).getCounties() == null
|
||||
|| jsonBean.get(i).getCitys().get(c).getCounties().size() == 0) {
|
||||
@ -331,17 +323,14 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
AreaList.add(new CityBean(jsonBean.get(i).getCitys().get(c).getCounties().get(j).getName(), jsonBean.get(i).getCitys().get(c).getCounties().get(j).getRegion_id()));
|
||||
City_AreaList.add(jsonBean.get(i).getCitys().get(c).getCounties().get(j).getName());
|
||||
}
|
||||
|
||||
}
|
||||
Province_AreaList.add(City_AreaList);//添加该省所有地区数据
|
||||
city_AreaList.add(AreaList);//添加该省所有地区数据的bean
|
||||
}
|
||||
|
||||
/*
|
||||
* 添加城市数据
|
||||
*/
|
||||
options2Items.add(CityList);
|
||||
|
||||
/*
|
||||
* 添加地区数据
|
||||
*/
|
||||
|
@ -26,6 +26,7 @@ import java.util.Map;
|
||||
public class WebActivity extends BaseActivity implements View.OnClickListener {
|
||||
|
||||
private WebView nWebView;
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.activity_web;
|
||||
@ -57,7 +58,8 @@ public class WebActivity extends BaseActivity implements View.OnClickListener {
|
||||
httpParams.put(entry.getKey(),entry.getValue());
|
||||
}
|
||||
}
|
||||
OkGoBuilder.getInstance().Builder(this)
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(this)
|
||||
.url(url)
|
||||
.cls(RichTextBean.class)
|
||||
.token(Constant.ACCESS_TOKEN)
|
||||
|
@ -14,17 +14,23 @@ import com.navinfo.outdoor.bean.BankPathBean;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BankAdapter extends RecyclerView.Adapter<BankAdapter.ViewHolder> {
|
||||
private List<BankPathBean> bankPathBeans ;
|
||||
private List<BankPathBean> bankPathBeans =new ArrayList<>();
|
||||
private Context context;
|
||||
|
||||
public BankAdapter(List<BankPathBean> bankPathBeans, Context context) {
|
||||
this.bankPathBeans = bankPathBeans;
|
||||
public BankAdapter(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public void setBankPathBeans(List<BankPathBean> bankPathBeans) {
|
||||
this.bankPathBeans.clear();
|
||||
this.bankPathBeans.addAll(bankPathBeans);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull @NotNull ViewGroup parent, int viewType) {
|
||||
@ -38,7 +44,7 @@ public class BankAdapter extends RecyclerView.Adapter<BankAdapter.ViewHolder> {
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
onBankClick.onClick(position);
|
||||
onBankClick.onClick(bankPathBeans.get(position));
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -57,7 +63,7 @@ public class BankAdapter extends RecyclerView.Adapter<BankAdapter.ViewHolder> {
|
||||
}
|
||||
}
|
||||
public interface OnBankClick {
|
||||
void onClick(int pos);
|
||||
void onClick(BankPathBean bankPathBean);
|
||||
}
|
||||
|
||||
private OnBankClick onBankClick;
|
||||
|
@ -186,7 +186,7 @@ public class Constant {
|
||||
public static boolean IS_FILTER_LIST_ITEM = true;//poi页面的查重
|
||||
public static TencentMap.OnMarkerClickListener markerClickListener=null;
|
||||
|
||||
public static final String NAVIN_FO="9.17";//版本
|
||||
public static final String NAVIN_FO="9.22";//版本
|
||||
|
||||
/**
|
||||
* 联系我们的QQ群名称和QQ群号
|
||||
|
@ -55,7 +55,6 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
|
||||
ImageView ivEvaluationTaskFinish = findViewById(R.id.iv_evaluation_task_finish);
|
||||
capacityEvaluationRecycler = findViewById(R.id.capacity_evaluation_recycler);
|
||||
ivEvaluationTaskFinish.setOnClickListener(this);
|
||||
@ -63,8 +62,8 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
|
||||
capacityEvaluationRecycler.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
|
||||
capacityEvaluationRecycler.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
|
||||
//取消上拉加载,刷新功能
|
||||
// capacityEvaluationRecycler.setPullRefreshEnabled(false);
|
||||
// capacityEvaluationRecycler.setLoadingMoreEnabled(false);
|
||||
//capacityEvaluationRecycler.setPullRefreshEnabled(false);
|
||||
//capacityEvaluationRecycler.setLoadingMoreEnabled(false);
|
||||
capacityEvaluationAdapter = new CapacityEvaluationAdapter(capacityList,getActivity());
|
||||
capacityEvaluationRecycler.setAdapter(capacityEvaluationAdapter);
|
||||
capacityEvaluationRecycler.getDefaultFootView().setNoMoreHint("加载成功");
|
||||
@ -74,7 +73,6 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
|
||||
capacityPage=1;
|
||||
initNewWork(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMore() {
|
||||
initNewWork(false);
|
||||
@ -116,12 +114,9 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
|
||||
dismissLoadingDialog();
|
||||
if (response.getCode() == 200){
|
||||
initTaskPrefectureBean(response,aNet);
|
||||
|
||||
}else {
|
||||
Toast.makeText(getActivity(), response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
|
||||
Log.d("TAG", "onSuccess: " + response.getMessage() + "sassafrases");
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.kongzue.dialog.util.DialogSettings;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.lzy.okgo.model.Response;
|
||||
@ -52,6 +53,7 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
private Gson gson;
|
||||
private Button btn;
|
||||
|
||||
|
||||
public static CapacityMeasurementFragment newInstance(Bundle bundle) {
|
||||
CapacityMeasurementFragment fragment = new CapacityMeasurementFragment();
|
||||
fragment.setArguments(bundle);
|
||||
@ -66,8 +68,8 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
ImageView ivMeasurementFinish = (ImageView) findViewById(R.id.iv_measurement_finish);
|
||||
RecyclerView capacityMeasurementRel = (RecyclerView) findViewById(R.id.capacity_measurementRel);
|
||||
ImageView ivMeasurementFinish = findViewById(R.id.iv_measurement_finish);
|
||||
RecyclerView capacityMeasurementRel = findViewById(R.id.capacity_measurementRel);
|
||||
ivMeasurementFinish.setOnClickListener(this);
|
||||
capacityMeasurementRel.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
capacityMeasureAdapter = new CapacityMeasureAdapter(getActivity());
|
||||
@ -100,16 +102,17 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
@Override
|
||||
public void onSuccess(MeasureBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
|
||||
//单选
|
||||
List<MeasureBean.BodyBean.MultiChoiceBean> multiChoice = response.getBody().getMultiChoice();
|
||||
//多选
|
||||
List<MeasureBean.BodyBean.SingleChoiceBean> singleChoice1 = response.getBody().getSingleChoice();
|
||||
if (multiChoice != null) {
|
||||
for (int i = 0; i < multiChoice.size(); i++) {
|
||||
baleen.add(new BolBean(multiChoice.get(i).getId(), multiChoice.get(i).getQuestion(), multiChoice.get(i).getOption(), true));
|
||||
examId = multiChoice.get(i).getExamId();
|
||||
}
|
||||
}
|
||||
//多选
|
||||
List<MeasureBean.BodyBean.SingleChoiceBean> singleChoice1 = response.getBody().getSingleChoice();
|
||||
if (singleChoice1 != null) {
|
||||
for (int i = 0; i < singleChoice1.size(); i++) {
|
||||
baleen.add(new BolBean(singleChoice1.get(i).getId(), singleChoice1.get(i).getQuestion(), singleChoice1.get(i).getOption(), false));
|
||||
@ -138,8 +141,7 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
Objects.requireNonNull(getActivity()).finish();
|
||||
break;
|
||||
case R.id.btn:
|
||||
try {
|
||||
if (baleen != null) {
|
||||
if (baleen.size() != 0) {
|
||||
Map<String, String> checkedMap = capacityMeasureAdapter.getCheckedMap();
|
||||
for (int i = 0; i < baleen.size(); i++) {
|
||||
final String id = baleen.get(i).getId();
|
||||
@ -166,17 +168,14 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "无数据", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void initExamSubmit() throws JSONException {
|
||||
private void initExamSubmit() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("examId", examId);
|
||||
map.put("answerList", examBeans);
|
||||
map.put("examId", examId);//试卷ID
|
||||
map.put("answerList", examBeans);//答案列表
|
||||
String json = gson.toJson(map);
|
||||
examBeans.clear();
|
||||
showLoadingDialog();
|
||||
@ -184,40 +183,29 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
.Builder(getActivity())
|
||||
.url(HttpInterface.EXAM_SUBMIT)
|
||||
.cls(ExamSubmitBean.class)
|
||||
.token(Constant.ACCESS_TOKEN)
|
||||
.json(json)
|
||||
.params(new HttpParams())
|
||||
.token(Constant.ACCESS_TOKEN)
|
||||
.postCapacity(new Callback<ExamSubmitBean>() {
|
||||
@Override
|
||||
public void onSuccess(ExamSubmitBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
if (response.getCode() == 200) {
|
||||
|
||||
|
||||
|
||||
|
||||
if (response.getCode().equals("0")) {
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "不通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
String message = null;
|
||||
if (response.getBody() == 0) {
|
||||
message = "不通过";
|
||||
} else if (response.getBody()==1){
|
||||
message = "通过";
|
||||
}
|
||||
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", message, "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Toast.makeText(getActivity(), response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
|
||||
|
||||
|
||||
}
|
||||
Log.d("TAG", "onSuccess: " + response.toString());
|
||||
}
|
||||
|
@ -973,56 +973,56 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
}
|
||||
|
||||
// private void chargingPileByWork(ChargingPileEntity chargingPileEntity) {
|
||||
// showLoadingDialog();
|
||||
// HttpParams httpParams = new HttpParams();
|
||||
// httpParams.put("taskId", taskId);
|
||||
// httpParams.put("name", chargingPileEntity.getName());
|
||||
// httpParams.put("existence", chargingPileEntity.getExist());
|
||||
// httpParams.put("geo", chargingPileEntity.getP());
|
||||
// httpParams.put("memo", chargingPileEntity.getMemo());
|
||||
// httpParams.put("ffid", chargingPileEntity.getFid());
|
||||
// HashMap<String, Object> hashMap = new HashMap<>();
|
||||
// hashMap.put("cp_openType",chargingPileEntity.getCp_openType());
|
||||
// hashMap.put("cp_floor",chargingPileEntity.getCp_floor());
|
||||
// hashMap.put("cp_availableState",chargingPileEntity.getCp_availableState());
|
||||
// hashMap.put("sign_exist",chargingPileEntity.getSign_exist());
|
||||
// httpParams.put("detail", String.valueOf(hashMap));
|
||||
// OkGoBuilder.getInstance()
|
||||
// .Builder(getActivity())
|
||||
// .url(HttpInterface.SUBMIT_CSTASK)
|
||||
// .method(OkGoBuilder.GET)
|
||||
// .cls(ChargingPileSaveBean.class)
|
||||
// .params(httpParams)
|
||||
// .callback(new Callback<ChargingPileSaveBean>() {
|
||||
// @Override
|
||||
// public void onSuccess(ChargingPileSaveBean chargingPileSaveBean, int id) {
|
||||
// dismissLoadingDialog();
|
||||
// chargingPileBody = chargingPileSaveBean.getBody();
|
||||
// Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
|
||||
// Log.d("TAG", "onSuccess: " + chargingPileSaveBean.getBody());
|
||||
// phoneList();
|
||||
// Message obtain = Message.obtain();
|
||||
// obtain.what = Constant.CHARGING_PILE_BODY;
|
||||
// obtain.obj = chargingPileBody;
|
||||
// EventBus.getDefault().post(obtain);
|
||||
//
|
||||
// Message obtain1 = Message.obtain();
|
||||
// obtain1.what = Constant.CHARGING_PILE_PHOTO;
|
||||
// obtain1.obj = phoneLists;
|
||||
// EventBus.getDefault().post(obtain1);
|
||||
// getActivity().onBackPressed();
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Throwable e, int id) {
|
||||
// dismissLoadingDialog();
|
||||
// Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
// Log.d("TAG", "onError: " + e.getMessage());
|
||||
// }
|
||||
// }).build();
|
||||
// }
|
||||
/* private void chargingPileByWork(ChargingPileEntity chargingPileEntity) {
|
||||
showLoadingDialog();
|
||||
HttpParams httpParams = new HttpParams();
|
||||
httpParams.put("taskId", taskId);
|
||||
httpParams.put("name", chargingPileEntity.getName());
|
||||
httpParams.put("existence", chargingPileEntity.getExist());
|
||||
httpParams.put("geo", chargingPileEntity.getP());
|
||||
httpParams.put("memo", chargingPileEntity.getMemo());
|
||||
httpParams.put("ffid", chargingPileEntity.getFid());
|
||||
HashMap<String, Object> hashMap = new HashMap<>();
|
||||
hashMap.put("cp_openType",chargingPileEntity.getCp_openType());
|
||||
hashMap.put("cp_floor",chargingPileEntity.getCp_floor());
|
||||
hashMap.put("cp_availableState",chargingPileEntity.getCp_availableState());
|
||||
hashMap.put("sign_exist",chargingPileEntity.getSign_exist());
|
||||
httpParams.put("detail", String.valueOf(hashMap));
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
.url(HttpInterface.SUBMIT_CSTASK)
|
||||
.method(OkGoBuilder.GET)
|
||||
.cls(ChargingPileSaveBean.class)
|
||||
.params(httpParams)
|
||||
.callback(new Callback<ChargingPileSaveBean>() {
|
||||
@Override
|
||||
public void onSuccess(ChargingPileSaveBean chargingPileSaveBean, int id) {
|
||||
dismissLoadingDialog();
|
||||
chargingPileBody = chargingPileSaveBean.getBody();
|
||||
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
|
||||
Log.d("TAG", "onSuccess: " + chargingPileSaveBean.getBody());
|
||||
phoneList();
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.CHARGING_PILE_BODY;
|
||||
obtain.obj = chargingPileBody;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
Message obtain1 = Message.obtain();
|
||||
obtain1.what = Constant.CHARGING_PILE_PHOTO;
|
||||
obtain1.obj = phoneLists;
|
||||
EventBus.getDefault().post(obtain1);
|
||||
getActivity().onBackPressed();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
}*/
|
||||
|
||||
|
||||
@Override
|
||||
|
@ -676,8 +676,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(getActivity(), getPhoneBean.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@ -689,18 +687,22 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
|
||||
public void initRemovePileSharePre() {
|
||||
|
||||
//获取SharedPreferences对象,方法中两个参数的意思为:第一个name
|
||||
//表示文件名,系统将会在/dada/dada/包名/shared_prefs目录下生成
|
||||
//一个以该参数命名的.xml文件。第二个mode表示创建的模式,通过查看
|
||||
//方法注释得知,建议以0或者MODE_PRIVATE为默认值。
|
||||
|
||||
SharedPreferences poi = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.DATA_FILE, 0);
|
||||
|
||||
//获取Editor对象
|
||||
SharedPreferences.Editor edit = poi.edit();
|
||||
|
||||
//根据要保存的数据的类型,调用对应的put方法,以键值对的形式添加新值。
|
||||
edit.putString("chargingPileEntity", null);
|
||||
|
||||
//提交新值。必须执行,否则前面的操作都无效。
|
||||
edit.apply();
|
||||
|
||||
}
|
||||
//禁用所有可操作性控件
|
||||
private void disables() {
|
||||
|
@ -42,15 +42,12 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
|
||||
private EventPrefectureAdapter eventPrefectureAdapter;
|
||||
private int eventPage = 1;
|
||||
|
||||
|
||||
public static EventPrefectureFragment newInstance(Bundle bundle) {
|
||||
EventPrefectureFragment fragment = new EventPrefectureFragment();
|
||||
fragment.setArguments(bundle);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.event_prefecture_fragment;
|
||||
@ -84,10 +81,7 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
|
||||
}else {
|
||||
Toast.makeText(getActivity(), taskPrefectureBean.getMessage()+"", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
Log.d("TAG", "onSuccess: " + taskPrefectureBean.getMessage());
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -79,8 +79,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
if (!hidden) {
|
||||
setSlidingUpPanelLayout(Constant.SLIDING_LAYOUT);
|
||||
if (slidingPaneLayout != null) {
|
||||
slidingPaneLayout.setScrollableView(recyclerFilter);
|
||||
}
|
||||
slidingPaneLayout.setScrollableView(recyclerFilter); }
|
||||
initHeader();
|
||||
}
|
||||
}
|
||||
@ -93,8 +92,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
Bundle arguments = getArguments();
|
||||
if (arguments != null) {
|
||||
isSliding = arguments.getBoolean("isSliding", true);
|
||||
Log.d("TAG", "onCaress's: " + isSliding);
|
||||
}
|
||||
Log.d("TAG", "onCaress's: " + isSliding); }
|
||||
if (isSliding) {
|
||||
// 监听到返回按钮点击事件
|
||||
Message obtain = Message.obtain();
|
||||
@ -133,8 +131,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
if (allPoi != null) {
|
||||
for (int i = 0; i < allPoi.size(); i++) {
|
||||
if (allPoi.get(i).getTaskStatus() == 0 || allPoi.get(i).getTaskStatus() == 1) {
|
||||
poiEntities.add(allPoi.get(i));
|
||||
}
|
||||
poiEntities.add(allPoi.get(i)); }
|
||||
}
|
||||
}
|
||||
filterAdapter.setAllPoi(poiEntities);
|
||||
@ -195,12 +192,16 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
ConstraintLayout clPhotograph = findViewById(R.id.cl_photograph);
|
||||
clPhotograph.setOnClickListener(this);
|
||||
tvPhotograph = findViewById(R.id.tv_photograph);
|
||||
if (Constant.LIMIT_TYPE == -1) {//"全部", "普通任务", "专属任务"
|
||||
if (Constant.LIMIT_TYPE == -1) {//"全部", "普通任务", "专属任务","挑战任务","奖励任务"
|
||||
tvPhotograph.setText("全部");
|
||||
} else if (Constant.LIMIT_TYPE == 0) {
|
||||
tvPhotograph.setText("普通任务");
|
||||
} else if (Constant.LIMIT_TYPE == 1) {
|
||||
tvPhotograph.setText("专属任务");
|
||||
} else if (Constant.LIMIT_TYPE == 2) {
|
||||
tvPhotograph.setText("挑战任务");
|
||||
} else if (Constant.LIMIT_TYPE == 3) {
|
||||
tvPhotograph.setText("奖励任务");
|
||||
}
|
||||
ConstraintLayout clExclusive = findViewById(R.id.cl_exclusive);
|
||||
clExclusive.setOnClickListener(this);
|
||||
@ -237,7 +238,6 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
}*/
|
||||
Button btnFilter = findViewById(R.id.btn_filter);
|
||||
btnFilter.setOnClickListener(this);
|
||||
RelativeLayout rlDraw = findViewById(R.id.rl_draw);
|
||||
checkOk = findViewById(R.id.check_ok);
|
||||
Button btnDraw = findViewById(R.id.btn_draw);
|
||||
btnDraw.setOnClickListener(this);
|
||||
@ -263,9 +263,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
recyclerFilter.setAdapter(filterAdapter);
|
||||
recyclerFilter.setScrollAlphaChangeListener(new XRecyclerView.ScrollAlphaChangeListener() {
|
||||
@Override
|
||||
public void onAlphaChange(int alpha) {
|
||||
}
|
||||
|
||||
public void onAlphaChange(int alpha) {}
|
||||
@Override
|
||||
public int setLimitHeight() {
|
||||
return 0;
|
||||
@ -274,13 +272,9 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
recyclerFilter.getDefaultFootView().setNoMoreHint("成功加载完毕");
|
||||
recyclerFilter.setLoadingListener(new XRecyclerView.LoadingListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
}
|
||||
|
||||
public void onRefresh() {}
|
||||
@Override
|
||||
public void onLoadMore() {
|
||||
}
|
||||
|
||||
public void onLoadMore() {}
|
||||
});
|
||||
checkOk.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
@ -293,7 +287,6 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
checkOk.setChecked(false);
|
||||
Toast.makeText(getActivity(), "您的等级暂不具备此权限哦", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
filterAdapter.setItemCLick(new FilterAdapter.ItemCLick() {
|
||||
@ -306,13 +299,13 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
EventBus.getDefault().post(obtains);
|
||||
}
|
||||
});
|
||||
|
||||
filterAdapter.setItemOnCLick(new FilterAdapter.ItemOnCLick() {
|
||||
@Override
|
||||
public void item(PoiEntity poiEntity, boolean isChockBox) {
|
||||
if (isChockBox) {
|
||||
btnChock.add(poiEntity);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < btnChock.size(); i++) {
|
||||
if (poiEntity.getId().equals(btnChock.get(i).getId())) {
|
||||
btnChock.remove(poiEntity);
|
||||
@ -343,7 +336,6 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "您的等级暂不具备此权限哦", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
break;
|
||||
case R.id.btn_filter:
|
||||
Message obtain = Message.obtain();
|
||||
@ -380,7 +372,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
});
|
||||
break;
|
||||
case R.id.cl_photograph:
|
||||
BottomMenu.show((AppCompatActivity) Objects.requireNonNull(getContext()), new String[]{"全部", "普通任务", "专属任务"}, new OnMenuItemClickListener() {
|
||||
BottomMenu.show((AppCompatActivity) Objects.requireNonNull(getContext()), new String[]{"全部", "普通任务", "专属任务", "挑战任务", "奖励任务"}, new OnMenuItemClickListener() {
|
||||
@Override
|
||||
public void onClick(String text, int index) {
|
||||
tvPhotograph.setText(text);
|
||||
@ -394,6 +386,12 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
case 2:
|
||||
Constant.LIMIT_TYPE = 1;
|
||||
break;
|
||||
case 3:
|
||||
Constant.LIMIT_TYPE = 2;
|
||||
break;
|
||||
case 4:
|
||||
Constant.LIMIT_TYPE = 3;
|
||||
break;
|
||||
}
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||
@ -477,10 +475,8 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 批量领取
|
||||
*
|
||||
* @param taskId
|
||||
*/
|
||||
private void initBatch(String taskId) {
|
||||
HttpParams httpParams = new HttpParams();
|
||||
@ -517,13 +513,10 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 通过不同类型的type 进行批量领取
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
private void initType(FilterBatchBean.BodyBean.SuccessBean successBean) {
|
||||
switch (successBean.getType()) {
|
||||
@ -579,7 +572,6 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdateChargingPile(getActivity(), chargingPileEntityList);
|
||||
}
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), chargingStationEntity);
|
||||
|
||||
}
|
||||
}).start();
|
||||
break;
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
@ -54,8 +55,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
private PoiDao poiDao;
|
||||
private ChargingPileDao chargingPileDao;
|
||||
|
||||
|
||||
|
||||
public static GatherGetFragment newInstance(Bundle bundle) {
|
||||
GatherGetFragment fragment = new GatherGetFragment();
|
||||
fragment.setArguments(bundle);
|
||||
@ -75,6 +74,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
getView().setOnKeyListener(new View.OnKeyListener() {
|
||||
@Override
|
||||
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
||||
|
||||
if (event.getAction() == KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
assert getArguments() != null;
|
||||
boolean aBoolean = getArguments().getBoolean("boolean", false);
|
||||
@ -98,6 +98,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
return R.layout.fragment_gather_get;
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
@ -137,11 +138,9 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
tvTime.setText("到期时间:" + poiEntity.getCreateTime());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
assert poiEntity != null;
|
||||
if (poiEntity.getDist() != null) {
|
||||
tvDistance.setText("距离:" + format5(Double.valueOf(poiEntity.getDist()) / 1000) + "km");
|
||||
tvDistance.setText("距离:" + format5(Double.parseDouble(poiEntity.getDist()) / 1000) + "km");
|
||||
}
|
||||
if (poiEntity.getRecord_way()==0){//不可领取
|
||||
btnGetTask.setEnabled(false);
|
||||
@ -196,7 +195,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
@ -223,15 +221,15 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
if (type == 6) {//面状任务的领取类型
|
||||
initPolygonTask(HttpInterface.RECEIVED_POLYGON_TASK, poiEntity.getTaskId(), false);
|
||||
} else if (type == 1) {//poi的领取类型
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK, poiEntity.getTaskId(), false, poiEntity, 1);
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK, poiEntity.getTaskId(), false, 1);
|
||||
} else if (type == 2) {//充电站的领取类型
|
||||
chargingTaskByWork(HttpInterface.RECEIVED_CTASK, poiEntity.getTaskId(), false, 1);
|
||||
} else if (type == 3) {//poi录像的领取类型
|
||||
taskByNet(HttpInterface.RECEIVED_POI_VIDEO_TASK, poiEntity.getTaskId(), false, poiEntity, 1);
|
||||
taskByNet(HttpInterface.RECEIVED_POI_VIDEO_TASK, poiEntity.getTaskId(), false, 1);
|
||||
} else if (type == 4) {//道路的领取类型
|
||||
taskByNet(HttpInterface.RECEIVED_ROAD_TASK, poiEntity.getTaskId(), false, poiEntity, 1);
|
||||
taskByNet(HttpInterface.RECEIVED_ROAD_TASK, poiEntity.getTaskId(), false, 1);
|
||||
} else if (type == 5) {//其他的领取类型
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK, poiEntity.getTaskId(), false, poiEntity, 1);
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK, poiEntity.getTaskId(), false, 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -249,8 +247,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
}else {
|
||||
if (geometry>50){
|
||||
// Voice.sprat("注意在附近50米范围内进行采集",0);
|
||||
|
||||
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "注意在任务附近50米范围内进行采集", "确定").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
@ -314,19 +310,17 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
|
||||
}
|
||||
} else if (type == 1) {//poi的领取类型
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK, poiEntity.getTaskId(), true, poiEntity, 5);
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK, poiEntity.getTaskId(), true, 5);
|
||||
} else if (type == 2) {//充电站的领取类型
|
||||
chargingTaskByWork(HttpInterface.RECEIVED_CTASK, poiEntity.getTaskId(), true, 5);
|
||||
} else if (type == 3) {//poi录像的领取类型
|
||||
taskByNet(HttpInterface.RECEIVED_POI_VIDEO_TASK, poiEntity.getTaskId(), true, poiEntity, 5);
|
||||
taskByNet(HttpInterface.RECEIVED_POI_VIDEO_TASK, poiEntity.getTaskId(), true, 5);
|
||||
} else if (type == 4) {//道路的领取类型
|
||||
taskByNet(HttpInterface.RECEIVED_ROAD_TASK, poiEntity.getTaskId(), true, poiEntity, 5);
|
||||
taskByNet(HttpInterface.RECEIVED_ROAD_TASK, poiEntity.getTaskId(), true, 5);
|
||||
} else if (type == 5) {//其他的领取类型
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK, poiEntity.getTaskId(), true, poiEntity, 5);
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK, poiEntity.getTaskId(), true, 5);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -366,7 +360,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
}else {
|
||||
chargingStationEntity.setTelPhone(stationBean.getTelephone());
|
||||
}
|
||||
chargingStationEntity.setType(Integer.valueOf(stationBean.getType()));
|
||||
chargingStationEntity.setType(stationBean.getType());
|
||||
chargingStationEntity.setTaskStatus(statusId);
|
||||
chargingStationEntity.setGeoWkt(stationBean.getGeo());
|
||||
String encodeStr = stationBean.getGeo();
|
||||
@ -386,7 +380,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
chargingStationEntity.setY(latLineString.get(0).latitude + "");
|
||||
break;
|
||||
}
|
||||
|
||||
//充电桩
|
||||
List<ReceivedBean.BodyBean.CsTaskListBean> csTaskList = response.getBody().getCsTaskList();
|
||||
if (csTaskList != null && !csTaskList.isEmpty()) {
|
||||
@ -504,7 +497,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
polygonEntity.setTaskStatus(1);
|
||||
}
|
||||
|
||||
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -538,11 +530,12 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param url 所以类型的结束领取
|
||||
* @param poiEntity
|
||||
* @param url
|
||||
* 所以类型的结束领取
|
||||
*/
|
||||
private void initEndReceiveTask(String url, int taskId, PoiEntity poiEntity) {
|
||||
if (taskId == 0) {
|
||||
@ -683,7 +676,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
poiDao.deleteFormTaskID(taskId);
|
||||
}
|
||||
}).start();
|
||||
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@ -698,12 +690,10 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param url poi类型对应的url
|
||||
* @param poiEntity
|
||||
*/
|
||||
private void receivedTaskByNet(String url, int taskId, boolean isSaver, PoiEntity poiEntity, int statusId) {
|
||||
private void receivedTaskByNet(String url, int taskId, boolean isSaver, int statusId) {
|
||||
showLoadingDialog();
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
@ -825,9 +815,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
|
||||
/**
|
||||
* @param url 不同任务类型对应的url
|
||||
* @param poiEntity
|
||||
*/
|
||||
private void taskByNet(String url, int taskId, boolean isSaver, PoiEntity poiEntity, int statusId) {
|
||||
private void taskByNet(String url, int taskId, boolean isSaver, int statusId) {
|
||||
showLoadingDialog();
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
|
@ -5,9 +5,9 @@ import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
@ -18,13 +18,11 @@ import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.github.lazylibrary.util.StringUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
|
||||
@ -45,28 +43,21 @@ import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||
import com.navinfo.outdoor.util.GetJsonDataUtil;
|
||||
import com.navinfo.outdoor.util.PhotoUtils;
|
||||
|
||||
import org.json.JSONArray;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Objects;
|
||||
|
||||
import static android.app.Activity.RESULT_OK;
|
||||
|
||||
/**
|
||||
* 收款信息
|
||||
*/
|
||||
public class GatheringFragment extends BaseFragment implements View.OnClickListener {
|
||||
|
||||
private TextView tvBank;
|
||||
private EditText etBankNum;
|
||||
private ImageView gatheringCamera;
|
||||
|
||||
private ArrayList<BankPathBean> jsonBean;
|
||||
private String value;
|
||||
|
||||
|
||||
public static GatheringFragment newInstance(Bundle bundle) {
|
||||
GatheringFragment fragment = new GatheringFragment();
|
||||
fragment.setArguments(bundle);
|
||||
@ -92,17 +83,27 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
tvBank.setOnClickListener(this);
|
||||
Button btnBank = findViewById(R.id.btn_bank);
|
||||
btnBank.setOnClickListener(this);
|
||||
TextView tvName = (TextView) findViewById(R.id.tv_name);
|
||||
etBankNum = (EditText) findViewById(R.id.et_bank_num);
|
||||
gatheringCamera = (ImageView) findViewById(R.id.gathering_camera);
|
||||
TextView tvName = findViewById(R.id.tv_name);
|
||||
etBankNum = findViewById(R.id.et_bank_num);
|
||||
gatheringCamera = findViewById(R.id.gathering_camera);
|
||||
gatheringCamera.setOnClickListener(this);
|
||||
if (Constant.NAME!=null){
|
||||
if (Constant.NAME != null) {
|
||||
tvName.setText(Constant.NAME);
|
||||
}
|
||||
if (Constant.ID_NUMBER!=null&&Constant.BACKGROUND_NAME!=null&&Constant.BACKGROUND!=null){
|
||||
/*
|
||||
String bankAccount = navInfo.getString("bankAccount", null);
|
||||
String bank = navInfo.getString("bankName", null);
|
||||
String idNumber = navInfo.getString("idNumber", null);
|
||||
if (bankAccount!=null&&!bankAccount.equals("")&&bank!=null&&!bank.equals("")&&idNumber!=null&&!idNumber.equals("")){
|
||||
etBankNum.setText(idNumber);
|
||||
tvBank.setText(bank);
|
||||
value=bankAccount;
|
||||
btnBank.setText("重新绑定");
|
||||
}*/
|
||||
if (Constant.ID_NUMBER != null && Constant.BACKGROUND_NAME != null && Constant.BACKGROUND != null) {
|
||||
etBankNum.setText(Constant.ID_NUMBER);
|
||||
tvBank.setText(Constant.BACKGROUND_NAME);
|
||||
value=Constant.BACKGROUND;
|
||||
value = Constant.BACKGROUND;
|
||||
btnBank.setText("重新绑定");
|
||||
}
|
||||
}
|
||||
@ -132,17 +133,51 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
RecyclerView rlvBank = dialog.findViewById(R.id.rlv_bank);
|
||||
rlvBank.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
|
||||
rlvBank.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
BankAdapter bankAdapter = new BankAdapter(jsonBean, getContext());
|
||||
BankAdapter bankAdapter = new BankAdapter(getContext());
|
||||
bankAdapter.setBankPathBeans(jsonBean);
|
||||
rlvBank.setAdapter(bankAdapter);
|
||||
bankAdapter.setOnBankClick(new BankAdapter.OnBankClick() {
|
||||
@Override
|
||||
public void onClick(int pos) {
|
||||
tvBank.setText(jsonBean.get(pos).getLabel());
|
||||
value = jsonBean.get(pos).getValue();
|
||||
bankAdapter.notifyDataSetChanged();
|
||||
public void onClick(BankPathBean bankPathBean) {
|
||||
tvBank.setText(bankPathBean.getLabel());
|
||||
value = bankPathBean.getValue();
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
EditText editText = dialog.findViewById(R.id.editText);
|
||||
ArrayList<BankPathBean> bankPathBeans = new ArrayList<>();
|
||||
editText.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
bankAdapter.setBankPathBeans(jsonBean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
bankPathBeans.clear();
|
||||
for (int i = 0; i < jsonBean.size(); i++) {
|
||||
String label = jsonBean.get(i).getLabel();
|
||||
if (label.contains(s.toString())){//含有
|
||||
BankPathBean bankPathBean = jsonBean.get(i);
|
||||
bankPathBeans.add(bankPathBean);
|
||||
}
|
||||
}
|
||||
bankAdapter.setBankPathBeans(bankPathBeans);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
bankPathBeans.clear();
|
||||
for (int i = 0; i < jsonBean.size(); i++) {
|
||||
String label = jsonBean.get(i).getLabel();
|
||||
if (label.contains(s.toString())){//含有
|
||||
BankPathBean bankPathBean = jsonBean.get(i);
|
||||
bankPathBeans.add(bankPathBean);
|
||||
}
|
||||
}
|
||||
bankAdapter.setBankPathBeans(bankPathBeans);
|
||||
}
|
||||
});
|
||||
Window window = dialog.getWindow();
|
||||
assert window != null;
|
||||
WindowManager.LayoutParams wlp = window.getAttributes();
|
||||
@ -155,7 +190,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
case R.id.btn_bank:
|
||||
if (etBankNum.getText().toString().equals("")) {
|
||||
Toast.makeText(getActivity(), "银行卡号不能为空", Toast.LENGTH_SHORT).show();
|
||||
Log.e("TAG", "onClick: "+etBankNum );
|
||||
Log.e("TAG", "onClick: " + etBankNum);
|
||||
return;
|
||||
}
|
||||
gatheringNetWork();
|
||||
@ -173,9 +208,9 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
private void gatheringNetWork() {
|
||||
ArrayList<File> gatheringList = new ArrayList<>();
|
||||
if (gatheringCamera.getTag() == null) {
|
||||
if (Constant.ID_NUMBER==null){
|
||||
if (Constant.ID_NUMBER == null) {
|
||||
Toast.makeText(getActivity(), "请先拍银行卡", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "如果需要重新绑定请先拍照银行卡", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
return;
|
||||
@ -214,18 +249,18 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "绑定成功", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
Constant.BACKGROUND =value;
|
||||
Constant.BACKGROUND_NAME=bank;
|
||||
Constant.BACKGROUND = value;
|
||||
Constant.BACKGROUND_NAME = bank;
|
||||
Constant.ID_NUMBER = etBankAccount;
|
||||
getActivity().finish();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "绑定失败", "确定","取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "绑定失败", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
Toast.makeText(getActivity(), response.getMessage()+"", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
@ -235,7 +270,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
Toast.makeText(getActivity(), e.getMessage()+"", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(getActivity(), e.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -255,18 +290,18 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
gatheringCamera.setTag(absolutePath);
|
||||
//银行卡识别
|
||||
BankCardBean bankCardBean = new Gson().fromJson(BankCard.bankCard(), BankCardBean.class);
|
||||
if (bankCardBean==null){
|
||||
if (bankCardBean == null) {
|
||||
Toast.makeText(getContext(), "识别失败,可以重新识别或则进行手动输入", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
if (bankCardBean.getResult()!=null&&bankCardBean.getResult().getBank_card_number()!=null){
|
||||
} else {
|
||||
if (bankCardBean.getResult() != null && bankCardBean.getResult().getBank_card_number() != null) {
|
||||
String bank_card_number = bankCardBean.getResult().getBank_card_number();
|
||||
if (StringUtils.isEmpty(bank_card_number)) {
|
||||
Toast.makeText(getActivity(), "识别失败,可以重新识别或则进行手动输入", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
etBankNum.setText(bank_card_number);
|
||||
String bankName = bankCardBean.getResult().getBank_name();
|
||||
}else {
|
||||
// String bankName = bankCardBean.getResult().getBank_name();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "识别失败,可以重新识别或则进行手动输入", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
@ -86,7 +86,6 @@ import java.util.Objects;
|
||||
* 2021-5-25
|
||||
*/
|
||||
public class PoiFragment extends BaseDrawerFragment implements View.OnClickListener {
|
||||
|
||||
private EditText editDescribe;
|
||||
private RelativeLayout rlPanorama, rlName, rlInternalPhotos, rlCard, rlElse;
|
||||
private ImageView ivPanorama, ivName, ivInternal, ivCard, ivElse;
|
||||
@ -104,10 +103,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
private RelativeLayout linearExist;
|
||||
private Spinner spinnerExist;
|
||||
String poiAddressName = "";
|
||||
|
||||
|
||||
//获取的拍照图片
|
||||
|
||||
private LinearLayout linearContact;
|
||||
private ContactView contactView;
|
||||
private ArrayList<File> poiPicList;
|
||||
@ -543,7 +539,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
Constant.CODE = code;
|
||||
Constant.TelLength = telLength;
|
||||
/* for (int i = 0; i < poiBeans.size(); i++) {
|
||||
/* for (int i = 0; i < poiBeans.size(); i++) {
|
||||
poiBeans.get(i).setArea(Constant.CODE);
|
||||
}
|
||||
contactView = new ContactView(getActivity(), linearContact, poiBeans);
|
||||
@ -552,8 +548,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(getActivity(), getPhoneBean.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@ -816,6 +810,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
HttpParams httpParams = new HttpParams();
|
||||
httpParams.put("auditId", body);
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
.url(HttpInterface.POI_TASK_UPLOAD_PIC)
|
||||
.cls(OtherUploadPicBean.class)
|
||||
.token(Constant.ACCESS_TOKEN)
|
||||
|
@ -74,7 +74,6 @@ import java.util.Objects;
|
||||
*/
|
||||
|
||||
public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClickListener {
|
||||
|
||||
private EditText etRoadName;
|
||||
private ImageView ivPoiVideoPicture;
|
||||
private EditText etDesc;
|
||||
@ -184,7 +183,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
btnRoadSave.setOnClickListener(this);
|
||||
Button btnPoiVideoUpload = findViewById(R.id.btn_poi_video_upload);
|
||||
btnPoiVideoUpload.setOnClickListener(this);
|
||||
|
||||
//添加数据
|
||||
initShowPoi();
|
||||
}
|
||||
@ -198,7 +196,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
if (name != null && !name.equals("")) {
|
||||
etRoadName.setText(name);
|
||||
}
|
||||
|
||||
String geoWkt = showPoiEntity.getGeoWkt();
|
||||
if (geoWkt!=null){
|
||||
String geo = Geohash.getInstance().decode(geoWkt);
|
||||
@ -231,7 +228,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
moveLatlng(latLng, null);
|
||||
}
|
||||
}
|
||||
|
||||
String describe = showPoiEntity.getMemo();//任务描述
|
||||
if (describe != null && !describe.equals("")) {
|
||||
etDesc.setText(describe);
|
||||
|
@ -26,7 +26,6 @@ import java.util.Objects;
|
||||
*/
|
||||
public class RecordFragment extends BaseFragment implements View.OnClickListener {
|
||||
|
||||
|
||||
private final String[] names = {"待提交", "已提交"};
|
||||
private StaySubmitFragment staySubmitFragment; // 待提交
|
||||
private HasSubmitFragment hasSubmitFragment;// 已提交
|
||||
|
@ -73,7 +73,6 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
|
||||
btnRegister.setOnClickListener(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
|
@ -246,7 +246,6 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
}
|
||||
fmRoadPic.setTag(fileListByUUID);
|
||||
}
|
||||
|
||||
/* String[] photos = photoList.split(",");
|
||||
List<File> videoFileList = new ArrayList<>();
|
||||
boolean isImageLoad = false;
|
||||
@ -374,7 +373,6 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
} else {
|
||||
Toast.makeText(getContext(), "有正在提交的数据,等提交成功后,方可操作", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
@ -564,7 +562,6 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
Log.d("TAG", "initRoadSharePre: " + newPoiEntity);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
|
@ -23,7 +23,6 @@ import java.util.Objects;
|
||||
public class SetFragment extends BaseFragment implements View.OnClickListener {
|
||||
|
||||
private SharedPreferences.Editor navInfoEditor;
|
||||
|
||||
public static SetFragment newInstance(Bundle bundle) {
|
||||
SetFragment fragment = new SetFragment();
|
||||
fragment.setArguments(bundle);
|
||||
|
@ -84,7 +84,6 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
roadDao = roadDatabase.getPoiDao();
|
||||
ConstraintLayout clStayType = findViewById(R.id.cl_stay_type);
|
||||
clStayType.setOnClickListener(this);
|
||||
RecyclerView stayXrv = findViewById(R.id.stay_xrv);
|
||||
cbSelect = findViewById(R.id.cb_select);
|
||||
cbSelect.setOnClickListener(this);
|
||||
TextView tvDelete = findViewById(R.id.tv_delete);
|
||||
@ -92,6 +91,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
tvStayType = findViewById(R.id.tv_stay_type);
|
||||
Button btnStaySubmit = findViewById(R.id.btn_stay_submit);
|
||||
btnStaySubmit.setOnClickListener(this);
|
||||
RecyclerView stayXrv = findViewById(R.id.stay_xrv);
|
||||
stayXrv.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
stayXrv.addItemDecoration(new DividerItemDecoration(Objects.requireNonNull(getContext()), DividerItemDecoration.VERTICAL));
|
||||
staySubmitAdapter = new StaySubmitAdapter(getContext());
|
||||
@ -104,12 +104,10 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
subObtain.what = Constant.EVENT_WORK_HOME;
|
||||
subObtain.obj = true;
|
||||
EventBus.getDefault().post(subObtain);
|
||||
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.EVENT_WHAT_COMPLETE_TASK;
|
||||
obtain.obj = poiEntity;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
}
|
||||
});
|
||||
//全选
|
||||
@ -281,12 +279,10 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
Toast.makeText(getActivity(), e.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -307,7 +303,6 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
} else {
|
||||
newEntities.clear();
|
||||
}
|
||||
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -317,7 +312,6 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
public void run() {
|
||||
roadEntities.clear();
|
||||
roadEntities.addAll(roadAll);
|
||||
|
||||
// for (int i = 0; i < roadAll.size(); i++) {
|
||||
// if (roadAll.get(i).getType()!=6){
|
||||
// roadEntities.add(roadAll.get(i));
|
||||
|
@ -69,7 +69,6 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
|
||||
taskPage=1;
|
||||
initNetwork(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMore() {
|
||||
initNetwork(false);
|
||||
@ -111,11 +110,9 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
|
||||
public void onSuccess(TaskPrefectureBean taskPrefectureBean, int id) {
|
||||
dismissLoadingDialog();
|
||||
initTaskPrefectureBean(taskPrefectureBean,aNet);
|
||||
|
||||
Log.d("TAG", "onSuccess: " + taskPrefectureBean.getMessage() + "");
|
||||
//initTaskSpecification(taskSpecificationBean,start);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
|
@ -183,10 +183,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
* 刷新筛选界面数据
|
||||
*/
|
||||
private void refreshFilterData() {
|
||||
|
||||
String dataTime = sharedPreferences.getString("dataTime", null);
|
||||
int type = sharedPreferences.getInt("type", 0);
|
||||
|
||||
if (type == 0) {//隐藏
|
||||
ivMassNotification.setVisibility(View.GONE);
|
||||
} else {//显示S
|
||||
@ -204,13 +202,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
if (result>=0){
|
||||
//进行请求
|
||||
initMessageNotice();
|
||||
}else {
|
||||
//无需请求
|
||||
|
||||
}else {//无需请求
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Message msg = Message.obtain();
|
||||
msg.what = Constant.FILTER_DATA_CLEAR;
|
||||
EventBus.getDefault().post(msg);
|
||||
@ -222,15 +216,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "未开启定位服务", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 给时间加上几个小时
|
||||
*
|
||||
* @param day 当前时间 格式:yyyy-MM-dd HH:mm:ss
|
||||
* @param hour 需要加的时间
|
||||
* @return
|
||||
*/
|
||||
public static String addDateMinot(String day, int hour) {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
@ -252,7 +242,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
Log.d("TAGss", "addDateMinut: " + format.format(date));
|
||||
cal = null;
|
||||
return format.format(date);
|
||||
|
||||
}
|
||||
|
||||
private void initMessageNotice() {
|
||||
@ -289,14 +278,12 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
Toast.makeText(getActivity(), messageNoticeBean.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("CommitPrefEdits")
|
||||
@ -306,14 +293,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
EventBus.getDefault().register(this);
|
||||
sharedPreferences = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.MESSAGE_TYPE, Context.MODE_PRIVATE);
|
||||
sharedEdit = sharedPreferences.edit();
|
||||
|
||||
//fragment 管理器
|
||||
|
||||
supportFragmentManager = Objects.requireNonNull(getActivity()).getSupportFragmentManager();
|
||||
PoiDatabase poiDatabase = PoiDatabase.getInstance(getContext());
|
||||
poiDao = poiDatabase.getPoiDao();
|
||||
builder = new AlertDialog.Builder(Objects.requireNonNull(getActivity()));
|
||||
|
||||
sliding_layout = findViewById(R.id.sliding_layout);
|
||||
LinearLayout dragView = findViewById(R.id.dragView);
|
||||
frameLayout = findViewById(R.id.frame_layout);
|
||||
@ -340,7 +324,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
} else {
|
||||
tencentMap.setMapType(TencentMap.MAP_TYPE_NORMAL);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
//地图放大
|
||||
@ -393,7 +376,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
//检查是否有没有填完的页面
|
||||
initSharePre();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
}
|
||||
@ -410,7 +392,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
treasureMap.getLayoutParams().width = widthHeight[0];
|
||||
treasureMap.getLayoutParams().height = widthHeight[1];
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到电话区号,电话位数
|
||||
*/
|
||||
@ -436,7 +417,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
Constant.TelLength = telLength;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
@ -444,7 +424,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private static class NestedScrollableViewHelper extends ScrollableViewHelper {
|
||||
public int getScrollableViewScrollPosition(View mScrollableView, boolean isSlidingUp) {
|
||||
if (mScrollableView instanceof NestedScrollView) {
|
||||
@ -490,7 +469,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
Log.d("TAG", "onSuccess: " + response.getCode() + response.getMessage() + "" + response.getBody());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
Log.d("TAG", "onSuccess:" + e.getMessage() + "");
|
||||
@ -593,7 +571,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
if (latLineString != null && latLineString.size() > 0) {
|
||||
latLng = latLineString.get(0);
|
||||
}
|
||||
|
||||
break;
|
||||
case "Point": //点
|
||||
latLng = GeometryTools.createLatLng(geo);
|
||||
@ -715,7 +692,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
LatLng lng = GeometryTools.createLatLng(key);
|
||||
latList.add(lng);
|
||||
}
|
||||
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.JOB_SEARCH_WORD;
|
||||
obtain.obj = response;
|
||||
@ -723,9 +699,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
} else {
|
||||
Toast.makeText(getActivity(), response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
@ -775,7 +749,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.road_arrows);
|
||||
} else if (poiEntity.getType() == 4) {//道路录像
|
||||
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_arrows);
|
||||
|
||||
}
|
||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
||||
// 构造 PolylineOnions
|
||||
@ -907,7 +880,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
if (poiEntity.getTaskStatus()==1){
|
||||
color= Color.parseColor("#FFE70C");
|
||||
}else {
|
||||
color= Color.parseColor("#7fffffff");
|
||||
color= Color.parseColor("#BDBDBD");
|
||||
}
|
||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
||||
// 构造 PolylineOnions
|
||||
@ -1342,9 +1315,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
/*
|
||||
* 控制主界面各个按钮的显示状态
|
||||
*/
|
||||
private void setMainButtonVisitable(int visitable) {
|
||||
@ -1357,9 +1328,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
ivFilter.setVisibility(visitable);
|
||||
ivMessage.setVisibility(visitable);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
/*
|
||||
* 设置定位图标样式
|
||||
*/
|
||||
private void setLocMarkerStyle() {
|
||||
@ -1376,7 +1345,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
tencentMap.setMyLocationStyle(locationStyle);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 定位的一些初始化设置
|
||||
*/
|
||||
private void initLocation() {
|
||||
@ -1649,7 +1618,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
Toast.makeText(getActivity(), "申请权限失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDenied(List<String> permissions, boolean never) {
|
||||
if (never) {
|
||||
@ -1688,27 +1656,30 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
//多点
|
||||
MultiPoint multiPoint = GeometryTools.createMultiPoint(latList);
|
||||
//拿到覆蓋點
|
||||
Geometry intersection = polygon.intersection(multiPoint);
|
||||
if (intersection == null) {
|
||||
if (multiPoint == null) {
|
||||
initEntity(marker, true);
|
||||
} else {
|
||||
if (intersection.getGeometryType().equals("MultiPoint")) {
|
||||
List<LatLng> latList = GeometryTools.getLatList(intersection);
|
||||
for (int i = 0; i < latList.size(); i++) {
|
||||
LatLng latL = latList.get(i);
|
||||
Geometry geometry = GeometryTools.createGeometry(latL);
|
||||
Log.d("TAG", "onMarkerClick: " + geometry.toString());
|
||||
List<Marker> markerList = removableHashMap.get(geometry.toText());
|
||||
if (markerList != null) {
|
||||
for (Marker mar : markerList) {
|
||||
initEntity(mar, false);
|
||||
Geometry intersection = polygon.intersection(multiPoint);
|
||||
if (intersection!=null){
|
||||
if (intersection.getGeometryType().equals("MultiPoint")) {
|
||||
List<LatLng> latList = GeometryTools.getLatList(intersection);
|
||||
for (int i = 0; i < latList.size(); i++) {
|
||||
LatLng latL = latList.get(i);
|
||||
Geometry geometry = GeometryTools.createGeometry(latL);
|
||||
Log.d("TAG", "onMarkerClick: " + geometry.toString());
|
||||
List<Marker> markerList = removableHashMap.get(geometry.toText());
|
||||
if (markerList != null) {
|
||||
for (Marker mar : markerList) {
|
||||
initEntity(mar, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
customDialog(poiEntityArrayList, marker);
|
||||
} else {
|
||||
initEntity(marker, true);
|
||||
}
|
||||
customDialog(poiEntityArrayList, marker);
|
||||
} else {
|
||||
initEntity(marker, true);
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -1971,7 +1942,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
|
@ -32,7 +32,6 @@ import java.util.Objects;
|
||||
*/
|
||||
public class VideoFragment extends BaseFragment implements View.OnClickListener {
|
||||
|
||||
|
||||
private ArrayList<FileBean> fileBeans;
|
||||
private ArrayList<FileBean> deleteFiles;
|
||||
private VideoAdapter videoAdapter;
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
@ -98,16 +99,16 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
});
|
||||
Button btWithdraw = findViewById(R.id.button);
|
||||
btWithdraw.setOnClickListener(this);
|
||||
poiPushMoney = (TextView) findViewById(R.id.poi_push_money);
|
||||
poiReportMoney = (TextView) findViewById(R.id.poi_report_money);
|
||||
poiVideoPushMoney = (TextView) findViewById(R.id.poiVideo_push_money);
|
||||
poiVideoReportMoney = (TextView) findViewById(R.id.poiVideo_report_money);
|
||||
roadPushMoney = (TextView) findViewById(R.id.road_push_money);
|
||||
roadReportMoney = (TextView) findViewById(R.id.road_report_money);
|
||||
chargingPushMoney = (TextView) findViewById(R.id.charging_push_money);
|
||||
chargingReportMoney = (TextView) findViewById(R.id.charging_report_money);
|
||||
otherPushMoney = (TextView) findViewById(R.id.other_push_money);
|
||||
otherReportMoney = (TextView) findViewById(R.id.other_report_money);
|
||||
poiPushMoney = findViewById(R.id.poi_push_money);
|
||||
poiReportMoney = findViewById(R.id.poi_report_money);
|
||||
poiVideoPushMoney = findViewById(R.id.poiVideo_push_money);
|
||||
poiVideoReportMoney = findViewById(R.id.poiVideo_report_money);
|
||||
roadPushMoney = findViewById(R.id.road_push_money);
|
||||
roadReportMoney = findViewById(R.id.road_report_money);
|
||||
chargingPushMoney = findViewById(R.id.charging_push_money);
|
||||
chargingReportMoney = findViewById(R.id.charging_report_money);
|
||||
otherPushMoney = findViewById(R.id.other_push_money);
|
||||
otherReportMoney = findViewById(R.id.other_report_money);
|
||||
initNetWork();
|
||||
}
|
||||
|
||||
@ -120,6 +121,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
.token(Constant.ACCESS_TOKEN)
|
||||
.params(new HttpParams())
|
||||
.getRequest(new Callback<GetPriceBean>() {
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void onSuccess(GetPriceBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
@ -149,7 +151,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
// Toast.makeText(getContext(), "获取失败" + e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(getContext(), "获取失败" + e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
|
@ -3,9 +3,9 @@ package com.navinfo.outdoor.http;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
|
||||
public class HttpInterface {
|
||||
public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
|
||||
public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口T
|
||||
public static final String DATA_IP = "http://172.23.139.4:9999/m4";//接口
|
||||
public static final String IP_TEXt = "http://dtxbmaps.navinfo.com/dtxb_test/m4";//测试接口
|
||||
public static final String IP_TEXT = "http://dtxbmaps.navinfo.com/dtxb_test/m4";//测试接口
|
||||
public static final String TEST_GUIDANCE_IP = "http://172.21.98.90:9999/m4";//引导页完成接口
|
||||
public static final String APKIP = "http://172.23.139.4:8001/";
|
||||
public static final String USER_PATH = "/user/";//我的
|
||||
|
@ -130,11 +130,14 @@ public class OkGoBuilder<T> {
|
||||
callback.onError(new Throwable("网络不可用"),2);
|
||||
return;
|
||||
}
|
||||
long time = System.currentTimeMillis();
|
||||
params.put("datetime", time);
|
||||
OkGo
|
||||
.<T>post(url)
|
||||
.isMultipart(true)
|
||||
.headers(getHeader())
|
||||
.upString(json, MediaType.parse("application/json"))
|
||||
.params(params)
|
||||
.tag(this)
|
||||
.execute(new DialogCallback<T>(clazz) {
|
||||
@Override
|
||||
@ -162,8 +165,6 @@ public class OkGoBuilder<T> {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* post异步请求
|
||||
*/
|
||||
|
@ -13,7 +13,18 @@ import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.util.SdkFolderCreate;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/*
|
||||
* (1) 使用entities来映射相关的实体类
|
||||
* (2) version来指明当前数据库的版本号
|
||||
* (3) 使用了单例模式来返回Database,以防止新建过多的实例造成内存的浪费
|
||||
*(4)Room.databaseBuilder(context,class,name).build()来创建Database,
|
||||
* 其中第一个参数为上下文,
|
||||
* 第二个参数为当前Database的class字节码文件,
|
||||
* 第三个参数为数据库名称
|
||||
* 注意事项:默认情况下Database是不可以在主线程中进行调用的。
|
||||
* 因为大部分情况,操作数据库都还算是比较耗时的动作。
|
||||
* 如果需要在主线程调用则使用allowMainThreadQueries进行说明。
|
||||
*/
|
||||
@Database(entities = {PoiEntity.class,ChargingPileEntity.class}, version = 2, exportSchema = false)
|
||||
public abstract class PoiDatabase extends RoomDatabase {
|
||||
private static final String DB_NAME = "navinfo.db";
|
||||
|
@ -45,8 +45,8 @@ public class PoiEntity implements Serializable {
|
||||
private int taskStatus;//任务状态 0.未领取 1.已领取,5 立即采集,2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功),4已上传(结束采集)
|
||||
private int type;//1 "POI"2 "充电站"3 "POI录像"4 "道路录像"5 "其他"6 "面状任务"
|
||||
private int station_type;//1."充电站"2 "充换电站"3 "充电桩组"4 "换电站"5 "门牌", "公交:6 情报:7
|
||||
private int isLocalData;//
|
||||
private int isExclusive;//任务类型 0.普通任务,1.专属任务
|
||||
private int isLocalData;//是否是本地数据 0,服务 1,本地
|
||||
private int isExclusive;//任务类型 0.普通任务,1.专属任务 2挑战任务, 3奖励任务
|
||||
private int bodyId;//保存本地的bodyId
|
||||
private int work_type;//0."车行" 1."自行车" 2."步行"
|
||||
private int record_way; //等同于 canReceived : 1是可领取 0是不可领取
|
||||
|
@ -17,33 +17,35 @@ import javax.crypto.NoSuchPaddingException;
|
||||
|
||||
public class Geohash {
|
||||
|
||||
private Geohash(){}
|
||||
private Geohash() {
|
||||
}
|
||||
|
||||
private static class GeorasInstance {
|
||||
private static final Geohash INSTANCE = new Geohash();
|
||||
}
|
||||
private static class GeorasInstance {
|
||||
private static final Geohash INSTANCE = new Geohash();
|
||||
}
|
||||
|
||||
public static Geohash getInstance(){
|
||||
return GeorasInstance.INSTANCE;
|
||||
}
|
||||
public static Geohash getInstance() {
|
||||
return GeorasInstance.INSTANCE;
|
||||
}
|
||||
|
||||
private static int nubbins = 6 * 5;
|
||||
/*
|
||||
* final static char[] digits = { '0', '1', '2', '3', '4', '5', '6', '7',
|
||||
* '8', '9', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'm', 'n', 'p',
|
||||
* 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
|
||||
*/
|
||||
// 为了加密,所以改了base32编码代码表
|
||||
final static char[] digits = { 'd', 'f', 'g', 'y', 'n', 't', 'u', 'v', 'q',
|
||||
'b', '9', 's', 'z', '7', 'i', '2', 'h', '5', '0', 'p', '4', 'm',
|
||||
'8', 'x', 'c', 'j', '6', 'e', '1', 'r', '3', 'k' };
|
||||
private static int nubbins = 6 * 5;
|
||||
/*
|
||||
* final static char[] digits = { '0', '1', '2', '3', '4', '5', '6', '7',
|
||||
* '8', '9', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'm', 'n', 'p',
|
||||
* 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
|
||||
*/
|
||||
// 为了加密,所以改了base32编码代码表
|
||||
final static char[] digits = {'d', 'f', 'g', 'y', 'n', 't', 'u', 'v', 'q',
|
||||
'b', '9', 's', 'z', '7', 'i', '2', 'h', '5', '0', 'p', '4', 'm',
|
||||
'8', 'x', 'c', 'j', '6', 'e', '1', 'r', '3', 'k'};
|
||||
|
||||
final static HashMap<Character, Integer> lookup = new HashMap<Character, Integer>();
|
||||
static {
|
||||
int i = 0;
|
||||
for (char c : digits)
|
||||
lookup.put(c, i++);
|
||||
}
|
||||
final static HashMap<Character, Integer> lookup = new HashMap<Character, Integer>();
|
||||
|
||||
static {
|
||||
int i = 0;
|
||||
for (char c : digits)
|
||||
lookup.put(c, i++);
|
||||
}
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// String s = "1rn7exd5uhxy";
|
||||
@ -53,12 +55,13 @@ public class Geohash {
|
||||
// System.out.println(new Geohash().encode(40.073556024581194, 116.24643344432116));
|
||||
// }
|
||||
|
||||
//数据解密
|
||||
/**
|
||||
* @param geohash 需要被解密的字符串
|
||||
* @return double[] 经纬度double数组,纬度(latitude)在前,经度在后(longitude)
|
||||
* */
|
||||
public String decode(String geohash) {
|
||||
//数据解密
|
||||
|
||||
/**
|
||||
* @param geohash 需要被解密的字符串
|
||||
* @return double[] 经纬度double数组,纬度(latitude)在前,经度在后(longitude)
|
||||
*/
|
||||
public String decode(String geohash) {
|
||||
// try {
|
||||
// StringBuilder buffer = new StringBuilder();
|
||||
// for (char c : geohash.toCharArray()) {
|
||||
@ -100,99 +103,100 @@ public class Geohash {
|
||||
// re.printStackTrace();
|
||||
// return null;
|
||||
// }
|
||||
try {
|
||||
return Base64.desDecrypt(geohash);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchPaddingException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InvalidKeyException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InvalidAlgorithmParameterException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalBlockSizeException e) {
|
||||
e.printStackTrace();
|
||||
} catch (BadPaddingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Base64.desDecrypt(geohash);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchPaddingException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InvalidKeyException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InvalidAlgorithmParameterException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalBlockSizeException e) {
|
||||
e.printStackTrace();
|
||||
} catch (BadPaddingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private double decode(BitSet bs, double floor, double ceiling) {
|
||||
double mid = 0;
|
||||
for (int i = 0; i < bs.length(); i++) {
|
||||
mid = (floor + ceiling) / 2;
|
||||
if (bs.get(i))
|
||||
floor = mid;
|
||||
else
|
||||
ceiling = mid;
|
||||
}
|
||||
return mid;
|
||||
}
|
||||
private double decode(BitSet bs, double floor, double ceiling) {
|
||||
double mid = 0;
|
||||
for (int i = 0; i < bs.length(); i++) {
|
||||
mid = (floor + ceiling) / 2;
|
||||
if (bs.get(i))
|
||||
floor = mid;
|
||||
else
|
||||
ceiling = mid;
|
||||
}
|
||||
return mid;
|
||||
}
|
||||
|
||||
//数据加密
|
||||
/**
|
||||
* @param lat,lon 需要被加密的double 值
|
||||
* */
|
||||
public String encode(double lat, double lon) {
|
||||
// BitSet latbits = getBits(lat, -90, 90);
|
||||
// BitSet lonbits = getBits(lon, -180, 180);
|
||||
// StringBuilder buffer = new StringBuilder();
|
||||
// for (int i = 0; i < numbits; i++) {
|
||||
// buffer.append((lonbits.get(i)) ? '1' : '0');
|
||||
// buffer.append((latbits.get(i)) ? '1' : '0');
|
||||
// }
|
||||
Geometry geometry = GeometryTools.createGeometry(new LatLng(lat, lon));
|
||||
try {
|
||||
return Base64.desEncrypt(geometry.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public String encodeList(List<LatLng> latLngs){
|
||||
String lineString = GeometryTools.getLineString(latLngs);
|
||||
try {
|
||||
return Base64.desEncrypt(lineString);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private BitSet getBits(double lat, double floor, double ceiling) {
|
||||
BitSet buffer = new BitSet(nubbins);
|
||||
for (int i = 0; i < nubbins; i++) {
|
||||
double mid = (floor + ceiling) / 2;
|
||||
if (lat >= mid) {
|
||||
buffer.set(i);
|
||||
floor = mid;
|
||||
} else {
|
||||
ceiling = mid;
|
||||
}
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
/**
|
||||
* @param lat,lon 需要被加密的double
|
||||
*/
|
||||
public String encode(double lat, double lon) {
|
||||
/*BitSet latbits = getBits(lat, -90, 90);
|
||||
BitSet lonbits = getBits(lon, -180, 180);
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
for (int i = 0; i < numbits; i++) {
|
||||
buffer.append((lonbits.get(i)) ? '1' : '0');
|
||||
buffer.append((latbits.get(i)) ? '1' : '0');
|
||||
}*/
|
||||
Geometry geometry = GeometryTools.createGeometry(new LatLng(lat, lon));
|
||||
try {
|
||||
return Base64.desEncrypt(geometry.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String base32(long i) {
|
||||
char[] buf = new char[65];
|
||||
int charPos = 64;
|
||||
boolean negative = (i < 0);
|
||||
if (!negative)
|
||||
i = -i;
|
||||
while (i <= -32) {
|
||||
buf[charPos--] = digits[(int) (-(i % 32))];
|
||||
i /= 32;
|
||||
}
|
||||
buf[charPos] = digits[(int) (-i)];
|
||||
public String encodeList(List<LatLng> latLngs) {
|
||||
String lineString = GeometryTools.getLineString(latLngs);
|
||||
try {
|
||||
return Base64.desEncrypt(lineString);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
if (negative)
|
||||
buf[--charPos] = '-';
|
||||
return new String(buf, charPos, (65 - charPos));
|
||||
}
|
||||
private BitSet getBits(double lat, double floor, double ceiling) {
|
||||
BitSet buffer = new BitSet(nubbins);
|
||||
for (int i = 0; i < nubbins; i++) {
|
||||
double mid = (floor + ceiling) / 2;
|
||||
if (lat >= mid) {
|
||||
buffer.set(i);
|
||||
floor = mid;
|
||||
} else {
|
||||
ceiling = mid;
|
||||
}
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
||||
public static String base32(long i) {
|
||||
char[] buf = new char[65];
|
||||
int charPos = 64;
|
||||
boolean negative = (i < 0);
|
||||
if (!negative)
|
||||
i = -i;
|
||||
while (i <= -32) {
|
||||
buf[charPos--] = digits[(int) (-(i % 32))];
|
||||
i /= 32;
|
||||
}
|
||||
buf[charPos] = digits[(int) (-i)];
|
||||
|
||||
if (negative)
|
||||
buf[--charPos] = '-';
|
||||
return new String(buf, charPos, (65 - charPos));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -44,7 +44,6 @@ public class GeometryTools {
|
||||
|
||||
/**
|
||||
* 返回点几何
|
||||
*
|
||||
* @param gp
|
||||
* @return Geometry
|
||||
*/
|
||||
@ -62,7 +61,6 @@ public class GeometryTools {
|
||||
|
||||
/**
|
||||
* 返回点几何
|
||||
* @param gp
|
||||
* @param formatDouble5
|
||||
* @return Geometry
|
||||
*/
|
||||
@ -78,9 +76,7 @@ public class GeometryTools {
|
||||
Geometry geo = factory.createPoint(coordinate);
|
||||
return geo;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
public static Geometry createGeometry(double[] coor) {
|
||||
@ -90,14 +86,11 @@ public class GeometryTools {
|
||||
Geometry geo = factory.createPoint(coordinate);
|
||||
return geo;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 获取多面
|
||||
*
|
||||
* @param polygons
|
||||
* @return
|
||||
*/
|
||||
@ -106,21 +99,16 @@ public class GeometryTools {
|
||||
return null;
|
||||
MultiPolygon multiPolygon = null;
|
||||
GeometryFactory factory = new GeometryFactory();
|
||||
|
||||
try {
|
||||
|
||||
multiPolygon = factory.createMultiPolygon(polygons);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return multiPolygon;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 获取多线
|
||||
*
|
||||
* @param lineStrings
|
||||
* @return
|
||||
*/
|
||||
@ -141,10 +129,10 @@ public class GeometryTools {
|
||||
return multiLineString;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 创建集合
|
||||
*
|
||||
* @param coords []
|
||||
* @param Coordinate []
|
||||
* @return Geometry
|
||||
*/
|
||||
public MultiPoint createMultiPoint(Coordinate[] coords) {
|
||||
@ -179,27 +167,21 @@ public class GeometryTools {
|
||||
return null;
|
||||
|
||||
MultiPoint createMultiPoint = null;
|
||||
|
||||
GeometryFactory factory = new GeometryFactory();
|
||||
|
||||
try {
|
||||
Coordinate[] coords = new Coordinate[list.size()];
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
coords[i] = new Coordinate(list.get(i).getLongitude(), list.get(i).getLatitude());
|
||||
}
|
||||
|
||||
createMultiPoint = factory.createMultiPoint(coords);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
e.getLocalizedMessage();
|
||||
}
|
||||
|
||||
return createMultiPoint;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
/*
|
||||
* 返回点几何
|
||||
*
|
||||
* @param wkt
|
||||
@ -211,16 +193,12 @@ public class GeometryTools {
|
||||
return null;
|
||||
|
||||
WKTReader reader = new WKTReader();
|
||||
|
||||
Geometry geometry;
|
||||
try {
|
||||
|
||||
geometry = reader.read(wkt);
|
||||
|
||||
if (geometry != null) {
|
||||
return geometry;
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
@ -229,10 +207,10 @@ public class GeometryTools {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 创建多边形几何
|
||||
*
|
||||
* @param coords []
|
||||
* @param Coordinate []
|
||||
* @return Geometry
|
||||
*/
|
||||
public static String createPolygon(Coordinate[] coords) {
|
||||
@ -245,9 +223,8 @@ public class GeometryTools {
|
||||
return gon.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 创建多边形几何
|
||||
*
|
||||
* @param LatLngList
|
||||
* @return Polygon
|
||||
*/
|
||||
@ -263,25 +240,21 @@ public class GeometryTools {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* *//**
|
||||
/*
|
||||
* 创建线
|
||||
*
|
||||
* @param coords
|
||||
* []
|
||||
* @param coords []
|
||||
* @return Geometry
|
||||
*
|
||||
* *//*
|
||||
* */
|
||||
/*
|
||||
public String createLineString(Coordinate[] coords) {
|
||||
LineString lineString = null;
|
||||
GeometryFactory factory = new GeometryFactory();
|
||||
lineString = factory.createLineString(coords);
|
||||
return lineString.toString();
|
||||
}
|
||||
*/
|
||||
}*/
|
||||
|
||||
/**
|
||||
/*
|
||||
* 创建线
|
||||
*
|
||||
* @param coords []
|
||||
* @return Geometry
|
||||
*/
|
||||
@ -365,9 +338,8 @@ public class GeometryTools {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 计算两点距离
|
||||
*
|
||||
* @param startLatLng
|
||||
* @param endLatLng
|
||||
* @return double:单位 米
|
||||
@ -437,8 +409,7 @@ public class GeometryTools {
|
||||
y = (point2.getLatitude() - point1.getLatitude()) * dx;
|
||||
y = point2.getLatitude() - y;
|
||||
}
|
||||
LatLng LatLng = new LatLng(y, x);
|
||||
return LatLng;
|
||||
return new LatLng(y, x);
|
||||
} else {
|
||||
if (total - a < 4) {
|
||||
return points.get(i + 1);
|
||||
@ -528,10 +499,9 @@ public class GeometryTools {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* LINESTRING (116.4206899999999933 39.9620999999999995,
|
||||
* 116.4184900000000056 39.9620600000000010)
|
||||
*
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
@ -543,9 +513,9 @@ public class GeometryTools {
|
||||
if (geometry != null) {
|
||||
Coordinate[] coordinates = geometry.getCoordinates();
|
||||
if (coordinates != null && coordinates.length > 0) {
|
||||
list = new ArrayList<LatLng>();
|
||||
for (Coordinate coor : coordinates) {
|
||||
list.add(new LatLng(coor.y, coor.x));
|
||||
list = new ArrayList<>();
|
||||
for (Coordinate color : coordinates) {
|
||||
list.add(new LatLng(color.y, color.x));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -557,8 +527,8 @@ public class GeometryTools {
|
||||
Coordinate[] coordinates = geo.getCoordinates();
|
||||
if (coordinates != null && coordinates.length > 0) {
|
||||
list = new ArrayList<LatLng>();
|
||||
for (Coordinate coor : coordinates) {
|
||||
list.add(new LatLng(coor.y, coor.x));
|
||||
for (Coordinate color : coordinates) {
|
||||
list.add(new LatLng(color.y, color.x));
|
||||
}
|
||||
}
|
||||
return list;
|
||||
@ -579,7 +549,6 @@ public class GeometryTools {
|
||||
}
|
||||
|
||||
public static String getLineString(List<LatLng> list) {
|
||||
|
||||
if (list != null && list.size() > 1) {
|
||||
int size = list.size();
|
||||
Coordinate[] coors = new Coordinate[size];
|
||||
@ -612,9 +581,8 @@ public class GeometryTools {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 获取线型
|
||||
*
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
@ -632,9 +600,8 @@ public class GeometryTools {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 获取线型
|
||||
*
|
||||
* @param coors
|
||||
* @return
|
||||
*/
|
||||
@ -777,14 +744,13 @@ public class GeometryTools {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 角度变换
|
||||
*
|
||||
* @param angle
|
||||
* @return angle;
|
||||
*/
|
||||
public double angleSwap(double angle) {
|
||||
|
||||
if (angle >= 180)
|
||||
angle = angle - 180;
|
||||
else
|
||||
@ -793,7 +759,7 @@ public class GeometryTools {
|
||||
return angle;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 是否第一个点
|
||||
*
|
||||
* @param lineString
|
||||
@ -819,7 +785,7 @@ public class GeometryTools {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 是否最后点
|
||||
*
|
||||
* @param lineString
|
||||
|
@ -4,12 +4,21 @@
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_bank"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/editText" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -1,13 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="center_vertical"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:id="@+id/tv_bank"/>
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bank"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:gravity="center_vertical"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
x
Reference in New Issue
Block a user