定时推送逻辑。批量领取的页面显示

This commit is contained in:
wangdongsheng 2021-09-07 19:07:30 +08:00
parent 4911f5df93
commit 1cc7e45c9a
12 changed files with 347 additions and 240 deletions

View File

@ -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"
@ -11,7 +11,6 @@ android {
targetSdkVersion 30 targetSdkVersion 30
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
lintOptions { lintOptions {

View File

@ -311,8 +311,7 @@ public class MainActivity extends BaseActivity {
fileOutputStream.flush(); fileOutputStream.flush();
fileOutputStream.close(); fileOutputStream.close();
} }
//apk下载完成使用Handler()通知安装apk handler.sendEmptyMessage(0);//apk下载完成使用Handler()通知安装apk
handler.sendEmptyMessage(0);
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();

View File

@ -225,7 +225,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
} else { } else {
message.what = 0x101; message.what = 0x101;
Toast.makeText(PicturesActivity.this, "保存成功" + (videoIndex+1), Toast.LENGTH_SHORT).show(); Toast.makeText(PicturesActivity.this, "保存成功" + (videoIndex+1), Toast.LENGTH_SHORT).show();
handler.sendMessageDelayed(message, 2000); handler.sendMessageDelayed(message, 1500);
} }
} }
} }

View File

