commit
d13d1628c8
@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion "29.0.0"
|
||||
// ndkVersion '23.0.7123448'
|
||||
ndkVersion '23.0.7123448'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.navinfo.outdoor"
|
||||
|
@ -22,10 +22,14 @@ import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.hjq.permissions.OnPermissionCallback;
|
||||
import com.hjq.permissions.Permission;
|
||||
import com.hjq.permissions.XXPermissions;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseActivity;
|
||||
|
||||
import com.navinfo.outdoor.util.NetWorkUtils;
|
||||
import com.navinfo.outdoor.util.SdkFolderCreate;
|
||||
import com.navinfo.outdoor.util.ToastUtil;
|
||||
import com.otaliastudios.cameraview.CameraException;
|
||||
@ -48,6 +52,7 @@ import com.tencent.map.geolocation.TencentLocationRequest;
|
||||
import com.tencent.tencentmap.mapsdk.maps.LocationSource;
|
||||
import com.tencent.tencentmap.mapsdk.maps.MapView;
|
||||
import com.tencent.tencentmap.mapsdk.maps.TencentMap;
|
||||
import com.tencent.tencentmap.mapsdk.maps.UiSettings;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptorFactory;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.MyLocationStyle;
|
||||
@ -66,6 +71,8 @@ import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tencent.mapsdk.internal.aaa.getContext;
|
||||
|
||||
|
||||
public class PictureActivity extends BaseActivity implements View.OnClickListener, LocationSource, TencentLocationListener {
|
||||
private static final CameraLogger LOG = CameraLogger.create("Picture");
|
||||
@ -73,8 +80,6 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
private ImageButton capturePicture;
|
||||
private long captureTime = 0;
|
||||
private android.widget.Button btnSwitch;
|
||||
private boolean USE_FRAME_PROCESSOR = false;
|
||||
private boolean DECODE_BITMAP = false;
|
||||
private TencentMap tencentMap;
|
||||
private TencentLocationManager locationManager;
|
||||
private TencentLocationRequest locationRequest;
|
||||
@ -100,8 +105,9 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
btnVideo.setOnClickListener(this::onClick);
|
||||
btnSwitch = (Button) findViewById(R.id.btn_switch);
|
||||
btnSwitch.setOnClickListener(this::onClick);
|
||||
capturePicture = (ImageButton) findViewById(R.id.capturePicture);
|
||||
capturePicture.setOnClickListener(this::onClick);
|
||||
// capturePicture = (ImageButton) findViewById(R.id.capturePicture);
|
||||
// capturePicture.setOnClickListener(this::onClick);
|
||||
//相机记录器
|
||||
CameraLogger.setLogLevel(CameraLogger.LEVEL_VERBOSE);
|
||||
camera = findViewById(R.id.camera);
|
||||
camera.setOnClickListener(this::onClick);
|
||||
@ -117,8 +123,12 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
SdkFolderCreate.mkdirs(Constant.PICTURE_FOLDER);
|
||||
//获取地图
|
||||
tencentMap = ivMap.getMap();
|
||||
//地图定位
|
||||
initLocation();
|
||||
//获取地图UI 设置对象
|
||||
UiSettings uiSettings = tencentMap.getUiSettings();
|
||||
//设置logo的大小
|
||||
uiSettings.setLogoScale(0.7f);
|
||||
//开启定位权限
|
||||
checkNetWork();
|
||||
|
||||
//相机预览监听
|
||||
camera.addCameraListener(new CameraListener() {
|
||||
@ -131,7 +141,6 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
String format = formatter.format(calendar.getTime());
|
||||
//文件
|
||||
File file = new File(Constant.PICTURE_FOLDER, format + ".jpg");
|
||||
|
||||
result.toFile(file, new FileCallback() {
|
||||
@Override
|
||||
public void onFileReady(@Nullable @org.jetbrains.annotations.Nullable File file) {
|
||||
@ -163,6 +172,48 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
|
||||
});
|
||||
}
|
||||
//
|
||||
private void checkNetWork() {
|
||||
if (NetWorkUtils.isNetworkAvailable(this)) { // 当前网络可用
|
||||
checkMyLocation();
|
||||
} else { // 当前网络不可用
|
||||
ToastUtil.showShort(this, Constant.NETWORK_UNAVAILABLE);
|
||||
}
|
||||
}
|
||||
|
||||
private void checkMyLocation() {
|
||||
// 1.判断是否拥有定位的权限
|
||||
// 1.1 拥有权限进行相应操作
|
||||
// 1.2 没有权限申请权限
|
||||
// 1.2.1 Android 6.0 动态申请权限
|
||||
// 1.2.1.1 用户给予权限进行相应操作
|
||||
// 1.2.1.2 用户没有给予权限 作出相应提示
|
||||
// 1.2.2 某些5.0权限的手机执行相应操作
|
||||
|
||||
XXPermissions.with(this)
|
||||
.permission(Permission.ACCESS_COARSE_LOCATION)
|
||||
.request(new OnPermissionCallback() {
|
||||
|
||||
@Override
|
||||
public void onGranted(List<String> permissions, boolean all) {
|
||||
if (all) {
|
||||
//建立定位
|
||||
initLocation();
|
||||
} else {
|
||||
Toast.makeText(PictureActivity.this, "申请权限失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDenied(List<String> permissions, boolean never) {
|
||||
if (never) {
|
||||
Toast.makeText(PictureActivity.this, "被永久拒绝授权,请手动授予定位权限", Toast.LENGTH_SHORT).show();
|
||||
// 如果是被永久拒绝就跳转到应用权限系统设置页面
|
||||
XXPermissions.startPermissionActivity(PictureActivity.this, permissions);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void message(String content, Boolean important) {
|
||||
if (important) {
|
||||
@ -185,14 +236,14 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.capturePicture:
|
||||
camera.setMode(Mode.PICTURE);
|
||||
if (!camera.isTakingPicture()) {
|
||||
captureTime = System.currentTimeMillis();
|
||||
message("Capturing picture...", false);
|
||||
camera.takePicture();
|
||||
}
|
||||
break;
|
||||
// case R.id.capturePicture:
|
||||
// camera.setMode(Mode.PICTURE);
|
||||
// if (!camera.isTakingPicture()) {
|
||||
// captureTime = System.currentTimeMillis();
|
||||
// message("Capturing picture...", false);
|
||||
// camera.takePicture();
|
||||
// }
|
||||
// break;
|
||||
case R.id.btn_switch:
|
||||
btnSwich();
|
||||
break;
|
||||
@ -333,7 +384,13 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
locationRequest = null;
|
||||
locationChangedListener = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 实现位置监听
|
||||
*
|
||||
* @param tencentLocation
|
||||
* @param i
|
||||
* @param s
|
||||
*/
|
||||
@Override
|
||||
public void onLocationChanged(TencentLocation tencentLocation, int i, String s) {
|
||||
if (i == TencentLocation.ERROR_OK && locationChangedListener != null) {
|
||||
|
@ -21,14 +21,18 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.ViewHolder> {
|
||||
|
||||
private List<PoiEntity> allRoad = new ArrayList<>();
|
||||
private Context context;
|
||||
|
||||
|
||||
public StaySubmitAdapter(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public void setAllRoad(List<PoiEntity> allRoad) {
|
||||
this.allRoad.addAll(allRoad);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@NotNull
|
||||
@Override
|
||||
@ -39,24 +43,27 @@ public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.Vi
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull @NotNull ViewHolder holder, int position) {
|
||||
PoiEntity poiEntity = allRoad.get(position);
|
||||
holder.tvName.setText(poiEntity.getName());
|
||||
holder.tvDay.setText(poiEntity.getCreateTime());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return 0;
|
||||
return allRoad.size();
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private TextView tvCs1;
|
||||
private TextView tvName;
|
||||
private TextView tvDay;
|
||||
private CheckBox cbAll;
|
||||
|
||||
public ViewHolder(@NonNull @NotNull View itemView) {
|
||||
super(itemView);
|
||||
tvCs1 = itemView.findViewById(R.id.tv_cs1);
|
||||
tvDay = itemView.findViewById(R.id.tv_day);
|
||||
tvName = itemView.findViewById(R.id.tv_road_name);
|
||||
tvDay = itemView.findViewById(R.id.tv_road_day);
|
||||
cbAll = itemView.findViewById(R.id.cb_all);
|
||||
}
|
||||
}
|
||||
|
16
app/src/main/java/com/navinfo/outdoor/bean/RoadExtend.java
Normal file
16
app/src/main/java/com/navinfo/outdoor/bean/RoadExtend.java
Normal file
@ -0,0 +1,16 @@
|
||||
package com.navinfo.outdoor.bean;
|
||||
/***
|
||||
* 道路数据的附加信息
|
||||
*/
|
||||
|
||||
public class RoadExtend {
|
||||
private int type;//拍照方式 0-车行,1-自行车
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
@ -146,7 +146,6 @@ public class FilterFragment extends BaseDialogFragment implements View.OnClickLi
|
||||
@Override
|
||||
public void onClick(String text, int index) {
|
||||
tvExclusive.setText(text);
|
||||
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
@ -108,7 +108,6 @@ public class PoiFragment extends BaseDialogFragment implements View.OnClickListe
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
|
||||
|
||||
poiDatabase = PoiDatabase.getInstance(getContext());
|
||||
poiDao = poiDatabase.getPoiDao();
|
||||
checkBoxLife = findViewById(R.id.check_pot_life);
|
||||
@ -219,7 +218,6 @@ public class PoiFragment extends BaseDialogFragment implements View.OnClickListe
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(Message data) {
|
||||
if (data.what == Constant.POI_WORD_2) {
|
||||
|
@ -1,22 +1,40 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.media.MediaMetadataRetriever;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.google.gson.Gson;
|
||||
import com.hjq.permissions.OnPermissionCallback;
|
||||
import com.hjq.permissions.Permission;
|
||||
import com.hjq.permissions.XXPermissions;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.PictureActivity;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.bean.Info;
|
||||
import com.navinfo.outdoor.bean.JsonBean;
|
||||
import com.navinfo.outdoor.bean.RoadExtend;
|
||||
import com.navinfo.outdoor.room.PoiDao;
|
||||
import com.navinfo.outdoor.room.PoiDatabase;
|
||||
import com.navinfo.outdoor.room.PoiEntity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 寻宝-点击上传弹窗-道路
|
||||
*/
|
||||
|
||||
public class RoadFragment extends BaseFragment {
|
||||
public class RoadFragment extends BaseFragment implements View.OnClickListener {
|
||||
private TextView tvPictures;
|
||||
private EditText etRoadName;
|
||||
private ImageView ivRoadPicture;
|
||||
@ -27,6 +45,9 @@ public class RoadFragment extends BaseFragment {
|
||||
private EditText etDesc;
|
||||
private Button btnRoadSave;
|
||||
private RadioGroup rgType;
|
||||
private RoadExtend roadExtend;
|
||||
private PoiDatabase poiDatabase;
|
||||
private PoiDao poiDao;
|
||||
|
||||
|
||||
@Override
|
||||
@ -37,23 +58,25 @@ public class RoadFragment extends BaseFragment {
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
poiDatabase = PoiDatabase.getInstance(getContext());
|
||||
poiDao = poiDatabase.getPoiDao();
|
||||
tvPictures = (TextView) findViewById(R.id.tv_pictures);
|
||||
tvPictures.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(getContext(), PictureActivity.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
tvPictures.setOnClickListener(this::onClick);
|
||||
etRoadName = (EditText) findViewById(R.id.et_road_name);
|
||||
ivRoadPicture = (ImageView) findViewById(R.id.iv_road_picture);
|
||||
Glide.with(getContext()).load(getLocalVideoBitmap(String.valueOf(R.drawable.bg_01))).into(ivRoadPicture);
|
||||
rbCar = (RadioButton) findViewById(R.id.rb_car);
|
||||
rbBicycle = (RadioButton) findViewById(R.id.rb_bicycle);
|
||||
rbWalking = (RadioButton) findViewById(R.id.rb_walking);
|
||||
rbManual = (RadioButton) findViewById(R.id.rb_manual);
|
||||
etDesc = (EditText) findViewById(R.id.et_desc);
|
||||
btnRoadSave = (Button) findViewById(R.id.btn_road_save);
|
||||
btnRoadSave.setOnClickListener(this::onClick);
|
||||
rgType = (RadioGroup) findViewById(R.id.rg_type);
|
||||
|
||||
//禁用可操作性控件
|
||||
// disables();
|
||||
// disables();
|
||||
//获取
|
||||
}
|
||||
|
||||
private void disables() {
|
||||
@ -68,5 +91,104 @@ public class RoadFragment extends BaseFragment {
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
// infos = new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取本地视频的第一帧
|
||||
*
|
||||
* @param localPath
|
||||
* @return
|
||||
*/
|
||||
public Bitmap getLocalVideoBitmap(String localPath) {
|
||||
Bitmap bitmap = null;
|
||||
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
|
||||
try {
|
||||
//根据文件路径获取缩略图
|
||||
retriever.setDataSource(localPath);
|
||||
//获得第一帧图片
|
||||
bitmap = retriever.getFrameAtTime();
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
retriever.release();
|
||||
}
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.btn_road_save:
|
||||
XXPermissions.with(getContext())
|
||||
.permission(Permission.MANAGE_EXTERNAL_STORAGE)
|
||||
.request(new OnPermissionCallback() {
|
||||
@Override
|
||||
public void onGranted(List<String> permissions, boolean all) {
|
||||
if (all) {
|
||||
PoiEntity poiEntity = new PoiEntity();
|
||||
String roadName = etRoadName.getText().toString().trim();
|
||||
if (roadName == null || roadName.equals("")) {
|
||||
Toast.makeText(getContext(), "请输入道路 名称", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
poiEntity.setName(roadName);
|
||||
}
|
||||
RoadExtend roadExtend = new RoadExtend();
|
||||
int type = getPictureType();
|
||||
if (type== -1){
|
||||
Toast.makeText(getContext(), "请选择拍照方式", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
roadExtend.setType(type);
|
||||
Gson gson = new Gson();
|
||||
String roadExtendJson = gson.toJson(roadExtend);
|
||||
poiEntity.setExtend(roadExtendJson);
|
||||
String desc = etDesc.getText().toString().trim();
|
||||
if (desc == null || desc.equals("")) {
|
||||
Toast.makeText(getContext(), "请输入你的任务描述", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
poiEntity.setDescribe(desc);
|
||||
}
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiDao.insertPoiEntity(poiEntity);
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
|
||||
@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.tv_pictures:
|
||||
Intent intent = new Intent(getContext(), PictureActivity.class);
|
||||
startActivity(intent);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//获取拍照类型
|
||||
private int getPictureType() {
|
||||
if (rbCar != null && rbCar.isChecked()) {
|
||||
return 0;
|
||||
} else if (rbBicycle != null && rbBicycle.isChecked()) {
|
||||
return 1;
|
||||
} else if (rbWalking != null && rbWalking.isChecked()) {
|
||||
return 2;
|
||||
}else if (rbManual != null && rbManual.isChecked()) {
|
||||
return 3;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
@ -5,8 +5,13 @@ import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import java.text.SimpleDateFormat;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.jcodecraeer.xrecyclerview.ProgressStyle;
|
||||
import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
||||
import com.kongzue.dialog.interfaces.OnMenuItemClickListener;
|
||||
@ -18,6 +23,9 @@ import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.room.PoiDao;
|
||||
import com.navinfo.outdoor.room.PoiDatabase;
|
||||
import com.navinfo.outdoor.room.PoiEntity;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -33,6 +41,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
private PoiDao poiDao;
|
||||
private TextView tvStayType;
|
||||
private TextView tvStayResult;
|
||||
private ArrayList<Object> poiEntities;
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
@ -53,6 +62,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
cbSelect = (CheckBox) findViewById(R.id.cb_select);
|
||||
tvDelete = (TextView) findViewById(R.id.tv_delete);
|
||||
btnStaySubmit = (Button) findViewById(R.id.btn_stay_submit);
|
||||
stayXrv.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
stayXrv.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
|
||||
stayXrv.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
|
||||
stayXrv.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
|
||||
@ -78,7 +88,27 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
|
||||
poiDatabase = PoiDatabase.getInstance(getContext());
|
||||
poiDao = poiDatabase.getPoiDao();
|
||||
poiEntities = new ArrayList<>();
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
List<PoiEntity> allRoad = poiDao.getAllPoi();
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Log.d("TAG", "run: " + allRoad.toString());
|
||||
// SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm ");
|
||||
// Date curDate = new Date(System.currentTimeMillis());//获取当前时间
|
||||
// String str = formatter.format(curDate);
|
||||
//
|
||||
poiEntities.addAll(allRoad);
|
||||
staySubmitAdapter.setAllRoad(allRoad);
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -86,21 +116,15 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
switch (v.getId()) {
|
||||
case R.id.tv_stay_result:
|
||||
Toast.makeText(getContext(), "点击了", Toast.LENGTH_SHORT).show();
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
List<PoiEntity> allPoi = poiDao.getAllPoi();
|
||||
Log.d("TAG", "run: " + allPoi.toString());
|
||||
}
|
||||
}).start();
|
||||
break;
|
||||
case R.id.cl_stay_type:
|
||||
// BottomMenu.show(UserApplication.getUserApplication(), new String[]{"poi", "道路", "充电站", "其他"}, new OnMenuItemClickListener() {
|
||||
// @Override
|
||||
// public void onClick(String text, int index) {
|
||||
// tvStayType.setText(text);
|
||||
// }
|
||||
// });
|
||||
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"poi", "道路", "充电站", "其他"}, new OnMenuItemClickListener() {
|
||||
@Override
|
||||
public void onClick(String text, int index) {
|
||||
tvStayType.setText(text);
|
||||
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ import java.util.List;
|
||||
public class PoiEntity {
|
||||
@PrimaryKey(autoGenerate = true) // 设置主键,并且自动生长
|
||||
private int id;
|
||||
|
||||
private int pid; //采集id 保存本地或提交数据时时返回
|
||||
private int taskId;//任务id
|
||||
private int userId;//用户id
|
||||
@ -26,6 +25,15 @@ public class PoiEntity {
|
||||
private String memo;//备注
|
||||
private double precision;//金额
|
||||
private String photo;//照片信息
|
||||
private String extend;//添加字段
|
||||
public String getExtend() {
|
||||
return extend;
|
||||
}
|
||||
|
||||
public void setExtend(String extend) {
|
||||
this.extend = extend;
|
||||
}
|
||||
|
||||
//ROOM不支持直接存储集合
|
||||
@TypeConverters(PhotoInfoConverter.class)
|
||||
private List<Info> photoInfo;//照片信息
|
||||
@ -170,26 +178,4 @@ public class PoiEntity {
|
||||
this.detail = detail;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PoiEntity{" +
|
||||
"id=" + id +
|
||||
", pid=" + pid +
|
||||
", taskId=" + taskId +
|
||||
", userId=" + userId +
|
||||
", createTime='" + createTime + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", describe='" + describe + '\'' +
|
||||
", address='" + address + '\'' +
|
||||
", telPhone='" + telPhone + '\'' +
|
||||
", memo='" + memo + '\'' +
|
||||
", precision=" + precision +
|
||||
", photo='" + photo + '\'' +
|
||||
", photoInfo=" + photoInfo +
|
||||
", existence=" + existence +
|
||||
", x='" + x + '\'' +
|
||||
", y='" + y + '\'' +
|
||||
", detail='" + detail + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
android:id="@+id/camera"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/ll_caiji"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
@ -65,111 +65,58 @@
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="1dp"-->
|
||||
<!-- android:layout_weight="1" />-->
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_caiji"
|
||||
android:layout_width="match_parent"
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:id="@+id/ll_caiji"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:background="#50FFFFFF"-->
|
||||
<!-- android:orientation="horizontal"-->
|
||||
<!-- android:layout_marginBottom="20dp"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent">-->
|
||||
<!-- <Button-->
|
||||
<!-- android:id="@+id/capuretVideo"-->
|
||||
<!-- android:layout_width="100dp"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:text="开始采集"-->
|
||||
<!-- android:layout_marginRight="10dp"-->
|
||||
<!-- style="@style/user_data_style"/>-->
|
||||
<!-- <Button-->
|
||||
|
||||
<!-- android:layout_width="100dp"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:text="结束采集"-->
|
||||
<!-- android:layout_marginLeft="10dp"-->
|
||||
<!-- android:background="@drawable/uploding_shape"-->
|
||||
<!-- android:textColor="@color/colorBlue"/>-->
|
||||
<!-- <ImageButton-->
|
||||
<!-- android:id="@+id/capturePicture"-->
|
||||
<!-- android:layout_width="56dp"-->
|
||||
<!-- android:layout_height="56dp"-->
|
||||
<!-- android:visibility="gone"-->
|
||||
<!-- android:background="?attr/selectableItemBackgroundBorderless"-->
|
||||
<!-- app:srcCompat="@drawable/ic_photo" />-->
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
<Button
|
||||
android:id="@+id/capuretVideo"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
|
||||
android:orientation="horizontal"
|
||||
android:text="开始采集"
|
||||
app:layout_constraintRight_toLeftOf="@id/btn_stop_video"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginBottom="20dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
<Button
|
||||
android:id="@+id/capuretVideo"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="开始采集"
|
||||
android:layout_marginRight="10dp"
|
||||
style="@style/user_data_style"/>
|
||||
<Button
|
||||
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="结束采集"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:background="@drawable/uploding_shape"
|
||||
android:textColor="@color/colorBlue"/>
|
||||
<ImageButton
|
||||
android:id="@+id/capturePicture"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:visibility="gone"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
app:srcCompat="@drawable/ic_photo" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<!-- <Space-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="1dp"-->
|
||||
<!-- android:layout_weight="1" />-->
|
||||
<!-- <Space-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="1dp"-->
|
||||
<!-- android:layout_weight="1" />-->
|
||||
|
||||
<!-- <Space-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="1dp"-->
|
||||
<!-- android:layout_weight="1" />-->
|
||||
<!-- <Space-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="1dp"-->
|
||||
<!-- android:layout_weight="1" />-->
|
||||
|
||||
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:id="@+id/capturePictureSnapshot"-->
|
||||
<!-- android:layout_width="56dp"-->
|
||||
<!-- android:layout_height="56dp"-->
|
||||
<!-- android:background="?attr/selectableItemBackgroundBorderless"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:orientation="vertical"-->
|
||||
<!-- android:visibility="gone">-->
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:srcCompat="@drawable/ic_photo" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:text="SNAP"-->
|
||||
<!-- android:textColor="@android:color/white"-->
|
||||
<!-- android:textSize="10sp"-->
|
||||
<!-- android:textStyle="bold" />-->
|
||||
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
<!-- <ImageButton-->
|
||||
<!-- android:id="@+id/capuretVideo"-->
|
||||
<!-- android:layout_width="56dp"-->
|
||||
<!-- android:layout_height="56dp"-->
|
||||
<!-- android:background="?attr/selectableItemBackgroundBorderless"-->
|
||||
<!-- app:srcCompat="@drawable/ic_video" />-->
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:id="@+id/captureVideoSnapshot"-->
|
||||
<!-- android:layout_width="56dp"-->
|
||||
<!-- android:layout_height="56dp"-->
|
||||
<!-- android:orientation="vertical"-->
|
||||
<!-- android:background="?attr/selectableItemBackgroundBorderless"-->
|
||||
<!-- android:gravity="center" >-->
|
||||
<!-- <ImageView-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:srcCompat="@drawable/ic_video"/>-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:textColor="@android:color/white"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- android:textSize="10sp"-->
|
||||
<!-- android:text="SNAP"/>-->
|
||||
<!-- </LinearLayout>-->
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
|
||||
style="@style/user_data_style"/>
|
||||
<Button
|
||||
android:id="@+id/btn_stop_video"
|
||||
app:layout_constraintBottom_toBottomOf="@id/capuretVideo"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="结束采集"
|
||||
app:layout_constraintLeft_toRightOf="@id/capuretVideo"
|
||||
android:background="@drawable/uploding_shape"
|
||||
android:textColor="@color/colorBlue"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
@ -205,9 +205,16 @@
|
||||
android:id="@+id/iv_road_picture"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/bg_01"
|
||||
app:layout_constraintLeft_toLeftOf="@id/ll_pictures"
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_pictures" />
|
||||
|
||||
<!--<androidx.recyclerview.widget.RecyclerView-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:id="@+id/rel_road"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/ll_pictures"/>-->
|
||||
<!-- -->
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_desc"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -13,7 +13,6 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
style="@style/text_style"
|
||||
android:layout_width="wrap_content"
|
||||
@ -59,6 +58,7 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cl_stay_type">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_stay_result"
|
||||
android:layout_width="wrap_content"
|
||||
@ -67,9 +67,10 @@
|
||||
android:text="筛选结果"
|
||||
android:textSize="25sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="300dp">
|
||||
|
||||
<com.jcodecraeer.xrecyclerview.XRecyclerView
|
||||
android:id="@+id/stay_xrv"
|
||||
@ -93,6 +94,7 @@
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cb_select"
|
||||
style="@style/CheckBoxTheme"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="15dp"
|
||||
@ -106,7 +108,7 @@
|
||||
android:layout_margin="15dp"
|
||||
android:text="删除"
|
||||
android:textColor="@color/colorPrimaryBlue"
|
||||
android:textSize="18sp"/>
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
|
@ -19,19 +19,19 @@
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
<TextView
|
||||
android:id="@+id/tv_cs1"
|
||||
android:id="@+id/tv_road_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:text="测试1"
|
||||
android:textSize="15sp" />
|
||||
<TextView
|
||||
android:id="@+id/tv_day"
|
||||
android:id="@+id/tv_road_day"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="2021-05-08 13:24:36"
|
||||
android:layout_margin="10dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_cs1"/>
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_road_name"/>
|
||||
</LinearLayout>
|
||||
<CheckBox
|
||||
android:id="@+id/cb_all"
|
||||
|
@ -143,4 +143,8 @@
|
||||
<!-- <item name="android:textColor">@drawable/textcolor_record</item>-->
|
||||
</style>
|
||||
|
||||
<!-- checkBox选中的颜色-->
|
||||
<style name="CheckBoxTheme">
|
||||
<item name="colorAccent">@color/colorPrimaryBlue</item><!--选中颜色-->
|
||||
</style>
|
||||
</resources>
|
Loading…
x
Reference in New Issue
Block a user