添加log日志,提现 财务提现
This commit is contained in:
parent
9c0a60791b
commit
c86c914a9b
@ -37,8 +37,13 @@ import com.navinfo.outdoor.util.RegexUtil;
|
||||
|
||||
import org.json.JSONArray;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 用户资料
|
||||
@ -52,6 +57,8 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
private EditText etPhone, etQq, etMailbox;
|
||||
private String region_id;
|
||||
private SharedPreferences.Editor navInfoEditor;
|
||||
private File logFile;
|
||||
private StringBuilder userBuilder;
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
@ -61,6 +68,28 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
SharedPreferences sharedPreferences = this.getSharedPreferences(Constant.MESSAGE_TYPE, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor sharedEdit = sharedPreferences.edit();
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
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);
|
||||
sharedEdit.apply();
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
} else {
|
||||
if (pictures_time.equals(newFormat)) {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + pictures_time + ".txt");
|
||||
} else {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
}
|
||||
}
|
||||
userBuilder = new StringBuilder();
|
||||
userBuilder.append("UserFragment-onCreate-initData ,");
|
||||
if (Constant.USHERED != null) {
|
||||
userBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("CommitPrefEdits")
|
||||
@ -115,9 +144,11 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.iv_user:
|
||||
userBuilder.append("点击了用户资料的返回 ,");
|
||||
finish();
|
||||
break;
|
||||
case R.id.btn_gathering:
|
||||
userBuilder.append("点击了去绑定的返回 ,");
|
||||
if (Constant.AUDIOTAPES == -1) {
|
||||
Toast.makeText(this, "请先实名认证", Toast.LENGTH_SHORT).show();
|
||||
} else if (Constant.AUDIOTAPES == 1) {//认证通过
|
||||
@ -129,19 +160,24 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
}
|
||||
break;
|
||||
case R.id.btn_attestations:
|
||||
userBuilder.append("点击了去认证的返回 ,");
|
||||
Intent attestationIntent = new Intent(this, FragmentManagement.class);
|
||||
attestationIntent.putExtra("tag", 25);
|
||||
startActivity(attestationIntent);
|
||||
break;
|
||||
case R.id.ll_region:
|
||||
userBuilder.append("点击了所在区域 ,");
|
||||
showPickerView();
|
||||
break;
|
||||
case R.id.edit_qq:
|
||||
userBuilder.append("请输入qq ,");
|
||||
// qq();
|
||||
break;
|
||||
case R.id.edit_mailbox:
|
||||
userBuilder.append("请输入电子邮件 ,");
|
||||
break;
|
||||
case R.id.btn_save:
|
||||
userBuilder.append("点击了保存的按钮 ,");
|
||||
if (Constant.ID_NUM == null) {
|
||||
Toast.makeText(this, "请先实名认证", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
@ -194,6 +230,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
netWork(httpParams);
|
||||
break;
|
||||
case R.id.btn_weChat_binding:
|
||||
userBuilder.append("点击了微信 去提交的按钮 ,");
|
||||
Toast.makeText(this, "此功能未开通", Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
}
|
||||
@ -343,4 +380,21 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
return detail;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
userBuilder.append("onPause ,");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
userBuilder.append("onStop ,");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
userBuilder.append("onDestroy ,");
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Color;
|
||||
@ -26,6 +28,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.github.lazylibrary.util.FileUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.hjq.permissions.OnPermissionCallback;
|
||||
import com.hjq.permissions.Permission;
|
||||
@ -60,7 +63,10 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@ -92,6 +98,8 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
private Marker markerPile;
|
||||
private Point screenPilePositions;
|
||||
private ChargingPileEntity chargingPileEntity;
|
||||
private File logFile;
|
||||
private StringBuilder chargingPileBuilder;
|
||||
|
||||
public static ChargingPileFragment newInstance(Bundle bundle) {
|
||||
ChargingPileFragment fragment = new ChargingPileFragment();
|
||||
@ -723,7 +731,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
}*/
|
||||
|
||||
public void setCList(ArrayList<String> list) {
|
||||
switch (list.size()) {
|
||||
case 1:
|
||||
@ -815,6 +822,28 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
SharedPreferences sharedPreferences = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.MESSAGE_TYPE, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor sharedEdit = sharedPreferences.edit();
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
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);
|
||||
sharedEdit.apply();
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
} else {
|
||||
if (pictures_time.equals(newFormat)) {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + pictures_time + ".txt");
|
||||
} else {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
}
|
||||
}
|
||||
chargingPileBuilder = new StringBuilder();
|
||||
chargingPileBuilder.append("ChargingPileActivity-onCreate-initData ,");
|
||||
if (Constant.USHERED != null) {
|
||||
chargingPileBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -891,6 +920,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
});
|
||||
break;
|
||||
case R.id.rl_panorama:
|
||||
chargingPileBuilder.append("点击了全景照片进行拍照,");
|
||||
Intent intentPanorama = new Intent(getActivity(), PhotographActivity.class);
|
||||
File panoramaFile = PhotoUtils.showPhotoFile("a", latLng);
|
||||
intentPanorama.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
@ -898,6 +928,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
startActivityForResult(intentPanorama, 101);
|
||||
break;
|
||||
case R.id.rl_coding:
|
||||
chargingPileBuilder.append("点击了充电桩编码进行拍照,");
|
||||
Intent intentCoding = new Intent(getActivity(), PhotographActivity.class);
|
||||
File codingFile = PhotoUtils.showPhotoFile("b", latLng);
|
||||
intentCoding.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
@ -905,6 +936,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
startActivityForResult(intentCoding, 102);
|
||||
break;
|
||||
case R.id.rl_equipment:
|
||||
chargingPileBuilder.append("点击了设备标牌进行拍照,");
|
||||
Intent intentEquipment = new Intent(getActivity(), PhotographActivity.class);
|
||||
File equipmentFile = PhotoUtils.showPhotoFile("c", latLng);
|
||||
intentEquipment.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
@ -913,6 +945,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
|
||||
break;
|
||||
case R.id.rl_facility:
|
||||
chargingPileBuilder.append("点击了设备标牌进行拍照,");
|
||||
Intent intentFacility = new Intent(getActivity(), PhotographActivity.class);
|
||||
File facilityFile = PhotoUtils.showPhotoFile("c", latLng);
|
||||
intentFacility.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
@ -920,6 +953,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
startActivityForResult(intentFacility, 104);
|
||||
break;
|
||||
case R.id.rl_scutcheon:
|
||||
chargingPileBuilder.append("点击了设备标牌进行拍照,");
|
||||
Intent intentScutcheon = new Intent(getActivity(), PhotographActivity.class);
|
||||
File scutcheonFile = PhotoUtils.showPhotoFile("c", latLng);
|
||||
intentScutcheon.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
@ -927,6 +961,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
startActivityForResult(intentScutcheon, 105);
|
||||
break;
|
||||
case R.id.rl_device:
|
||||
chargingPileBuilder.append("点击了设备标牌进行拍照,");
|
||||
Intent intentDevice = new Intent(getActivity(), PhotographActivity.class);
|
||||
File deviceFile = PhotoUtils.showPhotoFile("c", latLng);
|
||||
intentDevice.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
@ -934,6 +969,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
startActivityForResult(intentDevice, 106);
|
||||
break;
|
||||
case R.id.rl_usable:
|
||||
chargingPileBuilder.append("点击了可用状态进行拍照,");
|
||||
Intent intentUsable = new Intent(getActivity(), PhotographActivity.class);
|
||||
File usableFile = PhotoUtils.showPhotoFile("d", latLng);
|
||||
intentUsable.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
@ -941,6 +977,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
startActivityForResult(intentUsable, 107);
|
||||
break;
|
||||
case R.id.rl_available:
|
||||
chargingPileBuilder.append("点击了可用专题进行拍照,");
|
||||
Intent intentAvailable = new Intent(getActivity(), PhotographActivity.class);
|
||||
File availableFile = PhotoUtils.showPhotoFile("d", latLng);
|
||||
intentAvailable.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
@ -948,6 +985,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
startActivityForResult(intentAvailable, 108);
|
||||
break;
|
||||
case R.id.rl_parking:
|
||||
chargingPileBuilder.append("点击了停车位编号进行拍照,");
|
||||
Intent intentParking = new Intent(getActivity(), PhotographActivity.class);
|
||||
File parkingFile = PhotoUtils.showPhotoFile("e", latLng);
|
||||
intentParking.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
@ -955,6 +993,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
startActivityForResult(intentParking, 109);
|
||||
break;
|
||||
case R.id.rl_number:
|
||||
chargingPileBuilder.append("点击了停车位编号进行拍照,");
|
||||
Intent intentNumber = new Intent(getActivity(), PhotographActivity.class);
|
||||
File numberFile = PhotoUtils.showPhotoFile("e", latLng);
|
||||
intentNumber.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
@ -1015,8 +1054,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
}).build();
|
||||
}*/
|
||||
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
@ -1145,6 +1182,17 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
chargingPileBuilder.append("onPause ,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
chargingPileBuilder.append("onStop ,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
@ -1154,6 +1202,9 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
if (markerPile!=null){
|
||||
markerPile.remove();
|
||||
}
|
||||
chargingPileBuilder.append("onDestroy ,");
|
||||
chargingPileBuilder.append("\r\n");
|
||||
FileUtils.writeFile(logFile.getAbsolutePath(), chargingPileBuilder.toString(), true);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
@ -18,6 +20,7 @@ import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.github.lazylibrary.util.FileUtils;
|
||||
import com.jcodecraeer.xrecyclerview.ProgressStyle;
|
||||
import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
||||
import com.kongzue.dialog.interfaces.OnMenuItemClickListener;
|
||||
@ -51,8 +54,12 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@ -66,6 +73,8 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
private ArrayList<PoiEntity> poiEntities;
|
||||
private ArrayList<PoiEntity> btnChock;
|
||||
private CheckBox checkOk;
|
||||
private File logFile;
|
||||
private StringBuilder filterBuilder;
|
||||
|
||||
public static FilterFragment newInstance(Bundle bundle) {
|
||||
FilterFragment fragment = new FilterFragment();
|
||||
@ -180,10 +189,37 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
SharedPreferences sharedPreferences = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.MESSAGE_TYPE, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor sharedEdit = sharedPreferences.edit();
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
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);
|
||||
sharedEdit.apply();
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
} else {
|
||||
if (pictures_time.equals(newFormat)) {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + pictures_time + ".txt");
|
||||
} else {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
}
|
||||
}
|
||||
filterBuilder = new StringBuilder();
|
||||
filterBuilder.append("FilterActivity-onCreate-initData ,");
|
||||
if (Constant.USHERED != null) {
|
||||
filterBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
PoiDatabase poiDatabase = PoiDatabase.getInstance(getContext());
|
||||
PoiDao poiDao = poiDatabase.getPoiDao();
|
||||
poiEntities = new ArrayList<>();
|
||||
@ -277,13 +313,18 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
recyclerFilter.getDefaultFootView().setNoMoreHint("成功加载完毕");
|
||||
recyclerFilter.setLoadingListener(new XRecyclerView.LoadingListener() {
|
||||
@Override
|
||||
public void onRefresh() { }
|
||||
public void onRefresh() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMore() { }
|
||||
public void onLoadMore() {
|
||||
}
|
||||
});
|
||||
checkOk.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
filterBuilder.append("点击了checkBox 按钮 ,");
|
||||
filterBuilder.append(" ,");
|
||||
if (Constant.LEVEL == 1 || Constant.LEVEL == 2) {
|
||||
filterAdapter.setAddFilter(isChecked);
|
||||
filterAdapter.notifyDataSetChanged();
|
||||
@ -297,6 +338,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
filterAdapter.setItemCLick(new FilterAdapter.ItemCLick() {
|
||||
@Override
|
||||
public void item(PoiEntity poiEntity) {
|
||||
filterBuilder.append("点击了item ,");
|
||||
//查看详情
|
||||
Message obtains = Message.obtain();
|
||||
obtains.what = Constant.FILTER_LIST_ITEM;
|
||||
@ -307,6 +349,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
filterAdapter.setItemOnCLick(new FilterAdapter.ItemOnCLick() {
|
||||
@Override
|
||||
public void item(PoiEntity poiEntity, boolean isChockBox) {
|
||||
filterBuilder.append("点击了item ,");
|
||||
if (isChockBox) {
|
||||
btnChock.add(poiEntity);
|
||||
} else {
|
||||
@ -324,6 +367,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.btn_draw:
|
||||
filterBuilder.append("点击了批量领取的按钮 ,");
|
||||
if (Constant.LEVEL == 1 || Constant.LEVEL == 2) {
|
||||
if (btnChock == null) {
|
||||
return;
|
||||
@ -342,6 +386,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
}
|
||||
break;
|
||||
case R.id.btn_filter:
|
||||
filterBuilder.append("点击了地图显示的按钮 ,");
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj = true;
|
||||
@ -355,6 +400,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
onBackPressed();
|
||||
break;
|
||||
case R.id.cl_number:
|
||||
filterBuilder.append("点击了任务个数的按钮 ,");
|
||||
BottomMenu.show((AppCompatActivity) Objects.requireNonNull(getContext()), new String[]{"200", "500", "1000"}, new OnMenuItemClickListener() {
|
||||
@Override
|
||||
public void onClick(String text, int index) {
|
||||
@ -378,6 +424,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
});
|
||||
break;
|
||||
case R.id.cl_photograph:
|
||||
filterBuilder.append("点击了权限类型的按钮 ,");
|
||||
BottomMenu.show((AppCompatActivity) Objects.requireNonNull(getContext()), new String[]{"全部", "普通任务", "专属任务", "挑战任务", "奖励任务"}, new OnMenuItemClickListener() {
|
||||
@Override
|
||||
public void onClick(String text, int index) {
|
||||
@ -415,6 +462,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
6 "面状任务"
|
||||
*/
|
||||
case R.id.cl_exclusive:
|
||||
filterBuilder.append("点击了任务类型的按钮 ,");
|
||||
BottomMenu.show((AppCompatActivity) Objects.requireNonNull(getContext()), new String[]{"全部", "POI", "充电站", "POI录像", "道路录像", "其他", "面状任务"}, new OnMenuItemClickListener() {
|
||||
@Override
|
||||
public void onClick(String text, int index) {
|
||||
@ -450,6 +498,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
});
|
||||
break;
|
||||
case R.id.cl_type://任务状态 0.未领取 1.已领取,2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功),4已上传(结束采集),
|
||||
filterBuilder.append("点击了任务状态的按钮 ,");
|
||||
BottomMenu.show((AppCompatActivity) Objects.requireNonNull(getContext()), new String[]{"全部", "未领取", "已领取"/*, "未保存", "已保存"*/}, new OnMenuItemClickListener() {
|
||||
@Override
|
||||
public void onClick(String text, int index) {
|
||||
@ -656,11 +705,26 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
filterBuilder.append("onPause ,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
filterBuilder.append("onStop ,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroy();
|
||||
filterBuilder.append("onDestroy ,");
|
||||
filterBuilder.append("\r\n");
|
||||
FileUtils.writeFile(logFile.getAbsolutePath(), filterBuilder.toString(), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,15 +1,26 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
|
||||
import com.github.lazylibrary.util.FileUtils;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.FragmentManagement;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* 发现的Fragment
|
||||
@ -17,6 +28,9 @@ import com.navinfo.outdoor.base.BaseFragment;
|
||||
*/
|
||||
public class FindFragment extends BaseFragment implements View.OnClickListener{
|
||||
|
||||
private File logFile;
|
||||
private StringBuilder findBuilder;
|
||||
|
||||
public static FindFragment newInstance(Bundle bundle) {
|
||||
FindFragment fragment = new FindFragment();
|
||||
fragment.setArguments(bundle);
|
||||
@ -44,27 +58,53 @@ public class FindFragment extends BaseFragment implements View.OnClickListener{
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
SharedPreferences sharedPreferences = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.MESSAGE_TYPE, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor sharedEdit = sharedPreferences.edit();
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
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);
|
||||
sharedEdit.apply();
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
} else {
|
||||
if (pictures_time.equals(newFormat)) {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + pictures_time + ".txt");
|
||||
} else {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
}
|
||||
}
|
||||
findBuilder = new StringBuilder();
|
||||
findBuilder.append("FindFragment-onCreate-initData ,");
|
||||
if (Constant.USHERED != null) {
|
||||
findBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.linear_task_prefecture:
|
||||
findBuilder.append("点击了最新公告:任务专区 跳转,");
|
||||
Intent prefectureIntent = new Intent(getActivity(), FragmentManagement.class);
|
||||
prefectureIntent.putExtra("tag", 7);
|
||||
startActivity(prefectureIntent);
|
||||
break;
|
||||
case R.id.linear_task_explain:
|
||||
findBuilder.append("点击了帮助中心:任务说明 跳转,");
|
||||
Intent explainIntent = new Intent(getActivity(), FragmentManagement.class);
|
||||
explainIntent.putExtra("tag", 8);
|
||||
startActivity(explainIntent);
|
||||
break;
|
||||
case R.id.linear_event_prefecture:
|
||||
findBuilder.append("点击了最新公告:活动专区 跳转,");
|
||||
Intent eventIntent = new Intent(getActivity(), FragmentManagement.class);
|
||||
eventIntent.putExtra("tag",9);
|
||||
startActivity(eventIntent);
|
||||
break;
|
||||
case R.id.linear_end:
|
||||
findBuilder.append("点击了帮助中心:能力测评 跳转,");
|
||||
Intent endIntent = new Intent(getActivity(), FragmentManagement.class);
|
||||
endIntent.putExtra("tag", 11);
|
||||
startActivity(endIntent);
|
||||
@ -72,4 +112,24 @@ public class FindFragment extends BaseFragment implements View.OnClickListener{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
findBuilder.append("onPause ,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
findBuilder.append("onStop ,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
findBuilder.append("onDestroy ");
|
||||
findBuilder.append("\r\n");
|
||||
FileUtils.writeFile(logFile.getAbsolutePath(), findBuilder.toString(), true);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
@ -12,6 +14,7 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.github.lazylibrary.util.FileUtils;
|
||||
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
|
||||
import com.kongzue.dialog.util.BaseDialog;
|
||||
import com.kongzue.dialog.util.DialogSettings;
|
||||
@ -41,8 +44,12 @@ import com.vividsolutions.jts.geom.Geometry;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.io.File;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DateFormat;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@ -54,6 +61,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
private PoiEntity poiEntity;
|
||||
private PoiDao poiDao;
|
||||
private ChargingPileDao chargingPileDao;
|
||||
private File logFile;
|
||||
private StringBuilder gatherGetBuilder;
|
||||
|
||||
public static GatherGetFragment newInstance(Bundle bundle) {
|
||||
GatherGetFragment fragment = new GatherGetFragment();
|
||||
@ -61,6 +70,33 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
SharedPreferences sharedPreferences = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.MESSAGE_TYPE, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor sharedEdit = sharedPreferences.edit();
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
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);
|
||||
sharedEdit.apply();
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
} else {
|
||||
if (pictures_time.equals(newFormat)) {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + pictures_time + ".txt");
|
||||
} else {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
}
|
||||
}
|
||||
gatherGetBuilder = new StringBuilder();
|
||||
gatherGetBuilder.append("GatherGetFragment-onCreate-initData ,");
|
||||
if (Constant.USHERED != null) {
|
||||
gatherGetBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
@ -199,6 +235,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.btn_delete:
|
||||
gatherGetBuilder.append("点击了返回的按钮 ,");
|
||||
assert getArguments() != null;
|
||||
boolean aBoolean = getArguments().getBoolean("boolean", false);
|
||||
Message obtain = Message.obtain();
|
||||
@ -211,11 +248,13 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
EventBus.getDefault().post(obtains);
|
||||
break;
|
||||
case R.id.btn_cancel_get://结束领取
|
||||
gatherGetBuilder.append("点击了结束领取的按钮 ,");
|
||||
if (poiEntity != null) {
|
||||
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, poiEntity.getTaskId(), poiEntity);
|
||||
}
|
||||
break;
|
||||
case R.id.btn_get_task://领取任务
|
||||
gatherGetBuilder.append("点击了领取任务的按钮 ,");
|
||||
if (poiEntity != null) {
|
||||
int type = poiEntity.getType();
|
||||
if (type == 6) {//面状任务的领取类型
|
||||
@ -234,6 +273,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
}
|
||||
break;
|
||||
case R.id.btn_gather://立即采集
|
||||
gatherGetBuilder.append("点击了立即采集的按钮 ,");
|
||||
//如果是领取的任务或者是新得任务就只能在当前用户位置方圆5000以内才可以使用
|
||||
if (poiEntity.getTaskStatus() < 2) {
|
||||
double latitude = Constant.currentLocation.getLatitude();
|
||||
@ -263,6 +303,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
}
|
||||
break;
|
||||
case R.id.btn_finish_gather://结束采集
|
||||
gatherGetBuilder.append("点击了结束采集的按钮 ,");
|
||||
if (poiEntity != null) {
|
||||
int type = poiEntity.getType();
|
||||
if (type == 6) {
|
||||
@ -799,10 +840,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
|
||||
private void senMessageMarker(int type, String y, String x) {
|
||||
Message markerMsg = Message.obtain();
|
||||
@ -926,4 +964,24 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
public static String format5(double value) {
|
||||
return String.format("%.2f", value).toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
gatherGetBuilder.append("onPause ,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
gatherGetBuilder.append("onStop ,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
gatherGetBuilder.append("onDestroy ,");
|
||||
gatherGetBuilder.append("\r\n");
|
||||
FileUtils.writeFile(logFile.getAbsolutePath(), gatherGetBuilder.toString(), true);
|
||||
}
|
||||
}
|
||||
|
@ -311,6 +311,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
//所属银行解析
|
||||
public ArrayList<BankPathBean> parseData(String result) {//Gao 解析
|
||||
ArrayList<BankPathBean> detail = new ArrayList<>();
|
||||
|
||||
try {
|
||||
JSONArray data = new JSONArray(result);
|
||||
Gson gson = new Gson();
|
||||
@ -321,6 +322,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return detail;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,9 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
@ -9,6 +12,7 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.github.lazylibrary.util.FileUtils;
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.FragmentManagement;
|
||||
@ -19,6 +23,12 @@ import com.navinfo.outdoor.http.Callback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 记录-已提交
|
||||
*/
|
||||
@ -41,6 +51,8 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
||||
private TextView poiVideoAuditThrough;
|
||||
private TextView poiVideoAuditProcessAbleNotThrough;
|
||||
private int hasPage;
|
||||
private File logFile;
|
||||
private StringBuilder hasSubmitBuilder;
|
||||
|
||||
public static HasSubmitFragment newInstance(Bundle bundle) {
|
||||
HasSubmitFragment fragment = new HasSubmitFragment();
|
||||
@ -87,6 +99,8 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
||||
initRequest();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void initRequest() {
|
||||
initPoiSubMitWork();//poi
|
||||
initCaningSubMitWork();//充电站
|
||||
@ -95,6 +109,7 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
||||
initOtherSubMitWork();//其他
|
||||
}
|
||||
|
||||
|
||||
private void initOtherSubMitWork() {
|
||||
HttpParams httpParams = new HttpParams();
|
||||
httpParams.put("type", "5");
|
||||
@ -122,14 +137,12 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
||||
} else {
|
||||
Toast.makeText(getActivity(), hasSubmitBean.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
Log.d("TAG", "onSuccess: " + hasSubmitBean.getBody() + "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
Toast.makeText(getActivity(), "请求失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
@ -168,7 +181,6 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
Toast.makeText(getActivity(), e.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
@ -207,7 +219,6 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
Toast.makeText(getActivity(), "请求失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
@ -246,7 +257,6 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
Toast.makeText(getActivity(), "请求失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
@ -293,36 +303,64 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
SharedPreferences sharedPreferences = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.MESSAGE_TYPE, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor sharedEdit = sharedPreferences.edit();
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
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);
|
||||
sharedEdit.apply();
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
} else {
|
||||
if (pictures_time.equals(newFormat)) {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + pictures_time + ".txt");
|
||||
} else {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
}
|
||||
}
|
||||
hasSubmitBuilder = new StringBuilder();
|
||||
hasSubmitBuilder.append("HasSubmitFragment-onCreate-initData ,");
|
||||
if (Constant.USHERED != null) {
|
||||
hasSubmitBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.cl_poi:
|
||||
hasSubmitBuilder.append("点击了poi item跳转到poi列表 ,");
|
||||
Intent poiIntent = new Intent(getContext(), FragmentManagement.class);
|
||||
poiIntent.putExtra("tag", 31);
|
||||
poiIntent.putExtra("type", 1);
|
||||
startActivity(poiIntent);
|
||||
break;
|
||||
case R.id.cl_road:
|
||||
hasSubmitBuilder.append("点击了road item跳转到road列表 ,");
|
||||
Intent roadIntent = new Intent(getContext(), FragmentManagement.class);
|
||||
roadIntent.putExtra("tag", 31);
|
||||
roadIntent.putExtra("type", 4);
|
||||
startActivity(roadIntent);
|
||||
break;
|
||||
case R.id.cl_charging:
|
||||
hasSubmitBuilder.append("点击了charging item跳转到charging列表 ,");
|
||||
Intent chargingIntent = new Intent(getContext(), FragmentManagement.class);
|
||||
chargingIntent.putExtra("tag", 31);
|
||||
chargingIntent.putExtra("type", 2);
|
||||
startActivity(chargingIntent);
|
||||
break;
|
||||
case R.id.cl_other:
|
||||
hasSubmitBuilder.append("点击了other item跳转到other列表 ,");
|
||||
Intent otherIntent = new Intent(getContext(), FragmentManagement.class);
|
||||
otherIntent.putExtra("tag", 31);
|
||||
otherIntent.putExtra("type", 5);
|
||||
startActivity(otherIntent);
|
||||
break;
|
||||
case R.id.cl_poiVideo:
|
||||
hasSubmitBuilder.append("点击了poiVideo item跳转到poiVideo列表 ,");
|
||||
Intent poiVideoIntent = new Intent(getContext(), FragmentManagement.class);
|
||||
poiVideoIntent.putExtra("tag", 31);
|
||||
poiVideoIntent.putExtra("type", 3);
|
||||
@ -330,4 +368,24 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
hasSubmitBuilder.append("onPause ,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
hasSubmitBuilder.append("onStop ,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
hasSubmitBuilder.append("onDestroy ");
|
||||
hasSubmitBuilder.append("\r\n");
|
||||
FileUtils.writeFile(logFile.getAbsolutePath(), hasSubmitBuilder.toString(), true);
|
||||
}
|
||||
}
|
@ -51,7 +51,7 @@ public class IssueWebFragment extends BaseFragment implements View.OnClickListen
|
||||
issueWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
settings.setBuiltInZoomControls(false);
|
||||
issueWebView.loadUrl("http://172.23.139.4:10001/#/serveclause");
|
||||
// issueWebView.loadUrl("http://www.navinfo.com");
|
||||
// issueWebView.loadUrl("http://www.navinfo.com");
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
@ -15,6 +17,7 @@ import android.widget.Toast;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.github.lazylibrary.util.FileUtils;
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.FragmentManagement;
|
||||
@ -30,6 +33,10 @@ import com.navinfo.outdoor.http.OkGoBuilder;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@ -39,6 +46,8 @@ import java.util.Objects;
|
||||
public class MineFragment extends BaseFragment implements View.OnClickListener {
|
||||
|
||||
private TextView tvMoney;
|
||||
private File logFile;
|
||||
private StringBuilder mainBuilder;
|
||||
|
||||
public static MineFragment newInstance(Bundle bundle) {
|
||||
MineFragment fragment = new MineFragment();
|
||||
@ -52,9 +61,9 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
||||
if (!EventBus.getDefault().isRegistered(this)) {//加上判断
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.mine_fragment;
|
||||
@ -146,6 +155,28 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
SharedPreferences sharedPreferences = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.MESSAGE_TYPE, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor sharedEdit = sharedPreferences.edit();
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
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);
|
||||
sharedEdit.apply();
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
} else {
|
||||
if (pictures_time.equals(newFormat)) {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + pictures_time + ".txt");
|
||||
} else {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
}
|
||||
}
|
||||
mainBuilder = new StringBuilder();
|
||||
mainBuilder.append("MineFragment-onCreate-initData ,");
|
||||
if (Constant.USHERED != null) {
|
||||
mainBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -153,6 +184,7 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
||||
switch (v.getId()) {
|
||||
case R.id.image_heard:
|
||||
case R.id.tv_name://跳转到个人信息
|
||||
mainBuilder.append("点击了头像和名字 跳转到个人信息 ,");
|
||||
Intent intentUser = new Intent(getActivity(), UserActivity.class);
|
||||
intentUser.putExtra("tag", 16);
|
||||
startActivity(intentUser);
|
||||
@ -165,16 +197,19 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
||||
Toast.makeText(getActivity(), "该功能以后上新,敬请期待", Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
case R.id.rl_privilege://我的特权
|
||||
mainBuilder.append("点击了item 跳转到我的特权,");
|
||||
Intent intentPrivilege = new Intent(getActivity(), FragmentManagement.class);
|
||||
intentPrivilege.putExtra("tag", 18);
|
||||
startActivity(intentPrivilege);
|
||||
break;
|
||||
case R.id.rl_grade://我的等级
|
||||
mainBuilder.append("点击了item 跳转到我的等级 ,");
|
||||
Intent intentGrade = new Intent(getActivity(), FragmentManagement.class);
|
||||
intentGrade.putExtra("tag", 17);
|
||||
startActivity(intentGrade);
|
||||
break;
|
||||
case R.id.btn_withdraw://提现页面
|
||||
mainBuilder.append("点击了item 跳转到提现页面 ,");
|
||||
Intent intentWithdraw = new Intent(getActivity(), FragmentManagement.class);
|
||||
intentWithdraw.putExtra("tag", 15);
|
||||
startActivity(intentWithdraw);
|
||||
@ -189,16 +224,19 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
||||
intentSet.putExtra("tag", 22);
|
||||
startActivity(intentSet);*/
|
||||
case R.id.rl_contact://联系我们
|
||||
mainBuilder.append("点击了item 跳转到联系我们 ,");
|
||||
Intent intentContact = new Intent(getActivity(), FragmentManagement.class);
|
||||
intentContact.putExtra("tag", 21);
|
||||
startActivity(intentContact);
|
||||
break;
|
||||
case R.id.rl_about://关于
|
||||
mainBuilder.append("点击了item 跳转到关于页面 ,");
|
||||
Intent intentAbout = new Intent(getActivity(), FragmentManagement.class);
|
||||
intentAbout.putExtra("tag", 23);
|
||||
startActivity(intentAbout);
|
||||
break;
|
||||
case R.id.btn_quit://退出登录
|
||||
mainBuilder.append("点击了退出登录的按钮 ,");
|
||||
Intent intent = new Intent(getContext(), LoginActivity.class);
|
||||
startActivity(intent);
|
||||
Objects.requireNonNull(getActivity()).finish();
|
||||
@ -206,11 +244,26 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
mainBuilder.append("onPause ,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
mainBuilder.append("onStop ,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroy();
|
||||
mainBuilder.append("onDestroy ");
|
||||
mainBuilder.append("\r\n");
|
||||
FileUtils.writeFile(logFile.getAbsolutePath(), mainBuilder.toString(), true);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,8 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
@ -16,6 +19,7 @@ import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.github.lazylibrary.util.FileUtils;
|
||||
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
|
||||
import com.kongzue.dialog.interfaces.OnMenuItemClickListener;
|
||||
import com.kongzue.dialog.util.BaseDialog;
|
||||
@ -40,7 +44,11 @@ import com.navinfo.outdoor.util.PoiSaveUtils;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@ -55,6 +63,8 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
private ArrayList<PoiEntity> poiEntities;
|
||||
private CheckBox cbSelect;
|
||||
private MessageDialog messageDialog;
|
||||
private File logFile;
|
||||
private StringBuilder staySubmitBuilder;
|
||||
|
||||
|
||||
public static StaySubmitFragment newInstance(Bundle bundle) {
|
||||
@ -98,6 +108,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
staySubmitAdapter.setOnClickItem(new StaySubmitAdapter.onClickItem() {
|
||||
@Override
|
||||
public void item(int position, PoiEntity poiEntity) {
|
||||
staySubmitBuilder.append("点击了条目item 进行跳转 ,");
|
||||
Message subObtain = Message.obtain();
|
||||
subObtain.what = Constant.EVENT_WORK_HOME;
|
||||
subObtain.obj = true;
|
||||
@ -112,6 +123,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
cbSelect.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
staySubmitBuilder.append("点击了全选进行勾选 ,");
|
||||
staySubmitAdapter.setAllDataChecked(isChecked);
|
||||
staySubmitAdapter.notifyDataSetChanged();
|
||||
}
|
||||
@ -123,6 +135,33 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
SharedPreferences sharedPreferences = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.MESSAGE_TYPE, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor sharedEdit = sharedPreferences.edit();
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
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);
|
||||
sharedEdit.apply();
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
} else {
|
||||
if (pictures_time.equals(newFormat)) {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + pictures_time + ".txt");
|
||||
} else {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
}
|
||||
}
|
||||
staySubmitBuilder = new StringBuilder();
|
||||
staySubmitBuilder.append("StaySubmitFragment-onCreate-initData ,");
|
||||
if (Constant.USHERED != null) {
|
||||
staySubmitBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(Message data) {
|
||||
if (data.what == Constant.EVENT_STAY_REFRESH) {
|
||||
@ -144,6 +183,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
dismissLoadingDialog();
|
||||
staySubmitBuilder.append("onStop ,");
|
||||
}
|
||||
|
||||
public List<PoiEntity> initRoadWord(int type) {
|
||||
@ -165,6 +205,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.cl_stay_type://1 "POI"2 "充电站"3 "POI录像"4 "道路录像"5 "其他"6 "面状任务"
|
||||
staySubmitBuilder.append("点击了待提交的类型 ,");
|
||||
BottomMenu.show((AppCompatActivity) Objects.requireNonNull(getContext()), new String[]{"全部", "poi", "充电站", "poi录像", "道路录像", "其他"}, new OnMenuItemClickListener() {
|
||||
@Override
|
||||
public void onClick(String text, int index) {
|
||||
@ -200,6 +241,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
break;
|
||||
|
||||
case R.id.tv_delete:
|
||||
staySubmitBuilder.append("点击了删除按钮 ,");
|
||||
if (Constant.isPresent) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@ -214,6 +256,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
}
|
||||
break;
|
||||
case R.id.btn_stay_submit://提交
|
||||
staySubmitBuilder.append("点击了提交的按钮 ,");
|
||||
if (Constant.isPresent) {
|
||||
if (poiEntities == null) {
|
||||
poiEntities = new ArrayList<>();
|
||||
@ -350,11 +393,22 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
staySubmitBuilder.append("onPause ,");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroy();
|
||||
dismissLoadingDialog();
|
||||
staySubmitBuilder.append("onDestroy ");
|
||||
staySubmitBuilder.append("\r\n");
|
||||
FileUtils.writeFile(logFile.getAbsolutePath(), staySubmitBuilder.toString(), true);
|
||||
}
|
||||
}
|
@ -158,7 +158,6 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
@Override
|
||||
public void onSuccess(GetPriceBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
// Toast.makeText(getContext(), "获取成功", Toast.LENGTH_SHORT).show();
|
||||
if (response.getCode() == 200) {
|
||||
Double userPrice = response.getBody().getUserPrice();
|
||||
tvTotal.setText(userPrice + "");
|
||||
@ -195,17 +194,17 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.iv_withdraw:
|
||||
withdrawBuilder.append("点击了财务信息的返回,");
|
||||
withdrawBuilder.append("点击了财务信息的返回 ,");
|
||||
Objects.requireNonNull(getActivity()).finish();
|
||||
break;
|
||||
case R.id.tv_text:
|
||||
withdrawBuilder.append("点击了提现记录,");
|
||||
withdrawBuilder.append("点击了提现记录 ,");
|
||||
Intent intentText = new Intent(getActivity(), FragmentManagement.class);
|
||||
intentText.putExtra("tag", 26);
|
||||
startActivity(intentText);
|
||||
break;
|
||||
case R.id.button:
|
||||
withdrawBuilder.append("点击了立即提现,");
|
||||
withdrawBuilder.append("点击了立即提现 ,");
|
||||
String price = etAllPrice.getText().toString().trim();
|
||||
if (!price.equals("")) {
|
||||
double aDouble = Double.parseDouble(price);
|
||||
@ -236,7 +235,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
break;
|
||||
case R.id.tv_all:
|
||||
withdrawBuilder.append("点击了全部,");
|
||||
withdrawBuilder.append("点击了全部 ,");
|
||||
etAllPrice.setText(canExchangePrice + "");
|
||||
break;
|
||||
}
|
||||
@ -258,19 +257,15 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
@Override
|
||||
public void onSuccess(UserPriceExchangeBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
Toast.makeText(getActivity(), response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
if (response.getCode() == 200) {
|
||||
String unit = tvUnit.getText().toString();
|
||||
String price = etAllPrice.getText().toString();
|
||||
double v = Double.parseDouble(unit) - Double.parseDouble(price);
|
||||
String s = String.format("%.2f", v).toString();
|
||||
tvUnit.setText(s);
|
||||
initNetWork();
|
||||
withdrawBuilder.append("提现了成功 ,");
|
||||
} else {
|
||||
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
withdrawBuilder.append("提现了失败 ,");
|
||||
}
|
||||
etAllPrice.getText().clear();
|
||||
|
||||
Log.d("TAG", "onSuccess: " + response.toString());
|
||||
Log.d("TAG", "onSuccess: " + response.getMessage()+response.getCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -3,8 +3,8 @@ 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_test/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 USER_PATH ="/user/";//我的
|
||||
public static final String MSG_LIST_PATH ="/msgList/";//发现
|
||||
|
Loading…
x
Reference in New Issue
Block a user