其他逻辑处理
This commit is contained in:
parent
8836e4c302
commit
ffa24988c3
@ -7,6 +7,7 @@ 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 android.widget.RelativeLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
@ -40,7 +41,9 @@ 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) {
|
||||||
holder.rlItem.setBackgroundColor(Color.parseColor("#03A9F4"));
|
ChargingPileEntity chargingPileEntity = chargingPileEntities.get(position);
|
||||||
|
holder.textView.setText(chargingPileEntity.getName());
|
||||||
|
holder.rlItem.setBackgroundColor(Color.parseColor("#03A9F4"));
|
||||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@ -57,10 +60,12 @@ 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;
|
RelativeLayout rlItem;
|
||||||
|
TextView textView;
|
||||||
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);
|
rlItem=itemView.findViewById(R.id.rl_item);
|
||||||
|
textView=itemView.findViewById(R.id.tv_text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,8 @@ public class Constant {
|
|||||||
public static final int MAIN_CHARGING_PILE= 18;//充电桩的Fragment 对地图页面marker 的一个展示
|
public static final int MAIN_CHARGING_PILE= 18;//充电桩的Fragment 对地图页面marker 的一个展示
|
||||||
public static final int CHARGING_PILE_WORD = 20;//地图页面marker 的经纬都回传
|
public static final int CHARGING_PILE_WORD = 20;//地图页面marker 的经纬都回传
|
||||||
public static final int CHARGING_PILE_STATION = 22;//将充电桩的数据回传给充电站
|
public static final int CHARGING_PILE_STATION = 22;//将充电桩的数据回传给充电站
|
||||||
|
public static final int MAIN_OTHER = 23;//其他的Fragment 对地图页面marker 的一个展示
|
||||||
|
public static final int OTHER_WORD = 25;//地图页面marker 的经纬都回传
|
||||||
/**
|
/**
|
||||||
* 用户当前位置
|
* 用户当前位置
|
||||||
*/
|
*/
|
||||||
|
@ -161,8 +161,6 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
|||||||
json.put("answer", examBeans.get(i).getAnswer());
|
json.put("answer", examBeans.get(i).getAnswer());
|
||||||
jsonArray.put(json);
|
jsonArray.put(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
examBeans.clear();
|
examBeans.clear();
|
||||||
Log.d("TAG", "initExamSubmit: " + jsonArray.toString());
|
Log.d("TAG", "initExamSubmit: " + jsonArray.toString());
|
||||||
OkGoBuilder.getInstance()
|
OkGoBuilder.getInstance()
|
||||||
|
@ -76,14 +76,14 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
String[] scutcheon = new String[]{"不存在", "存在"};
|
String[] scutcheon = new String[]{"不存在", "存在"};
|
||||||
String[] stake = new String[]{"可以使用", "不可使用", "维修中", "建设中", "规划中"};
|
String[] stake = new String[]{"可以使用", "不可使用", "维修中", "建设中", "规划中"};
|
||||||
private ArrayAdapter<String> adapterType, adapterScutcheon, adapterStake;
|
private ArrayAdapter<String> adapterType, adapterScutcheon, adapterStake;
|
||||||
private RadioGroup radioGroup;
|
|
||||||
private RadioButton radioButton1, radioButton2, radioButton3, radioButton4, radioButton5, radioButton6;
|
|
||||||
private RelativeLayout rlPanorama, rlCoding, rlEquipment, rlFacility, rlUsable, rlAvailable, rlParking, rlNumber, rlScutcheon, rlDevice;
|
private RelativeLayout rlPanorama, rlCoding, rlEquipment, rlFacility, rlUsable, rlAvailable, rlParking, rlNumber, rlScutcheon, rlDevice;
|
||||||
private ImageView ivPanorama, ivCoding, ivEquipment, ivFacility, ivUsable, ivAvailable, ivParking, ivNumber, ivScutcheon, ivDevice;
|
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 cp_floor = 1;
|
||||||
private int sign_exist = 0;
|
private int sign_exist = 0;
|
||||||
private int cp_availableState = 0;
|
private int cp_availableState = 0;
|
||||||
|
private CheckBox checkButton1, checkButton2, checkButton3, checkButton4, checkButton5, checkButton6;
|
||||||
|
private int pid;
|
||||||
|
|
||||||
public static ChargingPileFragment newInstance(Bundle bundle) {
|
public static ChargingPileFragment newInstance(Bundle bundle) {
|
||||||
ChargingPileFragment fragment = new ChargingPileFragment();
|
ChargingPileFragment fragment = new ChargingPileFragment();
|
||||||
@ -155,13 +155,65 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
});
|
});
|
||||||
checkBoxRight.setVisibility(View.GONE);
|
checkBoxRight.setVisibility(View.GONE);
|
||||||
editNameContent = findViewById(R.id.tv_name_content);
|
editNameContent = findViewById(R.id.tv_name_content);
|
||||||
radioGroup = findViewById(R.id.radio_group);
|
checkButton1 = findViewById(R.id.check_button1);
|
||||||
radioButton1 = findViewById(R.id.radio_button1);
|
checkButton1.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
radioButton2 = findViewById(R.id.radio_button2);
|
@Override
|
||||||
radioButton3 = findViewById(R.id.radio_button3);
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
radioButton4 = findViewById(R.id.radio_button4);
|
if (isChecked){
|
||||||
radioButton5 = findViewById(R.id.radio_button5);
|
Toast.makeText(getContext(), "1", Toast.LENGTH_SHORT).show();
|
||||||
radioButton6 = findViewById(R.id.radio_button6);
|
checkButton2.setChecked(false);
|
||||||
|
checkButton3.setChecked(false);
|
||||||
|
checkButton4.setChecked(false);
|
||||||
|
checkButton5.setChecked(false);
|
||||||
|
checkButton6.setChecked(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
checkButton2 = findViewById(R.id.check_button2);
|
||||||
|
checkButton2.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
|
if (isChecked){
|
||||||
|
Toast.makeText(getContext(), "2", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
checkButton3 = findViewById(R.id.check_button3);
|
||||||
|
checkButton3.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
|
if (isChecked){
|
||||||
|
Toast.makeText(getContext(), "3", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
checkButton4 = findViewById(R.id.check_button4);
|
||||||
|
checkButton4.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
|
if (isChecked){
|
||||||
|
Toast.makeText(getContext(), "4", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
checkButton5 = findViewById(R.id.check_button5);
|
||||||
|
checkButton5.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
|
if (isChecked){
|
||||||
|
Toast.makeText(getContext(), "5", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
checkButton6 = findViewById(R.id.check_button6);
|
||||||
|
checkButton6.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
|
if (isChecked){
|
||||||
|
Toast.makeText(getContext(), "6", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
spinnerType = findViewById(R.id.spinner_type);
|
spinnerType = findViewById(R.id.spinner_type);
|
||||||
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); //设置下拉列表框的下拉选项样式
|
||||||
@ -206,8 +258,10 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@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);
|
||||||
@ -303,6 +357,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
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);
|
||||||
|
pid = getArguments().getInt("pid",0);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -376,6 +431,17 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
} else {
|
} else {
|
||||||
chargingPileEntity.setMemo(describe);
|
chargingPileEntity.setMemo(describe);
|
||||||
}
|
}
|
||||||
|
if (pid == 0) {
|
||||||
|
Toast.makeText(getActivity(), "没有关联充电站", Toast.LENGTH_SHORT).show();
|
||||||
|
}else {
|
||||||
|
chargingPileEntity.setFid(pid);
|
||||||
|
}
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
chargingPileDao.insertChargingPileEntity(chargingPileEntity);
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
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;
|
||||||
|
@ -95,7 +95,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
private boolean aBoolean = false;
|
private boolean aBoolean = false;
|
||||||
private PoiEntity poiEntity;
|
private PoiEntity poiEntity;
|
||||||
private PoiEntity showPoiEntity;
|
private PoiEntity showPoiEntity;
|
||||||
private ArrayList<ChargingPileEntity> chargingPileEntities;
|
|
||||||
private ChargingPileDao chargingPileDao;
|
private ChargingPileDao chargingPileDao;
|
||||||
|
|
||||||
public static ChargingStationFragment newInstance(Bundle bundle) {
|
public static ChargingStationFragment newInstance(Bundle bundle) {
|
||||||
@ -299,9 +298,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
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");
|
showPoiEntity = (PoiEntity) getArguments().getSerializable("PoiEntity");
|
||||||
if (showPoiEntity != null) {
|
if (showPoiEntity != null) {
|
||||||
editNameContent.setText(showPoiEntity.getName());
|
editNameContent.setText(showPoiEntity.getName());
|
||||||
@ -310,13 +308,14 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
String x = showPoiEntity.getX();
|
String x = showPoiEntity.getX();
|
||||||
String y = showPoiEntity.getY();
|
String y = showPoiEntity.getY();
|
||||||
int id = showPoiEntity.getId();
|
int id = showPoiEntity.getId();
|
||||||
|
ArrayList<ChargingPileEntity> chargingPileEntities = new ArrayList<>();
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
List<ChargingPileEntity> chargingPile = chargingPileDao.getChargingPile();
|
List<ChargingPileEntity> chargingPile = chargingPileDao.getChargingPile();
|
||||||
for (int i = 0; i < chargingPile.size(); i++) {
|
for (int i = 0; i < chargingPile.size(); i++) {
|
||||||
ChargingPileEntity chargingPileEntity = chargingPile.get(i);
|
ChargingPileEntity chargingPileEntity = chargingPile.get(i);
|
||||||
if (id == chargingPileEntity.getFid()) {
|
if (showPoiEntity.getTaskId() == chargingPileEntity.getFid()) {
|
||||||
chargingPileEntities.add(chargingPileEntity);
|
chargingPileEntities.add(chargingPileEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -361,8 +360,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
phoneData = new ArrayList<>();
|
phoneData = new ArrayList<>();
|
||||||
//存储图片地址
|
//存储图片地址
|
||||||
photoBean = new ArrayList<>();
|
photoBean = new ArrayList<>();
|
||||||
//充电桩的数据
|
|
||||||
chargingPileEntities = new ArrayList<>();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -374,13 +371,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
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);
|
||||||
@ -428,7 +418,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.setMemo(describe);
|
poiEntity.setDescribe(describe);
|
||||||
}
|
}
|
||||||
if (phoneData.size() <= 0) {
|
if (phoneData.size() <= 0) {
|
||||||
Toast.makeText(getActivity(), "请输入手机号", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "请输入手机号", Toast.LENGTH_SHORT).show();
|
||||||
@ -456,6 +446,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
poiEntity.setCreateTime(format);
|
poiEntity.setCreateTime(format);
|
||||||
poiEntity.setType(2);
|
poiEntity.setType(2);
|
||||||
poiEntity.setTaskStatus(0);
|
poiEntity.setTaskStatus(0);
|
||||||
|
poiEntity.setTaskId(101);
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -519,7 +510,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
case R.id.linear_charging_pile:
|
case R.id.linear_charging_pile:
|
||||||
Message obtains = Message.obtain();
|
Message obtains = Message.obtain();
|
||||||
obtains.what = Constant.CHARGING_STATION;
|
obtains.what = Constant.CHARGING_STATION;
|
||||||
obtains.obj = true;
|
obtains.obj = 101;
|
||||||
EventBus.getDefault().post(obtains);
|
EventBus.getDefault().post(obtains);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,6 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
|||||||
return R.layout.fragment_has_submit;
|
return R.layout.fragment_has_submit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
clPoi = (ConstraintLayout) findViewById(R.id.cl_poi);
|
clPoi = (ConstraintLayout) findViewById(R.id.cl_poi);
|
||||||
|
@ -1,30 +1,79 @@
|
|||||||
package com.navinfo.outdoor.fragment;
|
package com.navinfo.outdoor.fragment;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.CompoundButton;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.slidingpanelayout.widget.SlidingPaneLayout;
|
import androidx.slidingpanelayout.widget.SlidingPaneLayout;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.hjq.permissions.OnPermissionCallback;
|
||||||
|
import com.hjq.permissions.Permission;
|
||||||
|
import com.hjq.permissions.XXPermissions;
|
||||||
|
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
|
||||||
|
import com.kongzue.dialog.util.BaseDialog;
|
||||||
|
import com.kongzue.dialog.util.DialogSettings;
|
||||||
|
import com.kongzue.dialog.v3.MessageDialog;
|
||||||
import com.navinfo.outdoor.R;
|
import com.navinfo.outdoor.R;
|
||||||
import com.navinfo.outdoor.api.Constant;
|
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.room.PoiDao;
|
||||||
|
import com.navinfo.outdoor.room.PoiDatabase;
|
||||||
|
import com.navinfo.outdoor.room.PoiEntity;
|
||||||
|
import com.navinfo.outdoor.util.PhotoPathUtil;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static android.app.Activity.RESULT_OK;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 寻宝-上报-其他的fragment
|
* 寻宝-上报-其他的fragment
|
||||||
*/
|
*/
|
||||||
public class OtherFragment extends BaseDrawerFragment implements View.OnClickListener {
|
public class OtherFragment extends BaseDrawerFragment implements View.OnClickListener {
|
||||||
|
|
||||||
private ImageView ivOtherFinal;
|
|
||||||
|
|
||||||
|
private Spinner spinnerOther;
|
||||||
|
String[] others = new String[]{"下拉选择", "门牌","道路施工","标牌采集","公交","其他"};
|
||||||
|
private String inode;
|
||||||
|
private EditText editTaskName,editOtherDescribe;
|
||||||
|
private RelativeLayout rlPicture;
|
||||||
|
private ImageView ivPicture;
|
||||||
|
private RelativeLayout rlPictures;
|
||||||
|
private ImageView ivPictures;
|
||||||
|
private Button btnOtherLocal;
|
||||||
|
private Button btnOtherUploading;
|
||||||
|
private List<Info> photoBean;
|
||||||
|
private PoiDatabase poiDatabase;
|
||||||
|
private PoiDao poiDao;
|
||||||
|
private boolean aBoolean=false;
|
||||||
|
private boolean bBoolean=false;
|
||||||
|
private PoiEntity showPoiEntity;
|
||||||
|
|
||||||
public static OtherFragment newInstance(Bundle bundle) {
|
public static OtherFragment newInstance(Bundle bundle) {
|
||||||
OtherFragment fragment = new OtherFragment();
|
OtherFragment fragment = new OtherFragment();
|
||||||
@ -36,18 +85,23 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
protected int getLayout() {
|
protected int getLayout() {
|
||||||
return R.layout.fragment_other;
|
return R.layout.fragment_other;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
|
if (!EventBus.getDefault().isRegistered(this)) {//加上判断
|
||||||
|
EventBus.getDefault().register(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
View header = LayoutInflater.from(getActivity()).inflate(R.layout.other_header, null);
|
View header = LayoutInflater.from(getActivity()).inflate(R.layout.other_header, null);
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.MAIN_HEADER;
|
obtain.what = Constant.MAIN_HEADER;
|
||||||
obtain.obj = header;
|
obtain.obj = header;
|
||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
//点击按钮返回上一页
|
header.findViewById(R.id.iv_final).setOnClickListener(new View.OnClickListener() {
|
||||||
ImageView ivOtherFinal = header.findViewById(R.id.iv_other_final);
|
|
||||||
ivOtherFinal.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Bundle arguments = getArguments();
|
Bundle arguments = getArguments();
|
||||||
@ -61,31 +115,262 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
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();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
|
//存储图片地址
|
||||||
|
photoBean = new ArrayList<>();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@Subscribe
|
||||||
|
public void onEvent(Message data) {
|
||||||
|
if (data.what == Constant.OTHER_WORD) {
|
||||||
|
inode = data.obj.toString();
|
||||||
|
Toast.makeText(getContext(), inode, Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void initData() {
|
protected void initData() {
|
||||||
super.initData();
|
super.initData();
|
||||||
|
poiDatabase = PoiDatabase.getInstance(getContext());
|
||||||
|
poiDao = poiDatabase.getPoiDao();
|
||||||
|
spinnerOther = findViewById(R.id.spinner_other);
|
||||||
|
ArrayAdapter<String> adapterOthers = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, others);
|
||||||
|
adapterOthers.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //设置下拉列表框的下拉选项样式
|
||||||
|
spinnerOther.setAdapter(adapterOthers);
|
||||||
|
spinnerOther.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
|
@Override
|
||||||
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
switch (position) {
|
||||||
|
case 0:
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
Toast.makeText(getActivity(), others[1], Toast.LENGTH_SHORT).show();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
Toast.makeText(getActivity(), others[2], Toast.LENGTH_SHORT).show();
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
Toast.makeText(getActivity(), others[3], Toast.LENGTH_SHORT).show();
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
Toast.makeText(getActivity(), others[4], Toast.LENGTH_SHORT).show();
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
Toast.makeText(getActivity(), others[5], Toast.LENGTH_SHORT).show();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onNothingSelected(AdapterView<?> parent) {}
|
||||||
|
});
|
||||||
|
CheckBox checkPot = findViewById(R.id.check_pot);
|
||||||
|
checkPot.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
|
Message obtain = Message.obtain();
|
||||||
|
obtain.what = Constant.MAIN_OTHER;
|
||||||
|
obtain.obj = isChecked;
|
||||||
|
EventBus.getDefault().post(obtain);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
editTaskName = findViewById(R.id.et_task_name);
|
||||||
|
rlPicture = findViewById(R.id.rl_picture);
|
||||||
|
rlPicture.setOnClickListener(this::onClick);
|
||||||
|
ivPicture = findViewById(R.id.iv_picture);
|
||||||
|
|
||||||
|
rlPictures = findViewById(R.id.rl_pictures);
|
||||||
|
rlPictures.setOnClickListener(this::onClick);
|
||||||
|
ivPictures = findViewById(R.id.iv_pictures);
|
||||||
|
editOtherDescribe = findViewById(R.id.edit_other_describe);
|
||||||
|
btnOtherLocal = findViewById(R.id.btn_other_local);
|
||||||
|
btnOtherLocal.setOnClickListener(this::onClick);
|
||||||
|
btnOtherUploading = findViewById(R.id.btn_other_uploading);
|
||||||
|
btnOtherUploading.setOnClickListener(this::onClick);
|
||||||
|
|
||||||
|
showPoiEntity = (PoiEntity) getArguments().getSerializable("PoiEntity");
|
||||||
|
if (showPoiEntity != null) {
|
||||||
|
editTaskName.setText(showPoiEntity.getName());
|
||||||
|
inode = showPoiEntity.getX() + "," + showPoiEntity.getY();
|
||||||
|
editOtherDescribe.setText(showPoiEntity.getDescribe());
|
||||||
|
if (showPoiEntity.getPhotoInfo() != null) {
|
||||||
|
if (showPoiEntity.getPhotoInfo().get(0).getPhoto() != null) {
|
||||||
|
Glide.with(getActivity()).load(showPoiEntity.getPhotoInfo().get(0).getPhoto()).into(ivPicture);
|
||||||
|
}
|
||||||
|
if (showPoiEntity.getPhotoInfo().get(1).getPhoto() != null) {
|
||||||
|
Glide.with(getActivity()).load(showPoiEntity.getPhotoInfo().get(1).getPhoto()).into(ivPictures);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()) {
|
switch (v.getId()) {
|
||||||
|
case R.id.rl_picture:
|
||||||
|
Intent intentPicture = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
startActivityForResult(intentPicture, 101);
|
||||||
|
break;
|
||||||
|
case R.id.rl_pictures:
|
||||||
|
Intent intentPictures = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
startActivityForResult(intentPictures, 102);
|
||||||
|
break;
|
||||||
|
case R.id.btn_other_local:
|
||||||
|
XXPermissions.with(this)
|
||||||
|
//读写权限
|
||||||
|
.permission(Permission.MANAGE_EXTERNAL_STORAGE)
|
||||||
|
.request(new OnPermissionCallback() {
|
||||||
|
@Override
|
||||||
|
public void onGranted(List<String> permissions, boolean all) {
|
||||||
|
if (all) {
|
||||||
|
//保存数据库:
|
||||||
|
PoiEntity poiEntity = new PoiEntity();
|
||||||
|
String name = editTaskName.getText().toString().trim();//名称
|
||||||
|
if (name == null || name.equals("")) {
|
||||||
|
Toast.makeText(getActivity(), "请输入poi 名称", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
poiEntity.setName(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (inode == null || inode.equals("")) {
|
||||||
|
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
String[] split = inode.split(",");
|
||||||
|
poiEntity.setX(split[0]);
|
||||||
|
poiEntity.setY(split[1]);
|
||||||
|
}
|
||||||
|
String describe = editOtherDescribe.getText().toString().trim();
|
||||||
|
if (describe == null || describe.equals("")) {
|
||||||
|
Toast.makeText(getActivity(), "请输入任务描述", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
poiEntity.setDescribe(describe);
|
||||||
|
}
|
||||||
|
if (photoBean.size() < 0) {
|
||||||
|
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
poiEntity.setPhotoInfo(photoBean);
|
||||||
|
}
|
||||||
|
if (!aBoolean) {
|
||||||
|
Toast.makeText(getActivity(), "请拍照 全景图", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!bBoolean) {
|
||||||
|
Toast.makeText(getActivity(), "请拍照 名称", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||||
|
String format = formatter.format(calendar.getTime());
|
||||||
|
poiEntity.setCreateTime(format);
|
||||||
|
poiEntity.setType(3);
|
||||||
|
poiEntity.setTaskStatus(0);
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
poiDao.insertPoiEntity(poiEntity);
|
||||||
|
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
Message obtains = Message.obtain();
|
||||||
|
obtains.what = Constant.TREASURE_FRAGMENT;
|
||||||
|
obtains.obj = false;
|
||||||
|
EventBus.getDefault().post(obtains);
|
||||||
|
onBackPressed();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDenied(List<String> permissions, boolean never) {
|
||||||
|
if (never) {
|
||||||
|
Toast.makeText(getActivity(), "被永久拒绝授权,请手动授予权限", Toast.LENGTH_SHORT).show();
|
||||||
|
// 如果是被永久拒绝就跳转到应用权限系统设置页面
|
||||||
|
XXPermissions.startPermissionActivity(getActivity(), permissions);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
break;
|
||||||
|
case R.id.btn_other_uploading:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
if (requestCode == 101 && 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, 101);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data);//照片路径
|
||||||
|
Info info = new Info();
|
||||||
|
info.setPhoto(takePhotoPath);
|
||||||
|
photoBean.add(info);
|
||||||
|
ivPicture.setImageBitmap(bitmap);//显示图像
|
||||||
|
aBoolean=true;
|
||||||
|
}
|
||||||
|
} else if (requestCode == 102 && 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, 102);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data);//照片路径
|
||||||
|
Info info = new Info();
|
||||||
|
info.setPhoto(takePhotoPath);
|
||||||
|
photoBean.add(info);
|
||||||
|
ivPictures.setImageBitmap(bitmap);//显示图像
|
||||||
|
bBoolean=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||||
|
EventBus.getDefault().unregister(this);
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -207,11 +207,12 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
initFilterMarker(poiEntities);
|
initFilterMarker(poiEntities);
|
||||||
} else if (data.what == Constant.TREASURE_WORD) { // POI采集-移动位置
|
} else if (data.what == Constant.TREASURE_WORD) { // POI采集-移动位置
|
||||||
initPoiMarker(Boolean.valueOf((Boolean) data.obj), Constant.POI_WORD);
|
initPoiMarker(Boolean.valueOf((Boolean) data.obj), Constant.POI_WORD);
|
||||||
|
} else if (data.what == Constant.MAIN_CHARGING_STATION) {//充电站采集-移动位置
|
||||||
}else if (data.what==Constant.MAIN_CHARGING_STATION){//充电站采集-移动位置
|
initPoiMarker(Boolean.valueOf((Boolean) data.obj), Constant.CHARGING_STATION_WORD);
|
||||||
initPoiMarker(Boolean.valueOf((Boolean) data.obj),Constant.CHARGING_STATION_WORD);
|
} else if (data.what == Constant.MAIN_CHARGING_PILE) {//充电桩采集-移动位置
|
||||||
}else if (data.what ==Constant.MAIN_CHARGING_PILE){//充电桩采集-移动位置
|
initPoiMarker(Boolean.valueOf((Boolean) data.obj), Constant.CHARGING_PILE_WORD);
|
||||||
initPoiMarker(Boolean.valueOf((Boolean)data.obj),Constant.CHARGING_PILE_WORD);
|
} else if (data.what == Constant.MAIN_OTHER) {//其他采集-移动位置
|
||||||
|
initPoiMarker(Boolean.valueOf((Boolean) data.obj), Constant.OTHER_WORD);
|
||||||
} else if (data.what == Constant.TREASURE_FRAGMENT) {
|
} else if (data.what == Constant.TREASURE_FRAGMENT) {
|
||||||
if ((boolean) data.obj == true) {
|
if ((boolean) data.obj == true) {
|
||||||
frameLayout.setVisibility(View.GONE);
|
frameLayout.setVisibility(View.GONE);
|
||||||
@ -237,14 +238,12 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
sliding_layout.setPanelHeight(1000);
|
sliding_layout.setPanelHeight(1000);
|
||||||
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
|
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
|
||||||
}
|
}
|
||||||
}else if (data.what==Constant.CHARGING_STATION){//充电站的充电桩
|
} else if (data.what == Constant.CHARGING_STATION) {//充电站的充电桩
|
||||||
if ((boolean)data.obj){
|
Bundle bundle = new Bundle();
|
||||||
Bundle bundle = new Bundle();
|
bundle.putBoolean("isSliding", false); // 通知抽屉不收回
|
||||||
bundle.putBoolean("isSliding", false); // 通知抽屉不收回
|
bundle.putInt("pid", (Integer) data.obj);
|
||||||
ChargingPileFragment chargingPileFragment = ChargingPileFragment.newInstance(bundle);
|
ChargingPileFragment chargingPileFragment = ChargingPileFragment.newInstance(bundle);
|
||||||
showSlidingFragment(chargingPileFragment);
|
showSlidingFragment(chargingPileFragment);
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -274,7 +273,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void initPoiMarker(Boolean t,int aInt) {
|
private void initPoiMarker(Boolean t, int aInt) {
|
||||||
if (t == true) {
|
if (t == true) {
|
||||||
//移动地图
|
//移动地图
|
||||||
CameraUpdate cameraSigma =
|
CameraUpdate cameraSigma =
|
||||||
@ -475,14 +474,15 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
break;
|
break;
|
||||||
case R.id.iv_message:
|
case R.id.iv_message:
|
||||||
Intent messageIntent = new Intent(getContext(), FragmentManagement.class);
|
Intent messageIntent = new Intent(getContext(), FragmentManagement.class);
|
||||||
messageIntent.putExtra("tag",35);
|
messageIntent.putExtra("tag", 35);
|
||||||
startActivity(messageIntent);
|
startActivity(messageIntent);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* header 头部布局
|
* header 头部布局
|
||||||
|
*
|
||||||
* @param view
|
* @param view
|
||||||
*/
|
*/
|
||||||
public void initHeader(View view) {
|
public void initHeader(View view) {
|
||||||
|
@ -18,7 +18,7 @@ import static androidx.room.ForeignKey.CASCADE;
|
|||||||
* PoiEntity实体类的id和ChargingPileEntity实体类的pileId相关联
|
* PoiEntity实体类的id和ChargingPileEntity实体类的pileId相关联
|
||||||
* 注解中包含Delete = CASCADE, 你可以告诉SQLite,如果相应的PoiEntity实例被删除,那么删除这个PoiEntity下的所有ChargingPileEntity。
|
* 注解中包含Delete = CASCADE, 你可以告诉SQLite,如果相应的PoiEntity实例被删除,那么删除这个PoiEntity下的所有ChargingPileEntity。
|
||||||
*/
|
*/
|
||||||
@Entity(tableName = "pile", foreignKeys = @ForeignKey(entity = PoiEntity.class,parentColumns = "id",childColumns = "pileId",onDelete =CASCADE))
|
@Entity(tableName = "pile")
|
||||||
public class ChargingPileEntity {
|
public class ChargingPileEntity {
|
||||||
@PrimaryKey(autoGenerate = true) // 设置主键,并且自动生长
|
@PrimaryKey(autoGenerate = true) // 设置主键,并且自动生长
|
||||||
private int pileId;
|
private int pileId;
|
||||||
|
@ -120,7 +120,81 @@
|
|||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/linear_name" />
|
app:layout_constraintTop_toBottomOf="@id/linear_name" />
|
||||||
<RadioGroup
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_charging"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
android:padding="2dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:background="@drawable/underline"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/text"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
>
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/check_button1"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="对所有车辆开放"
|
||||||
|
/>
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/check_button2"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="对环卫车开放"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
>
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/check_button3"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="对公交车开放"
|
||||||
|
/>
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/check_button4"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="对出租车开放"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
>
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/check_button5"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="80dp"
|
||||||
|
android:text="对除环卫,公交,出租,品牌,之外的其他 特种车辆开放"
|
||||||
|
/>
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/check_button6"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="对某品牌汽车开放"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
<!-- <RadioGroup
|
||||||
android:id="@+id/radio_group"
|
android:id="@+id/radio_group"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
@ -169,7 +243,7 @@
|
|||||||
android:text="对某品牌汽车开放"
|
android:text="对某品牌汽车开放"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</RadioGroup>
|
</RadioGroup>-->
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/linear_type"
|
android:id="@+id/linear_type"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -177,7 +251,7 @@
|
|||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
android:padding="2dp"
|
android:padding="2dp"
|
||||||
android:background="@drawable/underline"
|
android:background="@drawable/underline"
|
||||||
app:layout_constraintTop_toBottomOf="@id/radio_group"
|
app:layout_constraintTop_toBottomOf="@id/ll_charging"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent">
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
<TextView
|
<TextView
|
||||||
@ -311,7 +385,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="2dp"
|
android:padding="2dp"
|
||||||
android:background="@drawable/underline"
|
android:background="@drawable/underline"
|
||||||
app:layout_constraintTop_toBottomOf="@id/radio_group"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent">
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
<TextView
|
<TextView
|
||||||
@ -497,7 +570,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="2dp"
|
android:padding="2dp"
|
||||||
android:background="@drawable/underline"
|
android:background="@drawable/underline"
|
||||||
app:layout_constraintTop_toBottomOf="@id/radio_group"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent">
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -20,13 +20,13 @@
|
|||||||
android:layout_margin="20dp"
|
android:layout_margin="20dp"
|
||||||
android:text="01.选择情报类型"
|
android:text="01.选择情报类型"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/rl_other"/>
|
app:layout_constraintLeft_toLeftOf="parent" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_text"
|
android:id="@+id/ll_text"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="150dp"
|
android:layout_height="100dp"
|
||||||
app:layout_constraintLeft_toLeftOf="@id/tv_select_type"
|
app:layout_constraintLeft_toLeftOf="@id/tv_select_type"
|
||||||
app:layout_constraintTop_toBottomOf="@id/tv_select_type">
|
app:layout_constraintTop_toBottomOf="@id/tv_select_type">
|
||||||
|
|
||||||
@ -36,24 +36,32 @@
|
|||||||
android:layout_margin="20dp"
|
android:layout_margin="20dp"
|
||||||
android:background="@drawable/other_text">
|
android:background="@drawable/other_text">
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_down"
|
<Spinner
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/spinner_other"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:paddingLeft="10dp"
|
android:layout_height="40dp"
|
||||||
android:text="下拉选择"
|
android:layout_centerVertical="true"
|
||||||
android:textStyle="bold"
|
android:layout_margin="2dp"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginEnd="5dp"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:textColor="#333"
|
||||||
|
android:textSize="15sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/other_dawn"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="30dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="30dp"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_marginRight="10dp"
|
android:layout_centerVertical="true"
|
||||||
android:background="@drawable/ic_arrow_down"
|
android:layout_marginEnd="5dp"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
android:background="@drawable/ic_baseline_arrow_drop"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@ -95,15 +103,20 @@
|
|||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<EditText
|
<CheckBox
|
||||||
android:id="@+id/et_position"
|
android:id="@+id/check_pot"
|
||||||
android:layout_width="230dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="20dp"
|
||||||
android:background="@null"
|
android:layout_centerVertical="true"
|
||||||
android:paddingLeft="10dp"
|
android:layout_marginStart="20dp"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/tv_indeo"
|
android:background="@drawable/selector_change_bg"
|
||||||
app:layout_constraintLeft_toRightOf="@id/tv_indeo"
|
android:button="@null"
|
||||||
app:layout_constraintTop_toTopOf="@id/tv_indeo" />
|
android:gravity="center"
|
||||||
|
android:text="编辑"
|
||||||
|
android:textSize="8sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/tv_indeo"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_other_map"
|
android:id="@+id/iv_other_map"
|
||||||
@ -164,47 +177,70 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/tv_other_picture">
|
app:layout_constraintTop_toBottomOf="@+id/tv_other_picture">
|
||||||
|
<RelativeLayout
|
||||||
<LinearLayout
|
android:id="@+id/rl_picture"
|
||||||
android:layout_width="150dp"
|
android:layout_width="150dp"
|
||||||
android:layout_height="100dp"
|
android:layout_height="100dp"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
android:background="#03A9F4"
|
android:background="#03A9F4"
|
||||||
android:gravity="center"
|
android:gravity="center">
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="30dp"
|
android:id="@+id/image_picture"
|
||||||
android:layout_height="30dp"
|
android:layout_centerHorizontal="true"
|
||||||
android:background="@drawable/plus" />
|
android:layout_width="40dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:background="@drawable/plus"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="*照片"
|
android:layout_centerHorizontal="true"
|
||||||
android:textColor="@color/white" />
|
android:text="照片"
|
||||||
</LinearLayout>
|
android:textSize="8sp"
|
||||||
|
android:layout_margin="5dp"
|
||||||
<LinearLayout
|
android:textColor="@color/pickerview_wheelview_textcolor_divider"
|
||||||
|
android:layout_below="@id/image_picture"
|
||||||
|
/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_picture"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
/>
|
||||||
|
</RelativeLayout>
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rl_pictures"
|
||||||
android:layout_width="150dp"
|
android:layout_width="150dp"
|
||||||
android:layout_height="100dp"
|
android:layout_height="100dp"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
android:background="#03A9F4"
|
android:background="#03A9F4"
|
||||||
android:gravity="center"
|
android:gravity="center">
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="30dp"
|
android:id="@+id/image_pictures"
|
||||||
android:layout_height="30dp"
|
android:layout_centerHorizontal="true"
|
||||||
android:background="@drawable/plus" />
|
android:layout_width="40dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:background="@drawable/plus"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="*照片"
|
android:layout_centerHorizontal="true"
|
||||||
android:textColor="@color/white" />
|
android:text="照片"
|
||||||
|
android:textSize="8sp"
|
||||||
</LinearLayout>
|
android:layout_margin="5dp"
|
||||||
|
android:textColor="@color/pickerview_wheelview_textcolor_divider"
|
||||||
|
android:layout_below="@id/image_pictures"
|
||||||
|
/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_pictures"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
/>
|
||||||
|
</RelativeLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
android:background="@drawable/chartall" />
|
android:background="@drawable/chartall" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_text"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/image"
|
android:layout_below="@id/image"
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_other_final"
|
android:id="@+id/iv_final"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="45dp"
|
android:layout_height="45dp"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
|
@ -389,7 +389,7 @@
|
|||||||
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="02拍照"
|
android:text="03描述"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/linear_photograph" />
|
app:layout_constraintTop_toBottomOf="@id/linear_photograph" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user