@ -6,9 +6,12 @@ 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.CheckBox;
import android.widget.CompoundButton;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.navinfo.outdoor.R; import com.navinfo.outdoor.R;
@ -25,13 +28,23 @@ import java.util.List;
*/ */
public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder> { public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder> {
private Context context; private Context context;
private List<PoiEntity> allPoi; private List<PoiEntity> allPoi=new ArrayList<>();
public FilterAdapter(Context context, List<PoiEntity> allPoi) { public FilterAdapter(Context context) {
this.context = context; this.context = context;
this.allPoi = allPoi;
} }
public void setAllPoi(List<PoiEntity> allPoi) {
this.allPoi.clear();
this.allPoi.addAll(allPoi);
notifyDataSetChanged();
}
public void setAddFilter(boolean addFilter) {
for (int i = 0; i < allPoi.size(); i++) {
allPoi.get(i).setChecked(addFilter);
}
}
@NonNull @NonNull
@Override @Override
@ -44,13 +57,13 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder
@Override @Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) { public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
PoiEntity poiEntity = allPoi.get(position); PoiEntity poiEntity = allPoi.get(position);
holder.tvName.setText(poiEntity.getName()); holder.tvName.setText(poiEntity.getName());
if (poiEntity.getTaskId() != 0) { if (poiEntity.getTaskId() != 0) {
holder.tvTaskId.setText("任务id:" + poiEntity.getTaskId()); holder.tvTaskId.setText("任务id:" + poiEntity.getTaskId());
} else { } else {
holder.tvTaskId.setText("任务id:" + 0); holder.tvTaskId.setText("任务id:" + 0);
} }
if (poiEntity.getPrecision() != null) { if (poiEntity.getPrecision() != null) {
holder.tvMoney.setText("" + format2(Double.parseDouble(poiEntity.getPrecision()))); holder.tvMoney.setText("" + format2(Double.parseDouble(poiEntity.getPrecision())));
} else { } else {
@ -61,19 +74,31 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder
} else { } else {
holder.tvDistance.setText("距离:" + 0); holder.tvDistance.setText("距离:" + 0);
} }
//0.未领取 1.已领取2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功)4已上传结束采集,
if (poiEntity.getTaskStatus() == 0) {//"未领取", "已领取", "未保存", "已保存" if (poiEntity.getTaskStatus() == 0) {//"未领取", "已领取", "未保存", "已保存"
holder.tvTaskStatus.setVisibility(View.GONE); holder.tvTaskStatus.setVisibility(View.GONE);
holder.tvTaskStatus.setText("未领取"); holder.tvTaskStatus.setText("未领取");
holder.cbFilter.setEnabled(true);
} else if (poiEntity.getTaskStatus() == 1) { } else if (poiEntity.getTaskStatus() == 1) {
holder.tvTaskStatus.setVisibility(View.VISIBLE); holder.tvTaskStatus.setVisibility(View.VISIBLE);
holder.tvTaskStatus.setText("已领取"); holder.tvTaskStatus.setText("已领取");
holder.cbFilter.setEnabled(false);
holder.tvTaskStatus.setTextColor(Color.parseColor("#FFC107")); holder.tvTaskStatus.setTextColor(Color.parseColor("#FFC107"));
} else if (poiEntity.getTaskStatus() == 2) { } else if (poiEntity.getTaskStatus() == 2) {
holder.tvTaskStatus.setVisibility(View.VISIBLE); holder.tvTaskStatus.setVisibility(View.VISIBLE);
holder.tvTaskStatus.setText("未保存"); holder.tvTaskStatus.setText("未保存");
holder.cbFilter.setEnabled(false);
holder.tvTaskStatus.setTextColor(Color.parseColor("#1CEF7B")); holder.tvTaskStatus.setTextColor(Color.parseColor("#1CEF7B"));
}/*else if (poiEntity.getTaskStatus()==3){ }
holder.cbFilter.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (itemOnCLick != null) {
itemOnCLick.item(poiEntity,isChecked);
}
}
});
/*else if (poiEntity.getTaskStatus()==3){
holder.tvTaskStatus.setVisibility(View.VISIBLE); holder.tvTaskStatus.setVisibility(View.VISIBLE);
holder.tvTaskStatus.setText("已保存"); holder.tvTaskStatus.setText("已保存");
holder.tvTaskStatus.setTextColor(Color.parseColor("#00BCD4")); holder.tvTaskStatus.setTextColor(Color.parseColor("#00BCD4"));
@ -81,6 +106,16 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder
holder.tvTaskStatus.setVisibility(View.VISIBLE); holder.tvTaskStatus.setVisibility(View.VISIBLE);
holder.tvTaskStatus.setText("已上传"); holder.tvTaskStatus.setText("已上传");
}*/ }*/
if (poiEntity.isChecked()) {
holder.cbFilter.setVisibility(View.VISIBLE);
holder.constraintLayout.setEnabled(false);
} else {
holder.cbFilter.setVisibility(View.GONE);
holder.constraintLayout.setEnabled(true);
}
if (poiEntity.getType() == 1) { if (poiEntity.getType() == 1) {
holder.tvForm.setText("poi"); holder.tvForm.setText("poi");
} else if (poiEntity.getType() == 2) { } else if (poiEntity.getType() == 2) {
@ -94,7 +129,7 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder
} else if (poiEntity.getType() == 6) { } else if (poiEntity.getType() == 6) {
holder.tvForm.setText("面状任务"); holder.tvForm.setText("面状任务");
} }
holder.itemView.setOnClickListener(new View.OnClickListener() { holder.constraintLayout.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (itemCLick != null) { if (itemCLick != null) {
@ -103,7 +138,6 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder
} }
}); });
} }
@Override @Override
@ -113,20 +147,24 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder
public static class ViewHolder extends RecyclerView.ViewHolder { public static class ViewHolder extends RecyclerView.ViewHolder {
TextView tvName, tvForm, tvTaskId, tvMoney, tvDistance, tvTaskStatus; TextView tvName, tvForm, tvTaskId, tvMoney, tvDistance, tvTaskStatus;
CheckBox cbFilter;
ConstraintLayout constraintLayout;
public ViewHolder(@NonNull View itemView) { public ViewHolder(@NonNull View itemView) {
super(itemView); super(itemView);
constraintLayout=itemView.findViewById(R.id.constraintLayout);
tvName = itemView.findViewById(R.id.tv_name); tvName = itemView.findViewById(R.id.tv_name);
tvForm = itemView.findViewById(R.id.tv_form); tvForm = itemView.findViewById(R.id.tv_form);
tvTaskId = itemView.findViewById(R.id.tv_task_id); tvTaskId = itemView.findViewById(R.id.tv_task_id);
tvMoney = itemView.findViewById(R.id.tv_money); tvMoney = itemView.findViewById(R.id.tv_money);
tvDistance = itemView.findViewById(R.id.tv_distance); tvDistance = itemView.findViewById(R.id.tv_distance);
tvTaskStatus = itemView.findViewById(R.id.tv_task_status); tvTaskStatus = itemView.findViewById(R.id.tv_task_status);
cbFilter = itemView.findViewById(R.id.cb_filter);
} }
} }
ItemCLick itemCLick;
ItemCLick itemCLick;
public void setItemCLick(ItemCLick itemCLick) { public void setItemCLick(ItemCLick itemCLick) {
this.itemCLick = itemCLick; this.itemCLick = itemCLick;
} }
@ -135,6 +173,16 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder
void item(PoiEntity poiEntity); void item(PoiEntity poiEntity);
} }
ItemOnCLick itemOnCLick;
public void setItemOnCLick(ItemOnCLick itemOnCLick) {
this.itemOnCLick = itemOnCLick;
}
public interface ItemOnCLick {
void item(PoiEntity poiEntity,boolean view);
}
/** /**
* 保存小数点后两位 * 保存小数点后两位
*/ */
@ -147,25 +195,16 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder
public static String format3(double value) { public static String format3(double value) {
NumberFormat nf = NumberFormat.getNumberInstance(); NumberFormat nf = NumberFormat.getNumberInstance();
nf.setMaximumFractionDigits(2); nf.setMaximumFractionDigits(2);
/*setMinimumFractionDigits设置成2
/*setMinimumFractionDigits设置成2 * 如果不这么做那么当value的值是100.00的时候返回100
* 如果不这么做那么当value的值是100.00的时候返回100 * 而不是100.00
* 而不是100.00 */
*/
nf.setMinimumFractionDigits(2); nf.setMinimumFractionDigits(2);
nf.setRoundingMode(RoundingMode.HALF_UP); nf.setRoundingMode(RoundingMode.HALF_UP);
/*
/* 如果想输出的格式用逗号隔开可以设置成true
*/
如果想输出的格式用逗号隔开可以设置成true
*/
nf.setGroupingUsed(false); nf.setGroupingUsed(false);
return nf.format(value); return nf.format(value);

View File

@ -43,6 +43,7 @@ public class Constant {
public static String VIDEOS_; public static String VIDEOS_;
public static String POI_DAO; public static String POI_DAO;
public static String SHARED_PREFERENCES = "navInfo"; public static String SHARED_PREFERENCES = "navInfo";
public static String MESSAGE_TYPE="messageType";
public static String DATA_FILE = "dataFile"; public static String DATA_FILE = "dataFile";
//下载文件 //下载文件
public static final String NABISCO_APk = ROOT_FOLDER + "/apk/"; public static final String NABISCO_APk = ROOT_FOLDER + "/apk/";

View File

@ -1,10 +1,13 @@
package com.navinfo.outdoor.fragment; package com.navinfo.outdoor.fragment;
import android.annotation.SuppressLint;
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.View; import android.view.View;
import android.widget.Button; import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.TextView; import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
@ -45,6 +48,8 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
private TextView tvType, tvExclusive, tvPhotograph, tvNumber; private TextView tvType, tvExclusive, tvPhotograph, tvNumber;
private FilterAdapter filterAdapter; private FilterAdapter filterAdapter;
private ArrayList<PoiEntity> poiEntities; private ArrayList<PoiEntity> poiEntities;
private PoiDao poiDao;
private ArrayList<PoiEntity> btnChock;
public static FilterFragment newInstance(Bundle bundle) { public static FilterFragment newInstance(Bundle bundle) {
@ -84,7 +89,6 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
} }
onBackPressed(); onBackPressed();
} }
}); });
} }
@ -154,8 +158,8 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
poiEntities.add(allPoi.get(i)); poiEntities.add(allPoi.get(i));
} }
} }
} }
filterAdapter.setAllPoi(poiEntities);
} else if (data.what == Constant.JOB_SEARCH_WORD) { } else if (data.what == Constant.JOB_SEARCH_WORD) {
JobSearchBean jobSearchBean = (JobSearchBean) data.obj; JobSearchBean jobSearchBean = (JobSearchBean) data.obj;
if (jobSearchBean != null) { if (jobSearchBean != null) {
@ -165,47 +169,52 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
poiEntity.setTaskId(list.get(i).getId()); poiEntity.setTaskId(list.get(i).getId());
poiEntity.setName(list.get(i).getName()); poiEntity.setName(list.get(i).getName());
poiEntity.setAddress(list.get(i).getAddress()); poiEntity.setAddress(list.get(i).getAddress());
poiEntity.setTelPhone(list.get(i).getTelephone() + ""); poiEntity.setTelPhone(list.get(i).getTelephone()+"");
poiEntity.setPrecision(list.get(i).getPrice()+""); poiEntity.setPrecision(list.get(i).getPrice()+"");
poiEntity.setDist(list.get(i).getDist()+""); poiEntity.setDist(list.get(i).getDist()+"");
poiEntity.setType(list.get(i).getType()); poiEntity.setType(list.get(i).getType());
String geo = list.get(i).getGeo(); String geo = list.get(i).getGeo();
poiEntity.setGeoWkt(geo); poiEntity.setGeoWkt(geo);
Geometry geometry = GeometryTools.createGeometry(geo); Geometry geometry = GeometryTools.createGeometry(geo);
if (geometry.getGeometryType().equals("Point")) {// switch (geometry.getGeometryType()) {
LatLng latLng = GeometryTools.createLatLng(geo); case "Point": //
poiEntity.setX(latLng.longitude + ""); LatLng latLng = GeometryTools.createLatLng(geo);
poiEntity.setY(latLng.latitude + ""); poiEntity.setX(latLng.longitude + "");
} else if (geometry.getGeometryType().equals("LineString")) {//线 poiEntity.setY(latLng.latitude + "");
List<LatLng> latLineString = GeometryTools.getLatLags(geo); break;
assert latLineString != null; case "LineString": //线
poiEntity.setX(latLineString.get(0).longitude + ""); case "Polygon": //
poiEntity.setY(latLineString.get(0).latitude + ""); List<LatLng> latLineString = GeometryTools.getLatLags(geo);
} else if (geometry.getGeometryType().equals("Polygon")) {// assert latLineString != null;
List<LatLng> latPolygon = GeometryTools.getLatLags(geo); poiEntity.setX(latLineString.get(0).longitude + "");
assert latPolygon != null; poiEntity.setY(latLineString.get(0).latitude + "");
poiEntity.setX(latPolygon.get(0).longitude + ""); break;
poiEntity.setY(latPolygon.get(0).latitude + "");
} }
poiEntities.add(poiEntity); poiEntities.add(poiEntity);
} }
} }
filterAdapter.setAllPoi(poiEntities);
} else if (data.what == Constant.FILTER_DATA_CLEAR) { } else if (data.what == Constant.FILTER_DATA_CLEAR) {
poiEntities.clear(); poiEntities.clear();
} }
filterAdapter.notifyDataSetChanged();
Log.d("ssssssssssssss", "onEvent: "+"sssssssssssssssssssssssssssss");
} }
@SuppressLint("SetTextI18n")
@Override @Override
protected void initData() { protected void initData() {
super.initData(); super.initData();
PoiDatabase poiDatabase = PoiDatabase.getInstance(getContext()); PoiDatabase poiDatabase = PoiDatabase.getInstance(getContext());
PoiDao poiDao = poiDatabase.getPoiDao(); poiDao = poiDatabase.getPoiDao();
poiEntities = new ArrayList<>(); poiEntities = new ArrayList<>();
ConstraintLayout clNumber = findViewById(R.id.cl_number); ConstraintLayout clNumber = findViewById(R.id.cl_number);
clNumber.setOnClickListener(this); clNumber.setOnClickListener(this);
tvNumber = findViewById(R.id.tv_number); tvNumber = findViewById(R.id.tv_number);
tvNumber.setText(Constant.NUMBER + ""); tvNumber.setText(Constant.NUMBER + "");
CheckBox checkOk = findViewById(R.id.check_ok);
Button btnDraw = findViewById(R.id.btn_draw);
btnDraw.setOnClickListener(this);
ConstraintLayout clPhotograph = findViewById(R.id.cl_photograph); ConstraintLayout clPhotograph = findViewById(R.id.cl_photograph);
clPhotograph.setOnClickListener(this); clPhotograph.setOnClickListener(this);
tvPhotograph = findViewById(R.id.tv_photograph); tvPhotograph = findViewById(R.id.tv_photograph);
@ -243,12 +252,12 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
tvType.setText("未领取"); tvType.setText("未领取");
} else if (Constant.TASK_STARTUP == 1) { } else if (Constant.TASK_STARTUP == 1) {
tvType.setText("已领取"); tvType.setText("已领取");
}/* else if (Constant.TASK_STATUS == 2) { }
/* else if (Constant.TASK_STATUS == 2) {
tvType.setText("未保存"); tvType.setText("未保存");
} else if (Constant.TASK_STATUS == 3) { } else if (Constant.TASK_STATUS == 3) {
tvType.setText("已保存"); tvType.setText("已保存");
}*/ }*/
Button btnFilter = findViewById(R.id.btn_filter); Button btnFilter = findViewById(R.id.btn_filter);
btnFilter.setOnClickListener(this); btnFilter.setOnClickListener(this);
setSlidingUpPanelLayout(Constant.SLIDING_LAYOUT); setSlidingUpPanelLayout(Constant.SLIDING_LAYOUT);
@ -261,11 +270,10 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
recyclerFilter.addItemDecoration(new DividerItemDecoration(Objects.requireNonNull(getContext()), DividerItemDecoration.VERTICAL)); recyclerFilter.addItemDecoration(new DividerItemDecoration(Objects.requireNonNull(getContext()), DividerItemDecoration.VERTICAL));
recyclerFilter.setRefreshProgressStyle(ProgressStyle.SemiCircleSpin); recyclerFilter.setRefreshProgressStyle(ProgressStyle.SemiCircleSpin);
recyclerFilter.setLoadingMoreProgressStyle(ProgressStyle.BallRotate); recyclerFilter.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
//取消上啦加载下拉刷新 //取消上啦加载下拉刷新
recyclerFilter.setPullRefreshEnabled(false); recyclerFilter.setPullRefreshEnabled(false);
recyclerFilter.setLoadingMoreEnabled(false); recyclerFilter.setLoadingMoreEnabled(false);
filterAdapter = new FilterAdapter(getContext(), poiEntities); filterAdapter = new FilterAdapter(getContext());
recyclerFilter.setAdapter(filterAdapter); recyclerFilter.setAdapter(filterAdapter);
recyclerFilter.setScrollAlphaChangeListener(new XRecyclerView.ScrollAlphaChangeListener() { recyclerFilter.setScrollAlphaChangeListener(new XRecyclerView.ScrollAlphaChangeListener() {
@Override @Override
@ -275,33 +283,47 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
return 0; return 0;
} }
}); });
recyclerFilter.getDefaultFootView().setNoMoreHint("成功加载完毕"); recyclerFilter.getDefaultFootView().setNoMoreHint("成功加载完毕");
recyclerFilter.setLoadingListener(new XRecyclerView.LoadingListener() { recyclerFilter.setLoadingListener(new XRecyclerView.LoadingListener() {
@Override @Override
public void onRefresh() { public void onRefresh() {}
}
@Override @Override
public void onLoadMore() { public void onLoadMore() {}
});
checkOk.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
filterAdapter.setAddFilter(true);
filterAdapter.notifyDataSetChanged();
} }
}); });
filterAdapter.setItemCLick(new FilterAdapter.ItemCLick() { filterAdapter.setItemCLick(new FilterAdapter.ItemCLick() {
@Override @Override
public void item(PoiEntity poiEntity) { public void item(PoiEntity poiEntity) {
//查看详情
Message obtains = Message.obtain(); Message obtains = Message.obtain();
obtains.what = Constant.FILTER_LIST_ITEM; obtains.what = Constant.FILTER_LIST_ITEM;
obtains.obj = poiEntity; obtains.obj = poiEntity;
EventBus.getDefault().post(obtains); EventBus.getDefault().post(obtains);
} }
}); });
btnChock = new ArrayList<>();//存储选择中的的数据
filterAdapter.setItemOnCLick(new FilterAdapter.ItemOnCLick() {
@Override
public void item(PoiEntity poiEntity, boolean isChockBox) {
if (isChockBox){
btnChock.add(poiEntity);
}else {
for (int i = 0; i < btnChock.size(); i++) {
if (poiEntity.getId().equals(btnChock.get(i).getId())){
btnChock.remove(poiEntity);
}
}
}
}
});
} }
@Override @Override
public void onClick(View v) { public void onClick(View v) {
switch (v.getId()) { switch (v.getId()) {
@ -339,7 +361,6 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
} }
}); });
break; break;
case R.id.cl_photograph: case R.id.cl_photograph:
BottomMenu.show((AppCompatActivity) Objects.requireNonNull(getContext()), new String[]{"全部", "普通任务", "专属任务"}, new OnMenuItemClickListener() { BottomMenu.show((AppCompatActivity) Objects.requireNonNull(getContext()), new String[]{"全部", "普通任务", "专属任务"}, new OnMenuItemClickListener() {
@Override @Override
@ -363,8 +384,6 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
} }
}); });
break; break;
/* /*
1 "POI" 1 "POI"
2 "充电站" 2 "充电站"
@ -400,7 +419,6 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
case 6: case 6:
Constant.TASK_TYPE = 6; Constant.TASK_TYPE = 6;
break; break;
} }
Message obtain = Message.obtain(); Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR; obtain.what = Constant.JOB_WORD_MONITOR;
@ -409,7 +427,6 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
} }
}); });
break; break;
case R.id.cl_type://任务状态 0.未领取 1.已领取2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功)4已上传结束采集, case R.id.cl_type://任务状态 0.未领取 1.已领取2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功)4已上传结束采集,
BottomMenu.show((AppCompatActivity) Objects.requireNonNull(getContext()), new String[]{"全部", "未领取", "已领取"/*, "未保存", "已保存"*/}, new OnMenuItemClickListener() { BottomMenu.show((AppCompatActivity) Objects.requireNonNull(getContext()), new String[]{"全部", "未领取", "已领取"/*, "未保存", "已保存"*/}, new OnMenuItemClickListener() {
@Override @Override
@ -439,7 +456,6 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
} }
}); });
break; break;
} }
} }
@ -454,6 +470,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
protected PoiEntity initPoiEntityByUI(PoiEntity entity) { protected PoiEntity initPoiEntityByUI(PoiEntity entity) {
return null; return null;
} }
@Override @Override
protected PoiCheckResult checkPoiEntity(PoiEntity entity) { protected PoiCheckResult checkPoiEntity(PoiEntity entity) {
return null; return null;

View File

@ -309,11 +309,13 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
public void run() { public void run() {
roadEntities.clear(); roadEntities.clear();
roadEntities.addAll(roadAll); roadEntities.addAll(roadAll);
// for (int i = 0; i < roadAll.size(); i++) { // for (int i = 0; i < roadAll.size(); i++) {
// if (roadAll.get(i).getType()!=6){ // if (roadAll.get(i).getType()!=6){
// roadEntities.add(roadAll.get(i)); // roadEntities.add(roadAll.get(i));
// } // }
// } // }
Log.d("TAG", "run: " + roadEntities.toString()); Log.d("TAG", "run: " + roadEntities.toString());
staySubmitAdapter.setAllRoad(roadEntities); staySubmitAdapter.setAllRoad(roadEntities);
staySubmitAdapter.notifyDataSetChanged(); staySubmitAdapter.notifyDataSetChanged();

View File

@ -1,5 +1,6 @@
package com.navinfo.outdoor.fragment; package com.navinfo.outdoor.fragment;
import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
@ -161,6 +162,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
private ArrayList<PoiEntity> poiEntityArrayList; private ArrayList<PoiEntity> poiEntityArrayList;
private ImageView ivMassNotification; private ImageView ivMassNotification;
private int messageType = 0;//0: 已读消息 1新消息 private int messageType = 0;//0: 已读消息 1新消息
private SharedPreferences.Editor sharedEdit;
private SharedPreferences sharedPreferences;
public static TreasureFragment newInstance(Bundle bundle) { public static TreasureFragment newInstance(Bundle bundle) {
@ -178,30 +181,34 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
* 刷新筛选界面数据 * 刷新筛选界面数据
*/ */
private void refreshFilterData() { private void refreshFilterData() {
//获取系统当前的时间
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
String format = formatter.format(calendar.getTime());
SharedPreferences messageTypeSp = getActivity().getSharedPreferences("messageType", Context.MODE_PRIVATE); String dataTime = sharedPreferences.getString("dataTime", null);
String dataTime = messageTypeSp.getString("dataTime", null); int type = sharedPreferences.getInt("type", 0);
int messageTypeSpInt = messageTypeSp.getInt("messageType", 0);
try {
Date parse = formatter.parse(format); if (type == 0) {//隐藏
if (dataTime!=null){ ivMassNotification.setVisibility(View.GONE);
Date parse1 = formatter.parse(dataTime); } else {//显示S
if (parse.getTime() + parse1.getTime() >= 1) { ivMassNotification.setVisibility(View.VISIBLE);
// initMessageNotice(); }
Log.d("TAG", "refreshFilterData: " + parse + "" + parse1); if (dataTime == null) {
} else { initMessageNotice();
return; } else {
} String newData = addDateMinot(dataTime, 3);//是否三个小时之后
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
String presentData = formatter.format(calendar.getTime());//当前时间
int result = presentData.compareTo(newData);
if (result>=0){
//进行请求
initMessageNotice();
}else {
//无需请求
} }
} catch (ParseException e) {
e.printStackTrace();
} }
Message msg = Message.obtain(); Message msg = Message.obtain();
msg.what = Constant.FILTER_DATA_CLEAR; msg.what = Constant.FILTER_DATA_CLEAR;
EventBus.getDefault().post(msg); EventBus.getDefault().post(msg);
@ -272,10 +279,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis()); calendar.setTimeInMillis(System.currentTimeMillis());
String format = formatter.format(calendar.getTime()); String format = formatter.format(calendar.getTime());
SharedPreferences.Editor spMessageType = getActivity().getSharedPreferences("messageType", getActivity().MODE_PRIVATE).edit(); Log.d("TAG", "onSuccessssss: " + format);
spMessageType.putInt("messageType", messageType); sharedEdit.putInt("type", messageType);
spMessageType.putString("dataTime", format); sharedEdit.putString("dataTime", format);
spMessageType.commit(); sharedEdit.commit();
} else { } else {
Toast.makeText(getActivity(), messageNoticeBean.getMessage() + "", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), messageNoticeBean.getMessage() + "", Toast.LENGTH_SHORT).show();
} }
@ -290,10 +297,14 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
} }
@SuppressLint("CommitPrefEdits")
@Override @Override
protected void initView() { protected void initView() {
super.initView(); super.initView();
EventBus.getDefault().register(this); EventBus.getDefault().register(this);
sharedPreferences = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.MESSAGE_TYPE, Context.MODE_PRIVATE);
sharedEdit = sharedPreferences.edit();
//fragment 管理器 //fragment 管理器
supportFragmentManager = Objects.requireNonNull(getActivity()).getSupportFragmentManager(); supportFragmentManager = Objects.requireNonNull(getActivity()).getSupportFragmentManager();
@ -622,8 +633,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
poiMarker.setZIndex(MARKER_DOT); poiMarker.setZIndex(MARKER_DOT);
poiMarker.setTag(listBean); poiMarker.setTag(listBean);
removables.add(poiMarker); removables.add(poiMarker);
/*String poiGeo = initGeo(latLng); String poiGeo = initGeo(latLng);
geoMarker(poiGeo, poiMarker);*/ geoMarker(poiGeo, poiMarker);
poiMarker.setClickable(true); poiMarker.setClickable(true);
break; break;
case 2://充电站 case 2://充电站
@ -636,8 +647,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
stationMarker.setZIndex(MARKER_DOT); stationMarker.setZIndex(MARKER_DOT);
stationMarker.setTag(listBean); stationMarker.setTag(listBean);
removables.add(stationMarker); removables.add(stationMarker);
/* String stationGeo = initGeo(latLng); String stationGeo = initGeo(latLng);
geoMarker(stationGeo, stationMarker);*/ geoMarker(stationGeo, stationMarker);
stationMarker.setClickable(true); stationMarker.setClickable(true);
break; break;
@ -651,8 +662,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
poiVideoMarker.setTag(listBean); poiVideoMarker.setTag(listBean);
poiVideoMarker.setZIndex(MARKER_DOT); poiVideoMarker.setZIndex(MARKER_DOT);
removables.add(poiVideoMarker); removables.add(poiVideoMarker);
/* String poiVideoGeo = initGeo(latLng); String poiVideoGeo = initGeo(latLng);
geoMarker(poiVideoGeo, poiVideoMarker);*/ geoMarker(poiVideoGeo, poiVideoMarker);
poiVideoMarker.setClickable(true); poiVideoMarker.setClickable(true);
break; break;
case 4://道路录像 case 4://道路录像
@ -665,8 +676,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
roadMarker.setZIndex(MARKER_DOT); roadMarker.setZIndex(MARKER_DOT);
roadMarker.setTag(listBean); roadMarker.setTag(listBean);
removables.add(roadMarker); removables.add(roadMarker);
/* String roadGeo = initGeo(latLng); String roadGeo = initGeo(latLng);
geoMarker(roadGeo, roadMarker);*/ geoMarker(roadGeo, roadMarker);
roadMarker.setClickable(true); roadMarker.setClickable(true);
break; break;
case 5://其他 case 5://其他
@ -679,8 +690,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
otherMarker.setZIndex(MARKER_DOT); otherMarker.setZIndex(MARKER_DOT);
otherMarker.setTag(listBean); otherMarker.setTag(listBean);
removables.add(otherMarker); removables.add(otherMarker);
/* String otherGeo = initGeo(latLng); String otherGeo = initGeo(latLng);
geoMarker(otherGeo, otherMarker);*/ geoMarker(otherGeo, otherMarker);
otherMarker.setClickable(true); otherMarker.setClickable(true);
break; break;
case 6://面状任务 case 6://面状任务
@ -693,8 +704,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
planarMarker.setZIndex(MARKER_DOT); planarMarker.setZIndex(MARKER_DOT);
planarMarker.setTag(listBean); planarMarker.setTag(listBean);
removables.add(planarMarker); removables.add(planarMarker);
// String planarGeo = initGeo(latLng); String planarGeo = initGeo(latLng);
// geoMarker(planarGeo, planarMarker); geoMarker(planarGeo, planarMarker);
planarMarker.setClickable(true); planarMarker.setClickable(true);
break; break;
} }
@ -953,8 +964,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
poiMarker.setTitle(poiEntity.getName() + ""); poiMarker.setTitle(poiEntity.getName() + "");
poiMarker.setTag(poiEntity); poiMarker.setTag(poiEntity);
removablesLocality.add(poiMarker); removablesLocality.add(poiMarker);
// String poiGeo = initGeo(latLng); String poiGeo = initGeo(latLng);
// geoMarker(poiGeo, poiMarker); geoMarker(poiGeo, poiMarker);
break; break;
case 2://充电站 case 2://充电站
BitmapDescriptor chargeDescriptor = null; BitmapDescriptor chargeDescriptor = null;
@ -973,8 +984,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
stationMarker.setTitle(poiEntity.getName() + ""); stationMarker.setTitle(poiEntity.getName() + "");
stationMarker.setTag(poiEntity); stationMarker.setTag(poiEntity);
removablesLocality.add(stationMarker); removablesLocality.add(stationMarker);
// String stationGeo = initGeo(latLng); String stationGeo = initGeo(latLng);
// geoMarker(stationGeo, stationMarker); geoMarker(stationGeo, stationMarker);
break; break;
case 3://poi录像 case 3://poi录像
BitmapDescriptor poiVideoDescriptor = null; BitmapDescriptor poiVideoDescriptor = null;
@ -993,8 +1004,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
poiVideoMarker.setTitle(poiEntity.getName() + ""); poiVideoMarker.setTitle(poiEntity.getName() + "");
poiVideoMarker.setTag(poiEntity); poiVideoMarker.setTag(poiEntity);
removablesLocality.add(poiVideoMarker); removablesLocality.add(poiVideoMarker);
// String poiVideoGeo = initGeo(latLng); String poiVideoGeo = initGeo(latLng);
// geoMarker(poiVideoGeo, poiVideoMarker); geoMarker(poiVideoGeo, poiVideoMarker);
break; break;
case 4://道路录像 case 4://道路录像
BitmapDescriptor roadDescriptor = null; BitmapDescriptor roadDescriptor = null;
@ -1013,8 +1024,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
roadMarker.setTitle(poiEntity.getName() + ""); roadMarker.setTitle(poiEntity.getName() + "");
roadMarker.setTag(poiEntity); roadMarker.setTag(poiEntity);
removablesLocality.add(roadMarker); removablesLocality.add(roadMarker);
// String roadGeo = initGeo(latLng); String roadGeo = initGeo(latLng);
// geoMarker(roadGeo, roadMarker); geoMarker(roadGeo, roadMarker);
break; break;
case 5://其他 case 5://其他
BitmapDescriptor otherDescriptor = null; BitmapDescriptor otherDescriptor = null;
@ -1033,8 +1044,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
otherMarker.setTitle(poiEntity.getName() + ""); otherMarker.setTitle(poiEntity.getName() + "");
otherMarker.setTag(poiEntity); otherMarker.setTag(poiEntity);
removablesLocality.add(otherMarker); removablesLocality.add(otherMarker);
// String otherGeo = initGeo(latLng); String otherGeo = initGeo(latLng);
// geoMarker(otherGeo, otherMarker); geoMarker(otherGeo, otherMarker);
break; break;
case 6://面状任务 case 6://面状任务
BitmapDescriptor Descriptor = null; BitmapDescriptor Descriptor = null;
@ -1053,8 +1064,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
planarMarker.setTitle(poiEntity.getName() + ""); planarMarker.setTitle(poiEntity.getName() + "");
planarMarker.setTag(poiEntity); planarMarker.setTag(poiEntity);
removablesLocality.add(planarMarker); removablesLocality.add(planarMarker);
// String planarGeo = initGeo(latLng); String planarGeo = initGeo(latLng);
// geoMarker(planarGeo, planarMarker); geoMarker(planarGeo, planarMarker);
break; break;
} }
} }
@ -1646,54 +1657,51 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
TencentMap.OnMarkerClickListener markerClickListener = new TencentMap.OnMarkerClickListener() { TencentMap.OnMarkerClickListener markerClickListener = new TencentMap.OnMarkerClickListener() {
@Override @Override
public boolean onMarkerClick(Marker marker) { public boolean onMarkerClick(Marker marker) {
initEntity(marker, true); LatLng latLng = marker.getPosition();
ArrayList<LatLng> lngArrayList = new ArrayList<>();//存储的是内部的屏幕点坐标
// LatLng latLng = marker.getPosition(); Projection projection = tencentMap.getProjection();
// ArrayList<LatLng> lngArrayList = new ArrayList<>();//存储的是内部的屏幕点坐标 android.graphics.Point point = projection.toScreenLocation(latLng);//转换为屏幕坐标
// Projection projection = tencentMap.getProjection(); int minX = point.x - 200;
// android.graphics.Point point = projection.toScreenLocation(latLng);//转换为屏幕坐标 int minY = point.y - 200;
// int minX = point.x - 200; int maxX = point.x + 200;
// int minY = point.y - 200; int maxY = point.y + 200;
// int maxX = point.x + 200; point.set(minX, minY);
// int maxY = point.y + 200; lngArrayList.add(new LatLng(projection.fromScreenLocation(point)));
// point.set(minX, minY); point.set(maxX, minY);
// lngArrayList.add(new LatLng(projection.fromScreenLocation(point))); lngArrayList.add(new LatLng(projection.fromScreenLocation(point)));
// point.set(maxX, minY); point.set(maxX, maxY);
// lngArrayList.add(new LatLng(projection.fromScreenLocation(point))); lngArrayList.add(new LatLng(projection.fromScreenLocation(point)));
// point.set(maxX, maxY); point.set(minX, maxY);
// lngArrayList.add(new LatLng(projection.fromScreenLocation(point))); lngArrayList.add(new LatLng(projection.fromScreenLocation(point)));
// point.set(minX, maxY); point.set(minX, minY);
// lngArrayList.add(new LatLng(projection.fromScreenLocation(point))); lngArrayList.add(new LatLng(projection.fromScreenLocation(point)));
// point.set(minX, minY); poiEntityArrayList = new ArrayList<>();
// lngArrayList.add(new LatLng(projection.fromScreenLocation(point))); com.vividsolutions.jts.geom.Polygon polygon = GeometryTools.createPolygon(lngArrayList);
// poiEntityArrayList = new ArrayList<>(); //多点
// com.vividsolutions.jts.geom.Polygon polygon = GeometryTools.createPolygon(lngArrayList); MultiPoint multiPoint = GeometryTools.createMultiPoint(latList);
// //多点 //拿到覆蓋點
// MultiPoint multiPoint = GeometryTools.createMultiPoint(latList); Geometry intersection = polygon.intersection(multiPoint);
// //拿到覆蓋點 if (intersection == null) {
// Geometry intersection = polygon.intersection(multiPoint); initEntity(marker, true);
// if (intersection == null) { } else {
// initEntity(marker, true); if (intersection.getGeometryType().equals("MultiPoint")) {
// } else { List<LatLng> latList = GeometryTools.getLatList(intersection);
// initEntity(marker, true); for (int i = 0; i < latList.size(); i++) {
// /*if (intersection.getGeometryType().equals("MultiPoint")) { LatLng latL = latList.get(i);
// List<LatLng> latList = GeometryTools.getLatList(intersection); Geometry geometry = GeometryTools.createGeometry(latL);
// for (int i = 0; i < latList.size(); i++) { Log.d("TAG", "onMarkerClick: " + geometry.toString());
// LatLng latL = latList.get(i); List<Marker> markerList = removableHashMap.get(geometry.toText());
// Geometry geometry = GeometryTools.createGeometry(latL); if (markerList != null) {
// Log.d("TAG", "onMarkerClick: " + geometry.toString()); for (Marker mar : markerList) {
// List<Marker> markerList = removableHashMap.get(geometry.toText()); initEntity(mar, false);
// if (markerList != null) { }
// for (Marker mar : markerList) { }
// initEntity(mar, false); }
// } customDialog(poiEntityArrayList, marker);
// } } else {
// } initEntity(marker, true);
// customDialog(poiEntityArrayList, marker); }
// } else { }
// initEntity(marker, true);
// }*/
// }
return false; return false;
} }
}; };

