Compare commits
2 Commits
dev_XingeP
...
master
Author | SHA1 | Date | |
---|---|---|---|
ab666e86e6 | |||
143fc22492 |
@ -37,8 +37,8 @@ android {
|
||||
applicationId "com.navinfo.outdoor"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 30
|
||||
versionCode 118
|
||||
versionName "8.231110-通用测试版"
|
||||
versionCode 120
|
||||
versionName "8.231205-测试版"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
ndk {
|
||||
|
@ -120,8 +120,10 @@ import org.locationtech.jts.geom.Point;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -176,6 +178,7 @@ public class AutoTakePicture4PoiActivity extends BaseActivity implements View.On
|
||||
private LocationRecorderDao recorderDao;
|
||||
private PoiDao poiDao;
|
||||
private SimpleDateFormat picFormatter = new SimpleDateFormat("yyyyMMdd HHmmss");
|
||||
private DateFormat receiverDateFormate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");; // 接收任务时间的格式化对象
|
||||
private Button btnClearMatch, btnStopPicture;
|
||||
private Point lastPositionPoint; // 最近一次的定位,用来过滤距离较近的点位
|
||||
private static int BRIGHTNESS=40, FRAMENESS=30;
|
||||
@ -1287,7 +1290,7 @@ public class AutoTakePicture4PoiActivity extends BaseActivity implements View.On
|
||||
poiListEntity.setTaskId(poiEntity.getTaskId());
|
||||
poiListEntity.setName(listBean.getName());
|
||||
poiListEntity.setMemo(listBean.getMemo());
|
||||
poiListEntity.setCreateTime(listBean.getEndDate());
|
||||
poiListEntity.setCreateTime(receiverDateFormate.format(new Date()));
|
||||
poiListEntity.setAddress(listBean.getAddress());
|
||||
poiListEntity.setType(listBean.getType());
|
||||
poiListEntity.setPrecision(String.valueOf(listBean.getPrice()));
|
||||
@ -1365,7 +1368,7 @@ public class AutoTakePicture4PoiActivity extends BaseActivity implements View.On
|
||||
Gson gson = new Gson();
|
||||
UnPolygonTaskBean response = gson.fromJson(bodyString, UnPolygonTaskBean.class);
|
||||
if (response.getCode() == 200) {
|
||||
PoiDatabase.getInstance(AutoTakePicture4PoiActivity.this).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(AutoTakePicture4PoiActivity.this).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
// 不需要删除照片,自动采集时照片是临时保存在tmp目录下
|
||||
} else if (response.getCode() == 230) {
|
||||
FlushTokenUtil.flushToken(AutoTakePicture4PoiActivity.this);
|
||||
|
@ -122,6 +122,7 @@ import org.locationtech.jts.geom.Point;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@ -180,6 +181,7 @@ public class AutoTakePicture4PoiVideoActivity extends BaseActivity implements Vi
|
||||
private LocationRecorderDao recorderDao;
|
||||
private PoiDao poiDao;
|
||||
private SimpleDateFormat picFormatter = new SimpleDateFormat("yyyyMMdd HHmmss");
|
||||
private DateFormat receiverDateFormate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");; // 接收任务时间的格式化对象
|
||||
private Button btnClearMatch, btnStopPicture;
|
||||
private Point lastPositionPoint; // 最近一次的定位,用来过滤距离较近的点位
|
||||
private static int BRIGHTNESS=40, FRAMENESS=30;
|
||||
@ -1146,7 +1148,7 @@ public class AutoTakePicture4PoiVideoActivity extends BaseActivity implements Vi
|
||||
poiListEntity.setTaskId(poiEntity.getTaskId());
|
||||
poiListEntity.setName(listBean.getName());
|
||||
poiListEntity.setMemo(listBean.getMemo());
|
||||
poiListEntity.setCreateTime(listBean.getEndDate());
|
||||
poiListEntity.setCreateTime(receiverDateFormate.format(new Date()));
|
||||
poiListEntity.setAddress(listBean.getAddress());
|
||||
poiListEntity.setType(listBean.getType());
|
||||
poiListEntity.setPrecision(String.valueOf(listBean.getPrice()));
|
||||
@ -1224,7 +1226,7 @@ public class AutoTakePicture4PoiVideoActivity extends BaseActivity implements Vi
|
||||
Gson gson = new Gson();
|
||||
UnPolygonTaskBean response = gson.fromJson(bodyString, UnPolygonTaskBean.class);
|
||||
if (response.getCode() == 200) {
|
||||
PoiDatabase.getInstance(AutoTakePicture4PoiVideoActivity.this).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(AutoTakePicture4PoiVideoActivity.this).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
// 不需要删除照片,自动采集时照片是临时保存在tmp目录下
|
||||
} else if (response.getCode() == 230) {
|
||||
FlushTokenUtil.flushToken(AutoTakePicture4PoiVideoActivity.this);
|
||||
|
@ -227,6 +227,7 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
|
||||
private LocationRecorderDao recorderDao;
|
||||
private PoiDao poiDao;
|
||||
private SimpleDateFormat picFormatter = new SimpleDateFormat("yyyyMMdd HHmmss");
|
||||
private DateFormat receiverDateFormate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");; // 接收任务时间的格式化对象
|
||||
private Button btnClearMatch, btnStopPicture;
|
||||
private Point lastPositionPoint; // 最近一次的定位,用来过滤距离较近的点位
|
||||
private static int BRIGHTNESS=40, FRAMENESS=30;
|
||||
@ -1338,7 +1339,7 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
|
||||
poiListEntity.setTaskId(poiEntity.getTaskId());
|
||||
poiListEntity.setName(listBean.getName());
|
||||
poiListEntity.setMemo(listBean.getMemo());
|
||||
poiListEntity.setCreateTime(listBean.getEndDate());
|
||||
poiListEntity.setCreateTime(receiverDateFormate.format(new Date()));
|
||||
poiListEntity.setAddress(listBean.getAddress());
|
||||
poiListEntity.setType(listBean.getType());
|
||||
poiListEntity.setPrecision(String.valueOf(listBean.getPrice()));
|
||||
@ -1416,7 +1417,7 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
|
||||
Gson gson = new Gson();
|
||||
UnPolygonTaskBean response = gson.fromJson(bodyString, UnPolygonTaskBean.class);
|
||||
if (response.getCode() == 200) {
|
||||
PoiDatabase.getInstance(AutoTakePictureActivity.this).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(AutoTakePictureActivity.this).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
// 不需要删除照片,自动采集时照片是临时保存在tmp目录下
|
||||
} else if (response.getCode() == 230) {
|
||||
FlushTokenUtil.flushToken(AutoTakePictureActivity.this);
|
||||
|
@ -1,21 +1,26 @@
|
||||
package com.navinfo.outdoor.activity;
|
||||
|
||||
import com.elvishew.xlog.XLog;
|
||||
import com.github.lazylibrary.util.PreferencesUtils;
|
||||
import com.github.lazylibrary.util.ShellUtils;
|
||||
import com.google.gson.Gson;
|
||||
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.lzy.okgo.model.HttpParams;
|
||||
import com.navinfo.ocr.OCRManager;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.api.UserApplication;
|
||||
import com.navinfo.outdoor.base.BaseActivity;
|
||||
import com.navinfo.outdoor.bean.CommonRequestSend;
|
||||
import com.navinfo.outdoor.bean.CommonResponse;
|
||||
import com.navinfo.outdoor.bean.NotificationBean;
|
||||
import com.navinfo.outdoor.fragment.FindFragment;
|
||||
import com.navinfo.outdoor.fragment.MineFragment;
|
||||
import com.navinfo.outdoor.fragment.RecordFragment;
|
||||
import com.navinfo.outdoor.fragment.TreasureFragment;
|
||||
import com.navinfo.outdoor.http.Callback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.room.PoiDatabase;
|
||||
import com.navinfo.outdoor.service.ForegroundCoreService;
|
||||
@ -131,6 +136,8 @@ public class HomeActivity extends BaseActivity {
|
||||
}
|
||||
// 开启前台服务
|
||||
startService(new Intent(getApplicationContext(), ForegroundCoreService.class));
|
||||
// 使用Shared文件记录最近一次的登陆Id和推送需要的请求地址,防止通过推送响应时请求地址为null的问题
|
||||
PreferencesUtils.putString(HomeActivity.this, "MESSAGE_PUSH_GET_OR_CLICK_UPLOAD", HttpInterface.MESSAGE_PUSH_GET_OR_CLICK_UPLOAD);
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
@ -160,6 +167,7 @@ public class HomeActivity extends BaseActivity {
|
||||
if (intent != null) {
|
||||
String intentFrom = intent.getStringExtra(Constant.NOTIFYCATION_INTENT_FROM);
|
||||
if (intentFrom != null){
|
||||
int messageId = intent.getIntExtra(Constant.NOTIFYCATION_ID, -1);
|
||||
if (intentFrom.equals("recommandTask")) {
|
||||
// 从notifycation跳转过来的
|
||||
// 获取要跳转的定位点位和zoom,自动跳转到该位置后刷新地图界面
|
||||
@ -178,6 +186,7 @@ public class HomeActivity extends BaseActivity {
|
||||
msg.what = Constant.EVENT_WHAT_NOTIFYCATION_RECOMMAND_TASK;
|
||||
EventBus.getDefault().post(msg);
|
||||
}
|
||||
uploadReceivePushMessage(HomeActivity.this, messageId+"", 1);
|
||||
} else if (intentFrom.equals("normalNotification")) {
|
||||
String title = intent.getStringExtra(Constant.NOTIFYCATION_TITLE);
|
||||
String content = intent.getStringExtra(Constant.NOTIFYCATION_CONTENT);
|
||||
@ -186,11 +195,39 @@ public class HomeActivity extends BaseActivity {
|
||||
MessageDialog.show(HomeActivity.this, title, content, "确定")
|
||||
.setCancelable(false);
|
||||
}
|
||||
uploadReceivePushMessage(HomeActivity.this, messageId+"", 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 上报获取到推送消息的时间给服务端
|
||||
* @param messageId 推送消息对应的id
|
||||
* @param type 0-获取到消息,1-点击推送消息
|
||||
* */
|
||||
private void uploadReceivePushMessage(Context mContext, String messageId, int type) {
|
||||
HttpParams httpParams = new HttpParams();
|
||||
httpParams.put("messageId", messageId);
|
||||
httpParams.put("type", type);
|
||||
CommonRequestSend commonRequestSend = new CommonRequestSend<CommonResponse<Integer>>();
|
||||
commonRequestSend.postMethodCommonSilence(mContext, PreferencesUtils.getString(mContext, "MESSAGE_PUSH_GET_OR_CLICK_UPLOAD")/*从SP文件中获取*/,
|
||||
httpParams, Constant.DEFAULT_TIME_OUT, new Callback<CommonResponse<Integer>>() {
|
||||
@Override
|
||||
public void onSuccess(CommonResponse<Integer> response, int id) {
|
||||
if (response.getCode() == 200) {
|
||||
// 推送消息获取时间上报成功
|
||||
XLog.d("上报推送接收成功:"+response.getMessage()+"-messageId:"+messageId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
XLog.d("上报推送接收失败:"+e.getMessage()+"-messageId:"+messageId);
|
||||
}
|
||||
}, new CommonResponse<Integer>().getClass());
|
||||
}
|
||||
|
||||
private void initUM() {
|
||||
//自定义点击通知时的打开动作
|
||||
UmengNotificationClickHandler notificationClickHandler = new UmengNotificationClickHandler() {
|
||||
|
@ -117,7 +117,7 @@ public class HasReceiveAdapter extends RecyclerView.Adapter<HasReceiveAdapter.Vi
|
||||
PoiEntity poiEntity = (PoiEntity) iterator.next();
|
||||
if (poiEntity.isChecked()) {
|
||||
PoiEntityDeleteUtil.getInstance().deleteUtil(context, poiEntity);
|
||||
PoiDatabase.getInstance(context).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(context).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
@ -143,7 +143,16 @@ public class HasReceiveAdapter extends RecyclerView.Adapter<HasReceiveAdapter.Vi
|
||||
public void onBindViewHolder(@NotNull ViewHolder holder, @SuppressLint("RecyclerView") int position) {
|
||||
PoiEntity poiEntity = allRoad.get(position);
|
||||
holder.tvName.setText(poiEntity.getName());
|
||||
holder.tvDay.setText(poiEntity.getCreateTime());
|
||||
if (poiEntity.getCreateTime()!=null&&!poiEntity.getCreateTime().trim().isEmpty()) {
|
||||
holder.tvCreateTime.setText("领取时间:"+poiEntity.getCreateTime());
|
||||
} else {
|
||||
holder.tvCreateTime.setVisibility(View.GONE);
|
||||
}
|
||||
if (poiEntity.getUnReceivedTime()!=null&&!poiEntity.getUnReceivedTime().trim().isEmpty()) {
|
||||
holder.tvExpirationTime.setText("过期时间:"+poiEntity.getUnReceivedTime());
|
||||
} else {
|
||||
holder.tvExpirationTime.setVisibility(View.GONE);
|
||||
}
|
||||
//获取checkBox点击的记录
|
||||
holder.cbUnSubmit.setChecked(allRoad.get(position).isChecked());
|
||||
holder.cbUnSubmit.setOnClickListener(new View.OnClickListener() {
|
||||
@ -196,7 +205,7 @@ public class HasReceiveAdapter extends RecyclerView.Adapter<HasReceiveAdapter.Vi
|
||||
}
|
||||
|
||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
private TextView tvName, tvText, tvDay;
|
||||
private TextView tvName, tvText, tvCreateTime, tvExpirationTime;
|
||||
private CheckBox cbUnSubmit;
|
||||
private ProgressBar pbUpload;
|
||||
private TextView tvUploadProgress, tvUploadResult;
|
||||
@ -206,7 +215,8 @@ public class HasReceiveAdapter extends RecyclerView.Adapter<HasReceiveAdapter.Vi
|
||||
super(itemView);
|
||||
tvName = itemView.findViewById(R.id.tv_road_name);
|
||||
tvText = itemView.findViewById(R.id.tv_text);
|
||||
tvDay = itemView.findViewById(R.id.tv_road_day);
|
||||
tvCreateTime = itemView.findViewById(R.id.tv_poi_createtime);
|
||||
tvExpirationTime = itemView.findViewById(R.id.tv_poi_expirationtime);
|
||||
cbUnSubmit = itemView.findViewById(R.id.cb_unSubmit);
|
||||
pbUpload = itemView.findViewById(R.id.pb_stay_upload);
|
||||
tvUploadProgress = itemView.findViewById(R.id.tv_pb_stay_upload);
|
||||
|
@ -117,7 +117,7 @@ public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.Vi
|
||||
PoiEntity poiEntity = (PoiEntity) iterator.next();
|
||||
if (poiEntity.isChecked()) {
|
||||
PoiEntityDeleteUtil.getInstance().deleteUtil(context, poiEntity);
|
||||
PoiDatabase.getInstance(context).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(context).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
@ -143,7 +143,7 @@ public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.Vi
|
||||
public void onBindViewHolder(@NotNull ViewHolder holder, @SuppressLint("RecyclerView") int position) {
|
||||
PoiEntity poiEntity = allRoad.get(position);
|
||||
holder.tvName.setText(poiEntity.getName());
|
||||
holder.tvDay.setText(poiEntity.getCreateTime());
|
||||
holder.tvDay.setText("保存时间:"+poiEntity.getCreateTime());
|
||||
//获取checkBox点击的记录
|
||||
holder.cbUnSubmit.setChecked(allRoad.get(position).isChecked());
|
||||
holder.cbUnSubmit.setOnClickListener(new View.OnClickListener() {
|
||||
|
@ -293,4 +293,5 @@ public class Constant {
|
||||
public static String NOTIFYCATION_TASK_ZOOM = "NOTIFYCATION_TASK_ZOOM";
|
||||
public static String NOTIFYCATION_TITLE = "NOTIFYCATION_TITLE";
|
||||
public static String NOTIFYCATION_CONTENT = "NOTIFYCATION_CONTENT";
|
||||
public static String NOTIFYCATION_ID = "NOTIFYCATION_ID";
|
||||
}
|
||||
|
@ -29,6 +29,10 @@ import com.tencent.map.navi.TencentNavi;
|
||||
import com.tencent.navi.surport.utils.DeviceUtils;
|
||||
import com.tencent.tencentmap.mapsdk.maps.TencentMapInitializer;
|
||||
import com.umeng.commonsdk.UMConfigure;
|
||||
import com.umeng.message.IUmengRegisterCallback;
|
||||
import com.umeng.message.PushAgent;
|
||||
import com.umeng.message.UmengMessageHandler;
|
||||
import com.umeng.message.entity.UMessage;
|
||||
import com.umeng.umcrash.UMCrash;
|
||||
import com.umeng.umcrash.UMCrashCallback;
|
||||
|
||||
@ -44,7 +48,7 @@ import okhttp3.OkHttpClient;
|
||||
public class UserApplication extends Application {
|
||||
public static UserApplication userApplication;
|
||||
public static ExecutorService fixedThreadPool;
|
||||
// public static PushAgent instance;
|
||||
public static PushAgent instance;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
@ -102,45 +106,45 @@ public class UserApplication extends Application {
|
||||
return "注册友盟异常查看功能";
|
||||
}
|
||||
});
|
||||
// instance = PushAgent.getInstance(this);
|
||||
// instance.register(new IUmengRegisterCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(String s) {
|
||||
// //注册成功会返回deviceToken deviceToken是推送消息的唯一标志
|
||||
// Constant.DEVICE_TOKEN = s;
|
||||
// Log.i("TAGEE", "Success 注册成功:deviceToken:--> " + Constant.DEVICE_TOKEN);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String s, String s1) {
|
||||
// Log.e("TAGEE", "Failure 注册失败:--> " + "code:" + s + ", desc:" + s1);
|
||||
// }
|
||||
// });
|
||||
// instance.onAppStart();
|
||||
// UmengMessageHandler msgHandler = new UmengMessageHandler() {
|
||||
// //处理通知栏消息
|
||||
// @Override
|
||||
// public void dealWithNotificationMessage(Context context, UMessage msg) {
|
||||
// super.dealWithNotificationMessage(context, msg);
|
||||
// Log.i("TAGEE", "dealWithNotificationMessage:" + msg.getRaw().toString());
|
||||
// Constant.NOTIFICATION=msg.getRaw().toString();
|
||||
// }
|
||||
//
|
||||
// //自定义通知样式,此方法可以修改通知样式等
|
||||
// @Override
|
||||
// public Notification getNotification(Context context, UMessage msg) {
|
||||
// Log.i("TAGEE", "getNotification: "+msg.getRaw().toString());
|
||||
// return super.getNotification(context, msg);
|
||||
// }
|
||||
//
|
||||
// //处理透传消息
|
||||
// @Override
|
||||
// public void dealWithCustomMessage(Context context, UMessage msg) {
|
||||
// super.dealWithCustomMessage(context, msg);
|
||||
// Log.i("TAGEE", "dealWithCustomMessage:" + msg.getRaw().toString());
|
||||
// }
|
||||
// };
|
||||
// instance.setMessageHandler(msgHandler);
|
||||
instance = PushAgent.getInstance(this);
|
||||
instance.register(new IUmengRegisterCallback() {
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
//注册成功会返回deviceToken deviceToken是推送消息的唯一标志
|
||||
Constant.DEVICE_TOKEN = s;
|
||||
Log.i("TAGEE", "Success 注册成功:deviceToken:--> " + Constant.DEVICE_TOKEN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("TAGEE", "Failure 注册失败:--> " + "code:" + s + ", desc:" + s1);
|
||||
}
|
||||
});
|
||||
instance.onAppStart();
|
||||
UmengMessageHandler msgHandler = new UmengMessageHandler() {
|
||||
//处理通知栏消息
|
||||
@Override
|
||||
public void dealWithNotificationMessage(Context context, UMessage msg) {
|
||||
super.dealWithNotificationMessage(context, msg);
|
||||
Log.i("TAGEE", "dealWithNotificationMessage:" + msg.getRaw().toString());
|
||||
Constant.NOTIFICATION=msg.getRaw().toString();
|
||||
}
|
||||
|
||||
//自定义通知样式,此方法可以修改通知样式等
|
||||
@Override
|
||||
public Notification getNotification(Context context, UMessage msg) {
|
||||
Log.i("TAGEE", "getNotification: "+msg.getRaw().toString());
|
||||
return super.getNotification(context, msg);
|
||||
}
|
||||
|
||||
//处理透传消息
|
||||
@Override
|
||||
public void dealWithCustomMessage(Context context, UMessage msg) {
|
||||
super.dealWithCustomMessage(context, msg);
|
||||
Log.i("TAGEE", "dealWithCustomMessage:" + msg.getRaw().toString());
|
||||
}
|
||||
};
|
||||
instance.setMessageHandler(msgHandler);
|
||||
//App处于前台时不显示通知
|
||||
//instance.setNotificationOnForeground(false);
|
||||
//设置显示通知的数量
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.navinfo.outdoor.bean;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
@ -45,36 +46,40 @@ import okhttp3.ResponseBody;
|
||||
public class CommonRequestSend<T extends CommonResponseBase> {
|
||||
public void getMethodCommon(Activity mContext, String url, HttpParams params, int timeOut, Callback<CommonResponse<T>> callback, Class<T> tClass) {
|
||||
try {
|
||||
Response<CommonResponse<T>> response = ((GetRequest<CommonResponse<T>>) obitainRequest(mContext, url, params, timeOut, 0, tClass))
|
||||
((GetRequest<CommonResponse<T>>) obitainRequest(url, params, timeOut, 0, tClass))
|
||||
.adapt()
|
||||
.execute();
|
||||
if (response.code() == 200) {
|
||||
if (response.body().getCode() == 200) {
|
||||
callback.onSuccess(response.body(), 1);
|
||||
} else if (response.body().getCode() == 230){
|
||||
FlushTokenUtil.flushToken(mContext);
|
||||
Toast.makeText(mContext, "token过期,请重新登录后再试...", Toast.LENGTH_LONG).show();
|
||||
Throwable throwable = new Throwable("token过期,请重新登录后再试...");
|
||||
callback.onError(throwable, -1);
|
||||
/*
|
||||
* 友盟+
|
||||
* 使用自定义错误,查看时请在错误列表页面选择【自定义异常】
|
||||
*/
|
||||
UMCrash.generateCustomLog("网络请求报错-位置:OKGOBuilder" + throwable, "UmengException");
|
||||
} else {
|
||||
Toast.makeText(mContext, response.message(), Toast.LENGTH_LONG).show();
|
||||
Throwable throwable = new Throwable(response.message());
|
||||
callback.onError(throwable, -2);
|
||||
/*
|
||||
* 友盟+
|
||||
* 使用自定义错误,查看时请在错误列表页面选择【自定义异常】
|
||||
*/
|
||||
UMCrash.generateCustomLog("网络请求报错-位置:OKGOBuilder" + throwable, "UmengException");
|
||||
}
|
||||
.execute(new MyJsonCallback<CommonResponse<T>>() {
|
||||
@Override
|
||||
public void onSuccess(Response<CommonResponse<T>> response) {
|
||||
if (response.code() == 200) {
|
||||
if (response.body().getCode() == 200) {
|
||||
callback.onSuccess(response.body(), 1);
|
||||
} else if (response.body().getCode() == 230){
|
||||
FlushTokenUtil.flushToken(mContext);
|
||||
Toast.makeText(mContext, "token过期,请重新登录后再试...", Toast.LENGTH_LONG).show();
|
||||
Throwable throwable = new Throwable("token过期,请重新登录后再试...");
|
||||
callback.onError(throwable, -1);
|
||||
/*
|
||||
* 友盟+
|
||||
* 使用自定义错误,查看时请在错误列表页面选择【自定义异常】
|
||||
*/
|
||||
UMCrash.generateCustomLog("网络请求报错-位置:OKGOBuilder" + throwable, "UmengException");
|
||||
} else {
|
||||
Toast.makeText(mContext, response.message(), Toast.LENGTH_LONG).show();
|
||||
Throwable throwable = new Throwable(response.message());
|
||||
callback.onError(throwable, -2);
|
||||
/*
|
||||
* 友盟+
|
||||
* 使用自定义错误,查看时请在错误列表页面选择【自定义异常】
|
||||
*/
|
||||
UMCrash.generateCustomLog("网络请求报错-位置:OKGOBuilder" + throwable, "UmengException");
|
||||
}
|
||||
|
||||
} else {
|
||||
Toast.makeText(mContext, response.message(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(mContext, response.message(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Throwable throwable = e;
|
||||
@ -92,7 +97,7 @@ public class CommonRequestSend<T extends CommonResponseBase> {
|
||||
|
||||
public CommonResponse<T> getMethodCommonSync(Activity mContext, String url, HttpParams params, int timeOut, Class<T> tClass) {
|
||||
try {
|
||||
Response<CommonResponse<T>> response = ((GetRequest<CommonResponse<T>>) obitainRequest(mContext, url, params, timeOut, 0, tClass))
|
||||
Response<CommonResponse<T>> response = ((GetRequest<CommonResponse<T>>) obitainRequest(url, params, timeOut, 0, tClass))
|
||||
.adapt()
|
||||
.execute();
|
||||
if (response.code() == 200) {
|
||||
@ -117,38 +122,97 @@ public class CommonRequestSend<T extends CommonResponseBase> {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送post请求,但是无需重试,无需检查是否成功登录
|
||||
* 这个方法用于发送一些不重要的请求,当用户本地token过期时,有可能需要重新登录
|
||||
* */
|
||||
public void postMethodCommonSilence(Context mContext, String url, HttpParams params, int timeOut, Callback<CommonResponse<T>> callback, Class<T> tClass) {
|
||||
try {
|
||||
((PostRequest<CommonResponse<T>>) obitainRequest(url, params, timeOut, 1, tClass))
|
||||
.adapt()
|
||||
.execute(new MyJsonCallback<CommonResponse<T>>() {
|
||||
@Override
|
||||
public void onSuccess(Response<CommonResponse<T>> response) {
|
||||
if (response.code() == 200) {
|
||||
if (response.body().getCode() == 200) {
|
||||
callback.onSuccess(response.body(), 1);
|
||||
} else if (response.body().getCode() == 230){
|
||||
FlushTokenUtil.flushTokenSilence(mContext);
|
||||
Toast.makeText(mContext, "token过期,请重新登录后再试...", Toast.LENGTH_LONG).show();
|
||||
Throwable throwable = new Throwable("token过期,请重新登录后再试...");
|
||||
callback.onError(throwable, -1);
|
||||
/*
|
||||
* 友盟+
|
||||
* 使用自定义错误,查看时请在错误列表页面选择【自定义异常】
|
||||
*/
|
||||
UMCrash.generateCustomLog("网络请求报错-位置:OKGOBuilder" + throwable, "UmengException");
|
||||
} else {
|
||||
Toast.makeText(mContext, response.message(), Toast.LENGTH_LONG).show();
|
||||
Throwable throwable = new Throwable(response.message());
|
||||
callback.onError(throwable, -2);
|
||||
/*
|
||||
* 友盟+
|
||||
* 使用自定义错误,查看时请在错误列表页面选择【自定义异常】
|
||||
*/
|
||||
UMCrash.generateCustomLog("网络请求报错-位置:OKGOBuilder" + throwable, "UmengException");
|
||||
}
|
||||
|
||||
} else {
|
||||
Toast.makeText(mContext, response.message(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Throwable throwable = e;
|
||||
if (throwable != null) {
|
||||
throwable.printStackTrace();
|
||||
callback.onError(throwable, -3);
|
||||
}
|
||||
/*
|
||||
* 友盟+
|
||||
* 使用自定义错误,查看时请在错误列表页面选择【自定义异常】
|
||||
*/
|
||||
UMCrash.generateCustomLog("网络请求报错-位置:OKGOBuilder" + throwable, "UmengException");
|
||||
}
|
||||
}
|
||||
|
||||
public void postMethodCommon(Activity mContext, String url, HttpParams params, int timeOut, Callback<CommonResponse<T>> callback, Class<T> tClass) {
|
||||
try {
|
||||
Response<CommonResponse<T>> response = ((GetRequest<CommonResponse<T>>) obitainRequest(mContext, url, params, timeOut, 1, tClass))
|
||||
((PostRequest<CommonResponse<T>>) obitainRequest(url, params, timeOut, 1, tClass))
|
||||
.adapt()
|
||||
.execute();
|
||||
if (response.code() == 200) {
|
||||
if (response.body().getCode() == 200) {
|
||||
callback.onSuccess(response.body(), 1);
|
||||
} else if (response.body().getCode() == 230){
|
||||
FlushTokenUtil.flushToken(mContext);
|
||||
Toast.makeText(mContext, "token过期,请重新登录后再试...", Toast.LENGTH_LONG).show();
|
||||
Throwable throwable = new Throwable("token过期,请重新登录后再试...");
|
||||
callback.onError(throwable, -1);
|
||||
/*
|
||||
* 友盟+
|
||||
* 使用自定义错误,查看时请在错误列表页面选择【自定义异常】
|
||||
*/
|
||||
UMCrash.generateCustomLog("网络请求报错-位置:OKGOBuilder" + throwable, "UmengException");
|
||||
} else {
|
||||
Toast.makeText(mContext, response.message(), Toast.LENGTH_LONG).show();
|
||||
Throwable throwable = new Throwable(response.message());
|
||||
callback.onError(throwable, -2);
|
||||
/*
|
||||
* 友盟+
|
||||
* 使用自定义错误,查看时请在错误列表页面选择【自定义异常】
|
||||
*/
|
||||
UMCrash.generateCustomLog("网络请求报错-位置:OKGOBuilder" + throwable, "UmengException");
|
||||
}
|
||||
.execute(new MyJsonCallback<CommonResponse<T>>() {
|
||||
@Override
|
||||
public void onSuccess(Response<CommonResponse<T>> response) {
|
||||
if (response.code() == 200) {
|
||||
if (response.body().getCode() == 200) {
|
||||
callback.onSuccess(response.body(), 1);
|
||||
} else if (response.body().getCode() == 230){
|
||||
FlushTokenUtil.flushToken(mContext);
|
||||
Toast.makeText(mContext, "token过期,请重新登录后再试...", Toast.LENGTH_LONG).show();
|
||||
Throwable throwable = new Throwable("token过期,请重新登录后再试...");
|
||||
callback.onError(throwable, -1);
|
||||
/*
|
||||
* 友盟+
|
||||
* 使用自定义错误,查看时请在错误列表页面选择【自定义异常】
|
||||
*/
|
||||
UMCrash.generateCustomLog("网络请求报错-位置:OKGOBuilder" + throwable, "UmengException");
|
||||
} else {
|
||||
Toast.makeText(mContext, response.message(), Toast.LENGTH_LONG).show();
|
||||
Throwable throwable = new Throwable(response.message());
|
||||
callback.onError(throwable, -2);
|
||||
/*
|
||||
* 友盟+
|
||||
* 使用自定义错误,查看时请在错误列表页面选择【自定义异常】
|
||||
*/
|
||||
UMCrash.generateCustomLog("网络请求报错-位置:OKGOBuilder" + throwable, "UmengException");
|
||||
}
|
||||
|
||||
} else {
|
||||
Toast.makeText(mContext, response.message(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(mContext, response.message(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Throwable throwable = e;
|
||||
@ -166,7 +230,7 @@ public class CommonRequestSend<T extends CommonResponseBase> {
|
||||
|
||||
public CommonResponse<T> postMethodCommonSync(Activity mContext, String url, HttpParams params, int timeOut, List<File> files, Class<T> tClass) {
|
||||
try {
|
||||
PostRequest<CommonResponse<T>> postRequest = (PostRequest<CommonResponse<T>>) obitainRequest(mContext, url, params, timeOut, 1, tClass);
|
||||
PostRequest<CommonResponse<T>> postRequest = (PostRequest<CommonResponse<T>>) obitainRequest(url, params, timeOut, 1, tClass);
|
||||
if (files!=null) {
|
||||
postRequest.addFileParams("file", files);
|
||||
}
|
||||
@ -199,7 +263,7 @@ public class CommonRequestSend<T extends CommonResponseBase> {
|
||||
* 生成通用请求
|
||||
* @param requestType 0-默认为get请求,非0-post请求
|
||||
* */
|
||||
private Request obitainRequest(Activity mContext, String url, HttpParams params, int timeOut, int requestType, Class<T> clazz) throws Exception{
|
||||
private Request obitainRequest(String url, HttpParams params, int timeOut, int requestType, Class<T> clazz) throws Exception{
|
||||
if (!NetWorkUtils.iConnected(UserApplication.userApplication)) { // 当前网络不可用
|
||||
throw new Exception("网络不可用");
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ public class JobSearchBean implements Serializable {
|
||||
private String memo;
|
||||
private String telephone;
|
||||
|
||||
private int publish; // 是否已发布,如果是未发布的数据,则用半透明形式展示
|
||||
private int publish; // 是否已发布,如果是未发布的数据,则用半透明形式展示,0-未发布,1-已发布
|
||||
|
||||
public int getCanReceived() {
|
||||
return canReceived;
|
||||
|
@ -816,7 +816,7 @@ public class AreaHubFragment extends BaseDrawerFragment implements View.OnClickL
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
}
|
||||
}).start();
|
||||
if (poiEntity.getId() != null) {
|
||||
|
@ -917,7 +917,7 @@ public class BuildingInFragment extends BaseDrawerFragment implements View.OnCli
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
}
|
||||
}).start();
|
||||
if (poiEntity.getId() != null) {
|
||||
|
@ -1767,7 +1767,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
if (showPoiEntity != null) {
|
||||
List<ChargingPileEntity> chargingPileEntityList = PoiDatabase.getInstance(getActivity()).getChargingPileDao().getChargingPileByStationId(showPoiEntity.getId());
|
||||
if (chargingPileEntityList != null && !chargingPileEntityList.isEmpty()) {
|
||||
|
@ -75,6 +75,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
private StringBuilder gatherGetBuilder;
|
||||
private TextView tvStartNav;
|
||||
private TextView tvMatchTrack; // 手动匹配轨迹照片
|
||||
private DateFormat receiverDateFormate; // 接收任务时间的格式化对象
|
||||
|
||||
public static GatherGetFragment newInstance(Bundle bundle) {
|
||||
GatherGetFragment fragment = new GatherGetFragment();
|
||||
@ -89,6 +90,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
SharedPreferences.Editor sharedEdit = sharedPreferences.edit();
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
DateFormat formatter = new SimpleDateFormat("yyyyMMdd");
|
||||
receiverDateFormate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String newFormat = formatter.format(new Date(System.currentTimeMillis()));
|
||||
String pictures_time = sharedPreferences.getString("pictures_time", null);
|
||||
if (pictures_time == null) {
|
||||
@ -280,32 +282,39 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
* 根据当前数据状态重新构建领取对话框按钮的显隐
|
||||
* */
|
||||
private void initViewByTaskStatus(int taskStatus) {
|
||||
switch (taskStatus) {
|
||||
case 0://未领取
|
||||
btnCancelGet.setVisibility(View.GONE);//取消领取
|
||||
btnGetTask.setVisibility(View.VISIBLE);//领取任务
|
||||
btnGather.setVisibility(View.VISIBLE);//立即采集
|
||||
btnFinishGather.setVisibility(View.GONE);//结束采集
|
||||
break;
|
||||
case 1://已领取
|
||||
btnCancelGet.setVisibility(View.VISIBLE);
|
||||
btnGetTask.setVisibility(View.GONE);
|
||||
btnGather.setVisibility(View.VISIBLE);
|
||||
btnFinishGather.setVisibility(View.GONE);
|
||||
break;
|
||||
case 2://已保存
|
||||
case 3://已提交
|
||||
btnCancelGet.setVisibility(View.VISIBLE);
|
||||
btnGetTask.setVisibility(View.GONE);
|
||||
btnGather.setVisibility(View.GONE);
|
||||
btnFinishGather.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case 4://结束采集
|
||||
btnCancelGet.setVisibility(View.GONE);
|
||||
btnGetTask.setVisibility(View.GONE);
|
||||
btnGather.setVisibility(View.GONE);
|
||||
btnFinishGather.setVisibility(View.GONE);
|
||||
break;
|
||||
if (poiEntity.getPublish() == 1) { // 如果是已发布的数据
|
||||
switch (taskStatus) {
|
||||
case 0://未领取
|
||||
btnCancelGet.setVisibility(View.GONE);//取消领取
|
||||
btnGetTask.setVisibility(View.VISIBLE);//领取任务
|
||||
btnGather.setVisibility(View.VISIBLE);//立即采集
|
||||
btnFinishGather.setVisibility(View.GONE);//结束采集
|
||||
break;
|
||||
case 1://已领取
|
||||
btnCancelGet.setVisibility(View.VISIBLE);
|
||||
btnGetTask.setVisibility(View.GONE);
|
||||
btnGather.setVisibility(View.VISIBLE);
|
||||
btnFinishGather.setVisibility(View.GONE);
|
||||
break;
|
||||
case 2://已保存
|
||||
case 3://已提交
|
||||
btnCancelGet.setVisibility(View.VISIBLE);
|
||||
btnGetTask.setVisibility(View.GONE);
|
||||
btnGather.setVisibility(View.GONE);
|
||||
btnFinishGather.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case 4://结束采集
|
||||
btnCancelGet.setVisibility(View.GONE);
|
||||
btnGetTask.setVisibility(View.GONE);
|
||||
btnGather.setVisibility(View.GONE);
|
||||
btnFinishGather.setVisibility(View.GONE);
|
||||
break;
|
||||
}
|
||||
} else { // 未发布数据,所有按钮都隐藏
|
||||
btnCancelGet.setVisibility(View.GONE);
|
||||
btnGetTask.setVisibility(View.GONE);
|
||||
btnGather.setVisibility(View.GONE);
|
||||
btnFinishGather.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -391,7 +400,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
requireActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -462,10 +471,11 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
chargingStationEntity.setStation_type(stationBean.getSptype());
|
||||
chargingStationEntity.setName(stationBean.getName());
|
||||
chargingStationEntity.setDescribe(stationBean.getMemo());
|
||||
chargingStationEntity.setCreateTime(stationBean.getEndDate());
|
||||
// chargingStationEntity.setCreateTime(stationBean.getEndDate());
|
||||
chargingStationEntity.setUnReceivedTime(stationBean.getUnReceivedTime());
|
||||
chargingStationEntity.setPrecision(stationBean.getPrice() + "");
|
||||
chargingStationEntity.setAddress(stationBean.getAddress());
|
||||
chargingStationEntity.setCreateTime(receiverDateFormate.format(new Date()));
|
||||
if (stationBean.getTelephone() == null || stationBean.getTelephone().equals("") || stationBean.getTelephone().equals("null")) {
|
||||
chargingStationEntity.setTelPhone(null);
|
||||
} else {
|
||||
@ -605,6 +615,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
PoiEntity polygonEntity = new PoiEntity();
|
||||
polygonEntity.setRecord_way(poiEntity.getRecord_way());
|
||||
polygonEntity.setWork_type(poiEntity.getWork_type());
|
||||
polygonEntity.setCreateTime(receiverDateFormate.format(new Date()));
|
||||
if (listBean != null) {
|
||||
polygonEntity.setTaskId(listBean.getId());
|
||||
polygonEntity.setName(listBean.getName());
|
||||
@ -694,7 +705,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
if (poiEntity.getType() == 2) {
|
||||
PoiDatabase.getInstance(getContext()).getChargingPileDao().deleteChargingFidPileEntity(poiEntity.getId());
|
||||
}
|
||||
@ -846,7 +857,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -914,13 +925,14 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
poiListEntity.setTaskId(poiEntity.getTaskId());
|
||||
poiListEntity.setName(listBean.getName());
|
||||
poiListEntity.setDescribe(listBean.getMemo());
|
||||
poiListEntity.setCreateTime(listBean.getEndDate());
|
||||
// poiListEntity.setCreateTime(listBean.getEndDate());
|
||||
poiListEntity.setUnReceivedTime(listBean.getUnReceivedTime());
|
||||
poiListEntity.setAddress(listBean.getAddress());
|
||||
poiListEntity.setType(listBean.getType());
|
||||
poiListEntity.setIsExclusive(listBean.getIsExclusive());
|
||||
poiListEntity.setRecord_way(poiEntity.getRecord_way());
|
||||
poiListEntity.setWork_type(poiEntity.getWork_type());
|
||||
poiEntity.setCreateTime(receiverDateFormate.format(new Date()));
|
||||
if (listBean.getType() == 1) {
|
||||
if (listBean.getTelephone() == null || listBean.getTelephone().equals("") || listBean.getTelephone().equals("null")) {
|
||||
poiListEntity.setTelPhone(null);
|
||||
@ -1042,7 +1054,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
poiListEntity.setWork_type(poiEntity.getWork_type());
|
||||
poiListEntity.setName(listBean.getName());
|
||||
poiListEntity.setMemo(listBean.getMemo());
|
||||
poiListEntity.setCreateTime(listBean.getEndDate());
|
||||
// poiListEntity.setCreateTime(listBean.getEndDate());
|
||||
poiListEntity.setUnReceivedTime(listBean.getUnReceivedTime());
|
||||
poiListEntity.setAddress(listBean.getAddress());
|
||||
poiListEntity.setType(listBean.getType());
|
||||
@ -1052,6 +1064,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
poiListEntity.setGeoWkt(listBean.getGeo());
|
||||
String encodeStr = listBean.getGeo();
|
||||
String geo = Geohash.getInstance().decode(encodeStr);
|
||||
poiListEntity.setCreateTime(receiverDateFormate.format(new Date()));
|
||||
// 生成对应的x和y poiEntity.setX
|
||||
GeometryTools.obitainPoiEntityXY(geo, poiListEntity);
|
||||
if (statusId == 1 || statusId == 5) {
|
||||
|
@ -474,7 +474,7 @@ public class HasReceiveFragment extends BaseFragment implements View.OnClickList
|
||||
PoiEntity poiEntity = (PoiEntity) iterator.next();
|
||||
if (poiEntity.getUnReceivedTimeStamp()<=new Date().getTime()) {
|
||||
// 删除该条数据,并且将此数据移除出当前列表
|
||||
roadDao.deletePoiEntity(poiEntity);
|
||||
roadDao.deletePoiEntityById(poiEntity.getId());
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
@ -498,7 +498,7 @@ public class HasReceiveFragment extends BaseFragment implements View.OnClickList
|
||||
}
|
||||
}
|
||||
// 数据库中移除该数据
|
||||
roadDao.deletePoiEntity(poiEntity);
|
||||
roadDao.deletePoiEntityById(poiEntity.getId());
|
||||
iteratorAgain.remove();
|
||||
}
|
||||
} else {
|
||||
|
@ -901,7 +901,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
}
|
||||
}).start();
|
||||
initList();
|
||||
|
@ -1268,7 +1268,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
}
|
||||
}).start();
|
||||
initList();
|
||||
|
@ -819,7 +819,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
}
|
||||
}).start();
|
||||
if (poiEntity.getId() != null) {
|
||||
|
@ -927,7 +927,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
}
|
||||
}).start();
|
||||
if (poiEntity.getId() != null) {
|
||||
|
@ -816,7 +816,7 @@ public class TrafficHubFragment extends BaseDrawerFragment implements View.OnCli
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
}
|
||||
}).start();
|
||||
if (poiEntity.getId() != null) {
|
||||
|
@ -44,6 +44,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.elvishew.xlog.XLog;
|
||||
import com.github.lazylibrary.util.DensityUtil;
|
||||
import com.github.lazylibrary.util.FileUtils;
|
||||
@ -1951,6 +1952,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
poiListEntity.setType(listBean.getType());
|
||||
poiListEntity.setRecord_way(listBean.getCanReceived());
|
||||
poiListEntity.setIsExclusive(listBean.getIsExclusive());
|
||||
poiListEntity.setPublish(listBean.getPublish());
|
||||
String beanGeo = listBean.getGeo();
|
||||
String geo = Geohash.getInstance().decode(beanGeo);
|
||||
// 生成对应的x和y poiEntity.setX
|
||||
@ -2131,7 +2133,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
@Override
|
||||
public void onSuccess(LatestPushMessageResponse response, int id) {
|
||||
tvLatestPush.setVisibility(View.GONE); // 默认先隐藏推荐任务按钮
|
||||
if (response != null) {
|
||||
if (response != null&&response.getBody()!=null) {
|
||||
Map<String, String> responseBody = response.getBody();
|
||||
// 解析response
|
||||
// 获取当前json的id,如果id大于等于0,则根据Content内容尝试展示提示信息
|
||||
@ -2160,6 +2162,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
public void onBind(com.kongzue.dialogx.dialogs.CustomDialog dialog, View v) {
|
||||
ImageView photo = v.findViewById(R.id.img_photo);
|
||||
TextView tvConfirm = v.findViewById(R.id.tv_confirm);
|
||||
// // Glide增加加载中图片显示
|
||||
// RequestOptions options = new RequestOptions()
|
||||
// .placeholder(R.mipmap.ic_launcher);
|
||||
// 显示照片
|
||||
Glide.with(requireContext()).load(imgUrl).into(photo);
|
||||
View.OnClickListener clickListener = new View.OnClickListener() {
|
||||
|
@ -1,13 +1,17 @@
|
||||
package com.navinfo.outdoor.http;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
import com.github.lazylibrary.util.PreferencesUtils;
|
||||
|
||||
public class HttpInterface {
|
||||
// 开发
|
||||
public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/dev/m4";//开发地址
|
||||
public static final String IP_UPLOAD = "http://dtxbmaps.navinfo.com/dtxb/dev/m4";//开发接口-数据上传
|
||||
// // 开发
|
||||
// public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/dev/m4";//开发地址
|
||||
// public static final String IP_UPLOAD = "http://dtxbmaps.navinfo.com/dtxb/dev/m4";//开发接口-数据上传
|
||||
|
||||
// 测试
|
||||
// public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/test/m4";//测试环境接口
|
||||
// public static final String IP_UPLOAD = "http://dtxbmaps.navinfo.com/dtxb/test/m4";//测试环境接口-数据上传
|
||||
public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/test/m4";//测试环境接口
|
||||
public static final String IP_UPLOAD = "http://dtxbmaps.navinfo.com/dtxb/test/m4";//测试环境接口-数据上传
|
||||
|
||||
// 生产
|
||||
// public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/m4";//生产地址
|
||||
@ -145,6 +149,7 @@ public class HttpInterface {
|
||||
//dtxbmaps.navinfo.com/dtxb_test/m4/msgList/InfoPush/28/push?type=0
|
||||
public static String MESSAGE_INFO_PUSH = null;//消息通知
|
||||
public static String MESSAGE_LATEST_PUSH = null;//最新的推荐任务推送信息获取
|
||||
public static String MESSAGE_PUSH_GET_OR_CLICK_UPLOAD = null;//推送消息的获取和点击时间上报
|
||||
public static String UPDATE_PHONE_NUM_URL = null;//消息通知
|
||||
public static String CREATE_UPLOAD_TASK = null;//创建断点续传任务
|
||||
public static String UPLOAD_SPLITE_TASK = null;//执行断点续传
|
||||
@ -189,6 +194,7 @@ public class HttpInterface {
|
||||
EXAM_SUBMIT = IP + MSG_LIST_PATH + "findAndMessage/" + userId + "/submitExam";//发现 -能力测评提交试卷 post
|
||||
MESSAGE_INFO_PUSH = IP + MSG_LIST_PATH + "InfoPush/" + userId + "/push";//寻宝-消息通知
|
||||
MESSAGE_LATEST_PUSH = IP + MSG_LIST_PATH + "UserMessage/" + userId + "/getLatestMessage";//寻宝首页-获取最新推送推荐任务
|
||||
MESSAGE_PUSH_GET_OR_CLICK_UPLOAD = IP + MSG_LIST_PATH + "UserMessage/" + userId + "/feedbackUserMessage";//寻宝-推送数据获取和点击的时间上报
|
||||
|
||||
/* 提现 金额
|
||||
* Path=/m4/price/
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.navinfo.outdoor.http;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.elvishew.xlog.XLog;
|
||||
@ -44,7 +45,7 @@ import okhttp3.RequestBody;
|
||||
*/
|
||||
|
||||
public class OkGoBuilder<T> {
|
||||
private Activity activity;
|
||||
private Context activity;
|
||||
/**
|
||||
* 请求网址
|
||||
*/
|
||||
@ -87,7 +88,7 @@ public class OkGoBuilder<T> {
|
||||
return mOkGoBuilder;
|
||||
}
|
||||
|
||||
public OkGoBuilder Builder(Activity activity) {
|
||||
public OkGoBuilder Builder(Context activity) {
|
||||
this.activity = activity;
|
||||
return this;
|
||||
}
|
||||
@ -173,7 +174,8 @@ public class OkGoBuilder<T> {
|
||||
if (response.code() == 200) {
|
||||
callback.onSuccess(response.body(), 1);
|
||||
} else {
|
||||
ToastUtils.Message(activity, response.message());
|
||||
com.github.lazylibrary.util.ToastUtils.showToast(activity, response.message());
|
||||
// ToastUtils.Message(activity, response.message());
|
||||
}
|
||||
}
|
||||
|
||||
@ -223,7 +225,8 @@ public class OkGoBuilder<T> {
|
||||
if (response.code() == 200) {
|
||||
callback.onSuccess(response.body(), 1);
|
||||
} else {
|
||||
ToastUtils.Message(activity, response.message());
|
||||
com.github.lazylibrary.util.ToastUtils.showToast(activity, response.message());
|
||||
// ToastUtils.Message(activity, response.message());
|
||||
}
|
||||
}
|
||||
|
||||
@ -345,7 +348,8 @@ public class OkGoBuilder<T> {
|
||||
if (response.code() == 200) {
|
||||
callback.onSuccess(response.body(), 1);
|
||||
} else {
|
||||
ToastUtils.Message(activity, response.message());
|
||||
com.github.lazylibrary.util.ToastUtils.showToast(activity, response.message());
|
||||
// ToastUtils.Message(activity, response.message());
|
||||
}
|
||||
}
|
||||
|
||||
@ -398,7 +402,8 @@ public class OkGoBuilder<T> {
|
||||
if (response.code() == 200) {
|
||||
callback.onSuccess(response.body(), 1);
|
||||
} else {
|
||||
ToastUtils.Message(activity, response.message());
|
||||
com.github.lazylibrary.util.ToastUtils.showToast(activity, response.message());
|
||||
// ToastUtils.Message(activity, response.message());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,9 +19,16 @@ import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.elvishew.xlog.XLog;
|
||||
import com.github.lazylibrary.util.MD5;
|
||||
import com.github.lazylibrary.util.PreferencesUtils;
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.HomeActivity;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.bean.CommonRequestSend;
|
||||
import com.navinfo.outdoor.bean.CommonResponse;
|
||||
import com.navinfo.outdoor.http.Callback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.tencent.android.tpush.NotificationAction;
|
||||
import com.tencent.android.tpush.XGPushBaseReceiver;
|
||||
import com.tencent.android.tpush.XGPushClickedResult;
|
||||
@ -133,6 +140,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
intent.putExtra(Constant.NOTIFYCATION_INTENT_FROM, "normalNotification");
|
||||
intent.putExtra(Constant.NOTIFYCATION_TITLE, contentTitle);
|
||||
intent.putExtra(Constant.NOTIFYCATION_CONTENT, contentText);
|
||||
intent.putExtra(Constant.NOTIFYCATION_ID, id);
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(context, id, intent, PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context, mNormalChannelId)
|
||||
.setContentTitle(contentTitle)
|
||||
@ -145,6 +153,35 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
.addAction(R.mipmap.ic_launcher, "去看看", pendingIntent)
|
||||
.setAutoCancel(true);
|
||||
mManager.notify(2, mBuilder.build());
|
||||
|
||||
uploadReceivePushMessage(context, id+"", 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上报获取到推送消息的时间给服务端
|
||||
* @param messageId 推送消息对应的id
|
||||
* @param type 0-获取到消息,1-点击推送消息
|
||||
* */
|
||||
private void uploadReceivePushMessage(Context mContext, String messageId, int type) {
|
||||
HttpParams httpParams = new HttpParams();
|
||||
httpParams.put("messageId", messageId);
|
||||
httpParams.put("type", type);
|
||||
CommonRequestSend commonRequestSend = new CommonRequestSend<CommonResponse<Integer>>();
|
||||
commonRequestSend.postMethodCommonSilence(mContext, PreferencesUtils.getString(mContext, "MESSAGE_PUSH_GET_OR_CLICK_UPLOAD")/*从SP文件中获取*/,
|
||||
httpParams, Constant.DEFAULT_TIME_OUT, new Callback<CommonResponse<Integer>>() {
|
||||
@Override
|
||||
public void onSuccess(CommonResponse<Integer> response, int id) {
|
||||
if (response.getCode() == 200) {
|
||||
// 推送消息获取时间上报成功
|
||||
XLog.d("上报推送接收成功:"+response.getMessage()+"-messageId:"+messageId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
XLog.d("上报推送接收失败:"+e.getMessage()+"-messageId:"+messageId);
|
||||
}
|
||||
}, new CommonResponse<Integer>().getClass());
|
||||
}
|
||||
|
||||
private void createNotificationForBigImage(Context context, String contentTitle, String contentText, Bitmap bigPic,
|
||||
@ -160,6 +197,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
intent.putExtra(Constant.NOTIFYCATION_INTENT_FROM, "recommandTask");
|
||||
intent.putExtra(Constant.NOTIFYCATION_TASK_GEOM, wkt);
|
||||
intent.putExtra(Constant.NOTIFYCATION_TASK_ZOOM, zoom);
|
||||
intent.putExtra(Constant.NOTIFYCATION_ID, id);
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(context, id, intent, 0);
|
||||
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context, mBigImageChannelId)
|
||||
.setContentTitle(contentTitle)
|
||||
@ -173,6 +211,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
.addAction(R.mipmap.ic_launcher, "去看看", pendingIntent);
|
||||
mManager.notify(1, mBuilder.build());
|
||||
// 用户点击该提醒后跳转到主界面,并自动定位到指定位置
|
||||
uploadReceivePushMessage(context, id+"", 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -61,8 +61,10 @@ public interface PoiDao {
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@Delete
|
||||
void deletePoiEntity(PoiEntity... poiEntities);
|
||||
// @Delete
|
||||
// void deletePoiEntity(PoiEntity... poiEntities);
|
||||
@Query("DELETE FROM poi where id=:id")
|
||||
void deletePoiEntityById(String id);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
|
@ -61,6 +61,8 @@ public class PoiEntity implements Serializable {
|
||||
private String drawLine; // 用户绘制的线型
|
||||
private String uploadResult; //上传结果
|
||||
private String unReceivedTime; // 任务领取后自动释放的时间
|
||||
@Ignore
|
||||
private int publish = 1; // 是否已发布,0-未发布,1-已发布(默认)
|
||||
|
||||
public int getRecord_way() {
|
||||
return record_way;
|
||||
@ -331,6 +333,14 @@ public class PoiEntity implements Serializable {
|
||||
this.uploadResult = uploadResult;
|
||||
}
|
||||
|
||||
public int getPublish() {
|
||||
return publish;
|
||||
}
|
||||
|
||||
public void setPublish(int publish) {
|
||||
this.publish = publish;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取经过处理后的接受任务失效时间的时间戳
|
||||
* */
|
||||
|
@ -3,9 +3,7 @@ package com.navinfo.outdoor.util;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
@ -44,15 +42,24 @@ public class FlushTokenUtil {
|
||||
});
|
||||
}
|
||||
|
||||
private static void initLogin(Activity activity) {
|
||||
/**
|
||||
* 后台安静重新登录
|
||||
* */
|
||||
public static void flushTokenSilence(Context mContext) {
|
||||
initLogin(mContext);
|
||||
}
|
||||
|
||||
private static void initLogin(Context activity) {
|
||||
SharedPreferences navInfo = activity.getSharedPreferences(Constant.SHARED_PREFERENCES, Context.MODE_PRIVATE);
|
||||
navInfoEditor = navInfo.edit();
|
||||
if (Constant.USHERED == null) {
|
||||
ToastUtils.Message(activity,"token :更新失败");
|
||||
com.github.lazylibrary.util.ToastUtils.showToast(activity, "token :更新失败");
|
||||
// ToastUtils.Message(activity,"token :更新失败");
|
||||
return;
|
||||
} else {
|
||||
if (HttpInterface.USER_LOGIN_OAUTH_TOKEN == null) {
|
||||
ToastUtils.Message(activity,"token :更新失败");
|
||||
com.github.lazylibrary.util.ToastUtils.showToast(activity, "token :更新失败");
|
||||
// ToastUtils.Message(activity,"token :更新失败");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -85,16 +92,19 @@ public class FlushTokenUtil {
|
||||
Constant.USHERED = body.getUserId();
|
||||
navInfoEditor.apply();
|
||||
if (HttpInterface.USER_DETAIL_BY_USER_ID == null) {
|
||||
ToastUtils.Message(activity,"token :更新成功");
|
||||
com.github.lazylibrary.util.ToastUtils.showToast(activity, "token :更新成功");
|
||||
// ToastUtils.Message(activity,"token :更新成功");
|
||||
} else {
|
||||
initGetUserInfo(activity);//获取用户信息
|
||||
}
|
||||
}else {
|
||||
ToastUtils.Message(activity,"获取用户id 失败");
|
||||
// ToastUtils.Message(activity,"获取用户id 失败");
|
||||
com.github.lazylibrary.util.ToastUtils.showToast(activity, "获取用户id 失败");
|
||||
}
|
||||
|
||||
} else {
|
||||
ToastUtils.Message(activity,response.getMessage());
|
||||
// ToastUtils.Message(activity,response.getMessage());
|
||||
com.github.lazylibrary.util.ToastUtils.showToast(activity, response.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,9 +118,11 @@ public class FlushTokenUtil {
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
ToastUtils.Message(activity,"请求超时");
|
||||
// ToastUtils.Message(activity,"请求超时");
|
||||
com.github.lazylibrary.util.ToastUtils.showToast(activity,"请求超时");
|
||||
} else {
|
||||
ToastUtils.Message(activity,message);
|
||||
// ToastUtils.Message(activity,message);
|
||||
com.github.lazylibrary.util.ToastUtils.showToast(activity,message);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -119,7 +131,7 @@ public class FlushTokenUtil {
|
||||
}
|
||||
}
|
||||
|
||||
private static void initGetUserInfo(Activity activity) {
|
||||
private static void initGetUserInfo(Context activity) {
|
||||
OkGoBuilder okGoBuilder = OkGoBuilder
|
||||
.getInstance()
|
||||
.time(30)
|
||||
@ -167,10 +179,12 @@ public class FlushTokenUtil {
|
||||
Constant.AUDITING = userAuth.getAuditmsg();
|
||||
}
|
||||
navInfoEditor.commit();
|
||||
ToastUtils.Message(activity,"token :更新成功");
|
||||
// ToastUtils.Message(activity,"token :更新成功");
|
||||
com.github.lazylibrary.util.ToastUtils.showToast(activity,"token :更新成功");
|
||||
}
|
||||
} else {
|
||||
ToastUtils.Message(activity,response.getMessage());
|
||||
// ToastUtils.Message(activity,response.getMessage());
|
||||
com.github.lazylibrary.util.ToastUtils.showToast(activity,response.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -179,9 +193,11 @@ public class FlushTokenUtil {
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
ToastUtils.Message(activity,"请求超时");
|
||||
// ToastUtils.Message(activity,"请求超时");
|
||||
com.github.lazylibrary.util.ToastUtils.showToast(activity,"请求超时");
|
||||
} else {
|
||||
ToastUtils.Message(activity,message);
|
||||
// ToastUtils.Message(activity,message);
|
||||
com.github.lazylibrary.util.ToastUtils.showToast(activity,message);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -188,7 +188,8 @@ public class TencentMarkerUtils {
|
||||
}
|
||||
// publish字段标识了当前数据是否已发布,如果未发布,则半透明显示,且不可点击,否则正常显示
|
||||
float alpha = listBean.getPublish() == 0? 0.3f: 1.0f;
|
||||
boolean clickable = listBean.getPublish() == 0? false: true;
|
||||
// boolean clickable = listBean.getPublish() == 0? false: true;
|
||||
boolean clickable = true;
|
||||
switch (listBean.getType()) {
|
||||
case 1://poi
|
||||
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi);
|
||||
|
@ -34,10 +34,18 @@
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_road_day"
|
||||
android:id="@+id/tv_poi_createtime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:text="2021-05-08 13:24:36"
|
||||
android:textColor="#333"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_road_name" />
|
||||
<TextView
|
||||
android:id="@+id/tv_poi_expirationtime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:text="2021-05-08 13:24:36"
|
||||
android:textColor="#333"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_road_name" />
|
||||
|
@ -37,8 +37,8 @@
|
||||
android:id="@+id/tv_road_day"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:text="2021-05-08 13:24:36"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:text="2021-05-08 13:24:36"
|
||||
android:textColor="#333"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_road_name" />
|
||||
</LinearLayout>
|
||||
|
Loading…
x
Reference in New Issue
Block a user