fix: 修改了寻宝逻辑代码
This commit is contained in:
@@ -9,8 +9,8 @@ android {
|
||||
applicationId "com.navinfo.outdoor"
|
||||
minSdkVersion 22
|
||||
targetSdkVersion 30
|
||||
versionCode 4
|
||||
versionName "4.0"
|
||||
versionCode 5
|
||||
versionName "5.0"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
lintOptions {
|
||||
|
||||
@@ -41,7 +41,6 @@ public class HomeActivity extends BaseActivity{
|
||||
private TabLayout mTab;
|
||||
private final String[] names = {"寻宝", "记录", "发现", "我的"};
|
||||
private final int[] pic = {R.drawable.selector_map,R.drawable.selector_task,R.drawable.selector_article,R.drawable.selector_mine};
|
||||
private RecordFragment recordFragment;
|
||||
private boolean isBack=false;
|
||||
private Handler handler = new Handler(new Handler.Callback() {
|
||||
@Override
|
||||
@@ -76,7 +75,7 @@ public class HomeActivity extends BaseActivity{
|
||||
NoSlideViewPager mViewPager = findViewById(R.id.no_slide_view_pager);
|
||||
ArrayList<Fragment> fragments = new ArrayList<>();
|
||||
fragments.add(new TreasureFragment());
|
||||
recordFragment = new RecordFragment();
|
||||
RecordFragment recordFragment = new RecordFragment();
|
||||
fragments.add(recordFragment);
|
||||
fragments.add(new FindFragment());
|
||||
fragments.add(new MineFragment());
|
||||
@@ -109,20 +108,24 @@ public class HomeActivity extends BaseActivity{
|
||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
}else if (tab.getPosition()==1){
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.STAY_SUBMIT_ITEM;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
Message obtain1 = Message.obtain();
|
||||
obtain1.what = Constant.HAS_SUBMIT_ITEM;
|
||||
obtain1.obj = true;
|
||||
EventBus.getDefault().post(obtain1);
|
||||
|
||||
} else if (tab.getPosition()==3){
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.HOME_MINE;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
}
|
||||
}
|
||||
//点击table layout效果
|
||||
|
||||
@@ -12,6 +12,7 @@ import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
@@ -46,8 +47,7 @@ import java.util.Date;
|
||||
* 登录页
|
||||
*/
|
||||
public class LoginActivity extends BaseActivity implements View.OnClickListener {
|
||||
private android.widget.EditText etLoginName;
|
||||
private android.widget.EditText etLoginPaw;
|
||||
private EditText etLoginName, etLoginPaw;
|
||||
private SharedPreferences.Editor navInfoEditor;
|
||||
private CheckBox cbStatement;
|
||||
private Handler handler = new Handler(new Handler.Callback() {
|
||||
@@ -106,7 +106,6 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
public void onEvent(Message data) {
|
||||
if (data.what == Constant.REGISTER_WORD) {
|
||||
if ((boolean) data.obj) {
|
||||
|
||||
etLoginName.setText(Constant.USER_NAME);
|
||||
etLoginPaw.setText(Constant.PASS_WORD);
|
||||
}
|
||||
@@ -163,7 +162,6 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
Message message = new Message();
|
||||
message.what = 0x103;
|
||||
handler.sendMessageDelayed(message, 500);
|
||||
|
||||
String name = etLoginName.getText().toString().trim();
|
||||
if (name.equals("")) {
|
||||
Toast.makeText(this, "请输入账号", Toast.LENGTH_SHORT).show();
|
||||
@@ -224,11 +222,11 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
Constant.REFRESH_TOKEN = body.getRefresh_token();
|
||||
Constant.USHERED = body.getUserId();
|
||||
Constant.PASS_WORD = paw;
|
||||
loginBuilder.append("登录获取token ,");
|
||||
initGetUserInfo();//获取用户信息
|
||||
} else {
|
||||
Toast.makeText(LoginActivity.this, response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -243,7 +241,8 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
}
|
||||
|
||||
private void initGetUserInfo() {
|
||||
OkGoBuilder.getInstance().Builder(this)
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(this)
|
||||
.url(HttpInterface.USER_DETAIL_BY_USER_ID)
|
||||
.token(Constant.ACCESS_TOKEN)
|
||||
.params(new HttpParams())
|
||||
@@ -290,9 +289,11 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
navInfoEditor.commit();
|
||||
int needGuide = body.getNeedGuide();//0不需要 1需要
|
||||
if (needGuide == 1) {
|
||||
loginBuilder.append("进入介绍页 ,");
|
||||
Intent intent = new Intent(LoginActivity.this, GuidanceActivity.class);
|
||||
startActivity(intent);
|
||||
} else {
|
||||
loginBuilder.append("登录成功 ,");
|
||||
Toast.makeText(LoginActivity.this, "登录成功", Toast.LENGTH_SHORT).show();
|
||||
Intent intent = new Intent(LoginActivity.this, HomeActivity.class);
|
||||
startActivity(intent);
|
||||
@@ -303,6 +304,7 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
Toast.makeText(LoginActivity.this, response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
@@ -314,6 +316,7 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
@Override
|
||||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -61,7 +61,6 @@ public class PhotographActivity extends BaseActivity implements View.OnClickList
|
||||
private File logFile;
|
||||
private StringBuilder photographBuilder;
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v.getId() == R.id.capture_picture) {
|
||||
@@ -191,19 +190,8 @@ public class PhotographActivity extends BaseActivity implements View.OnClickList
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.PICTURE_VIDEO_WORD;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(Message data) {
|
||||
|
||||
}
|
||||
public void onEvent(Message data) { }
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
|
||||
@@ -156,7 +156,7 @@ public class Constant {
|
||||
public static SlidingUpPanelLayout SLIDING_LAYOUT = null;//設置
|
||||
public static boolean IS_FILTER_LIST_ITEM = true;//poi页面的查重
|
||||
public static TencentMap.OnMarkerClickListener markerClickListener = null;
|
||||
public static final String NAVIN_FO = "10.29";//版本日期
|
||||
public static final String NAVIN_FO = "11.01";//版本日期
|
||||
//marker
|
||||
public static final BitmapDescriptor MARKER_POI_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_show);
|
||||
public static final BitmapDescriptor MARKER_CHARGE_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_show);
|
||||
@@ -179,8 +179,6 @@ public class Constant {
|
||||
public static final BitmapDescriptor GRAY_OTHER= BitmapDescriptorFactory.fromResource(R.drawable.grayother);
|
||||
public static final BitmapDescriptor GRAY_FACET= BitmapDescriptorFactory.fromResource(R.drawable.grayfacet);
|
||||
public static final BitmapDescriptor ICON_OPERATION=BitmapDescriptorFactory.fromResource(R.mipmap.icon_operation);
|
||||
|
||||
|
||||
/*
|
||||
*联系我们的QQ群名称和QQ群号
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -93,6 +94,7 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import okhttp3.Response;
|
||||
|
||||
/**
|
||||
* 充电站的Fragment
|
||||
* 2021-5-25
|
||||
@@ -122,7 +124,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
private LinearLayout linearContact;
|
||||
private ContactView contactView;
|
||||
private ArrayList<File> chargingStationList;
|
||||
String str = "";
|
||||
private NestedScrollView nestedScrollView;
|
||||
private Marker markerStation;
|
||||
private Point screenStationPositions;
|
||||
@@ -302,7 +303,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
markerStation.setIcon(stationDescriptor);
|
||||
checkBoxLife.setText("编辑");
|
||||
checkBoxLife.setTextColor(Color.BLACK);
|
||||
if (screenStationPositions.x!=0||screenStationPositions.y!=0){
|
||||
if (screenStationPositions.x != 0 || screenStationPositions.y != 0) {
|
||||
latLng = tencentMap.getProjection().fromScreenLocation(screenStationPositions);
|
||||
}
|
||||
markerStation.setPosition(latLng);
|
||||
@@ -390,7 +391,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
ivElse.setImageDrawable(null);
|
||||
if (tvElse.getTag()!=null){
|
||||
if (tvElse.getTag() != null) {
|
||||
File file = new File((String) tvElse.getTag());
|
||||
file.delete();
|
||||
tvElse.setTag(null);
|
||||
@@ -409,7 +410,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
ivScutcheon.setImageDrawable(null);
|
||||
if (tvScutcheon.getTag()!=null){
|
||||
if (tvScutcheon.getTag() != null) {
|
||||
File file = new File((String) tvScutcheon.getTag());
|
||||
file.delete();
|
||||
tvScutcheon.setTag(null);
|
||||
@@ -428,7 +429,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
ivPanorama.setImageDrawable(null);
|
||||
if (tvPanorama.getTag()!=null){
|
||||
if (tvPanorama.getTag() != null) {
|
||||
File file = new File((String) tvPanorama.getTag());
|
||||
file.delete();
|
||||
tvPanorama.setTag(null);
|
||||
@@ -447,7 +448,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
ivName.setImageDrawable(null);
|
||||
if (tvNamePic.getTag()!=null){
|
||||
if (tvNamePic.getTag() != null) {
|
||||
File file = new File((String) tvNamePic.getTag());
|
||||
file.delete();
|
||||
tvNamePic.setTag(null);
|
||||
@@ -466,7 +467,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
ivInternal.setImageDrawable(null);
|
||||
if (tvInternal.getTag()!=null){
|
||||
if (tvInternal.getTag() != null) {
|
||||
File file = new File((String) tvInternal.getTag());
|
||||
file.delete();
|
||||
tvInternal.setTag(null);
|
||||
@@ -484,7 +485,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
// 添加信息:
|
||||
assert getArguments() != null;
|
||||
showPoiEntity = (PoiEntity) getArguments().getSerializable("poiEntity");
|
||||
if (showPoiEntity!=null){
|
||||
if (showPoiEntity != null) {
|
||||
if (showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 5) {
|
||||
tvExamine.setVisibility(View.GONE);
|
||||
} else {
|
||||
@@ -641,9 +642,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
|
||||
if (showPoiEntity.getTaskStatus() == 3) {
|
||||
disables();
|
||||
}
|
||||
|
||||
initPile();
|
||||
}
|
||||
}
|
||||
@@ -696,11 +699,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
Constant.CODE = code;
|
||||
Constant.TelLength = telLength;
|
||||
/*for (int i = 0; i < poiBeans.size(); i++) {
|
||||
poiBeans.get(i).setArea(Constant.CODE);
|
||||
}
|
||||
contactView = new ContactView(getActivity(), linearContact, poiBeans);
|
||||
contactView.resetView();*/
|
||||
return false;
|
||||
}
|
||||
});
|
||||
@@ -837,7 +835,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
initRoadSaveLocal(false);
|
||||
break;
|
||||
case R.id.btn_uploading:
|
||||
chargingStationBuilder.append("点击了保存本地的按钮 ,");
|
||||
chargingStationBuilder.append("点击了上传的按钮 ,");
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj = false;
|
||||
@@ -1094,7 +1092,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
@Override
|
||||
public void run() {
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
||||
if (getActivity()!=null){
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -1109,6 +1107,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDenied(List<String> permissions, boolean never) {
|
||||
if (never) {
|
||||
@@ -1121,13 +1120,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
|
||||
private void stationUploadByNetWork(PoiEntity poiEntity, ArrayList<File> chargingStationList) {
|
||||
if (poiEntity != null ) {
|
||||
if (poiEntity.getTaskId()==0){
|
||||
Toast.makeText(getActivity(), "没有保存本地", Toast.LENGTH_SHORT).show();
|
||||
Log.e("TAG", "poiUploadByNetWork: " + poiEntity.getBodyId() + chargingStationList);
|
||||
return;
|
||||
}
|
||||
}else {
|
||||
if (poiEntity == null) {
|
||||
Toast.makeText(getActivity(), "没有保存本地", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
@@ -1199,14 +1192,13 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
||||
// 充电站数据已经保存在服务上,批量保存充电桩数据
|
||||
saveChargingPileByChargingStation(poiEntity);
|
||||
if (getActivity()!=null){
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (isLocal) {
|
||||
stationUploadByNetWork(poiEntity, chargingStationList);
|
||||
Constant.isPresent = false;
|
||||
// chargingPileUploadNetWork(chargingPileBody, fileList);
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
|
||||
Message obtain = Message.obtain();
|
||||
@@ -1260,17 +1252,14 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
editNameContent.setTextColor(Color.BLACK);
|
||||
btnSaveLocal.setEnabled(true);
|
||||
btnUploading.setEnabled(true);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
List<String> body = taskNameBean.getBody();
|
||||
if (body != null) {
|
||||
if (body != null) {
|
||||
for (int i = 0; i < body.size(); i++) {
|
||||
str += body.get(i) + ",";
|
||||
}
|
||||
if (str != null) {
|
||||
Toast.makeText(getActivity(), "存在类似名称---" + str, Toast.LENGTH_SHORT).show();
|
||||
str = "";
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "没有类似名称可以作业", Toast.LENGTH_SHORT).show();
|
||||
stringBuilder.append(body.get(i)).append(";");
|
||||
}
|
||||
Toast.makeText(getActivity(), "不允许新增上报. 存在类似名称--" + stringBuilder.toString(), Toast.LENGTH_SHORT).show();
|
||||
editNameContent.setText(null);
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "没有类似名称可以作业", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@@ -1337,7 +1326,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
assert file != null;
|
||||
File videoFile = new File(file);
|
||||
if (videoFile.exists()) {
|
||||
if (tvPanorama.getTag()!=null){
|
||||
if (tvPanorama.getTag() != null) {
|
||||
File filePanorama = new File((String) tvPanorama.getTag());
|
||||
filePanorama.delete();
|
||||
tvPanorama.setTag(null);
|
||||
@@ -1351,7 +1340,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
assert file != null;
|
||||
File videoFile = new File(file);
|
||||
if (videoFile.exists()) {
|
||||
if (tvNamePic.getTag()!=null){
|
||||
if (tvNamePic.getTag() != null) {
|
||||
File fileName = new File((String) tvNamePic.getTag());
|
||||
fileName.delete();
|
||||
tvNamePic.setTag(null);
|
||||
@@ -1365,7 +1354,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
assert file != null;
|
||||
File videoFile = new File(file);
|
||||
if (videoFile.exists()) {
|
||||
if (tvInternal.getTag()!=null){
|
||||
if (tvInternal.getTag() != null) {
|
||||
File fileInternal = new File((String) tvInternal.getTag());
|
||||
fileInternal.delete();
|
||||
tvInternal.setTag(null);
|
||||
@@ -1379,7 +1368,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
assert file != null;
|
||||
File videoFile = new File(file);
|
||||
if (videoFile.exists()) {
|
||||
if (tvElse.getTag()!=null){
|
||||
if (tvElse.getTag() != null) {
|
||||
File fileElse = new File((String) tvElse.getTag());
|
||||
fileElse.delete();
|
||||
tvElse.setTag(null);
|
||||
@@ -1393,7 +1382,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
assert file != null;
|
||||
File videoFile = new File(file);
|
||||
if (videoFile.exists()) {
|
||||
if (tvScutcheon.getTag()!=null){
|
||||
if (tvScutcheon.getTag() != null) {
|
||||
File fileScutcheon = new File((String) tvScutcheon.getTag());
|
||||
fileScutcheon.delete();
|
||||
tvScutcheon.setTag(null);
|
||||
@@ -1406,7 +1395,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传充电桩数据到服务端
|
||||
* 保存充电桩数据到服务端
|
||||
*/
|
||||
private void saveChargingPileByWork(ChargingPileEntity chargingPileEntity, int bodyId) {
|
||||
HttpParams httpParams = new HttpParams();
|
||||
@@ -1458,7 +1447,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
@Override
|
||||
public void run() {
|
||||
if (showPoiEntity != null) {
|
||||
if (showPoiEntity.getId()!=null){
|
||||
if (showPoiEntity.getId() != null) {
|
||||
List<ChargingPileEntity> chargingPileEntityList = PoiDatabase.getInstance(getActivity()).getChargingPileDao().getChargingPileByStationId(showPoiEntity.getId());
|
||||
if (chargingPileEntityList != null && !chargingPileEntityList.isEmpty()) {
|
||||
for (ChargingPileEntity chargingPileEntity : chargingPileEntityList) {
|
||||
@@ -1546,7 +1535,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
removablesLocality.clear();
|
||||
|
||||
chargingStationBuilder.append("onDestroy ,");
|
||||
chargingStationBuilder.append("onDestroy ");
|
||||
chargingStationBuilder.append("\r\n");
|
||||
FileUtils.writeFile(logFile.getAbsolutePath(), chargingStationBuilder.toString(), true);
|
||||
}
|
||||
@@ -1573,7 +1562,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (showPoiEntity!=null){
|
||||
if (showPoiEntity != null) {
|
||||
List<ChargingPileEntity> chargingPileEntityList = PoiDatabase.getInstance(getActivity()).getChargingPileDao().getChargingPileByStationId(showPoiEntity.getId());
|
||||
if (chargingPileEntityList != null && !chargingPileEntityList.isEmpty()) {
|
||||
for (ChargingPileEntity chargingPileEntity : chargingPileEntityList) {
|
||||
|
||||
@@ -108,10 +108,10 @@ public class FindFragment extends BaseFragment implements View.OnClickListener{
|
||||
break;
|
||||
case R.id.linear_end:
|
||||
findBuilder.append("点击了帮助中心:能力测评 ,");
|
||||
// Toast.makeText(getContext(), "该功能以后上新,敬请期待", Toast.LENGTH_SHORT).show();
|
||||
Intent endIntent = new Intent(getActivity(), FragmentManagement.class);
|
||||
Toast.makeText(getContext(), "该功能以后上新,敬请期待", Toast.LENGTH_SHORT).show();
|
||||
/* Intent endIntent = new Intent(getActivity(), FragmentManagement.class);
|
||||
endIntent.putExtra("tag", 11);
|
||||
startActivity(endIntent);
|
||||
startActivity(endIntent);*/
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
@@ -891,7 +891,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
PoiEntity poiListEntity = new PoiEntity();
|
||||
poiListEntity.setTaskId(poiEntity.getTaskId());
|
||||
poiListEntity.setName(listBean.getName());
|
||||
poiListEntity.setDescribe(listBean.getMemo());
|
||||
poiListEntity.setMemo(listBean.getMemo());
|
||||
poiListEntity.setCreateTime(listBean.getEndDate());
|
||||
poiListEntity.setAddress(listBean.getAddress());
|
||||
poiListEntity.setType(listBean.getType());
|
||||
|
||||
@@ -328,17 +328,13 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
Toast.makeText(getContext(), "识别失败,可以重新识别或则进行手动输入", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
if (bankCardBean.getResult() != null && bankCardBean.getResult().getBank_card_number() != null) {
|
||||
String bank_card_number = bankCardBean.getResult().getBank_card_number().trim();
|
||||
String bankCardNumber = bankCardBean.getResult().getBank_card_number().trim();
|
||||
String bank_card_number = bankCardNumber.replace(" ", "");
|
||||
if (StringUtils.isEmpty(bank_card_number)) {
|
||||
Toast.makeText(getActivity(), "识别失败,可以重新识别或则进行手动输入", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
etBankNum.setText(bank_card_number);
|
||||
if (bank_card_number.contains(" ")){
|
||||
Log.d("TAG", "onActivityResult: 包含空格");
|
||||
}else {
|
||||
Log.d("TAG", "onActivityResult: 不包含空格");
|
||||
}
|
||||
// String bankName = bankCardBean.getResult().getBank_name();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "识别失败,可以重新识别或则进行手动输入", Toast.LENGTH_SHORT).show();
|
||||
|
||||
@@ -64,8 +64,6 @@ public class MessageFragment extends BaseFragment implements View.OnClickListen
|
||||
messageFinal.setOnClickListener(this);
|
||||
XRecyclerView messageRecycler = (XRecyclerView) findViewById(R.id.message_recycler);
|
||||
messageRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
TextView tvRoad = findViewById(R.id.tv_read);
|
||||
tvRoad.setOnClickListener(this);
|
||||
messageRecycler.addItemDecoration(new DividerItemDecoration(Objects.requireNonNull(getActivity()), DividerItemDecoration.VERTICAL));
|
||||
messageRecycler.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
|
||||
messageRecycler.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
|
||||
@@ -156,14 +154,9 @@ public class MessageFragment extends BaseFragment implements View.OnClickListen
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.message_final:
|
||||
messageBuilder.append("点击返回,");
|
||||
Objects.requireNonNull(getActivity()).finish();
|
||||
break;
|
||||
case R.id.tv_read:
|
||||
messageBuilder.append("点击全部领取,");
|
||||
break;
|
||||
if (v.getId() == R.id.message_final) {
|
||||
messageBuilder.append("点击返回,");
|
||||
Objects.requireNonNull(getActivity()).finish();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -768,13 +768,9 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
String format = formatter.format(calendar.getTime());
|
||||
poiEntity.setCreateTime(format);
|
||||
poiEntity.setType(3);
|
||||
if (fmPoiVideoPic.getTag() == null) {
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
if (fileListByUUID != null) {
|
||||
fmPoiVideoPic.setTag(fileListByUUID);
|
||||
}
|
||||
}
|
||||
if (fmPoiVideoPic.getTag() != null && !((List<File>) fmPoiVideoPic.getTag()).isEmpty()) {
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
if (fileListByUUID != null) {
|
||||
fmPoiVideoPic.setTag(fileListByUUID);
|
||||
List<LatLng> lineStringByFileList = AWMp4ParserHelper.getInstance().getLinePhotoByList((List<File>) fmPoiVideoPic.getTag());
|
||||
String lineString = Geohash.getInstance().encodeList(lineStringByFileList);
|
||||
String photoStr = AWMp4ParserHelper.getInstance().getVideoFileListStr((List<File>) fmPoiVideoPic.getTag());
|
||||
@@ -783,6 +779,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
poiEntity.setGeoWkt(lineString);
|
||||
}
|
||||
}
|
||||
|
||||
return poiEntity;
|
||||
}
|
||||
|
||||
|
||||
@@ -199,20 +199,20 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
DateFormat formatter = new SimpleDateFormat("yyyyMMdd");
|
||||
String newFormat = formatter.format(new Date(System.currentTimeMillis()));
|
||||
String pictures_time = sharedPreferences.getString("pictures_time", null);
|
||||
if (pictures_time==null){
|
||||
sharedEdit.putString("pictures_time",newFormat);
|
||||
if (pictures_time == null) {
|
||||
sharedEdit.putString("pictures_time", newFormat);
|
||||
sharedEdit.apply();
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
}else {
|
||||
if (pictures_time.equals(newFormat)){
|
||||
} else {
|
||||
if (pictures_time.equals(newFormat)) {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + pictures_time + ".txt");
|
||||
}else {
|
||||
} else {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
}
|
||||
}
|
||||
roadBuilder = new StringBuilder();
|
||||
roadBuilder.append("RoadActivity-onCreate-initData ,");
|
||||
if (Constant.USHERED!=null){
|
||||
if (Constant.USHERED != null) {
|
||||
roadBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||
}
|
||||
}
|
||||
@@ -259,26 +259,25 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
moveLatlng(latLng, null);
|
||||
}
|
||||
}
|
||||
String describe = showPoiEntity.getDescribe();//任务描述
|
||||
String describe = showPoiEntity.getMemo();//任务描述
|
||||
if (describe != null && !describe.equals("")) {
|
||||
etDesc.setText(describe);
|
||||
}
|
||||
String photoList = showPoiEntity.getPhoto();//存儲在數據庫中的數據
|
||||
if (!StringUtils.isEmpty(photoList)) {
|
||||
if (!StringUtils.isEmpty(photoList)) {
|
||||
boolean isImageLoad = false;
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
if (fileListByUUID.get(i).getPath().contains(".webp") && !fileListByUUID.get(i).getPath().contains("paper.txt")) {
|
||||
if (fileListByUUID.get(i).exists() && !isImageLoad) {
|
||||
// 使用glide加载视频的第一帧
|
||||
Glide.with(Objects.requireNonNull(getActivity())).load(fileListByUUID.get(i)).into(ivRoadPicture);
|
||||
isImageLoad = true;
|
||||
}
|
||||
boolean isImageLoad = false;
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
if (fileListByUUID.get(i).getPath().contains(".webp") && !fileListByUUID.get(i).getPath().contains("paper.txt")) {
|
||||
if (fileListByUUID.get(i).exists() && !isImageLoad) {
|
||||
// 使用glide加载视频的第一帧
|
||||
Glide.with(Objects.requireNonNull(getActivity())).load(fileListByUUID.get(i)).into(ivRoadPicture);
|
||||
isImageLoad = true;
|
||||
}
|
||||
}
|
||||
fmRoadPic.setTag(fileListByUUID);
|
||||
}
|
||||
fmRoadPic.setTag(fileListByUUID);
|
||||
}
|
||||
/* String[] photos = photoList.split(",");
|
||||
List<File> videoFileList = new ArrayList<>();
|
||||
boolean isImageLoad = false;
|
||||
@@ -298,7 +297,6 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
}
|
||||
fmRoadPic.setTag(videoFileList);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
assert showPoiEntity != null;
|
||||
if (showPoiEntity.getTaskStatus() == 3) {
|
||||
@@ -368,10 +366,10 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
LatLng startLatLng = new LatLng(latitude, longitude); //用户当前位置
|
||||
double geometry = GeometryTools.distanceToDouble(startLatLng, latLng);
|
||||
double rearGeometry = GeometryTools.distanceToDouble(startLatLng, rearLatLng);
|
||||
if (geometry>5000||rearGeometry>5000){
|
||||
if (geometry > 5000 || rearGeometry > 5000) {
|
||||
Toast.makeText(getActivity(), "用户距离作业起点或者终点五公里以内才能拍摄", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}else {
|
||||
} else {
|
||||
Intent intent = new Intent(getContext(), PicturesActivity.class);
|
||||
File finalFile = AWMp4ParserHelper.getInstance().obtainWebpFilePath(new File(Constant.PICTURE_FOLDER, showPoiEntity.getId()).getAbsolutePath());
|
||||
intent.putExtra(Constant.INTENT_JPG_PATH, finalFile.getAbsolutePath());
|
||||
@@ -392,8 +390,8 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
public void run() {
|
||||
ZipUtil.zipFiles(videoFileList, fileZip, null);//压缩
|
||||
long zipTrueSize = ZipUtils.getZipTrueSize(fileZip.getAbsolutePath());
|
||||
if (zipTrueSize>0){
|
||||
if (getActivity()!=null){
|
||||
if (zipTrueSize > 0) {
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -409,8 +407,8 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
}
|
||||
});
|
||||
}
|
||||
}else {
|
||||
if (getActivity()!=null){
|
||||
} else {
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -466,6 +464,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDenied(List<String> permissions, boolean never) {
|
||||
if (never) {
|
||||
@@ -533,7 +532,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
@Override
|
||||
public void run() {
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
||||
if (getActivity()!=null){
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -626,7 +625,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
if (showPoiEntity.getTaskStatus() == 5) {
|
||||
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
|
||||
} else if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
|
||||
if (showPoiEntity.getId()!=null){
|
||||
if (showPoiEntity.getId() != null) {
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
fileListByUUID.get(i).delete();
|
||||
@@ -697,7 +696,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
poiDao.deletePoiEntity(poiEntity);
|
||||
}
|
||||
}).start();
|
||||
if (poiEntity.getId()!=null){
|
||||
if (poiEntity.getId() != null) {
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(poiEntity.getId());
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
fileListByUUID.get(i).delete();
|
||||
@@ -745,7 +744,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
}
|
||||
sb.append("-").append(formats);
|
||||
poiEntity.setName(sb.toString());
|
||||
if (getActivity()!=null){
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -765,22 +764,18 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
String format = formatter.format(calendar.getTime());
|
||||
poiEntity.setCreateTime(format);
|
||||
poiEntity.setType(4);
|
||||
if (fmRoadPic.getTag() == null) {
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
if (fileListByUUID != null) {
|
||||
fmRoadPic.setTag(fileListByUUID);
|
||||
}
|
||||
}
|
||||
if (fmRoadPic.getTag() != null && !((List<File>) fmRoadPic.getTag()).isEmpty()) {
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
if (fileListByUUID != null) {
|
||||
fmRoadPic.setTag(fileListByUUID);
|
||||
List<LatLng> lineStringByFileList = AWMp4ParserHelper.getInstance().getLinePhotoByList((List<File>) fmRoadPic.getTag());
|
||||
String encodeList = Geohash.getInstance().encodeList(lineStringByFileList);
|
||||
Log.d("TAG", "onGranted: " + encodeList);
|
||||
String photoStr = AWMp4ParserHelper.getInstance().getVideoFileListStr((List<File>) fmRoadPic.getTag());
|
||||
poiEntity.setPhoto(photoStr);
|
||||
if (encodeList != null) {
|
||||
poiEntity.setGeoWkt(encodeList);
|
||||
}
|
||||
}
|
||||
|
||||
return poiEntity;
|
||||
}
|
||||
|
||||
|
||||
@@ -895,7 +895,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
String geo = Geohash.getInstance().decode(geoWkt);//解密geo
|
||||
Geometry geometry = GeometryTools.createGeometry(geo);
|
||||
switch (geometry.getGeometryType()) {
|
||||
case "Point": //点
|
||||
case "Point" : //点
|
||||
latLng = GeometryTools.createLatLng(geo);
|
||||
break;
|
||||
case "LineString": //线
|
||||
|
||||
@@ -3,9 +3,9 @@ package com.navinfo.outdoor.http;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
|
||||
public class HttpInterface {
|
||||
public static final String IP_= "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
|
||||
public static final String IP= "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
|
||||
|
||||
public static final String IP= "http://dtxbmaps.navinfo.com/dtxb_test/m4";//测试接口
|
||||
public static final String IP_= "http://dtxbmaps.navinfo.com/dtxb_test/m4";//测试接口
|
||||
|
||||
public static final String USER_PATH ="/user/";//我的
|
||||
public static final String MSG_LIST_PATH ="/msgList/";//发现
|
||||
|
||||
@@ -55,9 +55,8 @@ public class ZipUtils{
|
||||
* @param resFileList 要压缩的文件(夹)列表
|
||||
* @param zipFile 生成的压缩文件
|
||||
* @param comment 压缩文件的注释
|
||||
* @param zipListener zipListener
|
||||
*/
|
||||
public static void zipFiles(Collection<File> resFileList, File zipFile, String comment, com.github.lazylibrary.util.ZipUtil.ZipListener zipListener)
|
||||
public static void zipFiles(Collection<File> resFileList, File zipFile, String comment)
|
||||
{
|
||||
ZipOutputStream zipout = null;
|
||||
try {
|
||||
|
||||
@@ -23,6 +23,12 @@
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:src="@drawable/ic_baseline_arrow" />
|
||||
<TextView
|
||||
android:id="@+id/tv_event"
|
||||
android:layout_width="wrap_content"
|
||||
style="@style/text_style_toolbar_title"
|
||||
android:layout_toRightOf="@id/iv_find_task"
|
||||
android:text="活动专区" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
|
||||
@@ -5,46 +5,38 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".fragment.MessageFragment">
|
||||
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
android:id="@+id/rl_message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#fff"
|
||||
android:background="@color/colorPrimaryBlue"
|
||||
android:paddingTop="@dimen/top_pind_sp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/message_final"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/ic_arrow_left" />
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="45dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:src="@drawable/ic_baseline_arrow"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_message"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="50dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_toRightOf="@id/iv_find_task"
|
||||
android:gravity="center"
|
||||
android:text="消息"
|
||||
android:textColor="#000" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_read"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="20dp"
|
||||
android:visibility="gone"
|
||||
android:layout_marginRight="10dp"
|
||||
android:text="全部已读"
|
||||
android:textColor="@color/black" />
|
||||
</RelativeLayout>
|
||||
android:textColor="#fff"
|
||||
android:textSize="17sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.jcodecraeer.xrecyclerview.XRecyclerView
|
||||
android:id="@+id/message_recycler"
|
||||
|
||||
Reference in New Issue
Block a user