View File

@ -179,11 +179,41 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout> </LinearLayout>
<RelativeLayout
android:id="@+id/rl_draw"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@drawable/road_shape"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ll_filter">
<CheckBox
android:id="@+id/check_ok"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="批量领取"
/>
<Button
android:id="@+id/btn_draw"
style="@style/user_style"
android:layout_width="80dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:layout_marginEnd="20dp"
android:gravity="center"
android:text="批量领取"
android:textColor="@color/white"
android:textSize="15sp" />
</RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/rl_filters" android:id="@+id/rl_filters"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="80dp" android:layout_height="50dp"
android:background="@drawable/road_shape" android:background="@drawable/road_shape"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@ -194,10 +224,11 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_margin="20dp"
android:text="筛选结果" android:text="筛选结果"
android:layout_marginLeft="10dp"
android:textSize="20sp" /> android:textSize="20sp" />
<Button <Button
android:id="@+id/btn_filter" android:id="@+id/btn_filter"
style="@style/user_style" style="@style/user_style"
@ -211,7 +242,6 @@
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="15sp" /> android:textSize="15sp" />
</RelativeLayout> </RelativeLayout>
<com.jcodecraeer.xrecyclerview.XRecyclerView <com.jcodecraeer.xrecyclerview.XRecyclerView
android:id="@+id/recycler_filter" android:id="@+id/recycler_filter"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -164,7 +164,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:gravity="center" android:gravity="center"
android:visibility="gone"
android:text="点击查看成果" android:text="点击查看成果"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="15sp" /> android:textSize="15sp" />

