充电站充电桩保存到数据库
This commit is contained in:
parent
deca4550cf
commit
8836e4c302
@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
|
|||||||
android {
|
android {
|
||||||
compileSdkVersion 29
|
compileSdkVersion 29
|
||||||
buildToolsVersion '29.0.2'
|
buildToolsVersion '29.0.2'
|
||||||
ndkVersion '23.0.7123448'
|
//ndkVersion '23.0.7123448'
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.navinfo.outdoor"
|
applicationId "com.navinfo.outdoor"
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
package com.navinfo.outdoor.adapter;
|
package com.navinfo.outdoor.adapter;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
@ -38,8 +40,13 @@ public class ChargingPileAdapter extends RecyclerView.Adapter<ChargingPileAdapte
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||||
String photo = chargingPileEntities.get(position).getPhotoInfo().get(0).getPhoto();
|
holder.rlItem.setBackgroundColor(Color.parseColor("#03A9F4"));
|
||||||
Glide.with(context).load(photo).into(holder.imageView);
|
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -49,9 +56,11 @@ public class ChargingPileAdapter extends RecyclerView.Adapter<ChargingPileAdapte
|
|||||||
|
|
||||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
ImageView imageView;
|
ImageView imageView;
|
||||||
|
RelativeLayout rlItem;
|
||||||
public ViewHolder(@NonNull View itemView) {
|
public ViewHolder(@NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
imageView=itemView.findViewById(R.id.image);
|
imageView=itemView.findViewById(R.id.image);
|
||||||
|
rlItem=itemView.findViewById(R.id.rl_item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package com.navinfo.outdoor.fragment;
|
|||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@ -68,18 +69,21 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
private Button btnSaveLocal;
|
private Button btnSaveLocal;
|
||||||
private PoiDatabase poiDatabase;
|
private PoiDatabase poiDatabase;
|
||||||
private String inode;
|
private String inode;
|
||||||
private List<Info> photoBean;
|
private List<String> photoBean;
|
||||||
private CheckBox checkBoxLife, checkBoxRight;
|
private CheckBox checkBoxLife, checkBoxRight;
|
||||||
private Spinner spinnerType, spinnerScutcheon, spinnerStake;
|
private Spinner spinnerType, spinnerScutcheon, spinnerStake;
|
||||||
String[] type = new String[]{"地上五层", "地上四层", "地上三层", "地上二层", "地上一层","地下一层", "地下二层", "地下三层", "地下四层", "地下五层"};
|
String[] type = new String[]{"地上五层", "地上四层", "地上三层", "地上二层", "地上一层", "地下一层", "地下二层", "地下三层", "地下四层", "地下五层"};
|
||||||
String[] scutcheon = new String[]{"存在", "不存在"};
|
String[] scutcheon = new String[]{"不存在", "存在"};
|
||||||
String[] stake = new String[]{"全部", "poi", "道路", "充电站", "其他"};
|
String[] stake = new String[]{"可以使用", "不可使用", "维修中", "建设中", "规划中"};
|
||||||
private ArrayAdapter<String> adapterType, adapterScutcheon, adapterStake;
|
private ArrayAdapter<String> adapterType, adapterScutcheon, adapterStake;
|
||||||
private RadioGroup radioGroup;
|
private RadioGroup radioGroup;
|
||||||
private RadioButton radioButton1, radioButton2, radioButton3, radioButton4, radioButton5, radioButton6;
|
private RadioButton radioButton1, radioButton2, radioButton3, radioButton4, radioButton5, radioButton6;
|
||||||
private RelativeLayout rlPanorama, rlCoding, rlEquipment, rlFacility, rlUsable, rlAvailable, rlParking, rlNumber;
|
private RelativeLayout rlPanorama, rlCoding, rlEquipment, rlFacility, rlUsable, rlAvailable, rlParking, rlNumber, rlScutcheon, rlDevice;
|
||||||
private ImageView ivPanorama, ivCoding, ivEquipment, ivFacility, ivUsable, ivAvailable, ivParking, ivNumber;
|
private ImageView ivPanorama, ivCoding, ivEquipment, ivFacility, ivUsable, ivAvailable, ivParking, ivNumber, ivScutcheon, ivDevice;
|
||||||
private ChargingPileDao chargingPileDao;
|
private ChargingPileDao chargingPileDao;
|
||||||
|
private int cp_floor = 1;
|
||||||
|
private int sign_exist = 0;
|
||||||
|
private int cp_availableState = 0;
|
||||||
|
|
||||||
public static ChargingPileFragment newInstance(Bundle bundle) {
|
public static ChargingPileFragment newInstance(Bundle bundle) {
|
||||||
ChargingPileFragment fragment = new ChargingPileFragment();
|
ChargingPileFragment fragment = new ChargingPileFragment();
|
||||||
@ -112,20 +116,20 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Bundle arguments = getArguments();
|
Bundle arguments = getArguments();
|
||||||
if (arguments!=null) {
|
if (arguments != null) {
|
||||||
isSliding= arguments.getBoolean("isSliding",true);
|
isSliding = arguments.getBoolean("isSliding", true);
|
||||||
Log.d("TAG", "onCreatessss: "+isSliding);
|
Log.d("TAG", "onCreatessss: " + isSliding);
|
||||||
}
|
}
|
||||||
if (isSliding) {
|
if (isSliding) {
|
||||||
// 监听到返回按钮点击事件
|
// 监听到返回按钮点击事件
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what= Constant.TREASURE_FRAGMENT;
|
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||||
obtain.obj=isSliding;
|
obtain.obj = isSliding;
|
||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
|
|
||||||
Message mainButtonVisiableMsg = Message.obtain();
|
Message mainButtonVisiableMsg = Message.obtain();
|
||||||
mainButtonVisiableMsg.what= Constant.MAIN_BUTTON_VISIABLE;
|
mainButtonVisiableMsg.what = Constant.MAIN_BUTTON_VISIABLE;
|
||||||
mainButtonVisiableMsg.obj= View.VISIBLE;
|
mainButtonVisiableMsg.obj = View.VISIBLE;
|
||||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||||
}
|
}
|
||||||
onBackPressed();
|
onBackPressed();
|
||||||
@ -162,16 +166,48 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
adapterType = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, type);
|
adapterType = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, type);
|
||||||
adapterType.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //设置下拉列表框的下拉选项样式
|
adapterType.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //设置下拉列表框的下拉选项样式
|
||||||
spinnerType.setAdapter(adapterType);
|
spinnerType.setAdapter(adapterType);
|
||||||
|
spinnerType.setSelection(4, true);
|
||||||
spinnerType.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
spinnerType.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
switch (position) {
|
||||||
|
case 0:
|
||||||
|
cp_floor = 5;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
cp_floor = 4;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
cp_floor = 3;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
cp_floor = 2;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
cp_floor = 1;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
cp_floor = -1;
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
cp_floor = -2;
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
cp_floor = -3;
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
cp_floor = -4;
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
cp_floor = -5;
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNothingSelected(AdapterView<?> parent) {
|
public void onNothingSelected(AdapterView<?> parent) { }
|
||||||
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
spinnerScutcheon = findViewById(R.id.spinner_scutcheon);
|
spinnerScutcheon = findViewById(R.id.spinner_scutcheon);
|
||||||
adapterScutcheon = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, scutcheon);
|
adapterScutcheon = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, scutcheon);
|
||||||
@ -180,7 +216,20 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
spinnerScutcheon.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
spinnerScutcheon.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
switch (position) {
|
||||||
|
case 0:
|
||||||
|
rlFacility.setBackgroundColor(Color.parseColor("#EFEDED"));
|
||||||
|
rlScutcheon.setVisibility(View.GONE);
|
||||||
|
rlDevice.setVisibility(View.GONE);
|
||||||
|
sign_exist = 0;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
rlFacility.setBackgroundColor(Color.parseColor("#03A9F4"));
|
||||||
|
rlScutcheon.setVisibility(View.VISIBLE);
|
||||||
|
rlDevice.setVisibility(View.VISIBLE);
|
||||||
|
sign_exist = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -195,7 +244,24 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
spinnerStake.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
spinnerStake.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
switch (position) {
|
||||||
|
case 0:
|
||||||
|
cp_availableState = 0;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
cp_availableState = 1;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
cp_availableState = 2;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
cp_availableState = 3;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
cp_availableState = 4;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -227,6 +293,13 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
rlNumber = findViewById(R.id.rl_number);
|
rlNumber = findViewById(R.id.rl_number);
|
||||||
rlNumber.setOnClickListener(this::onClick);
|
rlNumber.setOnClickListener(this::onClick);
|
||||||
ivNumber = findViewById(R.id.iv_number);
|
ivNumber = findViewById(R.id.iv_number);
|
||||||
|
rlScutcheon = findViewById(R.id.rl_scutcheon);
|
||||||
|
rlScutcheon.setOnClickListener(this::onClick);
|
||||||
|
ivScutcheon = findViewById(R.id.iv_scutcheon);
|
||||||
|
rlDevice = findViewById(R.id.rl_device);
|
||||||
|
rlDevice.setOnClickListener(this::onClick);
|
||||||
|
ivDevice = findViewById(R.id.iv_device);
|
||||||
|
|
||||||
editDescribe = findViewById(R.id.edit_describe);
|
editDescribe = findViewById(R.id.edit_describe);
|
||||||
btnSaveLocal = findViewById(R.id.btn_save_local);
|
btnSaveLocal = findViewById(R.id.btn_save_local);
|
||||||
btnSaveLocal.setOnClickListener(this::onClick);
|
btnSaveLocal.setOnClickListener(this::onClick);
|
||||||
@ -247,6 +320,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
super.initData();
|
super.initData();
|
||||||
//存储图片地址
|
//存储图片地址
|
||||||
photoBean = new ArrayList<>();
|
photoBean = new ArrayList<>();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -271,6 +345,12 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
if (all) {
|
if (all) {
|
||||||
//保存数据库:
|
//保存数据库:
|
||||||
ChargingPileEntity chargingPileEntity = new ChargingPileEntity();
|
ChargingPileEntity chargingPileEntity = new ChargingPileEntity();
|
||||||
|
if (inode == null || inode.equals("")) {
|
||||||
|
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
chargingPileEntity.setP(inode);
|
||||||
|
}
|
||||||
String name = editNameContent.getText().toString().trim();//名称
|
String name = editNameContent.getText().toString().trim();//名称
|
||||||
if (name == null || name.equals("")) {
|
if (name == null || name.equals("")) {
|
||||||
Toast.makeText(getActivity(), "请输入 名称", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "请输入 名称", Toast.LENGTH_SHORT).show();
|
||||||
@ -278,33 +358,24 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
} else {
|
} else {
|
||||||
chargingPileEntity.setName(name);
|
chargingPileEntity.setName(name);
|
||||||
}
|
}
|
||||||
if (inode == null || inode.equals("")) {
|
if (cp_floor != 0) {
|
||||||
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
chargingPileEntity.setCp_floor(cp_floor);
|
||||||
|
}
|
||||||
|
if (photoBean.size() < 4) {
|
||||||
|
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
String[] split = inode.split(",");
|
chargingPileEntity.setPhotos(photoBean);
|
||||||
chargingPileEntity.setX(split[0]);
|
|
||||||
chargingPileEntity.setY(split[1]);
|
|
||||||
}
|
}
|
||||||
|
chargingPileEntity.setSign_exist(sign_exist);
|
||||||
|
chargingPileEntity.setCp_availableState(cp_availableState);
|
||||||
String describe = editDescribe.getText().toString().trim();
|
String describe = editDescribe.getText().toString().trim();
|
||||||
if (describe == null || describe.equals("")) {
|
if (describe == null || describe.equals("")) {
|
||||||
Toast.makeText(getActivity(), "请输入任务描述", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "请输入任务描述", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
chargingPileEntity.setDescribe(describe);
|
chargingPileEntity.setMemo(describe);
|
||||||
}
|
}
|
||||||
if (photoBean.size() < 0) {
|
|
||||||
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
chargingPileEntity.setPhotoInfo(photoBean);
|
|
||||||
}
|
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
|
||||||
String format = formatter.format(calendar.getTime());
|
|
||||||
chargingPileEntity.setCreateTime(format);
|
|
||||||
|
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.CHARGING_PILE_STATION;
|
obtain.what = Constant.CHARGING_PILE_STATION;
|
||||||
obtain.obj = chargingPileEntity;
|
obtain.obj = chargingPileEntity;
|
||||||
@ -346,22 +417,31 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
Intent intentFacility = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentFacility = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
startActivityForResult(intentFacility, 104);
|
startActivityForResult(intentFacility, 104);
|
||||||
break;
|
break;
|
||||||
|
case R.id.rl_scutcheon:
|
||||||
|
Intent intentScutcheon = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
startActivityForResult(intentScutcheon, 105);
|
||||||
|
break;
|
||||||
|
case R.id.rl_device:
|
||||||
|
Intent intentDevice = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
startActivityForResult(intentDevice, 106);
|
||||||
|
break;
|
||||||
case R.id.rl_usable:
|
case R.id.rl_usable:
|
||||||
Intent intentUsable = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentUsable = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
startActivityForResult(intentUsable, 105);
|
startActivityForResult(intentUsable, 107);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_available:
|
case R.id.rl_available:
|
||||||
Intent intentAvailable = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentAvailable = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
startActivityForResult(intentAvailable, 106);
|
startActivityForResult(intentAvailable, 108);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_parking:
|
case R.id.rl_parking:
|
||||||
Intent intentParking = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentParking = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
startActivityForResult(intentParking, 107);
|
startActivityForResult(intentParking, 109);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_number:
|
case R.id.rl_number:
|
||||||
Intent intentNumber = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentNumber = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
startActivityForResult(intentNumber, 108);
|
startActivityForResult(intentNumber, 110);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -379,16 +459,14 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
startActivityForResult(intentPanorama, 101);
|
startActivityForResult(intent, 101);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data);
|
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data);
|
||||||
Info info = new Info();
|
photoBean.add(takePhotoPath);
|
||||||
info.setPhoto(takePhotoPath);
|
|
||||||
photoBean.add(info);
|
|
||||||
ivPanorama.setImageBitmap(bitmap);//显示图像
|
ivPanorama.setImageBitmap(bitmap);//显示图像
|
||||||
}
|
}
|
||||||
} else if (requestCode == 102 && resultCode == RESULT_OK) {
|
} else if (requestCode == 102 && resultCode == RESULT_OK) {
|
||||||
@ -401,16 +479,14 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
startActivityForResult(intentPanorama, 102);
|
startActivityForResult(intent, 102);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data);
|
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data);
|
||||||
Info info = new Info();
|
photoBean.add(takePhotoPath);
|
||||||
info.setPhoto(takePhotoPath);
|
|
||||||
photoBean.add(info);
|
|
||||||
ivCoding.setImageBitmap(bitmap);//显示图像
|
ivCoding.setImageBitmap(bitmap);//显示图像
|
||||||
}
|
}
|
||||||
} else if (requestCode == 103 && resultCode == RESULT_OK) {
|
} else if (requestCode == 103 && resultCode == RESULT_OK) {
|
||||||
@ -423,19 +499,17 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
startActivityForResult(intentPanorama, 103);
|
startActivityForResult(intent, 103);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data);
|
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data);
|
||||||
Info info = new Info();
|
photoBean.add(takePhotoPath);
|
||||||
info.setPhoto(takePhotoPath);
|
|
||||||
photoBean.add(info);
|
|
||||||
ivEquipment.setImageBitmap(bitmap);//显示图像
|
ivEquipment.setImageBitmap(bitmap);//显示图像
|
||||||
}
|
}
|
||||||
}else if (requestCode == 104 && resultCode == RESULT_OK) {
|
} else if (requestCode == 104 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||||
int height = bitmap.getHeight();
|
int height = bitmap.getHeight();
|
||||||
@ -445,19 +519,17 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
startActivityForResult(intentPanorama, 104);
|
startActivityForResult(intent, 104);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data);
|
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data);
|
||||||
Info info = new Info();
|
photoBean.add(takePhotoPath);
|
||||||
info.setPhoto(takePhotoPath);
|
|
||||||
photoBean.add(info);
|
|
||||||
ivFacility.setImageBitmap(bitmap);//显示图像
|
ivFacility.setImageBitmap(bitmap);//显示图像
|
||||||
}
|
}
|
||||||
}else if (requestCode == 105 && resultCode == RESULT_OK) {
|
} else if (requestCode == 105 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||||
int height = bitmap.getHeight();
|
int height = bitmap.getHeight();
|
||||||
@ -467,19 +539,57 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
startActivityForResult(intentPanorama, 105);
|
startActivityForResult(intent, 105);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data);
|
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data);
|
||||||
Info info = new Info();
|
photoBean.add(takePhotoPath);
|
||||||
info.setPhoto(takePhotoPath);
|
ivScutcheon.setImageBitmap(bitmap);//显示图像
|
||||||
photoBean.add(info);
|
}
|
||||||
|
} else if (requestCode == 106 && resultCode == RESULT_OK) {
|
||||||
|
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||||
|
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||||
|
int height = bitmap.getHeight();
|
||||||
|
int width = bitmap.getWidth();
|
||||||
|
if (height > width) {
|
||||||
|
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||||
|
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
|
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
startActivityForResult(intent, 106);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data);
|
||||||
|
photoBean.add(takePhotoPath);
|
||||||
|
ivDevice.setImageBitmap(bitmap);//显示图像
|
||||||
|
}
|
||||||
|
} else if (requestCode == 107 && resultCode == RESULT_OK) {
|
||||||
|
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||||
|
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||||
|
int height = bitmap.getHeight();
|
||||||
|
int width = bitmap.getWidth();
|
||||||
|
if (height > width) {
|
||||||
|
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||||
|
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
|
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
startActivityForResult(intent, 107);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data);
|
||||||
|
photoBean.add(takePhotoPath);
|
||||||
ivUsable.setImageBitmap(bitmap);//显示图像
|
ivUsable.setImageBitmap(bitmap);//显示图像
|
||||||
}
|
}
|
||||||
}else if (requestCode == 106 && resultCode == RESULT_OK) {
|
} else if (requestCode == 108 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||||
int height = bitmap.getHeight();
|
int height = bitmap.getHeight();
|
||||||
@ -489,19 +599,17 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
startActivityForResult(intentPanorama, 106);
|
startActivityForResult(intent, 108);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data);
|
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data);
|
||||||
Info info = new Info();
|
photoBean.add(takePhotoPath);
|
||||||
info.setPhoto(takePhotoPath);
|
|
||||||
photoBean.add(info);
|
|
||||||
ivAvailable.setImageBitmap(bitmap);//显示图像
|
ivAvailable.setImageBitmap(bitmap);//显示图像
|
||||||
}
|
}
|
||||||
}else if (requestCode == 107 && resultCode == RESULT_OK) {
|
} else if (requestCode == 109 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||||
int height = bitmap.getHeight();
|
int height = bitmap.getHeight();
|
||||||
@ -511,19 +619,17 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
startActivityForResult(intentPanorama, 107);
|
startActivityForResult(intent, 109);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data);
|
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data);
|
||||||
Info info = new Info();
|
photoBean.add(takePhotoPath);
|
||||||
info.setPhoto(takePhotoPath);
|
|
||||||
photoBean.add(info);
|
|
||||||
ivParking.setImageBitmap(bitmap);//显示图像
|
ivParking.setImageBitmap(bitmap);//显示图像
|
||||||
}
|
}
|
||||||
}else if (requestCode == 108 && resultCode == RESULT_OK) {
|
} else if (requestCode == 110 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||||
int height = bitmap.getHeight();
|
int height = bitmap.getHeight();
|
||||||
@ -533,16 +639,14 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
startActivityForResult(intentPanorama, 108);
|
startActivityForResult(intent, 110);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data);
|
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data);
|
||||||
Info info = new Info();
|
photoBean.add(takePhotoPath);
|
||||||
info.setPhoto(takePhotoPath);
|
|
||||||
photoBean.add(info);
|
|
||||||
ivNumber.setImageBitmap(bitmap);//显示图像
|
ivNumber.setImageBitmap(bitmap);//显示图像
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,7 @@ import com.navinfo.outdoor.api.Constant;
|
|||||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||||
import com.navinfo.outdoor.bean.Info;
|
import com.navinfo.outdoor.bean.Info;
|
||||||
import com.navinfo.outdoor.bean.PoiBean;
|
import com.navinfo.outdoor.bean.PoiBean;
|
||||||
|
import com.navinfo.outdoor.room.ChargingPileDao;
|
||||||
import com.navinfo.outdoor.room.ChargingPileEntity;
|
import com.navinfo.outdoor.room.ChargingPileEntity;
|
||||||
import com.navinfo.outdoor.room.PoiDao;
|
import com.navinfo.outdoor.room.PoiDao;
|
||||||
import com.navinfo.outdoor.room.PoiDatabase;
|
import com.navinfo.outdoor.room.PoiDatabase;
|
||||||
@ -67,8 +68,8 @@ import static android.app.Activity.RESULT_OK;
|
|||||||
public class ChargingStationFragment extends BaseDrawerFragment implements View.OnClickListener {
|
public class ChargingStationFragment extends BaseDrawerFragment implements View.OnClickListener {
|
||||||
|
|
||||||
private EditText editDescribe;
|
private EditText editDescribe;
|
||||||
private RelativeLayout rlPanorama, rlName, rlInternalPhotos, rlCard, rlElse,rlScutcheon;
|
private RelativeLayout rlPanorama, rlName, rlInternalPhotos, rlCard, rlElse, rlScutcheon;
|
||||||
private ImageView ivPanorama, ivName, ivInternal, ivCard, ivElse,ivScutcheon;
|
private ImageView ivPanorama, ivName, ivInternal, ivCard, ivElse, ivScutcheon;
|
||||||
private TextView tvExamine;
|
private TextView tvExamine;
|
||||||
private EditText editNameContent, editSiteContent;
|
private EditText editNameContent, editSiteContent;
|
||||||
private RecyclerView recyclerPhone;
|
private RecyclerView recyclerPhone;
|
||||||
@ -90,6 +91,12 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
private LinearLayout linearChargingPile;
|
private LinearLayout linearChargingPile;
|
||||||
private RecyclerView recyclerStation;
|
private RecyclerView recyclerStation;
|
||||||
private ChargingPileAdapter chargingPileAdapter;
|
private ChargingPileAdapter chargingPileAdapter;
|
||||||
|
private int station_type = 0;
|
||||||
|
private boolean aBoolean = false;
|
||||||
|
private PoiEntity poiEntity;
|
||||||
|
private PoiEntity showPoiEntity;
|
||||||
|
private ArrayList<ChargingPileEntity> chargingPileEntities;
|
||||||
|
private ChargingPileDao chargingPileDao;
|
||||||
|
|
||||||
public static ChargingStationFragment newInstance(Bundle bundle) {
|
public static ChargingStationFragment newInstance(Bundle bundle) {
|
||||||
ChargingStationFragment fragment = new ChargingStationFragment();
|
ChargingStationFragment fragment = new ChargingStationFragment();
|
||||||
@ -115,19 +122,19 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Bundle arguments = getArguments();
|
Bundle arguments = getArguments();
|
||||||
if (arguments!=null) {
|
if (arguments != null) {
|
||||||
isSliding= arguments.getBoolean("isSliding",true);
|
isSliding = arguments.getBoolean("isSliding", true);
|
||||||
Log.d("TAG", "onCreatessss: "+isSliding);
|
Log.d("TAG", "onCreatessss: " + isSliding);
|
||||||
}
|
}
|
||||||
if (isSliding) {
|
if (isSliding) {
|
||||||
// 监听到返回按钮点击事件
|
// 监听到返回按钮点击事件
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what= Constant.TREASURE_FRAGMENT;
|
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||||
obtain.obj=isSliding;
|
obtain.obj = isSliding;
|
||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
Message mainButtonVisiableMsg = Message.obtain();
|
Message mainButtonVisiableMsg = Message.obtain();
|
||||||
mainButtonVisiableMsg.what= Constant.MAIN_BUTTON_VISIABLE;
|
mainButtonVisiableMsg.what = Constant.MAIN_BUTTON_VISIABLE;
|
||||||
mainButtonVisiableMsg.obj= View.VISIBLE;
|
mainButtonVisiableMsg.obj = View.VISIBLE;
|
||||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||||
}
|
}
|
||||||
onBackPressed();
|
onBackPressed();
|
||||||
@ -135,6 +142,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
@ -155,20 +163,20 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Bundle arguments = getArguments();
|
Bundle arguments = getArguments();
|
||||||
if (arguments!=null) {
|
if (arguments != null) {
|
||||||
isSliding= arguments.getBoolean("isSliding",true);
|
isSliding = arguments.getBoolean("isSliding", true);
|
||||||
Log.d("TAG", "onCreatessss: "+isSliding);
|
Log.d("TAG", "onCreatessss: " + isSliding);
|
||||||
}
|
}
|
||||||
if (isSliding) {
|
if (isSliding) {
|
||||||
// 监听到返回按钮点击事件
|
// 监听到返回按钮点击事件
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what= Constant.TREASURE_FRAGMENT;
|
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||||
obtain.obj=isSliding;
|
obtain.obj = isSliding;
|
||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
|
|
||||||
Message mainButtonVisiableMsg = Message.obtain();
|
Message mainButtonVisiableMsg = Message.obtain();
|
||||||
mainButtonVisiableMsg.what= Constant.MAIN_BUTTON_VISIABLE;
|
mainButtonVisiableMsg.what = Constant.MAIN_BUTTON_VISIABLE;
|
||||||
mainButtonVisiableMsg.obj= View.VISIBLE;
|
mainButtonVisiableMsg.obj = View.VISIBLE;
|
||||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||||
}
|
}
|
||||||
onBackPressed();
|
onBackPressed();
|
||||||
@ -181,6 +189,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
super.initView();
|
super.initView();
|
||||||
poiDatabase = PoiDatabase.getInstance(getContext());
|
poiDatabase = PoiDatabase.getInstance(getContext());
|
||||||
poiDao = poiDatabase.getPoiDao();
|
poiDao = poiDatabase.getPoiDao();
|
||||||
|
chargingPileDao = poiDatabase.getChargingPileDao();
|
||||||
checkBoxLife = findViewById(R.id.check_pot_life);
|
checkBoxLife = findViewById(R.id.check_pot_life);
|
||||||
checkBoxRight = findViewById(R.id.check_pot_right);
|
checkBoxRight = findViewById(R.id.check_pot_right);
|
||||||
checkBoxLife.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
checkBoxLife.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
@ -200,9 +209,28 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
spinnerType.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
spinnerType.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
switch (position) {
|
||||||
|
case 0:
|
||||||
|
station_type = 0;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
station_type = 1;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
station_type = 2;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
station_type = 3;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
station_type = 4;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNothingSelected(AdapterView<?> parent) {}
|
public void onNothingSelected(AdapterView<?> parent) {
|
||||||
|
}
|
||||||
});
|
});
|
||||||
//添加桩
|
//添加桩
|
||||||
linearChargingPile = findViewById(R.id.linear_charging_pile);
|
linearChargingPile = findViewById(R.id.linear_charging_pile);
|
||||||
@ -232,7 +260,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
rlCard.setOnClickListener(this::onClick);
|
rlCard.setOnClickListener(this::onClick);
|
||||||
rlElse = findViewById(R.id.rl_else);
|
rlElse = findViewById(R.id.rl_else);
|
||||||
rlElse.setOnClickListener(this::onClick);
|
rlElse.setOnClickListener(this::onClick);
|
||||||
rlScutcheon= findViewById(R.id.rl_scutcheon);
|
rlScutcheon = findViewById(R.id.rl_scutcheon);
|
||||||
rlScutcheon.setOnClickListener(this::onClick);
|
rlScutcheon.setOnClickListener(this::onClick);
|
||||||
recyclerPhone = findViewById(R.id.recycler_phone);
|
recyclerPhone = findViewById(R.id.recycler_phone);
|
||||||
recyclerPhone.setLayoutManager(new LinearLayoutManager(getContext()));
|
recyclerPhone.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
@ -268,14 +296,47 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
recyclerStation = findViewById(R.id.recycler_station);
|
recyclerStation = findViewById(R.id.recycler_station);
|
||||||
recyclerStation.setLayoutManager(new GridLayoutManager(getContext(),3));
|
recyclerStation.setLayoutManager(new GridLayoutManager(getContext(), 3));
|
||||||
chargingPileAdapter = new ChargingPileAdapter(getContext());
|
chargingPileAdapter = new ChargingPileAdapter(getContext());
|
||||||
recyclerStation.setAdapter(chargingPileAdapter);
|
recyclerStation.setAdapter(chargingPileAdapter);
|
||||||
|
/**
|
||||||
|
* 数据处理
|
||||||
|
*/
|
||||||
|
showPoiEntity = (PoiEntity) getArguments().getSerializable("PoiEntity");
|
||||||
|
if (showPoiEntity != null) {
|
||||||
|
editNameContent.setText(showPoiEntity.getName());
|
||||||
|
editDescribe.setText(showPoiEntity.getDescribe());
|
||||||
|
editSiteContent.setText(showPoiEntity.getAddress());
|
||||||
|
String x = showPoiEntity.getX();
|
||||||
|
String y = showPoiEntity.getY();
|
||||||
|
int id = showPoiEntity.getId();
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
List<ChargingPileEntity> chargingPile = chargingPileDao.getChargingPile();
|
||||||
|
for (int i = 0; i < chargingPile.size(); i++) {
|
||||||
|
ChargingPileEntity chargingPileEntity = chargingPile.get(i);
|
||||||
|
if (id == chargingPileEntity.getFid()) {
|
||||||
|
chargingPileEntities.add(chargingPileEntity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
chargingPileAdapter.setChargingPileEntities(chargingPileEntities);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
|
||||||
//禁用所有可操作控件
|
//禁用所有可操作控件
|
||||||
//disables();
|
//disables();
|
||||||
|
|
||||||
}
|
}
|
||||||
//禁用所有可操作性控件
|
|
||||||
|
//禁用所有可操作性控件
|
||||||
private void disables() {
|
private void disables() {
|
||||||
checkBoxLife.setEnabled(false);
|
checkBoxLife.setEnabled(false);
|
||||||
editNameContent.setEnabled(false);
|
editNameContent.setEnabled(false);
|
||||||
@ -300,21 +361,30 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
phoneData = new ArrayList<>();
|
phoneData = new ArrayList<>();
|
||||||
//存储图片地址
|
//存储图片地址
|
||||||
photoBean = new ArrayList<>();
|
photoBean = new ArrayList<>();
|
||||||
|
//充电桩的数据
|
||||||
|
chargingPileEntities = new ArrayList<>();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onEvent(Message data) {
|
public void onEvent(Message data) {
|
||||||
if (data.what == Constant.CHARGING_STATION_WORD) {
|
if (data.what == Constant.CHARGING_STATION_WORD) {
|
||||||
inode = data.obj.toString();
|
inode = data.obj.toString();
|
||||||
Toast.makeText(getContext(), inode, Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), inode, Toast.LENGTH_SHORT).show();
|
||||||
}else if (data.what==Constant.CHARGING_PILE_STATION){
|
} else if (data.what == Constant.CHARGING_PILE_STATION) {
|
||||||
ChargingPileEntity chargingPileEntity = (ChargingPileEntity) data.obj;
|
ChargingPileEntity chargingPileEntity = (ChargingPileEntity) data.obj;
|
||||||
|
chargingPileEntity.setFid(poiEntity.getId());
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
chargingPileDao.insertChargingPileEntity(chargingPileEntity);
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
ArrayList<ChargingPileEntity> chargingPileEntities = new ArrayList<>();
|
ArrayList<ChargingPileEntity> chargingPileEntities = new ArrayList<>();
|
||||||
chargingPileEntities.add(chargingPileEntity);
|
chargingPileEntities.add(chargingPileEntity);
|
||||||
chargingPileAdapter.setChargingPileEntities(chargingPileEntities);
|
chargingPileAdapter.setChargingPileEntities(chargingPileEntities);
|
||||||
|
aBoolean = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,7 +400,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
public void onGranted(List<String> permissions, boolean all) {
|
public void onGranted(List<String> permissions, boolean all) {
|
||||||
if (all) {
|
if (all) {
|
||||||
//保存数据库:
|
//保存数据库:
|
||||||
PoiEntity poiEntity = new PoiEntity();
|
poiEntity = new PoiEntity();
|
||||||
String name = editNameContent.getText().toString().trim();//名称
|
String name = editNameContent.getText().toString().trim();//名称
|
||||||
if (name == null || name.equals("")) {
|
if (name == null || name.equals("")) {
|
||||||
Toast.makeText(getActivity(), "请输入充电站 名称", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "请输入充电站 名称", Toast.LENGTH_SHORT).show();
|
||||||
@ -358,7 +428,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
Toast.makeText(getActivity(), "请输入任务描述", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "请输入任务描述", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
poiEntity.setDescribe(describe);
|
poiEntity.setMemo(describe);
|
||||||
}
|
}
|
||||||
if (phoneData.size() <= 0) {
|
if (phoneData.size() <= 0) {
|
||||||
Toast.makeText(getActivity(), "请输入手机号", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "请输入手机号", Toast.LENGTH_SHORT).show();
|
||||||
@ -366,12 +436,19 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
} else {
|
} else {
|
||||||
poiEntity.setTelPhone(phoneData.get(0));
|
poiEntity.setTelPhone(phoneData.get(0));
|
||||||
}
|
}
|
||||||
if (photoBean.size() < 0) {
|
if (photoBean.size() != 6) {
|
||||||
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
poiEntity.setPhotoInfo(photoBean);
|
poiEntity.setPhotoInfo(photoBean);
|
||||||
}
|
}
|
||||||
|
poiEntity.setStation_type(station_type);
|
||||||
|
if (!aBoolean) {
|
||||||
|
Toast.makeText(getActivity(), "请添加桩", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
aBoolean = false;
|
||||||
|
}
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||||
@ -382,7 +459,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
poiDao.insertPoiEntity(poiEntity);
|
poiDao.insertPoiEntity(poiEntity);
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
Message obtains = Message.obtain();
|
Message obtains = Message.obtain();
|
||||||
@ -565,7 +642,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
ivElse.setImageBitmap(bitmap);//显示图像
|
ivElse.setImageBitmap(bitmap);//显示图像
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if (requestCode==106 &&resultCode ==RESULT_OK){
|
} else if (requestCode == 106 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||||
int height = bitmap.getHeight();
|
int height = bitmap.getHeight();
|
||||||
@ -589,6 +666,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
if (EventBus.getDefault().isRegistered(this))//加上判断
|
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||||
|
@ -194,11 +194,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
showSlidingFragment(roadFragment);
|
showSlidingFragment(roadFragment);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(new Bundle());
|
ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle);
|
||||||
showSlidingFragment(chargingStationFragment);
|
showSlidingFragment(chargingStationFragment);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
OtherFragment otherFragment = OtherFragment.newInstance(new Bundle());
|
OtherFragment otherFragment = OtherFragment.newInstance(bundle);
|
||||||
showSlidingFragment(otherFragment);
|
showSlidingFragment(otherFragment);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -49,14 +49,6 @@ public interface ChargingPileDao {
|
|||||||
@Delete
|
@Delete
|
||||||
void deleteAll(List<ChargingPileEntity> chargingPileEntities);
|
void deleteAll(List<ChargingPileEntity> chargingPileEntities);
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据条件删除
|
|
||||||
* @param taskStatus
|
|
||||||
*/
|
|
||||||
@Query("DELETE FROM pile where taskStatus=:taskStatus")
|
|
||||||
void deleteFormName(int taskStatus);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 全部删除
|
* 全部删除
|
||||||
*/
|
*/
|
||||||
@ -70,10 +62,5 @@ public interface ChargingPileDao {
|
|||||||
@Query("SELECT * FROM pile ORDER BY pileId DESC")
|
@Query("SELECT * FROM pile ORDER BY pileId DESC")
|
||||||
List<ChargingPileEntity> getAllChargingPileEntity();
|
List<ChargingPileEntity> getAllChargingPileEntity();
|
||||||
|
|
||||||
@Query("SELECT * FROM pile where userId = :userId")
|
|
||||||
ChargingPileEntity queryChargingPileEntity(int userId);
|
|
||||||
|
|
||||||
@Query("DELETE FROM pile where userId = :userId")
|
|
||||||
void deleteChargingPileEntity(int userId);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import androidx.room.TypeConverters;
|
|||||||
|
|
||||||
import com.navinfo.outdoor.bean.Info;
|
import com.navinfo.outdoor.bean.Info;
|
||||||
import com.navinfo.outdoor.util.PhotoInfoConverter;
|
import com.navinfo.outdoor.util.PhotoInfoConverter;
|
||||||
|
import com.navinfo.outdoor.util.StringTypeConverter;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -21,26 +22,16 @@ import static androidx.room.ForeignKey.CASCADE;
|
|||||||
public class ChargingPileEntity {
|
public class ChargingPileEntity {
|
||||||
@PrimaryKey(autoGenerate = true) // 设置主键,并且自动生长
|
@PrimaryKey(autoGenerate = true) // 设置主键,并且自动生长
|
||||||
private int pileId;
|
private int pileId;
|
||||||
private int pid; //采集id 保存本地或提交数据时时返回
|
|
||||||
private int taskId;//任务id
|
|
||||||
private int userId;//用户id
|
|
||||||
private String createTime; //创建时间/采集时间
|
|
||||||
private String name;//名称
|
private String name;//名称
|
||||||
private String describe;//任务描述
|
private String p;//经纬度
|
||||||
private String address;//地址
|
private int exist;//是否存在 0不存在1存在
|
||||||
private String telPhone;//电话
|
private int cp_floor;//充电桩地面层 地面层是1 ,地上二层为2,向上依次加1,地下一层为-1,向下依次减1.默认为1
|
||||||
private String memo;//备注
|
private int sign_exist;//设备标牌是否存在 0不存在1存在
|
||||||
private double precision;//金额
|
private int cp_availableState;//可以状态 0(可以使用(有电),默认),1(不可使用(没电)),2(维修中),3(建设中)4(规划中)
|
||||||
private String photo;//照片信息
|
private String memo;//备注 默认为空
|
||||||
//ROOM不支持直接存储集合
|
@TypeConverters(StringTypeConverter.class)
|
||||||
@TypeConverters(PhotoInfoConverter.class)
|
private List<String> photos;//照片组
|
||||||
private List<Info> photoInfo;//照片信息
|
private int fid;//对应充电站id
|
||||||
private int existence;//是否存在
|
|
||||||
private String x;//经度
|
|
||||||
private String y;//纬度
|
|
||||||
private String detail;//深度信息
|
|
||||||
private int taskStatus;//任务状态 0.待提交,1.已提交,2 已领取
|
|
||||||
private int type;//0.poi,1.道路,2.充电站,3.其他
|
|
||||||
|
|
||||||
public int getPileId() {
|
public int getPileId() {
|
||||||
return pileId;
|
return pileId;
|
||||||
@ -49,53 +40,6 @@ public class ChargingPileEntity {
|
|||||||
public void setPileId(int pileId) {
|
public void setPileId(int pileId) {
|
||||||
this.pileId = pileId;
|
this.pileId = pileId;
|
||||||
}
|
}
|
||||||
public int getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setType(int type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getTaskStatus() {
|
|
||||||
return taskStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTaskStatus(int taskStatus) {
|
|
||||||
this.taskStatus = taskStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getPid() {
|
|
||||||
return pid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPid(int pid) {
|
|
||||||
this.pid = pid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getTaskId() {
|
|
||||||
return taskId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTaskId(int taskId) {
|
|
||||||
this.taskId = taskId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getUserId() {
|
|
||||||
return userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserId(int userId) {
|
|
||||||
this.userId = userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCreateTime() {
|
|
||||||
return createTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCreateTime(String createTime) {
|
|
||||||
this.createTime = createTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
@ -105,28 +49,44 @@ public class ChargingPileEntity {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDescribe() {
|
public String getP() {
|
||||||
return describe;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDescribe(String describe) {
|
public void setP(String p) {
|
||||||
this.describe = describe;
|
this.p = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAddress() {
|
public int getExist() {
|
||||||
return address;
|
return exist;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAddress(String address) {
|
public void setExist(int exist) {
|
||||||
this.address = address;
|
this.exist = exist;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTelPhone() {
|
public int getCp_floor() {
|
||||||
return telPhone;
|
return cp_floor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTelPhone(String telPhone) {
|
public void setCp_floor(int cp_floor) {
|
||||||
this.telPhone = telPhone;
|
this.cp_floor = cp_floor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSign_exist() {
|
||||||
|
return sign_exist;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSign_exist(int sign_exist) {
|
||||||
|
this.sign_exist = sign_exist;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCp_availableState() {
|
||||||
|
return cp_availableState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCp_availableState(int cp_availableState) {
|
||||||
|
this.cp_availableState = cp_availableState;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMemo() {
|
public String getMemo() {
|
||||||
@ -137,60 +97,19 @@ public class ChargingPileEntity {
|
|||||||
this.memo = memo;
|
this.memo = memo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getPrecision() {
|
public List<String> getPhotos() {
|
||||||
return precision;
|
return photos;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPrecision(double precision) {
|
public void setPhotos(List<String> photos) {
|
||||||
this.precision = precision;
|
this.photos = photos;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPhoto() {
|
public int getFid() {
|
||||||
return photo;
|
return fid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPhoto(String photo) {
|
public void setFid(int fid) {
|
||||||
this.photo = photo;
|
this.fid = fid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Info> getPhotoInfo() {
|
|
||||||
return photoInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPhotoInfo(List<Info> infoList) {
|
|
||||||
this.photoInfo = infoList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getExistence() {
|
|
||||||
return existence;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setExistence(int existence) {
|
|
||||||
this.existence = existence;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getX() {
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setX(String x) {
|
|
||||||
this.x = x;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getY() {
|
|
||||||
return y;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setY(String y) {
|
|
||||||
this.y = y;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDetail() {
|
|
||||||
return detail;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDetail(String detail) {
|
|
||||||
this.detail = detail;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,6 @@ import java.util.List;
|
|||||||
public class PoiEntity implements Serializable {
|
public class PoiEntity implements Serializable {
|
||||||
@PrimaryKey(autoGenerate = true) // 设置主键,并且自动生长
|
@PrimaryKey(autoGenerate = true) // 设置主键,并且自动生长
|
||||||
private int id;
|
private int id;
|
||||||
|
|
||||||
private int pid; //采集id 保存本地或提交数据时时返回
|
private int pid; //采集id 保存本地或提交数据时时返回
|
||||||
private int taskId;//任务id
|
private int taskId;//任务id
|
||||||
private int userId;//用户id
|
private int userId;//用户id
|
||||||
@ -57,6 +56,15 @@ public class PoiEntity implements Serializable {
|
|||||||
private String detail;//深度信息
|
private String detail;//深度信息
|
||||||
private int taskStatus;//任务状态 0.待提交,1.已提交,2 已领取
|
private int taskStatus;//任务状态 0.待提交,1.已提交,2 已领取
|
||||||
private int type;//0.poi,1.道路,2.充电站,3.其他
|
private int type;//0.poi,1.道路,2.充电站,3.其他
|
||||||
|
private int station_type;//0.全部,1.poi,2.道路,3.充电站,4.其他
|
||||||
|
|
||||||
|
public int getStation_type() {
|
||||||
|
return station_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStation_type(int station_type) {
|
||||||
|
this.station_type = station_type;
|
||||||
|
}
|
||||||
|
|
||||||
public int getType() {
|
public int getType() {
|
||||||
return type;
|
return type;
|
||||||
|
@ -104,7 +104,7 @@
|
|||||||
android:layout_marginLeft="18dp"
|
android:layout_marginLeft="18dp"
|
||||||
android:layout_toRightOf="@id/tv_name"
|
android:layout_toRightOf="@id/tv_name"
|
||||||
android:background="@color/white"
|
android:background="@color/white"
|
||||||
android:hint="充电桩"
|
android:text="充电桩"
|
||||||
android:layout_toEndOf="@id/tv_name"
|
android:layout_toEndOf="@id/tv_name"
|
||||||
android:textSize="15sp"
|
android:textSize="15sp"
|
||||||
android:textColor="#333" />
|
android:textColor="#333" />
|
||||||
@ -419,7 +419,77 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
/>
|
/>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rl_scutcheon"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:background="#03A9F4"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:layout_marginBottom="10dp">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image_scutcheon"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_width="20dp"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
android:background="@drawable/equipsign"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:text="*设备标牌"
|
||||||
|
android:textSize="8sp"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:textColor="@color/pickerview_wheelview_textcolor_divider"
|
||||||
|
android:layout_below="@id/image_scutcheon"
|
||||||
|
/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_scutcheon"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
/>
|
||||||
|
</RelativeLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rl_device"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:background="#03A9F4"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:layout_marginBottom="10dp">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image_device"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_width="20dp"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
android:background="@drawable/equipsign"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:text="*设备标牌"
|
||||||
|
android:textSize="8sp"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:textColor="@color/pickerview_wheelview_textcolor_divider"
|
||||||
|
android:layout_below="@id/image_device"
|
||||||
|
/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_device"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
/>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/linear_stake"
|
android:id="@+id/linear_stake"
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
<ScrollView
|
<ScrollView
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:id="@+id/scroller_view"
|
android:id="@+id/scroller_view"
|
||||||
@ -455,12 +456,14 @@
|
|||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_03"
|
android:id="@+id/tv_03"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="03.添加"
|
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
|
android:text="03.添加"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/recycler_station"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/linear_photograph" />
|
app:layout_constraintTop_toBottomOf="@id/linear_photograph" />
|
||||||
|
|
||||||
@ -468,23 +471,31 @@
|
|||||||
android:id="@+id/recycler_station"
|
android:id="@+id/recycler_station"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/tv_03" />
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/linear_charging_pile" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/linear_charging_pile"
|
android:id="@+id/linear_charging_pile"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:background="@drawable/underline"
|
android:background="@drawable/underline"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:orientation="vertical"
|
||||||
app:layout_constraintTop_toBottomOf="@id/recycler_station">
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/linear_photograph">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:background="@drawable/plus" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:background="@drawable/plus" />
|
android:text="添加桩" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_04"
|
android:id="@+id/tv_04"
|
||||||
@ -493,7 +504,7 @@
|
|||||||
android:text="04.描述"
|
android:text="04.描述"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/linear_charging_pile" />
|
app:layout_constraintTop_toBottomOf="@id/recycler_station" />
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/linear_describe"
|
android:id="@+id/linear_describe"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -2,13 +2,36 @@
|
|||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<ImageView
|
<RelativeLayout
|
||||||
android:id="@+id/image"
|
android:id="@+id/rl_item"
|
||||||
android:layout_width="120dp"
|
android:layout_width="100dp"
|
||||||
android:layout_height="120dp"
|
android:layout_height="100dp"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
android:background="#03A9F4"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image"
|
||||||
|
android:layout_width="20dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
android:background="@drawable/chartall" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/image"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="*充电桩"
|
||||||
|
android:textColor="@color/pickerview_wheelview_textcolor_divider"
|
||||||
|
android:textSize="8sp" />
|
||||||
|
</RelativeLayout>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
x
Reference in New Issue
Block a user