添加日志,修改poi 电话。纪录的修改。
This commit is contained in:
parent
c0ce706448
commit
482eaf31a1
@ -5,6 +5,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
@ -15,7 +16,9 @@ import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.github.lazylibrary.util.FileUtils;
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
@ -33,6 +36,8 @@ import com.navinfo.outdoor.util.SystemTTS;
|
||||
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.Calendar;
|
||||
import java.util.Date;
|
||||
@ -45,11 +50,11 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
private android.widget.EditText etLoginPaw;
|
||||
private SharedPreferences.Editor navInfoEditor;
|
||||
private CheckBox cbStatement;
|
||||
private Handler handler=new Handler(new Handler.Callback() {
|
||||
private Handler handler = new Handler(new Handler.Callback() {
|
||||
@Override
|
||||
public boolean handleMessage(@NonNull Message msg) {
|
||||
if (msg.what==0x103){
|
||||
if (btnLogin!=null){
|
||||
if (msg.what == 0x103) {
|
||||
if (btnLogin != null) {
|
||||
btnLogin.setEnabled(true);
|
||||
}
|
||||
}
|
||||
@ -57,6 +62,8 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
}
|
||||
});
|
||||
private Button btnLogin;
|
||||
private File logFile;
|
||||
private StringBuilder loginBuilder;
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
@ -74,6 +81,25 @@ public class LoginActivity 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");
|
||||
}
|
||||
}
|
||||
loginBuilder = new StringBuilder();
|
||||
loginBuilder.append("LoginActivity-initData ,");
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
@ -106,11 +132,11 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
tvRegister.setOnClickListener(this);
|
||||
tvForgetPaw.setOnClickListener(this);
|
||||
String user_name = navInfo.getString("user_name", null);
|
||||
if (user_name!=null&&!user_name.equals("")){
|
||||
if (user_name != null && !user_name.equals("")) {
|
||||
etLoginName.setText(user_name);
|
||||
}
|
||||
String pass_word = navInfo.getString("pass_word", null);
|
||||
if (pass_word!=null&&!pass_word.equals("")){
|
||||
if (pass_word != null && !pass_word.equals("")) {
|
||||
etLoginPaw.setText(pass_word);
|
||||
}
|
||||
}
|
||||
@ -119,20 +145,23 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.tv_register:
|
||||
loginBuilder.append("点击注册,");
|
||||
Intent register = new Intent(this, FragmentManagement.class);
|
||||
register.putExtra("tag", 5);
|
||||
startActivity(register);
|
||||
break;
|
||||
case R.id.tv_forget_paw:
|
||||
loginBuilder.append("点击忘记密码,");
|
||||
Intent forgetPaw = new Intent(this, FragmentManagement.class);
|
||||
forgetPaw.putExtra("tag", 6);
|
||||
startActivity(forgetPaw);
|
||||
break;
|
||||
case R.id.btn_login:
|
||||
loginBuilder.append("点击登录,");
|
||||
btnLogin.setEnabled(false);
|
||||
Message message = new Message();
|
||||
message.what=0x103;
|
||||
handler.sendMessageDelayed(message,500);
|
||||
message.what = 0x103;
|
||||
handler.sendMessageDelayed(message, 500);
|
||||
String name = etLoginName.getText().toString().trim();
|
||||
if (name.equals("")) {
|
||||
Toast.makeText(this, "请输入账号", Toast.LENGTH_SHORT).show();
|
||||
@ -143,14 +172,15 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
Toast.makeText(this, "请输入密码", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (!cbStatement.isChecked()){
|
||||
if (!cbStatement.isChecked()) {
|
||||
Toast.makeText(this, "请先同意用户协议", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}else {
|
||||
} else {
|
||||
initLogIn(name, paw);
|
||||
}
|
||||
break;
|
||||
case R.id.tv_statement:
|
||||
loginBuilder.append("点击了用户协议,");
|
||||
Intent stateIntent = new Intent(this, StatementActivity.class);
|
||||
startActivity(stateIntent);
|
||||
break;
|
||||
@ -175,27 +205,29 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
@Override
|
||||
public void onSuccess(LoginOauthTokenBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
if (response.getCode()==200){
|
||||
if (response.getCode() == 200) {
|
||||
LoginOauthTokenBean.BodyBean body = response.getBody();
|
||||
if (body.getUserId()!=null&&!body.getUserId().equals("")){
|
||||
if (body.getUserId() != null && !body.getUserId().equals("")) {
|
||||
Constant.initRootFolder(body.getUserId());
|
||||
HttpInterface.initHttpInter(body.getUserId());
|
||||
loginBuilder.append("userId:").append(body.getUserId()).append(",");
|
||||
}
|
||||
navInfoEditor.putString("access_token",body.getAccess_token());
|
||||
navInfoEditor.putString("refresh_token",body.getRefresh_token());
|
||||
navInfoEditor.putString("pass_word",paw);
|
||||
navInfoEditor.putString("user_name",name);
|
||||
navInfoEditor.putString("user_id",body.getUserId());
|
||||
navInfoEditor.putString("access_token", body.getAccess_token());
|
||||
navInfoEditor.putString("refresh_token", body.getRefresh_token());
|
||||
navInfoEditor.putString("pass_word", paw);
|
||||
navInfoEditor.putString("user_name", name);
|
||||
navInfoEditor.putString("user_id", body.getUserId());
|
||||
navInfoEditor.commit();
|
||||
Constant.ACCESS_TOKEN=body.getAccess_token();
|
||||
Constant.REFRESH_TOKEN=body.getRefresh_token();
|
||||
Constant.USHERED =body.getUserId();
|
||||
Constant.PASS_WORD=paw;
|
||||
Constant.ACCESS_TOKEN = body.getAccess_token();
|
||||
Constant.REFRESH_TOKEN = body.getRefresh_token();
|
||||
Constant.USHERED = body.getUserId();
|
||||
Constant.PASS_WORD = paw;
|
||||
initGetUserInfo();//获取用户信息
|
||||
} else {
|
||||
Toast.makeText(LoginActivity.this, response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
@ -217,60 +249,61 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
@Override
|
||||
public void onSuccess(UserDetailBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
if (response.getCode()==200){
|
||||
if (response.getCode() == 200) {
|
||||
UserDetailBean.BodyBean body = response.getBody();
|
||||
if (body!=null){
|
||||
navInfoEditor.putString("username",body.getUsername());
|
||||
Constant.USER_NAME=body.getUsername();
|
||||
navInfoEditor.putString("mobile",body.getMobile());
|
||||
Constant.MOBILE=body.getMobile();
|
||||
navInfoEditor.putInt("sex",body.getSex());//0:女 1:男
|
||||
Constant.SEX=body.getSex();
|
||||
navInfoEditor.putString("qq",body.getQq());
|
||||
Constant.QQ=body.getQq();
|
||||
navInfoEditor.putString("wechat",body.getWechat());
|
||||
Constant.WCHAR =body.getWechat();
|
||||
navInfoEditor.putInt("level",body.getLevel());
|
||||
Constant.LEVEL=body.getLevel();
|
||||
if (body != null) {
|
||||
navInfoEditor.putString("username", body.getUsername());
|
||||
Constant.USER_NAME = body.getUsername();
|
||||
navInfoEditor.putString("mobile", body.getMobile());
|
||||
Constant.MOBILE = body.getMobile();
|
||||
navInfoEditor.putInt("sex", body.getSex());//0:女 1:男
|
||||
Constant.SEX = body.getSex();
|
||||
navInfoEditor.putString("qq", body.getQq());
|
||||
Constant.QQ = body.getQq();
|
||||
navInfoEditor.putString("wechat", body.getWechat());
|
||||
Constant.WCHAR = body.getWechat();
|
||||
navInfoEditor.putInt("level", body.getLevel());
|
||||
Constant.LEVEL = body.getLevel();
|
||||
UserDetailBean.BodyBean.UserBankcardBean userBankcard = body.getUserBankcard();
|
||||
if (userBankcard!=null){//存储银行卡信息
|
||||
navInfoEditor.putString("bankAccount",userBankcard.getBankAccount());//银行卡编号
|
||||
Constant.BACKGROUND =userBankcard.getBankAccount();
|
||||
navInfoEditor.putString("idNumber",userBankcard.getIdNumber());//银行卡账号
|
||||
Constant.ID_NUMBER=userBankcard.getIdNumber();
|
||||
navInfoEditor.putString("bankName",userBankcard.getBankName());//銀行姓名
|
||||
Constant.BACKGROUND_NAME=userBankcard.getBankName();
|
||||
if (userBankcard != null) {//存储银行卡信息
|
||||
navInfoEditor.putString("bankAccount", userBankcard.getBankAccount());//银行卡编号
|
||||
Constant.BACKGROUND = userBankcard.getBankAccount();
|
||||
navInfoEditor.putString("idNumber", userBankcard.getIdNumber());//银行卡账号
|
||||
Constant.ID_NUMBER = userBankcard.getIdNumber();
|
||||
navInfoEditor.putString("bankName", userBankcard.getBankName());//銀行姓名
|
||||
Constant.BACKGROUND_NAME = userBankcard.getBankName();
|
||||
}
|
||||
UserDetailBean.BodyBean.UserAuthBean userAuth = body.getUserAuth();
|
||||
if (userAuth!=null){//存储身份证信息
|
||||
navInfoEditor.putString("name",userAuth.getName());//身份证姓名
|
||||
Constant.NAME=userAuth.getName();
|
||||
navInfoEditor.putString("idnum",userAuth.getIdnum());//身份证号码
|
||||
Constant.ID_NUM=userAuth.getIdnum();
|
||||
navInfoEditor.putInt("auditstatus",userAuth.getAuditstatus());//审核状态
|
||||
Constant.AUDIOTAPES =userAuth.getAuditstatus();
|
||||
navInfoEditor.putString("auditmsg",userAuth.getAuditmsg());//审核信息
|
||||
Constant.AUDITING =userAuth.getAuditmsg();
|
||||
if (userAuth != null) {//存储身份证信息
|
||||
navInfoEditor.putString("name", userAuth.getName());//身份证姓名
|
||||
Constant.NAME = userAuth.getName();
|
||||
navInfoEditor.putString("idnum", userAuth.getIdnum());//身份证号码
|
||||
Constant.ID_NUM = userAuth.getIdnum();
|
||||
navInfoEditor.putInt("auditstatus", userAuth.getAuditstatus());//审核状态
|
||||
Constant.AUDIOTAPES = userAuth.getAuditstatus();
|
||||
navInfoEditor.putString("auditmsg", userAuth.getAuditmsg());//审核信息
|
||||
Constant.AUDITING = userAuth.getAuditmsg();
|
||||
}
|
||||
navInfoEditor.commit();
|
||||
int needGuide = body.getNeedGuide();//0不需要 1需要
|
||||
if (needGuide==1){
|
||||
if (needGuide == 1) {
|
||||
Intent intent = new Intent(LoginActivity.this, GuidanceActivity.class);
|
||||
startActivity(intent);
|
||||
}else {
|
||||
} else {
|
||||
Toast.makeText(LoginActivity.this, "登录成功", Toast.LENGTH_SHORT).show();
|
||||
Intent intent = new Intent(LoginActivity.this, HomeActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}else {
|
||||
Toast.makeText(LoginActivity.this, response.getMessage()+"", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(LoginActivity.this, response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
dismissLoadingDialog();
|
||||
Toast.makeText(LoginActivity.this, e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
@ -281,10 +314,26 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
super.onConfigurationChanged(newConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
loginBuilder.append("onPause,");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
loginBuilder.append("onStop,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroy();
|
||||
loginBuilder.append("onDestroy");
|
||||
loginBuilder.append("\r\n");
|
||||
FileUtils.writeFile(logFile.getAbsolutePath(), loginBuilder.toString(), true);
|
||||
if (EventBus.getDefault().isRegistered(this)) {//加上判断
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -86,28 +86,6 @@ public class PhotographActivity extends BaseActivity implements View.OnClickList
|
||||
private File logFile;
|
||||
private StringBuilder photographBuilder;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
SharedPreferences sharedPreferences = this.getSharedPreferences(Constant.MESSAGE_TYPE, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor sharedEdit = sharedPreferences.edit();
|
||||
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.commit();
|
||||
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");
|
||||
}
|
||||
}
|
||||
photographBuilder = new StringBuilder();
|
||||
photographBuilder.append("PhotographActivity-onCreate ,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@ -126,7 +104,28 @@ public class PhotographActivity extends BaseActivity implements View.OnClickList
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
photographBuilder.append("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");
|
||||
}
|
||||
}
|
||||
photographBuilder = new StringBuilder();
|
||||
photographBuilder.append("PhotographActivity-onCreate-initData ,");
|
||||
if (Constant.USHERED!=null){
|
||||
photographBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||
}
|
||||
cameraView.setMode(Mode.PICTURE);
|
||||
}
|
||||
|
||||
|
@ -132,31 +132,6 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
private File logFile;
|
||||
private StringBuilder picturesBuilder;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
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");
|
||||
}
|
||||
}
|
||||
picturesBuilder = new StringBuilder();
|
||||
picturesBuilder.append("PicturesActivity-onCreate ,");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
@ -362,6 +337,28 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
@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");
|
||||
}
|
||||
}
|
||||
picturesBuilder = new StringBuilder();
|
||||
picturesBuilder.append("PicturesActivity-onCreate-initData ,");
|
||||
if (Constant.USHERED!=null){
|
||||
picturesBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||
}
|
||||
camera.setMode(Mode.PICTURE);
|
||||
}
|
||||
|
||||
@ -490,7 +487,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
}
|
||||
|
||||
//小图
|
||||
private void initMapBig() {
|
||||
private void initMapBig() {
|
||||
isMapSlide = false;
|
||||
ivZoomAdd.setVisibility(View.GONE);
|
||||
ivZoomDel.setVisibility(View.GONE);
|
||||
@ -535,10 +532,17 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
picturesBuilder.append("onPause, ");
|
||||
camera.close();
|
||||
stopTimer();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
picturesBuilder.append("onStop, ");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
@ -10,7 +10,6 @@ import com.navinfo.outdoor.base.BaseActivity;
|
||||
|
||||
public class StatementActivity extends BaseActivity {
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.activity_statement;
|
||||
|
@ -76,7 +76,7 @@ public class TestActivity extends BaseActivity {
|
||||
private final int MARKER_FACE = 1;
|
||||
private ClusterManager<MarkerClusterItem> clusterItemClusterManager;
|
||||
private HashMap<String, List<Marker>> stringListHashMap;
|
||||
private ArrayList<LatLng> listLatlng;
|
||||
private ArrayList<LatLng> listLatLng;
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
@ -88,8 +88,8 @@ public class TestActivity extends BaseActivity {
|
||||
super.initData();
|
||||
removables = new ArrayList<>();//存储网络数据的marker数据(线,面,点)
|
||||
stringListHashMap = new HashMap<>();//key :wkt,value :存储的数据类型
|
||||
//存储的多点latlng
|
||||
listLatlng = new ArrayList<>();
|
||||
//存储的多点latLng
|
||||
listLatLng = new ArrayList<>();
|
||||
initList(Constant.currentLocation);
|
||||
}
|
||||
|
||||
@ -288,15 +288,15 @@ public class TestActivity extends BaseActivity {
|
||||
}
|
||||
}
|
||||
}
|
||||
listLatlng.clear();
|
||||
listLatLng.clear();
|
||||
for (Map.Entry<String, List<Marker>> entry : stringListHashMap.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
List<Marker> markerList = stringListHashMap.get(key);
|
||||
assert markerList != null;
|
||||
Log.d("TAG", "onSuenccess: "+markerList.toString());
|
||||
Log.d("TAG", "onSuenccess: "+entry.getValue()+"sssssssssssssssssssssssssssssss"+entry.getKey());
|
||||
Log.d("TAG", ": "+markerList.toString());
|
||||
Log.d("TAG", ": "+entry.getValue()+"-"+entry.getKey());
|
||||
LatLng lng = GeometryTools.createLatLng(key);
|
||||
listLatlng.add(lng);
|
||||
listLatLng.add(lng);
|
||||
}
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.JOB_SEARCH_WORD;
|
||||
@ -377,7 +377,7 @@ public class TestActivity extends BaseActivity {
|
||||
latLngs.add(new LatLng(projection.fromScreenLocation(point)));
|
||||
com.vividsolutions.jts.geom.Polygon polygon = GeometryTools.createPolygon(latLngs);
|
||||
//多点
|
||||
MultiPoint multiPoint = GeometryTools.createMultiPoint(listLatlng);
|
||||
MultiPoint multiPoint = GeometryTools.createMultiPoint(listLatLng);
|
||||
//拿到覆蓋點
|
||||
Geometry intersection = polygon.intersection(multiPoint);
|
||||
String geometryType = intersection.getGeometryType();
|
||||
@ -440,7 +440,7 @@ public class TestActivity extends BaseActivity {
|
||||
@Override
|
||||
public boolean onMarkerClick(Marker marker) {
|
||||
if (marker.getTag().equals("marker")) {
|
||||
Toast.makeText(TestActivity.this, marker.getId()+"sssssssssssssssssssss", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(TestActivity.this, marker.getId()+" ", Toast.LENGTH_SHORT).show();
|
||||
//中心点的圆
|
||||
// Geometry geometry = GeometryTools.createGeometry();
|
||||
// 多 点
|
||||
|
@ -47,7 +47,7 @@ public class Constant {
|
||||
|
||||
public static String POI_DAO;
|
||||
|
||||
public static String LOG_FOLDER;
|
||||
public static String LOG_FOLDER=ROOT_FOLDER+"/log";
|
||||
|
||||
public static String SHARED_PREFERENCES = "navInfo";
|
||||
|
||||
@ -65,7 +65,6 @@ public class Constant {
|
||||
PICTURE_FOLDER = BASE_FOLDER + "/picture";
|
||||
POI_DAO = BASE_FOLDER + "/BaseDao/";
|
||||
VIDEOS_ = BASE_FOLDER + "/videos";
|
||||
LOG_FOLDER =BASE_FOLDER+"/log";
|
||||
|
||||
|
||||
// 初始化应用目录
|
||||
|
@ -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.os.CountDownTimer;
|
||||
import android.os.Message;
|
||||
@ -11,6 +14,7 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.github.lazylibrary.util.FileUtils;
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.FragmentManagement;
|
||||
@ -27,6 +31,10 @@ import com.navinfo.outdoor.util.RegexUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@ -37,6 +45,8 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
|
||||
private EditText etForgetPawPhone, etForgetPawNote, etForgetPawPaw, etForgetPawConfirmPaw;
|
||||
private String sessionId;
|
||||
private CountDownTimer timer;
|
||||
private File logFile;
|
||||
private StringBuilder forgetPawBuilder;
|
||||
|
||||
public static ForgetPawFragment newInstance(Bundle bundle) {
|
||||
ForgetPawFragment fragment = new ForgetPawFragment();
|
||||
@ -49,6 +59,33 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
|
||||
return R.layout.fragment_forget_paw;
|
||||
}
|
||||
|
||||
@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");
|
||||
}
|
||||
}
|
||||
forgetPawBuilder = new StringBuilder();
|
||||
forgetPawBuilder.append("ForgetPawFragment-onViewCreated-initData,");
|
||||
if (Constant.USHERED!=null){
|
||||
forgetPawBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
@ -68,9 +105,11 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.iv_forgePaw_finish:
|
||||
forgetPawBuilder.append("点击了忘记密码的返回,");
|
||||
Objects.requireNonNull(getActivity()).finish();
|
||||
break;
|
||||
case R.id.forgetPaw_get_note:
|
||||
forgetPawBuilder.append("点击了获取短信验证码,");
|
||||
if (!RegexUtil.isPhone(etForgetPawPhone.getText().toString())) {
|
||||
Toast.makeText(getActivity(), "手机号错误,请重新输入", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
@ -79,6 +118,7 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
|
||||
|
||||
break;
|
||||
case R.id.btn_forgetPaw:
|
||||
forgetPawBuilder.append("点击了提交,");
|
||||
initForgetPaw();
|
||||
break;
|
||||
}
|
||||
@ -222,4 +262,24 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
forgetPawBuilder.append("onPause,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
forgetPawBuilder.append("onStop,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
forgetPawBuilder.append("onDestroy");
|
||||
forgetPawBuilder.append("\r\n");
|
||||
FileUtils.writeFile(logFile.getAbsolutePath(), forgetPawBuilder.toString(), true);
|
||||
}
|
||||
}
|
@ -717,10 +717,10 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
Toast.makeText(getActivity(), "存在类似名称---" + poiAddressName, Toast.LENGTH_SHORT).show();
|
||||
poiAddressName = "";
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "没有类似名称可以作业", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(getActivity(), "没有类似名称,可以作业", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "没有类似名称可以作业", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(getActivity(), "没有类似名称,可以作业", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else {
|
||||
editNameContent.setTextColor(Color.RED);
|
||||
|
@ -68,6 +68,22 @@ public class RecordFragment extends BaseFragment implements View.OnClickListener
|
||||
tabRecord.setupWithViewPager(vpRecord);
|
||||
Objects.requireNonNull(tabRecord.getTabAt(0)).setText(names[0]);
|
||||
Objects.requireNonNull(tabRecord.getTabAt(1)).setText(names[1]);
|
||||
tabRecord.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
refreshData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabUnselected(TabLayout.Tab tab) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
@ -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.os.CountDownTimer;
|
||||
import android.os.Message;
|
||||
@ -12,6 +15,9 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.github.lazylibrary.util.FileUtils;
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.LoginActivity;
|
||||
@ -28,6 +34,10 @@ import com.navinfo.outdoor.util.RegexUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
@ -43,6 +53,8 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
|
||||
private String sessionId;
|
||||
private CountDownTimer timer;
|
||||
private CheckBox ivRegisterCheck;
|
||||
private File logFile;
|
||||
private StringBuilder registerBuilder;
|
||||
|
||||
public static RegisterFragment newInstance(Bundle bundle) {
|
||||
RegisterFragment fragment = new RegisterFragment();
|
||||
@ -50,6 +62,7 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
|
||||
return fragment;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.fragment_register;
|
||||
@ -77,23 +90,48 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
|
||||
@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");
|
||||
}
|
||||
}
|
||||
registerBuilder = new StringBuilder();
|
||||
registerBuilder.append("RegisterFragment-onViewCreated-initData,");
|
||||
if (Constant.USHERED!=null){
|
||||
registerBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.iv_register_finish:
|
||||
registerBuilder.append("注册点击了返回,");
|
||||
Objects.requireNonNull(getActivity()).finish();
|
||||
break;
|
||||
case R.id.have_go_login:
|
||||
registerBuilder.append("点击了已有账号,去登录,");
|
||||
Intent registerLogin = new Intent(getActivity(), LoginActivity.class);
|
||||
startActivity(registerLogin);
|
||||
break;
|
||||
case R.id.btn_register:
|
||||
|
||||
registerBuilder.append("点击了注册,");
|
||||
initRegister();
|
||||
break;
|
||||
case R.id.register_get_note:
|
||||
registerBuilder.append("点击了获取短信验证码,");
|
||||
if (!RegexUtil.isPhone(etRegisterPhone.getText().toString())) {
|
||||
Toast.makeText(getActivity(), "手机号错误,请重新输入", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
@ -252,4 +290,25 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
|
||||
};
|
||||
timer.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
registerBuilder.append("onPause,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
registerBuilder.append("onStop,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
registerBuilder.append("onDestroy");
|
||||
registerBuilder.append("\r\n");
|
||||
FileUtils.writeFile(logFile.getAbsolutePath(), registerBuilder.toString(), true);
|
||||
}
|
||||
|
||||
}
|
@ -35,6 +35,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.github.lazylibrary.util.DensityUtil;
|
||||
import com.github.lazylibrary.util.FileUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.hjq.permissions.OnPermissionCallback;
|
||||
import com.hjq.permissions.Permission;
|
||||
@ -100,6 +101,7 @@ import com.vividsolutions.jts.geom.Point;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
@ -135,13 +137,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
private List<Removable> removables;
|
||||
private List<Removable> removableScreenMarker;
|
||||
private List<Removable> removablesLocality;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* bitmapDescriptor1
|
||||
*/
|
||||
|
||||
// private BitmapDescriptor bitmapDescriptor1, bitmapDescriptor2, bitmapDescriptor3, bitmapDescriptor4, bitmapDescriptor5;
|
||||
private Marker bigMarker;
|
||||
private List<Integer> upload;
|
||||
@ -149,6 +147,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
private final int MARKER_LINE = 2;
|
||||
private final int MARKER_FACE = 1;
|
||||
private final int MARKER_BIG = 4;
|
||||
|
||||
private boolean isBack = false;
|
||||
private HashMap<String, List<Marker>> removableHashMap;
|
||||
private ArrayList<LatLng> latList;
|
||||
@ -158,7 +157,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
private SharedPreferences.Editor sharedEdit;
|
||||
private SharedPreferences sharedPreferences;
|
||||
private AlertDialog.Builder builder;
|
||||
|
||||
private File logFile;
|
||||
private StringBuilder treasureBuilder;
|
||||
|
||||
public static TreasureFragment newInstance(Bundle bundle) {
|
||||
TreasureFragment fragment = new TreasureFragment();
|
||||
@ -217,7 +217,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
* @param hour 需要加的时间
|
||||
*/
|
||||
public static String addDateMinot(String day, int hour) {
|
||||
@SuppressLint("SimpleDateFormat") SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date date = null;
|
||||
try {
|
||||
date = format.parse(day);
|
||||
@ -262,7 +263,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
String format = formatter.format(calendar.getTime());
|
||||
Log.d("TAG", "onSuccessssss: " + format);
|
||||
Log.d("TAG", "onSuccess: " + format);
|
||||
sharedEdit.putInt("type", messageType);
|
||||
sharedEdit.putString("dataTime", format);
|
||||
sharedEdit.commit();
|
||||
@ -282,7 +283,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
EventBus.getDefault().register(this);
|
||||
sharedPreferences = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.MESSAGE_TYPE, Context.MODE_PRIVATE);
|
||||
sharedEdit = sharedPreferences.edit();
|
||||
//fragment 管理器
|
||||
@ -692,8 +692,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
obtain.what = Constant.JOB_SEARCH_WORD;
|
||||
obtain.obj = response;
|
||||
EventBus.getDefault().post(obtain);
|
||||
} else {
|
||||
Toast.makeText(getActivity(), response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@ -1392,12 +1390,37 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
@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");
|
||||
}
|
||||
}
|
||||
treasureBuilder = new StringBuilder();
|
||||
treasureBuilder.append("TreasureFragment-onViewCreated-initData,");
|
||||
if (Constant.USHERED!=null){
|
||||
treasureBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (!EventBus.getDefault().isRegistered(this)) {//加上判断
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
treasureMap.onStart();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1410,16 +1433,24 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
treasureMap.onPause();
|
||||
treasureBuilder.append("onPause,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
treasureMap.onStop();
|
||||
treasureBuilder.append("onStop,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
treasureBuilder.append("onDestroy");
|
||||
treasureBuilder.append("\r\n");
|
||||
FileUtils.writeFile(logFile.getAbsolutePath(), treasureBuilder.toString(), true);
|
||||
if (EventBus.getDefault().isRegistered(this)){
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
super.onDestroy();
|
||||
treasureMap.onDestroy();
|
||||
if (bigMarker != null) {
|
||||
@ -1429,24 +1460,27 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
removableScreenMarker.get(i).remove();
|
||||
}
|
||||
removableScreenMarker.clear();
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.iv_zoom_add://放大
|
||||
treasureBuilder.append("点击了放大的按钮,");
|
||||
CameraUpdate cameraUpdateIn = CameraUpdateFactory.zoomIn();
|
||||
tencentMap.animateCamera(cameraUpdateIn);
|
||||
break;
|
||||
case R.id.iv_zoom_del://缩小
|
||||
case R.id.iv_zoom_del://缩小:
|
||||
treasureBuilder.append("点击了缩小的按钮,");
|
||||
CameraUpdate cameraUpdateOut = CameraUpdateFactory.zoomOut();
|
||||
tencentMap.animateCamera(cameraUpdateOut);
|
||||
break;
|
||||
case R.id.iv_refrish://刷新
|
||||
case R.id.iv_refrish://刷新:
|
||||
treasureBuilder.append("点击了刷新的按钮,");
|
||||
refreshFilterData();
|
||||
break;
|
||||
case R.id.iv_location://定位:
|
||||
treasureBuilder.append("点击了定位的按钮,");
|
||||
if (Constant.currentLocation != null) {
|
||||
CameraUpdate cameraSigma =
|
||||
CameraUpdateFactory.newCameraPosition(new CameraPosition(
|
||||
@ -1461,6 +1495,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
break;
|
||||
case R.id.iv_submit://弹窗
|
||||
treasureBuilder.append("点击了弹窗 上报的按钮,");
|
||||
debounce(ivSubmit);
|
||||
if (upload == null) {
|
||||
Toast.makeText(getActivity(), "网络请求失败", Toast.LENGTH_SHORT).show();
|
||||
@ -1535,12 +1570,14 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}).setTitle(title);
|
||||
break;
|
||||
case R.id.iv_filter:
|
||||
treasureBuilder.append("点击了删选的按钮,");
|
||||
debounce(ivFilter);
|
||||
FilterFragment filterFragment = FilterFragment.newInstance(new Bundle());
|
||||
showSlidingFragment(filterFragment);
|
||||
refreshFilterData();
|
||||
break;
|
||||
case R.id.iv_message:
|
||||
treasureBuilder.append("点击了消息的按钮,");
|
||||
Intent messageIntent = new Intent(getContext(), FragmentManagement.class);
|
||||
messageIntent.putExtra("tag", 35);
|
||||
startActivity(messageIntent);
|
||||
@ -1955,4 +1992,5 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
treasureMap.onSizeChanged(measuredHeight, measuredWidth, measuredWidth, measuredHeight);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -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.util.Log;
|
||||
import android.view.View;
|
||||
@ -15,6 +17,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;
|
||||
@ -30,13 +33,16 @@ 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;
|
||||
|
||||
/**
|
||||
* 提现页面的fragment
|
||||
*/
|
||||
public class WithdrawFragment extends BaseFragment implements View.OnClickListener {
|
||||
|
||||
private TextView tvUnit;
|
||||
private TextView tvAlready;
|
||||
private TextView tvTotal;
|
||||
@ -53,6 +59,8 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
private TextView otherPushMoney;
|
||||
private TextView otherReportMoney;
|
||||
private CheckBox checkBox;
|
||||
private File logFile;
|
||||
private StringBuilder withdrawBuilder;
|
||||
|
||||
public static WithdrawFragment newInstance(Bundle bundle) {
|
||||
WithdrawFragment fragment = new WithdrawFragment();
|
||||
@ -68,6 +76,29 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
@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");
|
||||
}
|
||||
}
|
||||
withdrawBuilder = new StringBuilder();
|
||||
withdrawBuilder.append("WithdrawFragment-onViewCreated-initData,");
|
||||
if (Constant.USHERED != null) {
|
||||
withdrawBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -88,27 +119,29 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
if (isChecked) {
|
||||
if (Constant.ID_NUMBER==null||Constant.BACKGROUND ==null){
|
||||
if (Constant.ID_NUMBER == null || Constant.BACKGROUND == null) {
|
||||
Toast.makeText(getActivity(), "没有绑定银行卡,请先绑定银行卡", Toast.LENGTH_SHORT).show();
|
||||
checkBox.setChecked(false);
|
||||
}else {
|
||||
withdrawBuilder.append("点击了银行卡的勾选,");
|
||||
} else {
|
||||
checkBox.setChecked(true);
|
||||
withdrawBuilder.append("取消了银行卡的勾选,");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
Button btWithdraw = findViewById(R.id.button);
|
||||
btWithdraw.setOnClickListener(this);
|
||||
poiPushMoney = findViewById(R.id.poi_push_money);
|
||||
poiReportMoney = findViewById(R.id.poi_report_money);
|
||||
poiVideoPushMoney = findViewById(R.id.poiVideo_push_money);
|
||||
poiVideoReportMoney = findViewById(R.id.poiVideo_report_money);
|
||||
roadPushMoney = findViewById(R.id.road_push_money);
|
||||
roadReportMoney = findViewById(R.id.road_report_money);
|
||||
chargingPushMoney = findViewById(R.id.charging_push_money);
|
||||
chargingReportMoney = findViewById(R.id.charging_report_money);
|
||||
otherPushMoney = findViewById(R.id.other_push_money);
|
||||
otherReportMoney = findViewById(R.id.other_report_money);
|
||||
poiPushMoney = findViewById(R.id.poi_push_money);
|
||||
poiReportMoney = findViewById(R.id.poi_report_money);
|
||||
poiVideoPushMoney = findViewById(R.id.poiVideo_push_money);
|
||||
poiVideoReportMoney = findViewById(R.id.poiVideo_report_money);
|
||||
roadPushMoney = findViewById(R.id.road_push_money);
|
||||
roadReportMoney = findViewById(R.id.road_report_money);
|
||||
chargingPushMoney = findViewById(R.id.charging_push_money);
|
||||
chargingReportMoney = findViewById(R.id.charging_report_money);
|
||||
otherPushMoney = findViewById(R.id.other_push_money);
|
||||
otherReportMoney = findViewById(R.id.other_report_money);
|
||||
initNetWork();
|
||||
}
|
||||
|
||||
@ -126,25 +159,25 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
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 + "");
|
||||
canExchangePrice = response.getBody().getCanExchangePrice();
|
||||
tvUnit.setText(canExchangePrice + "");
|
||||
tvAlready.setText(response.getBody().getHaveExchangePrice() + "");
|
||||
poiPushMoney.setText(response.getBody().getPoiPushPrice() + "元");
|
||||
poiReportMoney.setText(response.getBody().getPoiNonepushPrice() + "元");
|
||||
poiVideoPushMoney.setText(response.getBody().getPoivideoPushPrice() + "元");
|
||||
poiVideoReportMoney.setText(response.getBody().getPoivideoNonepushPrice() + "元");
|
||||
roadPushMoney.setText(response.getBody().getRoadPushPrice() + "元");
|
||||
roadReportMoney.setText(response.getBody().getRoadNonepushPrice() + "元");
|
||||
chargingPushMoney.setText(response.getBody().getCsPushPrice() + "元");
|
||||
chargingReportMoney.setText(response.getBody().getCsNonepushPrice() + "元");
|
||||
otherPushMoney.setText(response.getBody().getOtherPushPrice() + "元");
|
||||
otherReportMoney.setText(response.getBody().getOtherNonepushPrice() + "元");
|
||||
}else {
|
||||
Toast.makeText(getActivity(), response.getMessage()+"", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
if (response.getCode() == 200) {
|
||||
Double userPrice = response.getBody().getUserPrice();
|
||||
tvTotal.setText(userPrice + "");
|
||||
canExchangePrice = response.getBody().getCanExchangePrice();
|
||||
tvUnit.setText(canExchangePrice + "");
|
||||
tvAlready.setText(response.getBody().getHaveExchangePrice() + "");
|
||||
poiPushMoney.setText(response.getBody().getPoiPushPrice() + "元");
|
||||
poiReportMoney.setText(response.getBody().getPoiNonepushPrice() + "元");
|
||||
poiVideoPushMoney.setText(response.getBody().getPoivideoPushPrice() + "元");
|
||||
poiVideoReportMoney.setText(response.getBody().getPoivideoNonepushPrice() + "元");
|
||||
roadPushMoney.setText(response.getBody().getRoadPushPrice() + "元");
|
||||
roadReportMoney.setText(response.getBody().getRoadNonepushPrice() + "元");
|
||||
chargingPushMoney.setText(response.getBody().getCsPushPrice() + "元");
|
||||
chargingReportMoney.setText(response.getBody().getCsNonepushPrice() + "元");
|
||||
otherPushMoney.setText(response.getBody().getOtherPushPrice() + "元");
|
||||
otherReportMoney.setText(response.getBody().getOtherNonepushPrice() + "元");
|
||||
} else {
|
||||
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
Log.d("TAG", "onSuccess: " + response.toString());
|
||||
}
|
||||
|
||||
@ -162,22 +195,25 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.iv_withdraw:
|
||||
withdrawBuilder.append("点击了财务信息的返回,");
|
||||
Objects.requireNonNull(getActivity()).finish();
|
||||
break;
|
||||
case R.id.tv_text:
|
||||
withdrawBuilder.append("点击了提现记录,");
|
||||
Intent intentText = new Intent(getActivity(), FragmentManagement.class);
|
||||
intentText.putExtra("tag", 26);
|
||||
startActivity(intentText);
|
||||
break;
|
||||
case R.id.button:
|
||||
withdrawBuilder.append("点击了立即提现,");
|
||||
String price = etAllPrice.getText().toString().trim();
|
||||
if (!price.equals("")){
|
||||
if (!price.equals("")) {
|
||||
double aDouble = Double.parseDouble(price);
|
||||
if (aDouble<10 ){
|
||||
if (aDouble < 10) {
|
||||
Toast.makeText(getActivity(), "提现金额不能低于10元", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "提现金额不能为空", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
@ -200,6 +236,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
break;
|
||||
case R.id.tv_all:
|
||||
withdrawBuilder.append("点击了全部,");
|
||||
etAllPrice.setText(canExchangePrice + "");
|
||||
break;
|
||||
}
|
||||
@ -228,8 +265,8 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
double v = Double.parseDouble(unit) - Double.parseDouble(price);
|
||||
String s = String.format("%.2f", v).toString();
|
||||
tvUnit.setText(s);
|
||||
}else {
|
||||
Toast.makeText(getActivity(), response.getMessage()+"", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
etAllPrice.getText().clear();
|
||||
|
||||
@ -244,4 +281,24 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
withdrawBuilder.append("onPause,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
withdrawBuilder.append("onStop,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
withdrawBuilder.append("onDestroy");
|
||||
withdrawBuilder.append("\r\n");
|
||||
FileUtils.writeFile(logFile.getAbsolutePath(), withdrawBuilder.toString(), true);
|
||||
}
|
||||
}
|
||||
|
@ -161,8 +161,12 @@ public class ContactView {
|
||||
String areaCode = "";
|
||||
if (editAreaCode.isShown()) {
|
||||
areaCode = editAreaCode.getText().toString().trim();
|
||||
}else {
|
||||
if (!Constant.CODE.equals("")){
|
||||
areaCode=Constant.CODE;
|
||||
}
|
||||
}
|
||||
if (!areaCode.equals("")&&!editPhoneNumber.getText().toString().trim().equals("")&&editPhoneNumber.getText().toString().trim()!=null){
|
||||
if (!editPhoneNumber.getText().toString().trim().equals("")) {
|
||||
poiBeans.add(new PhoneBean(null, editPhoneNumber.getText().toString().trim(), areaCode, 0));
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import okhttp3.Response;
|
||||
|
||||
@ -311,6 +312,10 @@ public class PoiSaveUtils {
|
||||
for (int i = 0; i < photoFile.size(); i++) {
|
||||
photoFile.get(i).delete();
|
||||
}
|
||||
if (videoFileList!=null){
|
||||
File file = new File(Objects.requireNonNull(videoFileList.get(0).getParentFile()).getAbsoluteFile() + "");
|
||||
file.delete();
|
||||
}
|
||||
Log.d("TAGss", "uploadPoiNet: 成功" + anInt);
|
||||
anInt++;
|
||||
return;
|
||||
|
@ -31,7 +31,7 @@ public class UploadUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* 道路
|
||||
* road
|
||||
* @param mContext
|
||||
* @param showPoiEntity
|
||||
* @param fileZip
|
||||
@ -56,6 +56,10 @@ public class UploadUtils {
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
fileListByUUID.get(i).delete();
|
||||
}
|
||||
if (fileListByUUID.size()>0){
|
||||
File file = new File(Objects.requireNonNull(fileListByUUID.get(0).getParentFile()).getAbsoluteFile() + "");
|
||||
file.delete();
|
||||
}
|
||||
fileZip.delete();
|
||||
Objects.requireNonNull(mContext).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -142,7 +146,7 @@ public class UploadUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* poiVideo
|
||||
* PoiVideo
|
||||
* @param mContext
|
||||
* @param showPoiEntity
|
||||
* @param fileZip
|
||||
@ -167,6 +171,10 @@ public class UploadUtils {
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
fileListByUUID.get(i).delete();
|
||||
}
|
||||
if (fileListByUUID.size()>0){
|
||||
File file = new File(Objects.requireNonNull(fileListByUUID.get(0).getParentFile()).getAbsoluteFile() + "");
|
||||
file.delete();
|
||||
}
|
||||
fileZip.delete();
|
||||
Objects.requireNonNull(mContext).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user