View File

@ -6,80 +6,93 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<!-- android:lines="1"--> <!-- android:lines="1"-->
<CheckBox <CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/cb_filter" android:id="@+id/cb_filter"
app:layout_constraintTop_toTopOf="@+id/tv_form"
app:layout_constraintLeft_toLeftOf="parent"/>
<TextView
android:id="@+id/tv_name"
android:layout_width="260dp"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginLeft="35dp"
android:text="测试彼此"
android:textColor="#333"
android:textSize="15sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/tv_form"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="35dp"
android:layout_marginTop="5dp"
android:background="@drawable/underline"
android:padding="5dp"
android:text="道路"
android:textColor="#00BCD4"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_name" />
<TextView
android:id="@+id/tv_task_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/underline"
android:padding="5dp"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@+id/tv_form"
app:layout_constraintStart_toEndOf="@+id/tv_form"
app:layout_constraintTop_toTopOf="@+id/tv_form" />
<TextView
android:id="@+id/tv_task_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:layout_marginBottom="20dp"
android:text="任务id:11315"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/tv_name" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_name"/>
<TextView
android:id="@+id/tv_money"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginRight="10dp"
android:text="¥3.5"
android:textColor="#000"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintLeft_toRightOf="@+id/tv_name"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/tv_distance" android:id="@+id/constraintLayout"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="距离0.05km" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toBottomOf="@+id/tv_task_id" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintEnd_toEndOf="@+id/tv_money" app:layout_constraintStart_toEndOf="@+id/cb_filter"
app:layout_constraintTop_toTopOf="@+id/tv_task_id" /> app:layout_constraintTop_toTopOf="parent">
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/tv_name"
android:layout_width="260dp"
android:layout_height="wrap_content"
android:layout_marginLeft="35dp"
android:layout_marginTop="20dp"
android:text="测试彼此"
android:textColor="#333"
android:textSize="15sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_form"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="35dp"
android:layout_marginTop="5dp"
android:background="@drawable/underline"
android:padding="5dp"
android:text="道路"
android:textColor="#00BCD4"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_name" />
<TextView
android:id="@+id/tv_task_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/underline"
android:padding="5dp"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@+id/tv_form"
app:layout_constraintStart_toEndOf="@+id/tv_form"
app:layout_constraintTop_toTopOf="@+id/tv_form" />
<TextView
android:id="@+id/tv_task_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:layout_marginBottom="20dp"
android:text="任务id:11315"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/tv_name"
app:layout_constraintTop_toBottomOf="@+id/tv_name" />
<TextView
android:id="@+id/tv_money"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginRight="10dp"
android:text="¥3.5"
android:textColor="#000"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintLeft_toRightOf="@+id/tv_name"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_distance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="距离0.05km"
app:layout_constraintBottom_toBottomOf="@+id/tv_task_id"
app:layout_constraintEnd_toEndOf="@+id/tv_money"
app:layout_constraintTop_toTopOf="@+id/tv_task_id" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -174,7 +174,7 @@
<TextView <TextView
android:id="@+id/tv_photo_album" android:id="@+id/tv_photo_album"
style="@style/user_style" style="@style/user_style"
android:visibility="gone" android:visibility="visible"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="5dp" android:layout_marginStart="5dp"