1.修改友盟上的bug.
This commit is contained in:
parent
1b47add5bf
commit
9f6a3a1cfe
@ -72,8 +72,8 @@ dependencies {
|
|||||||
api 'com.umeng.umsdk:asms:1.4.1'
|
api 'com.umeng.umsdk:asms:1.4.1'
|
||||||
//友盟Push依赖
|
//友盟Push依赖
|
||||||
api 'com.umeng.umsdk:push:6.4.7'
|
api 'com.umeng.umsdk:push:6.4.7'
|
||||||
//状态栏侵染
|
|
||||||
|
|
||||||
|
//状态栏侵染
|
||||||
// 基础依赖包,必须要依赖
|
// 基础依赖包,必须要依赖
|
||||||
implementation 'com.gyf.immersionbar:immersionbar:3.0.0'
|
implementation 'com.gyf.immersionbar:immersionbar:3.0.0'
|
||||||
implementation 'com.gyf.immersionbar:immersionbar-components:3.0.0'
|
implementation 'com.gyf.immersionbar:immersionbar-components:3.0.0'
|
||||||
@ -99,8 +99,9 @@ dependencies {
|
|||||||
//省市区 https://github.com/Bigkoo/Android-PickerView
|
//省市区 https://github.com/Bigkoo/Android-PickerView
|
||||||
compile 'com.contrarywind:Android-PickerView:4.1.6'
|
compile 'com.contrarywind:Android-PickerView:4.1.6'
|
||||||
implementation 'com.contrarywind:Android-PickerView:4.1.8'
|
implementation 'com.contrarywind:Android-PickerView:4.1.8'
|
||||||
/* //加载html
|
/*加载html
|
||||||
implementation 'com.github.sendtion:XRichText:1.9.4'*/
|
implementation 'com.github.sendtion:XRichText:1.9.4'
|
||||||
|
*/
|
||||||
//加载图片的依赖包
|
//加载图片的依赖包
|
||||||
implementation 'com.github.bumptech.glide:glide:4.8.0'
|
implementation 'com.github.bumptech.glide:glide:4.8.0'
|
||||||
//弹窗 https://github.com/kongzue/DialogV3
|
//弹窗 https://github.com/kongzue/DialogV3
|
||||||
@ -113,7 +114,7 @@ dependencies {
|
|||||||
//抽屉控件 https://github.com/umano/AndroidSlidingUpPanel
|
//抽屉控件 https://github.com/umano/AndroidSlidingUpPanel
|
||||||
implementation 'com.sothree.slidinguppanel:library:3.4.0'
|
implementation 'com.sothree.slidinguppanel:library:3.4.0'
|
||||||
|
|
||||||
//腾讯地图
|
//腾讯地图
|
||||||
// 地图库
|
// 地图库
|
||||||
implementation 'com.tencent.map:tencent-map-vector-sdk:4.4.2'
|
implementation 'com.tencent.map:tencent-map-vector-sdk:4.4.2'
|
||||||
// 地图组件库,包括小车平移、点聚合等组件功能,详见开发指南。
|
// 地图组件库,包括小车平移、点聚合等组件功能,详见开发指南。
|
||||||
|
@ -79,7 +79,6 @@
|
|||||||
<meta-data
|
<meta-data
|
||||||
android:name="design_height_in_dp"
|
android:name="design_height_in_dp"
|
||||||
android:value="640" />
|
android:value="640" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.MainActivity"
|
android:name=".activity.MainActivity"
|
||||||
android:screenOrientation="portrait">
|
android:screenOrientation="portrait">
|
||||||
@ -88,6 +87,11 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
<!-- <activity
|
||||||
|
android:name=".activity.UMClickActivity"
|
||||||
|
android:launchMode="singleTask"
|
||||||
|
android:exported="true" />-->
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.LoginActivity"
|
android:name=".activity.LoginActivity"
|
||||||
android:configChanges="keyboardHidden|orientation"
|
android:configChanges="keyboardHidden|orientation"
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.navinfo.outdoor.activity;
|
package com.navinfo.outdoor.activity;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import com.navinfo.outdoor.R;
|
import com.navinfo.outdoor.R;
|
||||||
import com.navinfo.outdoor.base.BaseActivity;
|
import com.navinfo.outdoor.base.BaseActivity;
|
||||||
import com.navinfo.outdoor.fragment.AboutFragment;
|
import com.navinfo.outdoor.fragment.AboutFragment;
|
||||||
@ -176,13 +177,13 @@ public class FragmentManagement extends BaseActivity {
|
|||||||
fragmentTransaction.hide(filterFragment);
|
fragmentTransaction.hide(filterFragment);
|
||||||
if (otherFragment != null)//寻宝-上传-其他 -33
|
if (otherFragment != null)//寻宝-上传-其他 -33
|
||||||
fragmentTransaction.hide(otherFragment);
|
fragmentTransaction.hide(otherFragment);
|
||||||
if (chargingPileFragment!=null)//寻宝-上传-充电站-充电桩的fragment-34
|
if (chargingPileFragment != null)//寻宝-上传-充电站-充电桩的fragment-34
|
||||||
fragmentTransaction.hide(chargingPileFragment);
|
fragmentTransaction.hide(chargingPileFragment);
|
||||||
if (messageFragment!=null)//寻宝 -消息的Fragment -35
|
if (messageFragment != null)//寻宝 -消息的Fragment -35
|
||||||
fragmentTransaction.hide(messageFragment);
|
fragmentTransaction.hide(messageFragment);
|
||||||
if (photoFragment!=null)//查看详情-图片 36
|
if (photoFragment != null)//查看详情-图片 36
|
||||||
fragmentTransaction.hide(photoFragment);
|
fragmentTransaction.hide(photoFragment);
|
||||||
if (videoFragment!=null)//查看详情-视频 37
|
if (videoFragment != null)//查看详情-视频 37
|
||||||
fragmentTransaction.hide(videoFragment);
|
fragmentTransaction.hide(videoFragment);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,7 +204,7 @@ public class FragmentManagement extends BaseActivity {
|
|||||||
break;
|
break;
|
||||||
case 2://发现的fragment
|
case 2://发现的fragment
|
||||||
if (findFragment == null) {
|
if (findFragment == null) {
|
||||||
findFragment =FindFragment.newInstance(new Bundle());
|
findFragment = FindFragment.newInstance(new Bundle());
|
||||||
fragmentTransaction.add(R.id.frame_layout, findFragment);
|
fragmentTransaction.add(R.id.frame_layout, findFragment);
|
||||||
} else {
|
} else {
|
||||||
fragmentTransaction.show(findFragment);
|
fragmentTransaction.show(findFragment);
|
||||||
@ -219,7 +220,7 @@ public class FragmentManagement extends BaseActivity {
|
|||||||
break;
|
break;
|
||||||
case 4://寻宝的fragment
|
case 4://寻宝的fragment
|
||||||
if (treasureFragment == null) {
|
if (treasureFragment == null) {
|
||||||
treasureFragment =TreasureFragment.newInstance(new Bundle());
|
treasureFragment = TreasureFragment.newInstance(new Bundle());
|
||||||
fragmentTransaction.add(R.id.frame_layout, treasureFragment);
|
fragmentTransaction.add(R.id.frame_layout, treasureFragment);
|
||||||
} else {
|
} else {
|
||||||
fragmentTransaction.show(treasureFragment);
|
fragmentTransaction.show(treasureFragment);
|
||||||
@ -227,7 +228,7 @@ public class FragmentManagement extends BaseActivity {
|
|||||||
break;
|
break;
|
||||||
case 5://注册的fragment
|
case 5://注册的fragment
|
||||||
if (registerFragment == null) {
|
if (registerFragment == null) {
|
||||||
registerFragment =RegisterFragment.newInstance(new Bundle());
|
registerFragment = RegisterFragment.newInstance(new Bundle());
|
||||||
fragmentTransaction.add(R.id.frame_layout, registerFragment);
|
fragmentTransaction.add(R.id.frame_layout, registerFragment);
|
||||||
} else {
|
} else {
|
||||||
fragmentTransaction.show(registerFragment);
|
fragmentTransaction.show(registerFragment);
|
||||||
@ -235,7 +236,7 @@ public class FragmentManagement extends BaseActivity {
|
|||||||
break;
|
break;
|
||||||
case 6://忘记密码fragment
|
case 6://忘记密码fragment
|
||||||
if (forgetPawFragment == null) {
|
if (forgetPawFragment == null) {
|
||||||
forgetPawFragment =ForgetPawFragment.newInstance(new Bundle());
|
forgetPawFragment = ForgetPawFragment.newInstance(new Bundle());
|
||||||
fragmentTransaction.add(R.id.frame_layout, forgetPawFragment);
|
fragmentTransaction.add(R.id.frame_layout, forgetPawFragment);
|
||||||
} else {
|
} else {
|
||||||
fragmentTransaction.show(forgetPawFragment);
|
fragmentTransaction.show(forgetPawFragment);
|
||||||
@ -243,7 +244,7 @@ public class FragmentManagement extends BaseActivity {
|
|||||||
break;
|
break;
|
||||||
case 7://发现-任务专区的fragment
|
case 7://发现-任务专区的fragment
|
||||||
if (taskPrefectureFragment == null) {
|
if (taskPrefectureFragment == null) {
|
||||||
taskPrefectureFragment =TaskPrefectureFragment.newInstance(new Bundle());
|
taskPrefectureFragment = TaskPrefectureFragment.newInstance(new Bundle());
|
||||||
fragmentTransaction.add(R.id.frame_layout, taskPrefectureFragment);
|
fragmentTransaction.add(R.id.frame_layout, taskPrefectureFragment);
|
||||||
} else {
|
} else {
|
||||||
fragmentTransaction.show(taskPrefectureFragment);
|
fragmentTransaction.show(taskPrefectureFragment);
|
||||||
@ -259,7 +260,7 @@ public class FragmentManagement extends BaseActivity {
|
|||||||
break;
|
break;
|
||||||
case 9://发现-活动专区的fragment
|
case 9://发现-活动专区的fragment
|
||||||
if (eventPrefectureFragment == null) {
|
if (eventPrefectureFragment == null) {
|
||||||
eventPrefectureFragment =EventPrefectureFragment.newInstance(new Bundle());
|
eventPrefectureFragment = EventPrefectureFragment.newInstance(new Bundle());
|
||||||
fragmentTransaction.add(R.id.frame_layout, eventPrefectureFragment);
|
fragmentTransaction.add(R.id.frame_layout, eventPrefectureFragment);
|
||||||
} else {
|
} else {
|
||||||
fragmentTransaction.show(eventPrefectureFragment);
|
fragmentTransaction.show(eventPrefectureFragment);
|
||||||
@ -267,7 +268,7 @@ public class FragmentManagement extends BaseActivity {
|
|||||||
break;
|
break;
|
||||||
case 10://发现-任务说明点击Item进入fragment
|
case 10://发现-任务说明点击Item进入fragment
|
||||||
if (taskExplainFragment2 == null) {
|
if (taskExplainFragment2 == null) {
|
||||||
taskExplainFragment2 =TaskExplainFragment2.newInstance(new Bundle());
|
taskExplainFragment2 = TaskExplainFragment2.newInstance(new Bundle());
|
||||||
fragmentTransaction.add(R.id.frame_layout, taskExplainFragment2);
|
fragmentTransaction.add(R.id.frame_layout, taskExplainFragment2);
|
||||||
} else {
|
} else {
|
||||||
fragmentTransaction.show(taskExplainFragment2);
|
fragmentTransaction.show(taskExplainFragment2);
|
||||||
@ -283,7 +284,7 @@ public class FragmentManagement extends BaseActivity {
|
|||||||
break;
|
break;
|
||||||
case 12://发现-能力测评2的fragment
|
case 12://发现-能力测评2的fragment
|
||||||
if (capacityEvaluationFragment2 == null) {
|
if (capacityEvaluationFragment2 == null) {
|
||||||
capacityEvaluationFragment2 =CapacityEvaluationFragment2.newInstance(new Bundle());
|
capacityEvaluationFragment2 = CapacityEvaluationFragment2.newInstance(new Bundle());
|
||||||
fragmentTransaction.add(R.id.frame_layout, capacityEvaluationFragment2);
|
fragmentTransaction.add(R.id.frame_layout, capacityEvaluationFragment2);
|
||||||
} else {
|
} else {
|
||||||
fragmentTransaction.show(capacityEvaluationFragment2);
|
fragmentTransaction.show(capacityEvaluationFragment2);
|
||||||
@ -291,7 +292,7 @@ public class FragmentManagement extends BaseActivity {
|
|||||||
break;
|
break;
|
||||||
case 13://发现-任务说明点击Item进入Web页面的fragment
|
case 13://发现-任务说明点击Item进入Web页面的fragment
|
||||||
if (taskExWebFragment == null) {
|
if (taskExWebFragment == null) {
|
||||||
taskExWebFragment =TaskExWebFragment.newInstance(new Bundle());
|
taskExWebFragment = TaskExWebFragment.newInstance(new Bundle());
|
||||||
fragmentTransaction.add(R.id.frame_layout, taskExWebFragment);
|
fragmentTransaction.add(R.id.frame_layout, taskExWebFragment);
|
||||||
} else {
|
} else {
|
||||||
fragmentTransaction.show(taskExWebFragment);
|
fragmentTransaction.show(taskExWebFragment);
|
||||||
@ -299,7 +300,7 @@ public class FragmentManagement extends BaseActivity {
|
|||||||
break;
|
break;
|
||||||
case 14://发现-能力测评item点击跳转测试的fragment
|
case 14://发现-能力测评item点击跳转测试的fragment
|
||||||
if (capacityMeasurementFragment == null) {
|
if (capacityMeasurementFragment == null) {
|
||||||
capacityMeasurementFragment = CapacityMeasurementFragment.newInstance(new Bundle());
|
capacityMeasurementFragment = CapacityMeasurementFragment.newInstance(new Bundle());
|
||||||
fragmentTransaction.add(R.id.frame_layout, capacityMeasurementFragment);
|
fragmentTransaction.add(R.id.frame_layout, capacityMeasurementFragment);
|
||||||
} else {
|
} else {
|
||||||
fragmentTransaction.show(capacityMeasurementFragment);
|
fragmentTransaction.show(capacityMeasurementFragment);
|
||||||
@ -347,7 +348,7 @@ public class FragmentManagement extends BaseActivity {
|
|||||||
break;
|
break;
|
||||||
case 20://我的-常见问题的fragment
|
case 20://我的-常见问题的fragment
|
||||||
if (issueFragment == null) {
|
if (issueFragment == null) {
|
||||||
issueFragment =IssueFragment.newInstance(new Bundle());
|
issueFragment = IssueFragment.newInstance(new Bundle());
|
||||||
fragmentTransaction.add(R.id.frame_layout, issueFragment);
|
fragmentTransaction.add(R.id.frame_layout, issueFragment);
|
||||||
} else {
|
} else {
|
||||||
fragmentTransaction.show(issueFragment);
|
fragmentTransaction.show(issueFragment);
|
||||||
@ -355,7 +356,7 @@ public class FragmentManagement extends BaseActivity {
|
|||||||
break;
|
break;
|
||||||
case 21://我的-联系我们的fragment
|
case 21://我的-联系我们的fragment
|
||||||
if (contactFragment == null) {
|
if (contactFragment == null) {
|
||||||
contactFragment =ContactFragment.newInstance(new Bundle());
|
contactFragment = ContactFragment.newInstance(new Bundle());
|
||||||
fragmentTransaction.add(R.id.frame_layout, contactFragment);
|
fragmentTransaction.add(R.id.frame_layout, contactFragment);
|
||||||
} else {
|
} else {
|
||||||
fragmentTransaction.show(contactFragment);
|
fragmentTransaction.show(contactFragment);
|
||||||
@ -395,7 +396,7 @@ public class FragmentManagement extends BaseActivity {
|
|||||||
break;
|
break;
|
||||||
case 26://我的-提现-提现记录的fragment
|
case 26://我的-提现-提现记录的fragment
|
||||||
if (withdrawalRecordFragment == null) {
|
if (withdrawalRecordFragment == null) {
|
||||||
withdrawalRecordFragment =WithdrawalRecordFragment.newInstance(new Bundle());
|
withdrawalRecordFragment = WithdrawalRecordFragment.newInstance(new Bundle());
|
||||||
fragmentTransaction.add(R.id.frame_layout, withdrawalRecordFragment);
|
fragmentTransaction.add(R.id.frame_layout, withdrawalRecordFragment);
|
||||||
} else {
|
} else {
|
||||||
fragmentTransaction.show(withdrawalRecordFragment);
|
fragmentTransaction.show(withdrawalRecordFragment);
|
||||||
@ -411,7 +412,7 @@ public class FragmentManagement extends BaseActivity {
|
|||||||
break;
|
break;
|
||||||
case 28://寻宝-上传-道路的fragment
|
case 28://寻宝-上传-道路的fragment
|
||||||
if (roadFragment == null) {
|
if (roadFragment == null) {
|
||||||
roadFragment =RoadFragment.newInstance(new Bundle());
|
roadFragment = RoadFragment.newInstance(new Bundle());
|
||||||
fragmentTransaction.add(R.id.frame_layout, roadFragment);
|
fragmentTransaction.add(R.id.frame_layout, roadFragment);
|
||||||
} else {
|
} else {
|
||||||
fragmentTransaction.show(roadFragment);
|
fragmentTransaction.show(roadFragment);
|
||||||
@ -436,8 +437,8 @@ public class FragmentManagement extends BaseActivity {
|
|||||||
case 31://记录-已提交-任务列表的fragment
|
case 31://记录-已提交-任务列表的fragment
|
||||||
if (poiTaskFragment == null) {
|
if (poiTaskFragment == null) {
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putInt("type",getIntent().getIntExtra("type",0));
|
bundle.putInt("type", getIntent().getIntExtra("type", 0));
|
||||||
poiTaskFragment =PoiTaskFragment.newInstance(bundle);
|
poiTaskFragment = PoiTaskFragment.newInstance(bundle);
|
||||||
fragmentTransaction.add(R.id.frame_layout, poiTaskFragment);
|
fragmentTransaction.add(R.id.frame_layout, poiTaskFragment);
|
||||||
} else {
|
} else {
|
||||||
fragmentTransaction.show(poiTaskFragment);
|
fragmentTransaction.show(poiTaskFragment);
|
||||||
@ -460,10 +461,10 @@ public class FragmentManagement extends BaseActivity {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 34://寻宝-上传-充电站-充电桩
|
case 34://寻宝-上传-充电站-充电桩
|
||||||
if (chargingPileFragment ==null){
|
if (chargingPileFragment == null) {
|
||||||
chargingPileFragment =ChargingPileFragment.newInstance(new Bundle());
|
chargingPileFragment = ChargingPileFragment.newInstance(new Bundle());
|
||||||
fragmentTransaction.add(R.id.frame_layout,chargingPileFragment);
|
fragmentTransaction.add(R.id.frame_layout, chargingPileFragment);
|
||||||
}else {
|
} else {
|
||||||
fragmentTransaction.show(chargingPileFragment);
|
fragmentTransaction.show(chargingPileFragment);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -476,22 +477,22 @@ public class FragmentManagement extends BaseActivity {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 36://查看详情-图片
|
case 36://查看详情-图片
|
||||||
if (photoFragment == null){
|
if (photoFragment == null) {
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putSerializable("showPoiEntity",getIntent().getSerializableExtra("showPoiEntity"));
|
bundle.putSerializable("showPoiEntity", getIntent().getSerializableExtra("showPoiEntity"));
|
||||||
photoFragment = PhotoFragment.newInstance(bundle);
|
photoFragment = PhotoFragment.newInstance(bundle);
|
||||||
fragmentTransaction.add(R.id.frame_layout,photoFragment);
|
fragmentTransaction.add(R.id.frame_layout, photoFragment);
|
||||||
}else {
|
} else {
|
||||||
fragmentTransaction.show(photoFragment);
|
fragmentTransaction.show(photoFragment);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 37://查看详情-视频
|
case 37://查看详情-视频
|
||||||
if (videoFragment==null){
|
if (videoFragment == null) {
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putSerializable("showPoiEntity",getIntent().getSerializableExtra("showPoiEntity"));
|
bundle.putSerializable("showPoiEntity", getIntent().getSerializableExtra("showPoiEntity"));
|
||||||
videoFragment=VideoFragment.newInstance(bundle);
|
videoFragment = VideoFragment.newInstance(bundle);
|
||||||
fragmentTransaction.add(R.id.frame_layout,videoFragment);
|
fragmentTransaction.add(R.id.frame_layout, videoFragment);
|
||||||
}else {
|
} else {
|
||||||
fragmentTransaction.show(videoFragment);
|
fragmentTransaction.show(videoFragment);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -6,25 +6,24 @@ import android.content.Intent;
|
|||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.github.lazylibrary.util.FileUtils;
|
import com.github.lazylibrary.util.FileUtils;
|
||||||
import com.lzy.okgo.model.HttpParams;
|
import com.lzy.okgo.model.HttpParams;
|
||||||
import com.navinfo.outdoor.R;
|
import com.navinfo.outdoor.R;
|
||||||
import com.navinfo.outdoor.api.Constant;
|
import com.navinfo.outdoor.api.Constant;
|
||||||
import com.navinfo.outdoor.base.BaseActivity;
|
import com.navinfo.outdoor.base.BaseActivity;
|
||||||
import com.navinfo.outdoor.bean.BaseBean;
|
import com.navinfo.outdoor.bean.BaseBean;
|
||||||
|
import com.navinfo.outdoor.bean.UserBean;
|
||||||
import com.navinfo.outdoor.http.Callback;
|
import com.navinfo.outdoor.http.Callback;
|
||||||
import com.navinfo.outdoor.http.HttpInterface;
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
@ -153,10 +152,8 @@ public class GuidanceActivity extends BaseActivity {
|
|||||||
Message message = new Message();
|
Message message = new Message();
|
||||||
message.what = 0x101;
|
message.what = 0x101;
|
||||||
handler.sendMessageDelayed(message, 1000);
|
handler.sendMessageDelayed(message, 1000);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
taskItem.findViewById(R.id.btn_next_step).setOnClickListener(new View.OnClickListener() {
|
taskItem.findViewById(R.id.btn_next_step).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@ -167,7 +164,6 @@ public class GuidanceActivity extends BaseActivity {
|
|||||||
handler.sendMessageDelayed(message, 500);
|
handler.sendMessageDelayed(message, 500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
refreshItem.findViewById(R.id.btn_next_step).setOnClickListener(new View.OnClickListener() {
|
refreshItem.findViewById(R.id.btn_next_step).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@ -178,7 +174,6 @@ public class GuidanceActivity extends BaseActivity {
|
|||||||
handler.sendMessageDelayed(message, 500);
|
handler.sendMessageDelayed(message, 500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
screenItem.findViewById(R.id.btn_next_step).setOnClickListener(new View.OnClickListener() {
|
screenItem.findViewById(R.id.btn_next_step).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@ -189,7 +184,6 @@ public class GuidanceActivity extends BaseActivity {
|
|||||||
handler.sendMessageDelayed(message, 500);
|
handler.sendMessageDelayed(message, 500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
locationItem.findViewById(R.id.btn_next_step).setOnClickListener(new View.OnClickListener() {
|
locationItem.findViewById(R.id.btn_next_step).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@ -200,7 +194,6 @@ public class GuidanceActivity extends BaseActivity {
|
|||||||
handler.sendMessageDelayed(message, 500);
|
handler.sendMessageDelayed(message, 500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
gatherItem.findViewById(R.id.btn_next_step).setOnClickListener(new View.OnClickListener() {
|
gatherItem.findViewById(R.id.btn_next_step).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@ -211,7 +204,6 @@ public class GuidanceActivity extends BaseActivity {
|
|||||||
handler.sendMessageDelayed(message, 500);
|
handler.sendMessageDelayed(message, 500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
submitItem.findViewById(R.id.btn_next_step).setOnClickListener(new View.OnClickListener() {
|
submitItem.findViewById(R.id.btn_next_step).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@ -222,7 +214,6 @@ public class GuidanceActivity extends BaseActivity {
|
|||||||
handler.sendMessageDelayed(message, 500);
|
handler.sendMessageDelayed(message, 500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
submittedItem.findViewById(R.id.btn_next_step).setOnClickListener(new View.OnClickListener() {
|
submittedItem.findViewById(R.id.btn_next_step).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@ -233,7 +224,6 @@ public class GuidanceActivity extends BaseActivity {
|
|||||||
handler.sendMessageDelayed(message, 500);
|
handler.sendMessageDelayed(message, 500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
discoverItem.findViewById(R.id.btn_next_step).setOnClickListener(new View.OnClickListener() {
|
discoverItem.findViewById(R.id.btn_next_step).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@ -244,7 +234,6 @@ public class GuidanceActivity extends BaseActivity {
|
|||||||
handler.sendMessageDelayed(message, 500);
|
handler.sendMessageDelayed(message, 500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
myHeadItem.findViewById(R.id.btn_next_step).setOnClickListener(new View.OnClickListener() {
|
myHeadItem.findViewById(R.id.btn_next_step).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@ -255,7 +244,6 @@ public class GuidanceActivity extends BaseActivity {
|
|||||||
handler.sendMessageDelayed(message, 500);
|
handler.sendMessageDelayed(message, 500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
dataItem.findViewById(R.id.btn_next_step).setOnClickListener(new View.OnClickListener() {
|
dataItem.findViewById(R.id.btn_next_step).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@ -266,7 +254,6 @@ public class GuidanceActivity extends BaseActivity {
|
|||||||
handler.sendMessageDelayed(message, 500);
|
handler.sendMessageDelayed(message, 500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
withdrawItem.findViewById(R.id.btn_to_learn).setOnClickListener(new View.OnClickListener() {
|
withdrawItem.findViewById(R.id.btn_to_learn).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@ -285,20 +272,20 @@ public class GuidanceActivity extends BaseActivity {
|
|||||||
.time(30)
|
.time(30)
|
||||||
.Builder(this)
|
.Builder(this)
|
||||||
.url(HttpInterface.INSERT_USER_GUIDE)
|
.url(HttpInterface.INSERT_USER_GUIDE)
|
||||||
.cls(BaseBean.class)
|
.cls(UserBean.class)
|
||||||
.params(new HttpParams());
|
.params(new HttpParams());
|
||||||
okGoBuilder.getRequest(new Callback<BaseBean<Integer>>() {
|
okGoBuilder.getRequest(new Callback<UserBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(BaseBean<Integer> response, int id) {
|
public void onSuccess(UserBean response, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
if (response.getCode() == 200) {
|
if (response.getCode() == 200) {
|
||||||
startActivity(new Intent(GuidanceActivity.this, HomeActivity.class));
|
startActivity(new Intent(GuidanceActivity.this, HomeActivity.class));
|
||||||
GuidanceActivity.this.finish();
|
GuidanceActivity.this.finish();
|
||||||
Toast.makeText(GuidanceActivity.this, "可以在发现版块的任务说明中,进行再次学习哦", Toast.LENGTH_LONG).show();
|
ToastUtils.Message(GuidanceActivity.this,"可以在发现版块的任务说明中,进行再次学习哦");
|
||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(GuidanceActivity.this);
|
FlushTokenUtil.flushToken(GuidanceActivity.this);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(GuidanceActivity.this, response.getMessage(), Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(GuidanceActivity.this,response.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,10 +294,10 @@ public class GuidanceActivity extends BaseActivity {
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout")|| message.contains("Read time out")){
|
if (message.equals("timeout")|| message.equals("Read time out")){
|
||||||
Toast.makeText(GuidanceActivity.this, "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(GuidanceActivity.this,"请求超时");
|
||||||
}else {
|
}else {
|
||||||
Toast.makeText(GuidanceActivity.this, message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(GuidanceActivity.this,message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.navinfo.outdoor.activity;
|
package com.navinfo.outdoor.activity;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
|
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
|
||||||
import com.kongzue.dialog.util.BaseDialog;
|
import com.kongzue.dialog.util.BaseDialog;
|
||||||
import com.kongzue.dialog.util.DialogSettings;
|
import com.kongzue.dialog.util.DialogSettings;
|
||||||
@ -7,10 +8,12 @@ import com.kongzue.dialog.v3.MessageDialog;
|
|||||||
import com.navinfo.outdoor.api.Constant;
|
import com.navinfo.outdoor.api.Constant;
|
||||||
import com.navinfo.outdoor.api.UserApplication;
|
import com.navinfo.outdoor.api.UserApplication;
|
||||||
import com.navinfo.outdoor.base.BaseActivity;
|
import com.navinfo.outdoor.base.BaseActivity;
|
||||||
|
import com.navinfo.outdoor.bean.NotificationBean;
|
||||||
import com.navinfo.outdoor.fragment.FindFragment;
|
import com.navinfo.outdoor.fragment.FindFragment;
|
||||||
import com.navinfo.outdoor.fragment.MineFragment;
|
import com.navinfo.outdoor.fragment.MineFragment;
|
||||||
import com.navinfo.outdoor.fragment.RecordFragment;
|
import com.navinfo.outdoor.fragment.RecordFragment;
|
||||||
import com.navinfo.outdoor.fragment.TreasureFragment;
|
import com.navinfo.outdoor.fragment.TreasureFragment;
|
||||||
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
import com.navinfo.outdoor.room.PoiDatabase;
|
import com.navinfo.outdoor.room.PoiDatabase;
|
||||||
import com.navinfo.outdoor.util.BackHandlerHelper;
|
import com.navinfo.outdoor.util.BackHandlerHelper;
|
||||||
import com.navinfo.outdoor.util.NoSlideViewPager;
|
import com.navinfo.outdoor.util.NoSlideViewPager;
|
||||||
@ -42,6 +45,7 @@ import org.greenrobot.eventbus.Subscribe;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -70,9 +74,9 @@ public class HomeActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
if (Constant.USHERED!=null){
|
if (Constant.USHERED != null) {
|
||||||
Constant.initRootFolder(Constant.USHERED);
|
Constant.initRootFolder(Constant.USHERED);
|
||||||
}else {
|
} else {
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -88,33 +92,48 @@ public class HomeActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
initUM();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initUM() {
|
||||||
//自定义点击通知时的打开动作
|
//自定义点击通知时的打开动作
|
||||||
UmengNotificationClickHandler notificationClickHandler = new UmengNotificationClickHandler() {
|
UmengNotificationClickHandler notificationClickHandler = new UmengNotificationClickHandler() {
|
||||||
@Override
|
@Override
|
||||||
public void dealWithCustomAction(Context context, UMessage msg) {
|
public void dealWithCustomAction(Context context, UMessage msg) {
|
||||||
super.dealWithCustomAction(context, msg);
|
super.dealWithCustomAction(context, msg);
|
||||||
Log.i("TAG", "dealWithCustomAction: " + msg.getRaw().toString());
|
Log.i("TAGEE", "dealWithCustomAction: " + msg.getRaw().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void openActivity(Context context, UMessage msg) {
|
public void openActivity(Context context, UMessage msg) {
|
||||||
super.openActivity(context, msg);
|
super.openActivity(context, msg);
|
||||||
Log.i("TAG", "click openActivity: " + msg.getRaw().toString());
|
Log.i("TAGEE", "click openActivity: " + msg.getRaw().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void launchApp(Context context, UMessage msg) {
|
public void launchApp(Context context, UMessage msg) {
|
||||||
super.launchApp(context, msg);
|
super.launchApp(context, msg);
|
||||||
Log.i("TAGEE", "click launchApp: " + msg.getRaw().toString());
|
Log.i("TAGEE", "click launchApp: " + msg.getRaw().toString());
|
||||||
Intent messageIntent = new Intent(HomeActivity.this, FragmentManagement.class);
|
NotificationBean notificationBean = new Gson().fromJson(msg.getRaw().toString(), NotificationBean.class);
|
||||||
messageIntent.putExtra("tag", 35);
|
NotificationBean.ExtraBean extra = notificationBean.getExtra();
|
||||||
startActivity(messageIntent);
|
if (extra!=null){
|
||||||
|
HashMap<String, String> paramMap = new HashMap<>();
|
||||||
|
paramMap.put("id", extra.getId()+ "");
|
||||||
|
Intent intent = new Intent(HomeActivity.this, WebActivity.class);
|
||||||
|
intent.putExtra("map", paramMap);
|
||||||
|
intent.putExtra("url", HttpInterface.MSG_CONTENT);
|
||||||
|
startActivity(intent);
|
||||||
|
}else {
|
||||||
|
Intent messageIntent = new Intent(HomeActivity.this, FragmentManagement.class);
|
||||||
|
messageIntent.putExtra("tag", 35);
|
||||||
|
startActivity(messageIntent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dismissNotification(Context context, UMessage msg) {
|
public void dismissNotification(Context context, UMessage msg) {
|
||||||
super.dismissNotification(context, msg);
|
super.dismissNotification(context, msg);
|
||||||
Log.i("TAG", "click dismissNotification: " + msg.getRaw().toString());
|
Log.i("TAGEE", "click dismissNotification: " + msg.getRaw().toString());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
UserApplication.instance.setNotificationClickHandler(notificationClickHandler);
|
UserApplication.instance.setNotificationClickHandler(notificationClickHandler);
|
||||||
@ -140,6 +159,7 @@ public class HomeActivity extends BaseActivity {
|
|||||||
public Fragment getItem(int i) {
|
public Fragment getItem(int i) {
|
||||||
return fragments.get(i);
|
return fragments.get(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getCount() {
|
public int getCount() {
|
||||||
return fragments.size();
|
return fragments.size();
|
||||||
@ -162,7 +182,6 @@ public class HomeActivity extends BaseActivity {
|
|||||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||||
obtain.obj = true;
|
obtain.obj = true;
|
||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
|
|
||||||
} else if (tab.getPosition() == 1) {
|
} else if (tab.getPosition() == 1) {
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.STAY_SUBMIT_ITEM;
|
obtain.what = Constant.STAY_SUBMIT_ITEM;
|
||||||
@ -173,7 +192,6 @@ public class HomeActivity extends BaseActivity {
|
|||||||
obtain1.what = Constant.HAS_SUBMIT_ITEM;
|
obtain1.what = Constant.HAS_SUBMIT_ITEM;
|
||||||
obtain1.obj = true;
|
obtain1.obj = true;
|
||||||
EventBus.getDefault().post(obtain1);
|
EventBus.getDefault().post(obtain1);
|
||||||
|
|
||||||
} else if (tab.getPosition() == 3) {
|
} else if (tab.getPosition() == 3) {
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.HOME_MINE;
|
obtain.what = Constant.HOME_MINE;
|
||||||
@ -181,14 +199,14 @@ public class HomeActivity extends BaseActivity {
|
|||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//点击table layout效果
|
//点击table layout效果
|
||||||
@Override
|
@Override
|
||||||
public void onTabUnselected(TabLayout.Tab tab) {
|
public void onTabUnselected(TabLayout.Tab tab) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTabReselected(TabLayout.Tab tab) {
|
public void onTabReselected(TabLayout.Tab tab) {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,8 @@ import com.navinfo.outdoor.http.UploadCallBack;
|
|||||||
import com.navinfo.outdoor.util.Base64;
|
import com.navinfo.outdoor.util.Base64;
|
||||||
import com.navinfo.outdoor.util.Md5Util;
|
import com.navinfo.outdoor.util.Md5Util;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
import com.umeng.umcrash.UMCrash;
|
import com.umeng.umcrash.UMCrash;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
@ -167,16 +169,16 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
|||||||
handler.sendMessageDelayed(message, 500);
|
handler.sendMessageDelayed(message, 500);
|
||||||
String name = etLoginName.getText().toString().trim();
|
String name = etLoginName.getText().toString().trim();
|
||||||
if (name.equals("")) {
|
if (name.equals("")) {
|
||||||
Toast.makeText(this, "请输入账号", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(LoginActivity.this,"请输入账号");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String paw = etLoginPaw.getText().toString().trim();
|
String paw = etLoginPaw.getText().toString().trim();
|
||||||
if (paw.equals("")) {
|
if (paw.equals("")) {
|
||||||
Toast.makeText(this, "请输入密码", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(LoginActivity.this,"请输入密码");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!cbStatement.isChecked()) {
|
if (!cbStatement.isChecked()) {
|
||||||
Toast.makeText(this, "请先同意用户协议", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(LoginActivity.this,"请先同意用户协议");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
initLogIn(name, paw);
|
initLogIn(name, paw);
|
||||||
@ -229,10 +231,10 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
|||||||
loginBuilder.append(TimestampUtil.time()).append(",").append("登录获取token ,");
|
loginBuilder.append(TimestampUtil.time()).append(",").append("登录获取token ,");
|
||||||
initGetUserInfo();//获取用户信息
|
initGetUserInfo();//获取用户信息
|
||||||
}else {
|
}else {
|
||||||
Toast.makeText(LoginActivity.this, "获取id 失败", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(LoginActivity.this,"获取id 失败");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(LoginActivity.this, response.getMessage(), Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(LoginActivity.this,response.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,9 +247,9 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
|||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout")|| message.contains("Read time out")) {
|
if (message.contains("timeout")|| message.contains("Read time out")) {
|
||||||
Toast.makeText(LoginActivity.this, "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(LoginActivity.this,"请求超时");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(LoginActivity.this, message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(LoginActivity.this,message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -312,14 +314,14 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
|||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
} else {
|
} else {
|
||||||
loginBuilder.append(TimestampUtil.time()).append(",").append("登录成功 ,");
|
loginBuilder.append(TimestampUtil.time()).append(",").append("登录成功 ,");
|
||||||
Toast.makeText(LoginActivity.this, "登录成功", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(LoginActivity.this,"登录成功");
|
||||||
Intent intent = new Intent(LoginActivity.this, HomeActivity.class);
|
Intent intent = new Intent(LoginActivity.this, HomeActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(LoginActivity.this, response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(LoginActivity.this,response.getMessage()+"");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -328,10 +330,10 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout")|| message.contains("Read time out")) {
|
if (message.equals("timeout")|| message.equals("Read time out")) {
|
||||||
Toast.makeText(LoginActivity.this, "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(LoginActivity.this,"请求超时");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(LoginActivity.this, message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(LoginActivity.this,message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -340,7 +342,6 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
|||||||
@Override
|
@Override
|
||||||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||||
super.onConfigurationChanged(newConfig);
|
super.onConfigurationChanged(newConfig);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -42,6 +42,8 @@ import com.navinfo.outdoor.http.UploadCallBack;
|
|||||||
import com.navinfo.outdoor.util.APKVersionCodeUtils;
|
import com.navinfo.outdoor.util.APKVersionCodeUtils;
|
||||||
import com.navinfo.outdoor.util.Base64;
|
import com.navinfo.outdoor.util.Base64;
|
||||||
import com.navinfo.outdoor.util.Md5Util;
|
import com.navinfo.outdoor.util.Md5Util;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -60,7 +62,7 @@ public class MainActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
public boolean handleMessage(@NonNull Message msg) {
|
public boolean handleMessage(@NonNull Message msg) {
|
||||||
if (msg.what == 0) {
|
if (msg.what == 0) {
|
||||||
Toast.makeText(MainActivity.this, "下载完成", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(MainActivity.this, "下载完成");
|
||||||
//将下载进度对话框取消
|
//将下载进度对话框取消
|
||||||
pBar.cancel();
|
pBar.cancel();
|
||||||
//调用系统安装程序
|
//调用系统安装程序
|
||||||
@ -190,9 +192,9 @@ public class MainActivity extends BaseActivity {
|
|||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
Toast.makeText(MainActivity.this, "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(MainActivity.this,"请求超时");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(MainActivity.this, message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(MainActivity.this,message);
|
||||||
}
|
}
|
||||||
initTime();
|
initTime();
|
||||||
}
|
}
|
||||||
@ -214,7 +216,7 @@ public class MainActivity extends BaseActivity {
|
|||||||
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
||||||
downFile(bodyBean.getApkUrl());//点击确定将apk下载
|
downFile(bodyBean.getApkUrl());//点击确定将apk下载
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(MainActivity.this, "SD卡不可用,请插入SD卡", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(MainActivity.this, "SD卡不可用,请插入SD卡");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -233,7 +235,7 @@ public class MainActivity extends BaseActivity {
|
|||||||
Environment.MEDIA_MOUNTED)) {
|
Environment.MEDIA_MOUNTED)) {
|
||||||
downFile(bodyBean.getApkUrl());//点击确定将apk下载
|
downFile(bodyBean.getApkUrl());//点击确定将apk下载
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(MainActivity.this, "SD卡不可用,请插入SD卡", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(MainActivity.this,"SD卡不可用,请插入SD卡");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -337,10 +339,10 @@ public class MainActivity extends BaseActivity {
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout")|| message.contains("Read time out")) {
|
if (message.equals("timeout")|| message.equals("Read time out")) {
|
||||||
Toast.makeText(MainActivity.this, "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(MainActivity.this,"请求超时");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(MainActivity.this, message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(MainActivity.this,message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -378,7 +380,7 @@ public class MainActivity extends BaseActivity {
|
|||||||
navInfoEditor.commit();
|
navInfoEditor.commit();
|
||||||
initGetUserInfo();//获取用户信息
|
initGetUserInfo();//获取用户信息
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(MainActivity.this, "获取用户id失败,请重试", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(MainActivity.this,"获取用户id失败,请重试");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Intent intent = new Intent(MainActivity.this, LoginActivity.class);
|
Intent intent = new Intent(MainActivity.this, LoginActivity.class);
|
||||||
@ -388,19 +390,17 @@ public class MainActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void uploadProgress(Progress progress) {
|
public void uploadProgress(Progress progress) { }
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable e, int id) {
|
public void onError(Throwable e, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout")|| message.contains("Read time out")) {
|
if (message.equals("timeout")|| message.equals("Read time out")) {
|
||||||
Toast.makeText(MainActivity.this, "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(MainActivity.this,"请求超时");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(MainActivity.this, message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(MainActivity.this,message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -28,6 +28,7 @@ import com.navinfo.outdoor.api.Constant;
|
|||||||
import com.navinfo.outdoor.base.BaseActivity;
|
import com.navinfo.outdoor.base.BaseActivity;
|
||||||
import com.navinfo.outdoor.util.SystemTTS;
|
import com.navinfo.outdoor.util.SystemTTS;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
import com.otaliastudios.cameraview.CameraListener;
|
import com.otaliastudios.cameraview.CameraListener;
|
||||||
import com.otaliastudios.cameraview.CameraLogger;
|
import com.otaliastudios.cameraview.CameraLogger;
|
||||||
import com.otaliastudios.cameraview.CameraView;
|
import com.otaliastudios.cameraview.CameraView;
|
||||||
@ -154,12 +155,7 @@ public class PhotographActivity extends BaseActivity implements View.OnClickList
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
} else {
|
} else {
|
||||||
runOnUiThread(new Runnable() {
|
ToastUtils.Message(PhotographActivity.this, "源文件不存在");
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(PhotographActivity.this, "源文件不存在", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/* CompressImageTask.get().compressImage(ImageConfig.getDefaultConfig(file.getAbsolutePath(), file.getAbsolutePath()), new AsyncImageTask.OnImageResult(){
|
/* CompressImageTask.get().compressImage(ImageConfig.getDefaultConfig(file.getAbsolutePath(), file.getAbsolutePath()), new AsyncImageTask.OnImageResult(){
|
||||||
@Override
|
@Override
|
||||||
@ -176,7 +172,6 @@ public class PhotographActivity extends BaseActivity implements View.OnClickList
|
|||||||
});*/
|
});*/
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
package com.navinfo.outdoor.activity;
|
package com.navinfo.outdoor.activity;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.ActivityInfo;
|
import android.content.pm.ActivityInfo;
|
||||||
@ -23,6 +24,7 @@ import android.widget.FrameLayout;
|
|||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.github.lazylibrary.util.FileUtils;
|
import com.github.lazylibrary.util.FileUtils;
|
||||||
import com.navinfo.outdoor.R;
|
import com.navinfo.outdoor.R;
|
||||||
import com.navinfo.outdoor.api.Constant;
|
import com.navinfo.outdoor.api.Constant;
|
||||||
@ -32,6 +34,7 @@ import com.navinfo.outdoor.util.AWMp4ParserHelper;
|
|||||||
import com.navinfo.outdoor.util.Geohash;
|
import com.navinfo.outdoor.util.Geohash;
|
||||||
import com.navinfo.outdoor.util.GeometryTools;
|
import com.navinfo.outdoor.util.GeometryTools;
|
||||||
import com.navinfo.outdoor.util.MyTecentLocationSource;
|
import com.navinfo.outdoor.util.MyTecentLocationSource;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
import com.otaliastudios.cameraview.CameraException;
|
import com.otaliastudios.cameraview.CameraException;
|
||||||
import com.otaliastudios.cameraview.CameraListener;
|
import com.otaliastudios.cameraview.CameraListener;
|
||||||
import com.otaliastudios.cameraview.CameraLogger;
|
import com.otaliastudios.cameraview.CameraLogger;
|
||||||
@ -59,10 +62,12 @@ import com.tencent.tencentmap.mapsdk.maps.model.MyLocationStyle;
|
|||||||
import com.tencent.tencentmap.mapsdk.maps.model.Polyline;
|
import com.tencent.tencentmap.mapsdk.maps.model.Polyline;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.PolylineOptions;
|
import com.tencent.tencentmap.mapsdk.maps.model.PolylineOptions;
|
||||||
import com.vividsolutions.jts.geom.Geometry;
|
import com.vividsolutions.jts.geom.Geometry;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
import org.greenrobot.eventbus.ThreadMode;
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileDescriptor;
|
import java.io.FileDescriptor;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
@ -77,6 +82,7 @@ import java.util.List;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
|
|
||||||
import static com.tencent.tencentmap.mapsdk.maps.model.MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE;
|
import static com.tencent.tencentmap.mapsdk.maps.model.MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE;
|
||||||
import static com.tencent.tencentmap.mapsdk.maps.model.MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER;
|
import static com.tencent.tencentmap.mapsdk.maps.model.MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER;
|
||||||
|
|
||||||
@ -125,7 +131,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
@Override
|
@Override
|
||||||
protected int getLayout() {
|
protected int getLayout() {
|
||||||
EventBus.getDefault().register(this);
|
EventBus.getDefault().register(this);
|
||||||
// tmpFile = new File(Constant.PICTURE_FOLDER, "temp.mp4");
|
//tmpFile = new File(Constant.PICTURE_FOLDER, "temp.mp4");
|
||||||
formatter = new SimpleDateFormat("yyyyMMdd HHmmss");
|
formatter = new SimpleDateFormat("yyyyMMdd HHmmss");
|
||||||
return R.layout.activity_picture;
|
return R.layout.activity_picture;
|
||||||
}
|
}
|
||||||
@ -139,15 +145,15 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
oration = getIntent().getIntExtra(Constant.INTENT_VIDEO_OBLATION, -1);
|
oration = getIntent().getIntExtra(Constant.INTENT_VIDEO_OBLATION, -1);
|
||||||
}
|
}
|
||||||
videoChronometer = findViewById(R.id.video_chronometer);
|
videoChronometer = findViewById(R.id.video_chronometer);
|
||||||
// if (finalVideoPath == null) {
|
/* if (finalVideoPath == null) {
|
||||||
// finalVideoPath = Constant.PICTURE_FOLDER+"/final.mp4";
|
finalVideoPath = Constant.PICTURE_FOLDER+"/final.mp4";
|
||||||
// }
|
}*/
|
||||||
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||||
ivZoomAdd = findViewById(R.id.iv_zoom_add);
|
ivZoomAdd = findViewById(R.id.iv_zoom_add);
|
||||||
ivZoomAdd.setOnClickListener(this);
|
ivZoomAdd.setOnClickListener(this);
|
||||||
ivZoomDel = findViewById(R.id.iv_zoom_del);
|
ivZoomDel = findViewById(R.id.iv_zoom_del);
|
||||||
ivZoomDel.setOnClickListener(this);
|
ivZoomDel.setOnClickListener(this);
|
||||||
/* cbMapType = findViewById(R.id.cb_map_type);
|
/*cbMapType = findViewById(R.id.cb_map_type);
|
||||||
cbMapType.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
cbMapType.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
@ -158,11 +164,11 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
ivLocation.setOnClickListener(this);
|
ivLocation.setOnClickListener(this);
|
||||||
layerChange = findViewById(R.id.layer_change);
|
layerChange = findViewById(R.id.layer_change);
|
||||||
timer = new Timer();
|
timer = new Timer();
|
||||||
ivMap = (TextureMapView) findViewById(R.id.iv_map);
|
ivMap = findViewById(R.id.iv_map);
|
||||||
btnSwitch = (Button) findViewById(R.id.btn_switch);
|
btnSwitch = findViewById(R.id.btn_switch);
|
||||||
btnSwitch.setOnClickListener(this);
|
btnSwitch.setOnClickListener(this);
|
||||||
// capturePicture = (ImageButton) findViewById(R.id.capturePicture);
|
/*capturePicture = (ImageButton) findViewById(R.id.capturePicture);
|
||||||
// capturePicture.setOnClickListener(this::onClick);
|
capturePicture.setOnClickListener(this::onClick);*/
|
||||||
ivPic = findViewById(R.id.iv_pic);
|
ivPic = findViewById(R.id.iv_pic);
|
||||||
//相机记录器
|
//相机记录器
|
||||||
CameraLogger.setLogLevel(CameraLogger.LEVEL_VERBOSE);
|
CameraLogger.setLogLevel(CameraLogger.LEVEL_VERBOSE);
|
||||||
@ -176,21 +182,20 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
if (oration == 0) { // oblation为0时,拍摄视频必须为横屏
|
if (oration == 0) { // oblation为0时,拍摄视频必须为横屏
|
||||||
// 如果当前手机是竖向,则不允许拍摄
|
// 如果当前手机是竖向,则不允许拍摄
|
||||||
if (Objects.requireNonNull(camera.getVideoSize()).getWidth() < camera.getVideoSize().getHeight()) {
|
if (Objects.requireNonNull(camera.getVideoSize()).getWidth() < camera.getVideoSize().getHeight()) {
|
||||||
Toast.makeText(PictureActivity.this, "不允许竖向拍摄...", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(PictureActivity.this, "不允许竖向拍摄...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
captureVideo.setText("暂停采集");
|
captureVideo.setText("暂停采集");
|
||||||
// stopVideo.setEnabled(false);// 开始采集视频后,禁用停止采集的按钮,必须暂停采集后才可点击停止采集
|
//stopVideo.setEnabled(false);// 开始采集视频后,禁用停止采集的按钮,必须暂停采集后才可点击停止采集
|
||||||
startTakenVideo(); // 开始采集视频
|
startTakenVideo(); // 开始采集视频
|
||||||
} else {
|
} else {
|
||||||
stopTakenVideo();
|
stopTakenVideo();
|
||||||
captureVideo.setText("开始采集");
|
captureVideo.setText("开始采集");
|
||||||
// stopVideoAndFinish();
|
//stopVideoAndFinish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Button stopVideo = findViewById(R.id.btn_stop_video);
|
Button stopVideo = findViewById(R.id.btn_stop_video);
|
||||||
stopVideo.setOnClickListener(this);
|
stopVideo.setOnClickListener(this);
|
||||||
/*
|
/*
|
||||||
@ -221,7 +226,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
removables = new ArrayList<>();//存储轨迹的marker
|
removables = new ArrayList<>();//存储轨迹的marker
|
||||||
if (poiEntity!=null){
|
if (poiEntity != null) {
|
||||||
if (poiEntity.getId() != null) {
|
if (poiEntity.getId() != null) {
|
||||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(poiEntity.getId());
|
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(poiEntity.getId());
|
||||||
if (fileListByUUID != null) {
|
if (fileListByUUID != null) {
|
||||||
@ -266,7 +271,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
@Override
|
@Override
|
||||||
public void onFileReady(@Nullable @org.jetbrains.annotations.Nullable File file) {
|
public void onFileReady(@Nullable @org.jetbrains.annotations.Nullable File file) {
|
||||||
assert file != null;
|
assert file != null;
|
||||||
Toast.makeText(PictureActivity.this, "保存成功:" + pageNum++, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(PictureActivity.this, "保存成功:" + pageNum++);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (camera.isTakingVideo()) {
|
if (camera.isTakingVideo()) {
|
||||||
@ -287,11 +292,13 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
PictureActivity.this.finish();
|
PictureActivity.this.finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (captureVideo.isChecked() && !isFinishActivity) {
|
if (captureVideo.isChecked() && !isFinishActivity) {
|
||||||
startTakenVideo();
|
startTakenVideo();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Toast.makeText(PictureActivity.this, "暂停摄像", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(PictureActivity.this, "暂停摄像");
|
||||||
/* new Thread(new Runnable() {
|
/* new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -332,10 +339,11 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
}
|
}
|
||||||
}).start();*/
|
}).start();*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCameraError(@NonNull @NotNull CameraException exception) {
|
public void onCameraError(@NonNull @NotNull CameraException exception) {
|
||||||
super.onCameraError(exception);
|
super.onCameraError(exception);
|
||||||
Toast.makeText(PictureActivity.this, exception.toString(), Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(PictureActivity.this, exception.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -344,16 +352,16 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
/*
|
/*
|
||||||
* 获取当前视频的时间,记录csv文件时使用
|
* 获取当前视频的时间,记录csv文件时使用
|
||||||
* */
|
* */
|
||||||
// long currentTime = AWMp4ParserHelper.getInstance().getVedasTotalTime(new File(finalVideoPath));
|
// long currentTime = AWMp4ParserHelper.getInstance().getVedasTotalTime(new File(finalVideoPath));
|
||||||
timerTask = new CsvTimerTask(new File(finalVideoPath + ".txt"));
|
timerTask = new CsvTimerTask(new File(finalVideoPath + ".txt"));
|
||||||
timer.schedule(timerTask, 0, period * 1000);
|
timer.schedule(timerTask, 0, period * 1000);
|
||||||
// // 开始采集,每隔2秒实时记录位置信息、视频时间以及设备时间
|
// 开始采集,每隔2秒实时记录位置信息、视频时间以及设备时间
|
||||||
// if (currentTime == 0) {
|
/*if (currentTime == 0) {
|
||||||
// timer.schedule(timerTask, 0, period*1000);
|
timer.schedule(timerTask, 0, period*1000);
|
||||||
// } else {
|
} else {
|
||||||
// timerTask.setCurrentVideoTime(currentTime/1000+1);
|
timerTask.setCurrentVideoTime(currentTime/1000+1);
|
||||||
// timer.schedule(timerTask, 1, period*1000);
|
timer.schedule(timerTask, 1, period*1000);
|
||||||
// }
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -361,8 +369,8 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
super.onVideoRecordingEnd();
|
super.onVideoRecordingEnd();
|
||||||
if (timerTask != null) {
|
if (timerTask != null) {
|
||||||
timerTask.cancel();
|
timerTask.cancel();
|
||||||
} // Toast.makeText(PictureActivity.this, "请先拍照", Toast.LENGTH_SHORT).show();
|
}
|
||||||
|
// Toast.makeText(PictureActivity.this, "请先拍照", Toast.LENGTH_SHORT).show();
|
||||||
// 一段视频拍摄完成自动将当前拍摄路径加1
|
// 一段视频拍摄完成自动将当前拍摄路径加1
|
||||||
File finalVideoFile = new File(finalVideoPath);
|
File finalVideoFile = new File(finalVideoPath);
|
||||||
if (finalVideoFile.exists()) {
|
if (finalVideoFile.exists()) {
|
||||||
@ -380,38 +388,39 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
layoutParamsMap.width = dm.heightPixels / 3;
|
layoutParamsMap.width = dm.heightPixels / 3;
|
||||||
ivMap.setLayoutParams(layoutParamsMap);
|
ivMap.setLayoutParams(layoutParamsMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initLine() {
|
private void initLine() {
|
||||||
if (poiEntity!=null){
|
if (poiEntity != null) {
|
||||||
String geoWkt = poiEntity.getGeoWkt();
|
String geoWkt = poiEntity.getGeoWkt();
|
||||||
if (geoWkt != null) {
|
if (geoWkt != null) {
|
||||||
String geo = Geohash.getInstance().decode(geoWkt);
|
String geo = Geohash.getInstance().decode(geoWkt);
|
||||||
Geometry geometry = GeometryTools.createGeometry(geo);
|
Geometry geometry = GeometryTools.createGeometry(geo);
|
||||||
if (geometry.getGeometryType().equals("LineString")) {//线
|
if (geometry.getGeometryType().equals("LineString")) {//线
|
||||||
BitmapDescriptor bitmapLine = null;
|
BitmapDescriptor bitmapLine = null;
|
||||||
if (poiEntity.getType() == 3) {//poi录像
|
if (poiEntity.getType() == 3) {//poi录像
|
||||||
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_arrows);
|
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_arrows);
|
||||||
} else if (poiEntity.getType() == 4) {//道路录像
|
} else if (poiEntity.getType() == 4) {//道路录像
|
||||||
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.road_arrows);
|
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.road_arrows);
|
||||||
|
}
|
||||||
|
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
||||||
|
// 构造 PolylineOnions
|
||||||
|
PolylineOptions polylineOptions
|
||||||
|
= new PolylineOptions().addAll(latLineString)
|
||||||
|
// 折线设置圆形线头
|
||||||
|
.lineCap(true)
|
||||||
|
// 折线的颜色为绿色
|
||||||
|
.color(Color.parseColor("#0096FF"))
|
||||||
|
// 折线宽度为5像素
|
||||||
|
.width(20)
|
||||||
|
.arrow(true)
|
||||||
|
.arrowSpacing(150)
|
||||||
|
.arrowTexture(bitmapLine);
|
||||||
|
// 绘制折线
|
||||||
|
polyline = tencentMap.addPolyline(polylineOptions);
|
||||||
|
polyline.setZIndex(2);
|
||||||
}
|
}
|
||||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
|
||||||
// 构造 PolylineOnions
|
|
||||||
PolylineOptions polylineOptions
|
|
||||||
= new PolylineOptions().addAll(latLineString)
|
|
||||||
// 折线设置圆形线头
|
|
||||||
.lineCap(true)
|
|
||||||
// 折线的颜色为绿色
|
|
||||||
.color(Color.parseColor("#0096FF"))
|
|
||||||
// 折线宽度为5像素
|
|
||||||
.width(20)
|
|
||||||
.arrow(true)
|
|
||||||
.arrowSpacing(150)
|
|
||||||
.arrowTexture(bitmapLine);
|
|
||||||
// 绘制折线
|
|
||||||
polyline = tencentMap.addPolyline(polylineOptions);
|
|
||||||
polyline.setZIndex(2);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 将秒转化成小时分钟秒
|
// 将秒转化成小时分钟秒
|
||||||
@ -424,7 +433,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
|
|
||||||
private void message(String content) {
|
private void message(String content) {
|
||||||
LOG.i(content);
|
LOG.i(content);
|
||||||
Toast.makeText(this, content, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(this,content);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -436,22 +445,22 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()) {
|
switch (v.getId()) {
|
||||||
// case R.id.capturePicture:
|
/*case R.id.capturePicture:
|
||||||
// camera.setMode(Mode.PICTURE);
|
camera.setMode(Mode.PICTURE);
|
||||||
// if (!camera.isTakingPicture()) {
|
if (!camera.isTakingPicture()) {
|
||||||
// captureTime = System.currentTimeMillis();
|
captureTime = System.currentTimeMillis();
|
||||||
// message("Capturing picture...", false);
|
message("Capturing picture...", false);
|
||||||
// camera.takePicture();
|
camera.takePicture();
|
||||||
// }
|
}
|
||||||
// break;
|
break;*/
|
||||||
case R.id.btn_switch:
|
case R.id.btn_switch:
|
||||||
v.setEnabled(false);
|
v.setEnabled(false);
|
||||||
handler.sendEmptyMessageDelayed(0, 2000); // 利用handler延迟发送更改状态信息
|
handler.sendEmptyMessageDelayed(0, 2000); // 利用handler延迟发送更改状态信息
|
||||||
benSwitch();
|
benSwitch();
|
||||||
break;
|
break;
|
||||||
// case R.id.capuletVideo:
|
/*case R.id.capuletVideo:
|
||||||
// startTakenVideo(); // 开始拍摄视频
|
startTakenVideo(); // 开始拍摄视频
|
||||||
// break;
|
break;*/
|
||||||
case R.id.btn_stop_video:
|
case R.id.btn_stop_video:
|
||||||
stopVideoAndFinish();
|
stopVideoAndFinish();
|
||||||
break;
|
break;
|
||||||
@ -477,6 +486,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
@ -495,7 +505,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
intent.putExtra(Constant.INTENT_VIDEO_PATH, finalVideoPath);
|
intent.putExtra(Constant.INTENT_VIDEO_PATH, finalVideoPath);
|
||||||
setResult(0x101, intent);
|
setResult(0x101, intent);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(this, "本段视频没有计时!", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(this,"本段视频没有计时!");
|
||||||
}
|
}
|
||||||
if (camera.isTakingVideo()) {
|
if (camera.isTakingVideo()) {
|
||||||
// showLoadingDialog();
|
// showLoadingDialog();
|
||||||
@ -508,15 +518,15 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
|
|
||||||
private void startTakenVideo() {
|
private void startTakenVideo() {
|
||||||
if (camera.isTakingVideo()) {
|
if (camera.isTakingVideo()) {
|
||||||
Toast.makeText(this, "已经在拍摄中...", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(this,"已经在拍摄中...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
|
/*DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||||
// Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
// calendar.setTimeInMillis(System.currentTimeMillis());
|
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||||
// String formatVideoName = formatter.format(calendar.getTime());
|
String formatVideoName = formatter.format(calendar.getTime());
|
||||||
// 文件
|
文件
|
||||||
// String path = finalVideoPath.substring(finalVideoPath.length()-20);
|
String path = finalVideoPath.substring(finalVideoPath.length()-20);*/
|
||||||
if (finalVideoPath != null) {
|
if (finalVideoPath != null) {
|
||||||
File file = new File(finalVideoPath);
|
File file = new File(finalVideoPath);
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
@ -531,10 +541,8 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
camera.takeVideo(file);
|
camera.takeVideo(file);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(this, "请录像", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(this,"请录像");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void stopTakenVideo() {
|
private void stopTakenVideo() {
|
||||||
@ -558,20 +566,21 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置定位图标样式
|
* 设置定位图标样式
|
||||||
*/
|
* @param type type
|
||||||
private void setLocMarkerStyle(int type) {
|
*/
|
||||||
tencentMap.setLocationSource(new MyTecentLocationSource(this));
|
private void setLocMarkerStyle(int type) {
|
||||||
tencentMap.setMyLocationEnabled(true);
|
tencentMap.setLocationSource(new MyTecentLocationSource(this));
|
||||||
MyLocationStyle locationStyle = new MyLocationStyle();
|
tencentMap.setMyLocationEnabled(true);
|
||||||
locationStyle = locationStyle.myLocationType(type);
|
MyLocationStyle locationStyle = new MyLocationStyle();
|
||||||
//创建图标
|
locationStyle = locationStyle.myLocationType(type);
|
||||||
BitmapDescriptor bitmapDescriptor = BitmapDescriptorFactory.fromBitmap(getBitMap());
|
//创建图标
|
||||||
locationStyle.icon(bitmapDescriptor);
|
BitmapDescriptor bitmapDescriptor = BitmapDescriptorFactory.fromBitmap(getBitMap());
|
||||||
//设置定位圆形区域的边框宽度;
|
locationStyle.icon(bitmapDescriptor);
|
||||||
locationStyle.fillColor(getResources().getColor(android.R.color.transparent));
|
//设置定位圆形区域的边框宽度;
|
||||||
locationStyle.strokeWidth(1);
|
locationStyle.fillColor(getResources().getColor(android.R.color.transparent));
|
||||||
tencentMap.setMyLocationStyle(locationStyle);
|
locationStyle.strokeWidth(1);
|
||||||
|
tencentMap.setMyLocationStyle(locationStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void benSwitch() {
|
public void benSwitch() {
|
||||||
|
@ -48,6 +48,7 @@ import com.navinfo.outdoor.util.GeometryTools;
|
|||||||
import com.navinfo.outdoor.util.MyTecentLocationSource;
|
import com.navinfo.outdoor.util.MyTecentLocationSource;
|
||||||
import com.navinfo.outdoor.util.SystemTTS;
|
import com.navinfo.outdoor.util.SystemTTS;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
import com.otaliastudios.cameraview.CameraListener;
|
import com.otaliastudios.cameraview.CameraListener;
|
||||||
import com.otaliastudios.cameraview.CameraLogger;
|
import com.otaliastudios.cameraview.CameraLogger;
|
||||||
import com.otaliastudios.cameraview.CameraView;
|
import com.otaliastudios.cameraview.CameraView;
|
||||||
@ -148,7 +149,6 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayout() {
|
protected int getLayout() {
|
||||||
EventBus.getDefault().register(this);
|
EventBus.getDefault().register(this);
|
||||||
@ -182,7 +182,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
|||||||
systemTTS = SystemTTS.getInstance(PicturesActivity.this);
|
systemTTS = SystemTTS.getInstance(PicturesActivity.this);
|
||||||
tvMapView = findViewById(R.id.text_map_view);
|
tvMapView = findViewById(R.id.text_map_view);
|
||||||
tvMapView.setOnClickListener(this);
|
tvMapView.setOnClickListener(this);
|
||||||
ivPicRoadImage = findViewById(R.id.iv_pic);
|
ivPicRoadImage = findViewById(R.id.iv_pic_road);
|
||||||
ivPicVideoImage = findViewById(R.id.iv_pic_video);
|
ivPicVideoImage = findViewById(R.id.iv_pic_video);
|
||||||
Button btnSwitch = findViewById(R.id.btn_switch);
|
Button btnSwitch = findViewById(R.id.btn_switch);
|
||||||
btnSwitch.setOnClickListener(this);
|
btnSwitch.setOnClickListener(this);
|
||||||
@ -258,8 +258,8 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
|||||||
ivLocation.setOnClickListener(this);
|
ivLocation.setOnClickListener(this);
|
||||||
camera = findViewById(R.id.camera);
|
camera = findViewById(R.id.camera);
|
||||||
camera.setOnClickListener(this);
|
camera.setOnClickListener(this);
|
||||||
imageView = findViewById(R.id.image_view);
|
|
||||||
tvTitle = findViewById(R.id.tv_title);
|
tvTitle = findViewById(R.id.tv_title);
|
||||||
|
imageView = findViewById(R.id.image_view);
|
||||||
imageView.setOnClickListener(this);
|
imageView.setOnClickListener(this);
|
||||||
capturePicture = findViewById(R.id.capture_picture);
|
capturePicture = findViewById(R.id.capture_picture);
|
||||||
capturePicture.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
capturePicture.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
@ -268,7 +268,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
|||||||
if (radioPicture == 0) {
|
if (radioPicture == 0) {
|
||||||
capturePicture.setChecked(false);
|
capturePicture.setChecked(false);
|
||||||
capturePicture.setText("开始采集");
|
capturePicture.setText("开始采集");
|
||||||
Toast.makeText(PicturesActivity.this, "请选择模式", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(PicturesActivity.this,"请选择模式");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
@ -303,14 +303,14 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
|||||||
camera.addCameraListener(new CameraListener() {
|
camera.addCameraListener(new CameraListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onPictureTaken(@NonNull PictureResult result) {
|
public void onPictureTaken(@NonNull PictureResult result) {
|
||||||
if (result != null && result.getData() != null && result.getData().length > 0) {
|
if (result.getData()!=null&&result != null && result.getData().length > 0) {
|
||||||
super.onPictureTaken(result);
|
super.onPictureTaken(result);
|
||||||
isBack = true;
|
isBack = true;
|
||||||
// 如果当前手机是竖向,则不
|
// 如果当前手机是竖向,则不
|
||||||
if (isOration) {
|
if (isOration) {
|
||||||
if (Objects.requireNonNull(camera.getPictureSize()).getWidth() < camera.getPictureSize().getHeight()) {
|
if (Objects.requireNonNull(camera.getPictureSize()).getWidth() < camera.getPictureSize().getHeight()) {
|
||||||
isOration = true;
|
isOration = true;
|
||||||
Toast.makeText(PicturesActivity.this, "不允许竖向拍摄...", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(PicturesActivity.this,"不允许竖向拍摄...");
|
||||||
picturesBuilder.append("camera 用户竖屏拍照 ,");
|
picturesBuilder.append("camera 用户竖屏拍照 ,");
|
||||||
stopTimer();
|
stopTimer();
|
||||||
capturePicture.setChecked(false);
|
capturePicture.setChecked(false);
|
||||||
@ -363,12 +363,13 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Jpg2WebpRunnable implements Runnable {
|
class Jpg2WebpRunnable implements Runnable {
|
||||||
// private PictureResult pictureResult;
|
//private PictureResult pictureResult;
|
||||||
private File file;
|
private File file;
|
||||||
private int count; // 该转换执行次数,如果连续3次执行失败,则不再转换
|
private int count;
|
||||||
|
// 该转换执行次数,如果连续3次执行失败,则不再转换
|
||||||
|
|
||||||
public Jpg2WebpRunnable(/*PictureResult pictureResult, */File file, int count) {
|
public Jpg2WebpRunnable(/*PictureResult pictureResult,*/ File file, int count) {
|
||||||
// this.pictureResult = pictureResult;
|
//this.pictureResult = pictureResult;
|
||||||
this.file = file;
|
this.file = file;
|
||||||
this.count = count;
|
this.count = count;
|
||||||
}
|
}
|
||||||
@ -377,7 +378,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
|||||||
public void run() {
|
public void run() {
|
||||||
if (file.exists() && file != null) {
|
if (file.exists() && file != null) {
|
||||||
initWeb(file, count);
|
initWeb(file, count);
|
||||||
if (count<=0) { // 不是重新转换webp流程
|
if (count <= 0) { // 不是重新转换webp流程
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
@Override
|
@Override
|
||||||
@ -410,7 +411,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
|||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Toast.makeText(PicturesActivity.this, "源文件不存在", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(PicturesActivity.this,"源文件不存在");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -429,12 +430,13 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
|||||||
initMarkerPaper();
|
initMarkerPaper();
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
// 如果是写入txt记录失败,上传失败记录
|
//如果是写入txt记录失败,上传失败记录
|
||||||
UMCrashManager.reportCrash(this,e);
|
UMCrashManager.reportCrash(this, e);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
UMCrashManager.reportCrash(this,e);
|
UMCrashManager.reportCrash(this, e);
|
||||||
if (count<3) { // 当尝试次数小于3次,则加入转换队列,尝试重新转换
|
if (count < 3) {
|
||||||
|
//当尝试次数小于3次,则加入转换队列,尝试重新转换
|
||||||
UserApplication.fixedThreadPool.execute(new Jpg2WebpRunnable(/*result, */file, count));
|
UserApplication.fixedThreadPool.execute(new Jpg2WebpRunnable(/*result, */file, count));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -931,6 +933,20 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
|||||||
if (timer == null) {
|
if (timer == null) {
|
||||||
timer = new Timer();
|
timer = new Timer();
|
||||||
}
|
}
|
||||||
|
if (timerTask == null) {
|
||||||
|
timerTask = new TimerTask() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (radioPicture == 1) {
|
||||||
|
camera.takePicture();
|
||||||
|
} else {
|
||||||
|
Message message = new Message();
|
||||||
|
message.what = 0x101;
|
||||||
|
handler.sendMessage(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
if (radioPicture == 1) {
|
if (radioPicture == 1) {
|
||||||
timer.schedule(timerTask, 0);
|
timer.schedule(timerTask, 0);
|
||||||
} else if (radioPicture == 2) {
|
} else if (radioPicture == 2) {
|
||||||
|
@ -51,4 +51,24 @@ public class RegardMapActivity extends BaseActivity implements View.OnClickLis
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onStop() {
|
||||||
|
super.onStop();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
}
|
}
|
@ -8,7 +8,7 @@ import android.widget.TextView;
|
|||||||
import com.navinfo.outdoor.R;
|
import com.navinfo.outdoor.R;
|
||||||
import com.navinfo.outdoor.base.BaseActivity;
|
import com.navinfo.outdoor.base.BaseActivity;
|
||||||
|
|
||||||
public class StatementActivity extends BaseActivity {
|
public class StatementActivity extends BaseActivity implements View.OnClickListener{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayout() {
|
protected int getLayout() {
|
||||||
@ -20,16 +20,18 @@ public class StatementActivity extends BaseActivity {
|
|||||||
super.initView();
|
super.initView();
|
||||||
TextView tvTextStatement =findViewById(R.id.tv_textStatement);
|
TextView tvTextStatement =findViewById(R.id.tv_textStatement);
|
||||||
ImageView ivStatement =findViewById(R.id.iv_statement);
|
ImageView ivStatement =findViewById(R.id.iv_statement);
|
||||||
ivStatement.setOnClickListener(new View.OnClickListener() {
|
ivStatement.setOnClickListener(this);
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
StatementActivity.this. finish();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initData() {
|
protected void initData() {
|
||||||
super.initData();
|
super.initData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (v.getId()==R.id.iv_statement){
|
||||||
|
StatementActivity.this. finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -0,0 +1,74 @@
|
|||||||
|
package com.navinfo.outdoor.activity;
|
||||||
|
|
||||||
|
import android.annotation.TargetApi;
|
||||||
|
import android.app.ActivityManager;
|
||||||
|
import android.content.ComponentName;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.navinfo.outdoor.api.Constant;
|
||||||
|
import com.navinfo.outdoor.bean.NotificationBean;
|
||||||
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
|
import com.umeng.message.UmengNotifyClickActivity;
|
||||||
|
|
||||||
|
import org.android.agoo.common.AgooConstants;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
/*
|
||||||
|
集成厂商通道才会调用执行
|
||||||
|
*/
|
||||||
|
public class UMClickActivity extends UmengNotifyClickActivity {
|
||||||
|
@Override
|
||||||
|
public void onMessage(Intent intent) {
|
||||||
|
super.onMessage(intent);
|
||||||
|
String body = intent.getStringExtra(AgooConstants.MESSAGE_BODY);
|
||||||
|
Log.i("TAGEE", "onMessage: "+body);
|
||||||
|
NotificationBean notificationBean = new Gson().fromJson(body, NotificationBean.class);
|
||||||
|
NotificationBean.ExtraBean extra = notificationBean.getExtra();
|
||||||
|
/*
|
||||||
|
* 判断栈中是否有MainActivity,有则意味着程序已启动,否则没有
|
||||||
|
*/
|
||||||
|
if (isExistMainActivity(MainActivity.class)){
|
||||||
|
if (extra!=null){
|
||||||
|
HashMap<String, String> paramMap = new HashMap<>();
|
||||||
|
paramMap.put("id", extra.getId()+ "");
|
||||||
|
intent = new Intent(this, WebActivity.class);
|
||||||
|
intent.putExtra("map", paramMap);
|
||||||
|
intent.putExtra("url", HttpInterface.MSG_CONTENT);
|
||||||
|
}else {
|
||||||
|
intent = new Intent(this, FragmentManagement.class);
|
||||||
|
intent.putExtra("tag", 35);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
intent = new Intent(this, MainActivity.class);
|
||||||
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
Constant.NOTIFICATION=body;
|
||||||
|
}
|
||||||
|
startActivity(intent);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
@TargetApi(Build.VERSION_CODES.Q)
|
||||||
|
private boolean isExistMainActivity(Class<?> activity) {
|
||||||
|
Intent intent = new Intent(this, activity);
|
||||||
|
ComponentName cmpName = intent.resolveActivity(getPackageManager());
|
||||||
|
boolean flag = false;
|
||||||
|
if (cmpName != null) { // 说明系统中存在这个activity
|
||||||
|
ActivityManager am = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
|
||||||
|
List<ActivityManager.RunningTaskInfo> taskInfoList = am.getRunningTasks(10);
|
||||||
|
//这里获取的是APP栈的数量,一般也就两个
|
||||||
|
ActivityManager.RunningTaskInfo runningTaskInfo = taskInfoList.get(0);
|
||||||
|
// 只是拿当前运行的栈
|
||||||
|
int numActivities = taskInfoList.get(0).numActivities;
|
||||||
|
for (ActivityManager.RunningTaskInfo taskInfo : taskInfoList) {
|
||||||
|
if (taskInfo.baseActivity.equals(cmpName)) {// 说明它已经启动了
|
||||||
|
flag = true;
|
||||||
|
break;//跳出循环,优化效率
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
}
|
@ -39,6 +39,7 @@ import com.navinfo.outdoor.util.FlushTokenUtil;
|
|||||||
import com.navinfo.outdoor.util.GetJsonDataUtil;
|
import com.navinfo.outdoor.util.GetJsonDataUtil;
|
||||||
import com.navinfo.outdoor.util.RegexUtil;
|
import com.navinfo.outdoor.util.RegexUtil;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
|
|
||||||
@ -157,13 +158,13 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
|||||||
case R.id.btn_gathering:
|
case R.id.btn_gathering:
|
||||||
userBuilder.append(TimestampUtil.time()).append(",").append("点击了去绑定的返回 ,");
|
userBuilder.append(TimestampUtil.time()).append(",").append("点击了去绑定的返回 ,");
|
||||||
if (Constant.AUDIOTAPES == -1) {
|
if (Constant.AUDIOTAPES == -1) {
|
||||||
Toast.makeText(this, "请先实名认证", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(UserActivity.this,"请先实名认证");
|
||||||
} else if (Constant.AUDIOTAPES == 1) {//认证通过
|
} else if (Constant.AUDIOTAPES == 1) {//认证通过
|
||||||
Intent gatheringIntent = new Intent(this, FragmentManagement.class);
|
Intent gatheringIntent = new Intent(this, FragmentManagement.class);
|
||||||
gatheringIntent.putExtra("tag", 24);
|
gatheringIntent.putExtra("tag", 24);
|
||||||
startActivity(gatheringIntent);
|
startActivity(gatheringIntent);
|
||||||
} else if (Constant.AUDIOTAPES == 0) {
|
} else if (Constant.AUDIOTAPES == 0) {
|
||||||
Toast.makeText(this, Constant.AUDITING + "", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(this,Constant.AUDITING + "");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case R.id.btn_attestations:
|
case R.id.btn_attestations:
|
||||||
@ -188,7 +189,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
|||||||
break;
|
break;
|
||||||
case R.id.btn_weChat_binding:
|
case R.id.btn_weChat_binding:
|
||||||
userBuilder.append(TimestampUtil.time()).append(",").append("点击了微信 去提交的按钮 ,");
|
userBuilder.append(TimestampUtil.time()).append(",").append("点击了微信 去提交的按钮 ,");
|
||||||
Toast.makeText(this, "此功能未开通", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(UserActivity.this,"此功能未开通");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -208,20 +209,21 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
|||||||
//user.length() < 11 && user.length() > 5
|
//user.length() < 11 && user.length() > 5
|
||||||
if (TextUtils.isEmpty(userphone) || TextUtils.isEmpty(userqq) || TextUtils.isEmpty(usermailbox) || TextUtils.isEmpty(region_id)) {
|
if (TextUtils.isEmpty(userphone) || TextUtils.isEmpty(userqq) || TextUtils.isEmpty(usermailbox) || TextUtils.isEmpty(region_id)) {
|
||||||
if (region_id == null || region_id.equals("")) {
|
if (region_id == null || region_id.equals("")) {
|
||||||
Toast.makeText(this, "所在地区,请重新选择", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(UserActivity.this,"所在地区,请重新选择");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
httpParams.put("regionId", region_id);
|
httpParams.put("regionId", region_id);
|
||||||
}
|
}
|
||||||
/* if (!RegexUtil.isPhone(userphone)) {
|
/* if (!RegexUtil.isPhone(userphone)) {
|
||||||
Toast.makeText(this, "手机号输入错误", Toast.LENGTH_SHORT).show();
|
|
||||||
|
ToastUtils.Message(UserActivity.this,"手机号输入错误");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
httpParams.put("mobile", userphone);
|
httpParams.put("mobile", userphone);
|
||||||
}*/
|
}*/
|
||||||
if (!userqq.equals("")) {
|
if (!userqq.equals("")) {
|
||||||
if (!isQQNum_matcher) {
|
if (!isQQNum_matcher) {
|
||||||
Toast.makeText(this, "QQ号输入错误", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(UserActivity.this,"QQ号输入错误");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
httpParams.put("qq", userqq);
|
httpParams.put("qq", userqq);
|
||||||
@ -229,7 +231,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
|||||||
}
|
}
|
||||||
if (!usermailbox.equals("")) {
|
if (!usermailbox.equals("")) {
|
||||||
if (!isEmail_matcher) {
|
if (!isEmail_matcher) {
|
||||||
Toast.makeText(this, "邮箱格式错误", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(UserActivity.this,"邮箱格式错误");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
httpParams.put("mailbox", usermailbox); //邮箱
|
httpParams.put("mailbox", usermailbox); //邮箱
|
||||||
@ -268,7 +270,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
|||||||
}else if(response.getCode()==230){
|
}else if(response.getCode()==230){
|
||||||
FlushTokenUtil.flushToken(UserActivity.this);
|
FlushTokenUtil.flushToken(UserActivity.this);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(UserActivity.this, response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(UserActivity.this,response.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -282,10 +284,10 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout")|| message.contains("Read time out")){
|
if (message.equals("timeout")|| message.equals("Read time out")){
|
||||||
Toast.makeText(UserActivity.this, "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(UserActivity.this,"请求超时");
|
||||||
}else {
|
}else {
|
||||||
Toast.makeText(UserActivity.this, message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(UserActivity.this,message);
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onError: " + e.getMessage());
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
}
|
}
|
||||||
@ -306,11 +308,9 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
|||||||
//返回的分别是三个级别的选中位置
|
//返回的分别是三个级别的选中位置
|
||||||
String opt1tx = options1Items.size() > 0 ?
|
String opt1tx = options1Items.size() > 0 ?
|
||||||
options1Items.get(options1).getPickerViewText() : "";
|
options1Items.get(options1).getPickerViewText() : "";
|
||||||
|
|
||||||
String opt2tx = options2Items.size() > 0
|
String opt2tx = options2Items.size() > 0
|
||||||
&& options2Items.get(options1).size() > 0 ?
|
&& options2Items.get(options1).size() > 0 ?
|
||||||
options2Items.get(options1).get(options2) : "";
|
options2Items.get(options1).get(options2) : "";
|
||||||
|
|
||||||
String opt3tx = options2Items.size() > 0
|
String opt3tx = options2Items.size() > 0
|
||||||
&& options3Items.get(options1).size() > 0
|
&& options3Items.get(options1).size() > 0
|
||||||
&& options3Items.get(options1).get(options2).size() > 0 ?
|
&& options3Items.get(options1).get(options2).size() > 0 ?
|
||||||
|
@ -53,6 +53,7 @@ public class VideoActivity extends BaseActivity implements View.OnClickListener
|
|||||||
super.onPause();
|
super.onPause();
|
||||||
Jzvd.releaseAllVideos();
|
Jzvd.releaseAllVideos();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
if (Jzvd.backPress()){
|
if (Jzvd.backPress()){
|
||||||
@ -67,4 +68,5 @@ public class VideoActivity extends BaseActivity implements View.OnClickListener
|
|||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,13 @@
|
|||||||
package com.navinfo.outdoor.activity;
|
package com.navinfo.outdoor.activity;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.graphics.Bitmap;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.webkit.WebSettings;
|
import android.webkit.WebSettings;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
import android.webkit.WebViewClient;
|
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.lzy.okgo.model.HttpParams;
|
import com.lzy.okgo.model.HttpParams;
|
||||||
import com.navinfo.outdoor.R;
|
import com.navinfo.outdoor.R;
|
||||||
import com.navinfo.outdoor.api.Constant;
|
import com.navinfo.outdoor.api.Constant;
|
||||||
@ -20,10 +16,10 @@ import com.navinfo.outdoor.bean.RichTextBean;
|
|||||||
import com.navinfo.outdoor.http.Callback;
|
import com.navinfo.outdoor.http.Callback;
|
||||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 详情页
|
* 详情页
|
||||||
*/
|
*/
|
||||||
@ -46,6 +42,7 @@ public class WebActivity extends BaseActivity implements View.OnClickListener {
|
|||||||
nWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
nWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||||
ImageView ivIcon = findViewById(R.id.iv_icon);
|
ImageView ivIcon = findViewById(R.id.iv_icon);
|
||||||
ivIcon.setOnClickListener(this);
|
ivIcon.setOnClickListener(this);
|
||||||
|
Constant.NOTIFICATION=null;
|
||||||
initWebWork();
|
initWebWork();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,7 +51,7 @@ public class WebActivity extends BaseActivity implements View.OnClickListener {
|
|||||||
if (bundle != null) {
|
if (bundle != null) {
|
||||||
String url = bundle.getString("url");
|
String url = bundle.getString("url");
|
||||||
if (url == null || url.equals("")) {
|
if (url == null || url.equals("")) {
|
||||||
Toast.makeText(this, "连接失败", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(this,"连接失败");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
@ -85,7 +82,7 @@ public class WebActivity extends BaseActivity implements View.OnClickListener {
|
|||||||
}else if(response.getCode()==230){
|
}else if(response.getCode()==230){
|
||||||
FlushTokenUtil.flushToken(WebActivity.this);
|
FlushTokenUtil.flushToken(WebActivity.this);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(WebActivity.this, response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(WebActivity.this,response.getMessage() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,10 +91,10 @@ public class WebActivity extends BaseActivity implements View.OnClickListener {
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout")|| message.contains("Read time out")){
|
if (message.equals("timeout")|| message.equals("Read time out")){
|
||||||
Toast.makeText(WebActivity.this, "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(WebActivity.this,"请求超时" );
|
||||||
}else {
|
}else {
|
||||||
Toast.makeText(WebActivity.this, message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(WebActivity.this,message );
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onError:失败" + e.getMessage() + "");
|
Log.d("TAG", "onError:失败" + e.getMessage() + "");
|
||||||
}
|
}
|
||||||
@ -112,4 +109,18 @@ public class WebActivity extends BaseActivity implements View.OnClickListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onStop() {
|
||||||
|
super.onStop();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class BankAdapter extends RecyclerView.Adapter<BankAdapter.ViewHolder> {
|
public class BankAdapter extends RecyclerView.Adapter<BankAdapter.ViewHolder> {
|
||||||
private List<BankPathBean> bankPathBeans =new ArrayList<>();
|
private List<BankPathBean> bankPathBeans = new ArrayList<>();
|
||||||
private Context context;
|
private Context context;
|
||||||
|
|
||||||
public BankAdapter(Context context) {
|
public BankAdapter(Context context) {
|
||||||
@ -33,13 +33,13 @@ public class BankAdapter extends RecyclerView.Adapter<BankAdapter.ViewHolder> {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
View inflate = LayoutInflater.from(context).inflate(R.layout.bankadapteritem, parent, false);
|
View inflate = LayoutInflater.from(context).inflate(R.layout.bankadapteritem, parent, false);
|
||||||
return new ViewHolder(inflate);
|
return new ViewHolder(inflate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||||
holder.titer.setText(bankPathBeans.get(position).getLabel());
|
holder.titer.setText(bankPathBeans.get(position).getLabel());
|
||||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -54,14 +54,14 @@ public class BankAdapter extends RecyclerView.Adapter<BankAdapter.ViewHolder> {
|
|||||||
return bankPathBeans.size();
|
return bankPathBeans.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
TextView titer;
|
TextView titer;
|
||||||
|
|
||||||
public ViewHolder(@NonNull @NotNull View itemView) {
|
public ViewHolder(@NonNull @NotNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
titer = itemView.findViewById(R.id.tv_bank);
|
titer = itemView.findViewById(R.id.tv_bank);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface OnBankClick {
|
public interface OnBankClick {
|
||||||
void onClick(BankPathBean bankPathBean);
|
void onClick(BankPathBean bankPathBean);
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,6 @@ public class CapacityEvaluationAdapter extends RecyclerView.Adapter<CapacityEval
|
|||||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||||
TaskPrefectureBean.BodyBean.ListBean listBean = capacityList.get(position);
|
TaskPrefectureBean.BodyBean.ListBean listBean = capacityList.get(position);
|
||||||
holder.tvCapacity.setText(listBean.getTitle()+"");
|
holder.tvCapacity.setText(listBean.getTitle()+"");
|
||||||
|
|
||||||
Integer status = listBean.getStatus();
|
Integer status = listBean.getStatus();
|
||||||
if (status!=null){
|
if (status!=null){
|
||||||
if (status==0){
|
if (status==0){
|
||||||
@ -49,7 +48,6 @@ public class CapacityEvaluationAdapter extends RecyclerView.Adapter<CapacityEval
|
|||||||
}else if (status==1){
|
}else if (status==1){
|
||||||
holder.tvResults.setText("通过");
|
holder.tvResults.setText("通过");
|
||||||
}
|
}
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
holder.tvResults.setText("不通过");
|
holder.tvResults.setText("不通过");
|
||||||
}
|
}
|
||||||
@ -70,7 +68,6 @@ public class CapacityEvaluationAdapter extends RecyclerView.Adapter<CapacityEval
|
|||||||
return capacityList.size();
|
return capacityList.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
ImageView ivCapacity;
|
ImageView ivCapacity;
|
||||||
TextView tvCapacity;
|
TextView tvCapacity;
|
||||||
@ -82,7 +79,6 @@ public class CapacityEvaluationAdapter extends RecyclerView.Adapter<CapacityEval
|
|||||||
tvCapacity = itemView.findViewById(R.id.tas_capacity_title);
|
tvCapacity = itemView.findViewById(R.id.tas_capacity_title);
|
||||||
tvResults = itemView.findViewById(R.id.tv_capacity_through);
|
tvResults = itemView.findViewById(R.id.tv_capacity_through);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface OnCapacityClick {
|
public interface OnCapacityClick {
|
||||||
|
@ -60,7 +60,7 @@ public class CapacityItemAdapter extends RecyclerView.Adapter<CapacityItemAdapte
|
|||||||
return capItemList.size();
|
return capItemList.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
ImageView ivCapItem;
|
ImageView ivCapItem;
|
||||||
TextView tvCapItem;
|
TextView tvCapItem;
|
||||||
TextView tvReams;
|
TextView tvReams;
|
||||||
|
@ -114,7 +114,6 @@ public class CapacityMeasureAdapter extends RecyclerView.Adapter<CapacityMeasure
|
|||||||
if (!option.startsWith("http")) {
|
if (!option.startsWith("http")) {
|
||||||
tvOptionContent.setText(option);
|
tvOptionContent.setText(option);
|
||||||
} // Glide.with(context).load(option).into(ivOption);
|
} // Glide.with(context).load(option).into(ivOption);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,4 +192,5 @@ public class CapacityMeasureAdapter extends RecyclerView.Adapter<CapacityMeasure
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -84,9 +84,9 @@ public class ChargingPileAdapter extends RecyclerView.Adapter<ChargingPileAdapte
|
|||||||
textView=itemView.findViewById(R.id.tv_text);
|
textView=itemView.findViewById(R.id.tv_text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onLickItem onLickItem;
|
private onLickItem onLickItem;
|
||||||
|
|
||||||
public void setOnLickItem(ChargingPileAdapter.onLickItem onLickItem) {
|
public void setOnLickItem(onLickItem onLickItem) {
|
||||||
this.onLickItem = onLickItem;
|
this.onLickItem = onLickItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,9 +64,9 @@ public class EventPrefectureAdapter extends RecyclerView.Adapter<EventPrefecture
|
|||||||
tvTime=itemView.findViewById(R.id.tv_time);
|
tvTime=itemView.findViewById(R.id.tv_time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
clickItem clickItem;
|
private clickItem clickItem;
|
||||||
|
|
||||||
public void setClickItem(EventPrefectureAdapter.clickItem clickItem) {
|
public void setClickItem(clickItem clickItem) {
|
||||||
this.clickItem = clickItem;
|
this.clickItem = clickItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import android.widget.CheckBox;
|
|||||||
import android.widget.CompoundButton;
|
import android.widget.CompoundButton;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
@ -17,6 +18,8 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
|
|
||||||
import com.navinfo.outdoor.R;
|
import com.navinfo.outdoor.R;
|
||||||
import com.navinfo.outdoor.room.PoiEntity;
|
import com.navinfo.outdoor.room.PoiEntity;
|
||||||
|
import com.navinfo.outdoor.util.DoubleUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
|
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
@ -72,23 +75,18 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder
|
|||||||
holder.tvTaskId.setText("任务id:" + 0);
|
holder.tvTaskId.setText("任务id:" + 0);
|
||||||
}
|
}
|
||||||
if (poiEntity.getPrecision() != null) {
|
if (poiEntity.getPrecision() != null) {
|
||||||
holder.tvMoney.setText("¥" + format2(Double.parseDouble(poiEntity.getPrecision())));
|
holder.tvMoney.setText("¥" +DoubleUtil.format2(Double.parseDouble(poiEntity.getPrecision())));
|
||||||
} else {
|
} else {
|
||||||
holder.tvMoney.setText("¥" + 0);
|
holder.tvMoney.setText("¥" + 0);
|
||||||
}
|
}
|
||||||
if (poiEntity.getDist() != null) {
|
if (poiEntity.getDist() != null) {
|
||||||
holder.tvDistance.setText("距离:" + format2(Double.parseDouble(poiEntity.getDist()) / 1000) + "km");
|
holder.tvDistance.setText("距离:" + DoubleUtil.format2(Double.parseDouble(poiEntity.getDist()) / 1000) + "km");
|
||||||
} else {
|
} else {
|
||||||
holder.tvDistance.setText("距离:" + 0);
|
holder.tvDistance.setText("距离:" + 0);
|
||||||
}
|
}
|
||||||
if (poiEntity.getTaskStatus() == 0) {//"未领取", "已领取", "未保存", "已保存"
|
if (poiEntity.getTaskStatus() == 0) {//"未领取", "已领取", "未保存", "已保存"
|
||||||
holder.tvTaskStatus.setVisibility(View.GONE);
|
holder.tvTaskStatus.setVisibility(View.GONE);
|
||||||
holder.tvTaskStatus.setText("未领取");
|
holder.tvTaskStatus.setText("未领取");
|
||||||
if (poiEntity.getRecord_way() == 0) {//1是可领取 0是不可领取
|
|
||||||
holder.cbFilter.setEnabled(false);
|
|
||||||
} else if (poiEntity.getRecord_way() == 1) {
|
|
||||||
holder.cbFilter.setEnabled(true);
|
|
||||||
}
|
|
||||||
} else if (poiEntity.getTaskStatus() == 1) {
|
} else if (poiEntity.getTaskStatus() == 1) {
|
||||||
holder.tvTaskStatus.setVisibility(View.VISIBLE);
|
holder.tvTaskStatus.setVisibility(View.VISIBLE);
|
||||||
holder.tvTaskStatus.setText("已领取");
|
holder.tvTaskStatus.setText("已领取");
|
||||||
@ -132,10 +130,18 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder
|
|||||||
holder.cbFilter.setOnClickListener(new View.OnClickListener() {
|
holder.cbFilter.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
holder.cbFilter.setChecked(!poiEntity.isChecked());
|
if (poiEntity.getTaskStatus() == 0){
|
||||||
poiEntity.setChecked(!poiEntity.isChecked());
|
if (poiEntity.getRecord_way() == 0) {//1是可领取 0是不可领取
|
||||||
if (itemOnCLick != null) {
|
Toast.makeText(context, "用户等级不足,无法领取", Toast.LENGTH_SHORT).show();
|
||||||
itemOnCLick.item(poiEntity, holder.cbFilter.isChecked());
|
holder.cbFilter.setChecked(false);
|
||||||
|
} else if (poiEntity.getRecord_way() == 1) {
|
||||||
|
holder.cbFilter.setEnabled(true);
|
||||||
|
holder.cbFilter.setChecked(!poiEntity.isChecked());
|
||||||
|
poiEntity.setChecked(!poiEntity.isChecked());
|
||||||
|
if (itemOnCLick != null) {
|
||||||
|
itemOnCLick.item(poiEntity, holder.cbFilter.isChecked());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -166,7 +172,7 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ItemCLick itemCLick;
|
private ItemCLick itemCLick;
|
||||||
|
|
||||||
public void setItemCLick(ItemCLick itemCLick) {
|
public void setItemCLick(ItemCLick itemCLick) {
|
||||||
this.itemCLick = itemCLick;
|
this.itemCLick = itemCLick;
|
||||||
@ -176,7 +182,7 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder
|
|||||||
void item(PoiEntity poiEntity);
|
void item(PoiEntity poiEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemOnCLick itemOnCLick;
|
private ItemOnCLick itemOnCLick;
|
||||||
|
|
||||||
public void setItemOnCLick(ItemOnCLick itemOnCLick) {
|
public void setItemOnCLick(ItemOnCLick itemOnCLick) {
|
||||||
this.itemOnCLick = itemOnCLick;
|
this.itemOnCLick = itemOnCLick;
|
||||||
@ -186,35 +192,4 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder
|
|||||||
void item(PoiEntity poiEntity, boolean view);
|
void item(PoiEntity poiEntity, boolean view);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存小数点后两位
|
|
||||||
*/
|
|
||||||
public static String format2(double value) {
|
|
||||||
DecimalFormat df = new DecimalFormat("0.00");
|
|
||||||
df.setRoundingMode(RoundingMode.HALF_UP);
|
|
||||||
return df.format(value);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String format3(double value) {
|
|
||||||
NumberFormat nf = NumberFormat.getNumberInstance();
|
|
||||||
nf.setMaximumFractionDigits(2);
|
|
||||||
/*setMinimumFractionDigits设置成2
|
|
||||||
* 如果不这么做,那么当value的值是100.00的时候返回100
|
|
||||||
* 而不是100.00
|
|
||||||
*/
|
|
||||||
nf.setMinimumFractionDigits(2);
|
|
||||||
nf.setRoundingMode(RoundingMode.HALF_UP);
|
|
||||||
/*
|
|
||||||
如果想输出的格式用逗号隔开,可以设置成true
|
|
||||||
*/
|
|
||||||
nf.setGroupingUsed(false);
|
|
||||||
return nf.format(value);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String format5(double value) {
|
|
||||||
return String.format("%.2f", value).toString();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -23,8 +23,8 @@ public class ImagePagerAdapter extends PagerAdapter {
|
|||||||
Context context;
|
Context context;
|
||||||
ArrayList<String> impsUrl;
|
ArrayList<String> impsUrl;
|
||||||
LayoutInflater inflater = null;
|
LayoutInflater inflater = null;
|
||||||
|
|
||||||
ImageView full_image;
|
ImageView full_image;
|
||||||
|
|
||||||
public ImagePagerAdapter(Context context, ArrayList<String> imusUrl) {
|
public ImagePagerAdapter(Context context, ArrayList<String> imusUrl) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.impsUrl = imusUrl;
|
this.impsUrl = imusUrl;
|
||||||
|
@ -54,7 +54,7 @@ public class IssueProblemAdapter extends RecyclerView.Adapter<IssueProblemAdapte
|
|||||||
return issueList.size();
|
return issueList.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
TextView tvIssue;
|
TextView tvIssue;
|
||||||
public ViewHolder(@NonNull View itemView) {
|
public ViewHolder(@NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
|
@ -97,7 +97,7 @@ public class MarkerAdapter extends RecyclerView.Adapter<MarkerAdapter.ViewHolder
|
|||||||
return poiEntities.size();
|
return poiEntities.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
TextView titer;
|
TextView titer;
|
||||||
ImageView ivIcon;
|
ImageView ivIcon;
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ public class MessageAdapter extends RecyclerView.Adapter<MessageAdapter.ViewHold
|
|||||||
}
|
}
|
||||||
public messageClickItem messageClickItem;
|
public messageClickItem messageClickItem;
|
||||||
|
|
||||||
public void setMessageClickItem(MessageAdapter.messageClickItem messageClickItem) {
|
public void setMessageClickItem(messageClickItem messageClickItem) {
|
||||||
this.messageClickItem = messageClickItem;
|
this.messageClickItem = messageClickItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,6 @@ public class PhotoAdapter extends RecyclerView.Adapter<PhotoAdapter.ViewHolder>
|
|||||||
File file = fileBean.getFile();
|
File file = fileBean.getFile();
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
AWMp4ParserHelper.getInstance().loadFirstWithGlide(context, Uri.fromFile(file).toString(), holder.ivPhoto, 500);
|
AWMp4ParserHelper.getInstance().loadFirstWithGlide(context, Uri.fromFile(file).toString(), holder.ivPhoto, 500);
|
||||||
// Glide.with(context).load(file).apply(RequestOptions.bitmapTransform(new RotateTransformation(0))).into(holder.ivPhoto);
|
|
||||||
}
|
}
|
||||||
holder.ivPhoto.setOnClickListener(new View.OnClickListener() {
|
holder.ivPhoto.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -178,7 +178,7 @@ public class PoiRecycleAdapter extends RecyclerView.Adapter<PoiRecycleAdapter.My
|
|||||||
/**
|
/**
|
||||||
* ViewHolder的类,用于缓存控件
|
* ViewHolder的类,用于缓存控件
|
||||||
*/
|
*/
|
||||||
static class MyViewHolder extends RecyclerView.ViewHolder {
|
public static class MyViewHolder extends RecyclerView.ViewHolder {
|
||||||
TextView tvPhone;
|
TextView tvPhone;
|
||||||
EditText editAreaCode, editPhoneNumber;
|
EditText editAreaCode, editPhoneNumber;
|
||||||
ImageView image;
|
ImageView image;
|
||||||
|
@ -28,7 +28,6 @@ public class PoiTaskAdapter extends RecyclerView.Adapter<PoiTaskAdapter.ViewHold
|
|||||||
this.listBeans = listBeans;
|
this.listBeans = listBeans;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
@ -184,4 +184,5 @@ public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.Vi
|
|||||||
public interface onClickItem {
|
public interface onClickItem {
|
||||||
void item(int position, PoiEntity allRoad);
|
void item(int position, PoiEntity allRoad);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ public class TaskExplainAdapter extends RecyclerView.Adapter<TaskExplainAdapter.
|
|||||||
return explainList.size();
|
return explainList.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
ImageView ivExplain;
|
ImageView ivExplain;
|
||||||
TextView tvExplain;
|
TextView tvExplain;
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ public class TaskExplainAdapter2 extends RecyclerView.Adapter<TaskExplainAdapter
|
|||||||
return explainList2.size();
|
return explainList2.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
static class ViewHolder2 extends RecyclerView.ViewHolder {
|
public static class ViewHolder2 extends RecyclerView.ViewHolder {
|
||||||
TextView tvText;
|
TextView tvText;
|
||||||
|
|
||||||
public ViewHolder2(@NonNull View itemView) {
|
public ViewHolder2(@NonNull View itemView) {
|
||||||
|
@ -62,9 +62,9 @@ public class TaskPrefectureAdapter extends RecyclerView.Adapter<TaskPrefectureAd
|
|||||||
tvTime=itemView.findViewById(R.id.tv_time);
|
tvTime=itemView.findViewById(R.id.tv_time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
clickItem clickItem;
|
private clickItem clickItem;
|
||||||
|
|
||||||
public void setClickItem(TaskPrefectureAdapter.clickItem clickItem) {
|
public void setClickItem(clickItem clickItem) {
|
||||||
this.clickItem = clickItem;
|
this.clickItem = clickItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ import java.util.List;
|
|||||||
public class VideoAdapter extends RecyclerView.Adapter<VideoAdapter.ViewHolder> {
|
public class VideoAdapter extends RecyclerView.Adapter<VideoAdapter.ViewHolder> {
|
||||||
private List<FileBean> fileBeans;
|
private List<FileBean> fileBeans;
|
||||||
private Context context;
|
private Context context;
|
||||||
private List<File> textFile=new ArrayList<>();
|
private List<File> textFile = new ArrayList<>();
|
||||||
|
|
||||||
public VideoAdapter(List<FileBean> files, Context context) {
|
public VideoAdapter(List<FileBean> files, Context context) {
|
||||||
this.fileBeans = files;
|
this.fileBeans = files;
|
||||||
@ -47,16 +47,16 @@ public class VideoAdapter extends RecyclerView.Adapter<VideoAdapter.ViewHolder>
|
|||||||
for (int i = 0; i < fileBeans.size(); i++) {
|
for (int i = 0; i < fileBeans.size(); i++) {
|
||||||
String path = fileBeans.get(i).getFile().getPath();
|
String path = fileBeans.get(i).getFile().getPath();
|
||||||
if (fileBeanList.getFile().getPath().equals(path)) {
|
if (fileBeanList.getFile().getPath().equals(path)) {
|
||||||
fileBeans.set(i,fileBeanList);
|
fileBeans.set(i, fileBeanList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i = 0; i < fileBeans.size(); i++) {
|
for (int i = 0; i < fileBeans.size(); i++) {
|
||||||
boolean check = fileBeans.get(i).isCheck();
|
boolean check = fileBeans.get(i).isCheck();
|
||||||
if (check){
|
if (check) {
|
||||||
fileBeans.get(i).getFile().delete();
|
fileBeans.get(i).getFile().delete();
|
||||||
if (textFile!=null){
|
if (textFile != null) {
|
||||||
for (int i1 = 0; i1 < textFile.size(); i1++) {
|
for (int i1 = 0; i1 < textFile.size(); i1++) {
|
||||||
if (textFile.get(i).getPath().contains(fileBeans.get(i).getFile().getPath())){
|
if (textFile.get(i).getPath().contains(fileBeans.get(i).getFile().getPath())) {
|
||||||
textFile.get(i).delete();
|
textFile.get(i).delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -70,13 +70,13 @@ public class VideoAdapter extends RecyclerView.Adapter<VideoAdapter.ViewHolder>
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
View inflate = LayoutInflater.from(context).inflate(R.layout.video_item, parent, false);
|
View inflate = LayoutInflater.from(context).inflate(R.layout.video_item, parent, false);
|
||||||
return new ViewHolder(inflate);
|
return new ViewHolder(inflate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||||
FileBean fileBean = fileBeans.get(position);
|
FileBean fileBean = fileBeans.get(position);
|
||||||
File file = fileBean.getFile();
|
File file = fileBean.getFile();
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
@ -86,7 +86,7 @@ public class VideoAdapter extends RecyclerView.Adapter<VideoAdapter.ViewHolder>
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Intent intent = new Intent(context, VideoActivity.class);
|
Intent intent = new Intent(context, VideoActivity.class);
|
||||||
intent.putExtra("video",fileBean.getFile().getPath());
|
intent.putExtra("video", fileBean.getFile().getPath());
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -107,18 +107,18 @@ public class VideoAdapter extends RecyclerView.Adapter<VideoAdapter.ViewHolder>
|
|||||||
return fileBeans.size();
|
return fileBeans.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
class ViewHolder extends RecyclerView.ViewHolder {
|
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
private ImageView ivVideo;
|
private ImageView ivVideo;
|
||||||
private CheckBox cbVideo;
|
private CheckBox cbVideo;
|
||||||
|
|
||||||
public ViewHolder(@NonNull @NotNull View itemView) {
|
public ViewHolder(@NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
ivVideo = itemView.findViewById(R.id.iv_video);
|
ivVideo = itemView.findViewById(R.id.iv_video);
|
||||||
cbVideo = itemView.findViewById(R.id.check_video);
|
cbVideo = itemView.findViewById(R.id.check_video);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public photoClickItem photoClickItem;
|
private photoClickItem photoClickItem;
|
||||||
|
|
||||||
public void setPhotoClickItem(photoClickItem photoClickItem) {
|
public void setPhotoClickItem(photoClickItem photoClickItem) {
|
||||||
this.photoClickItem = photoClickItem;
|
this.photoClickItem = photoClickItem;
|
||||||
|
@ -54,7 +54,7 @@ public class WithdrawalAdapter extends RecyclerView.Adapter<WithdrawalAdapter.On
|
|||||||
WithdrawalBean.BodyBean.ListBean listBean = dataBeans.get(position);
|
WithdrawalBean.BodyBean.ListBean listBean = dataBeans.get(position);
|
||||||
holder.tvTitle.setText(listBean.getExchangePrice() + "元");
|
holder.tvTitle.setText(listBean.getExchangePrice() + "元");
|
||||||
holder.tvTime.setText(listBean.getCommitDate());
|
holder.tvTime.setText(listBean.getCommitDate());
|
||||||
int adminConfirm = listBean.getAdminConfirm();
|
int adminConfirm = listBean.getAdminConfirm();//-1 不通过,1 通过,0 审核
|
||||||
if (adminConfirm==-1){
|
if (adminConfirm==-1){
|
||||||
holder.tvDec.setText("未通过");
|
holder.tvDec.setText("未通过");
|
||||||
}else if (adminConfirm==0){
|
}else if (adminConfirm==0){
|
||||||
@ -62,7 +62,6 @@ public class WithdrawalAdapter extends RecyclerView.Adapter<WithdrawalAdapter.On
|
|||||||
}else if (adminConfirm==1){
|
}else if (adminConfirm==1){
|
||||||
holder.tvDec.setText("已通过,支付完成,可能到账延迟");
|
holder.tvDec.setText("已通过,支付完成,可能到账延迟");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
package com.navinfo.outdoor.api;
|
|
||||||
|
|
||||||
public interface ApiService {
|
|
||||||
}
|
|
@ -42,7 +42,6 @@ public class AuthService {
|
|||||||
*/
|
*/
|
||||||
public static String getAuth(String ak, String sk) {
|
public static String getAuth(String ak, String sk) {
|
||||||
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
|
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
|
||||||
|
|
||||||
StrictMode.setThreadPolicy(policy);
|
StrictMode.setThreadPolicy(policy);
|
||||||
// 获取token地址
|
// 获取token地址
|
||||||
String authHost = "https://aip.baidubce.com/oauth/2.0/token?";
|
String authHost = "https://aip.baidubce.com/oauth/2.0/token?";
|
||||||
|
@ -12,7 +12,6 @@ import java.net.URLEncoder;
|
|||||||
* 银行卡识别
|
* 银行卡识别
|
||||||
*/
|
*/
|
||||||
public class BankCard {
|
public class BankCard {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重要提示代码中所需工具类
|
* 重要提示代码中所需工具类
|
||||||
* FileUtil,Base64Util,HttpUtil,GsonUtils请从
|
* FileUtil,Base64Util,HttpUtil,GsonUtils请从
|
||||||
@ -31,9 +30,7 @@ public class BankCard {
|
|||||||
byte[] imgData = FileUtil.readFileByBytes(filePath);
|
byte[] imgData = FileUtil.readFileByBytes(filePath);
|
||||||
String imgStr = Base64Util.encode(imgData);
|
String imgStr = Base64Util.encode(imgData);
|
||||||
String imgParam = URLEncoder.encode(imgStr, "UTF-8");
|
String imgParam = URLEncoder.encode(imgStr, "UTF-8");
|
||||||
|
|
||||||
String param = "image=" + imgParam;
|
String param = "image=" + imgParam;
|
||||||
|
|
||||||
// 注意这里仅为了简化编码每一次请求都去获取access_token,线上环境access_token有过期时间, 客户端可自行缓存,过期后重新获取。
|
// 注意这里仅为了简化编码每一次请求都去获取access_token,线上环境access_token有过期时间, 客户端可自行缓存,过期后重新获取。
|
||||||
String accessToken = AuthService.getAuth("iafhTwf6LnOMoYTiZQDlrKTu","0d3yoIsrsrAspUMoyNkWeeqDTvxvg9QB");
|
String accessToken = AuthService.getAuth("iafhTwf6LnOMoYTiZQDlrKTu","0d3yoIsrsrAspUMoyNkWeeqDTvxvg9QB");
|
||||||
return HttpUtil.post(url, accessToken, param);
|
return HttpUtil.post(url, accessToken, param);
|
||||||
|
@ -27,7 +27,6 @@ public class Constant {
|
|||||||
public static final String GET_ERR_MESSAGE2 = "manifest 中配置的 key 不正确";
|
public static final String GET_ERR_MESSAGE2 = "manifest 中配置的 key 不正确";
|
||||||
public static final String GET_ERR_MESSAGE3 = "自动加载libtencentloc.so失败";
|
public static final String GET_ERR_MESSAGE3 = "自动加载libtencentloc.so失败";
|
||||||
public static final String ROOT_FOLDER = SdkFolderCreate.getSDPath() + "/navinfoOutDoor";
|
public static final String ROOT_FOLDER = SdkFolderCreate.getSDPath() + "/navinfoOutDoor";
|
||||||
|
|
||||||
public static String BASE_FOLDER = null;
|
public static String BASE_FOLDER = null;
|
||||||
//保存图片的目录
|
//保存图片的目录
|
||||||
public static String PICTURE_FOLDER;
|
public static String PICTURE_FOLDER;
|
||||||
@ -133,7 +132,7 @@ public class Constant {
|
|||||||
//public static final int CHARGING_PILE_PHOTO = 37;//充电桩的照片
|
//public static final int CHARGING_PILE_PHOTO = 37;//充电桩的照片
|
||||||
public static final int Filter_WhAT_RECYCLER = 39;//刪選適配器的刷新
|
public static final int Filter_WhAT_RECYCLER = 39;//刪選適配器的刷新
|
||||||
public static final int EVENT_WHAT_CURRENT_MARKER = 41; // 显示当前正在编辑的POI类型数据的Event的What值
|
public static final int EVENT_WHAT_CURRENT_MARKER = 41; // 显示当前正在编辑的POI类型数据的Event的What值
|
||||||
// CompleteTask
|
//CompleteTask
|
||||||
public static final int EVENT_WHAT_COMPLETE_TASK = 42; // 点击记录跳转开始采集
|
public static final int EVENT_WHAT_COMPLETE_TASK = 42; // 点击记录跳转开始采集
|
||||||
public static final int EVENT_WORK_HOME = 45; //切换到寻宝
|
public static final int EVENT_WORK_HOME = 45; //切换到寻宝
|
||||||
public static final int REGISTER_WORD = 46; //注册的返回
|
public static final int REGISTER_WORD = 46; //注册的返回
|
||||||
@ -152,6 +151,7 @@ public class Constant {
|
|||||||
public static int TASK_TYPE = -1; // 任务类型
|
public static int TASK_TYPE = -1; // 任务类型
|
||||||
public static int TASK_STARTUP = -1; // 任务状态
|
public static int TASK_STARTUP = -1; // 任务状态
|
||||||
public static String CODE = ""; //区号
|
public static String CODE = ""; //区号
|
||||||
|
public static String NOTIFICATION=null;//消息json串
|
||||||
/*
|
/*
|
||||||
用户当前位置
|
用户当前位置
|
||||||
*/
|
*/
|
||||||
@ -171,10 +171,9 @@ public class Constant {
|
|||||||
public static final String INTENT_DETAIL = "Detail";//poiEntity 的detail
|
public static final String INTENT_DETAIL = "Detail";//poiEntity 的detail
|
||||||
public static SlidingUpPanelLayout SLIDING_LAYOUT = null;//設置
|
public static SlidingUpPanelLayout SLIDING_LAYOUT = null;//設置
|
||||||
public static TencentMap.OnMarkerClickListener markerClickListener = null;
|
public static TencentMap.OnMarkerClickListener markerClickListener = null;
|
||||||
public static final String NAVIN_FO = "12.02";//版本日期
|
public static final String NAVIN_FO = "12.10";//版本日期
|
||||||
|
|
||||||
//marker
|
//marker
|
||||||
public static final BitmapDescriptor MARKER_POI_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_show);
|
|
||||||
public static final BitmapDescriptor MARKER_CHARGE_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_show);
|
public static final BitmapDescriptor MARKER_CHARGE_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_show);
|
||||||
public static final BitmapDescriptor MARKER_CHARGE_PILE_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_pile_show);
|
public static final BitmapDescriptor MARKER_CHARGE_PILE_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_pile_show);
|
||||||
public static final BitmapDescriptor MARKER_POI_VIDEO_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video_show);
|
public static final BitmapDescriptor MARKER_POI_VIDEO_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video_show);
|
||||||
|
@ -36,6 +36,7 @@ public class IdCard {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
@ -2,11 +2,16 @@ package com.navinfo.outdoor.api;
|
|||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.app.Notification;
|
import android.app.Notification;
|
||||||
|
import android.app.NotificationManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.StrictMode;
|
import android.os.StrictMode;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.widget.RemoteViews;
|
||||||
|
|
||||||
|
import androidx.core.app.NotificationCompat;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
import com.lzy.okgo.OkGo;
|
import com.lzy.okgo.OkGo;
|
||||||
import com.lzy.okgo.cache.CacheEntity;
|
import com.lzy.okgo.cache.CacheEntity;
|
||||||
import com.lzy.okgo.cache.CacheMode;
|
import com.lzy.okgo.cache.CacheMode;
|
||||||
@ -14,7 +19,12 @@ import com.lzy.okgo.cookie.CookieJarImpl;
|
|||||||
import com.lzy.okgo.cookie.store.DBCookieStore;
|
import com.lzy.okgo.cookie.store.DBCookieStore;
|
||||||
import com.lzy.okgo.interceptor.HttpLoggingInterceptor;
|
import com.lzy.okgo.interceptor.HttpLoggingInterceptor;
|
||||||
import com.lzy.okgo.model.HttpHeaders;
|
import com.lzy.okgo.model.HttpHeaders;
|
||||||
|
import com.navinfo.outdoor.R;
|
||||||
import com.navinfo.outdoor.activity.FragmentManagement;
|
import com.navinfo.outdoor.activity.FragmentManagement;
|
||||||
|
import com.navinfo.outdoor.activity.HomeActivity;
|
||||||
|
import com.navinfo.outdoor.activity.WebActivity;
|
||||||
|
import com.navinfo.outdoor.bean.NotificationBean;
|
||||||
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
import com.navinfo.outdoor.util.TalentLocationUtils;
|
import com.navinfo.outdoor.util.TalentLocationUtils;
|
||||||
import com.umeng.commonsdk.UMConfigure;
|
import com.umeng.commonsdk.UMConfigure;
|
||||||
import com.umeng.message.IUmengRegisterCallback;
|
import com.umeng.message.IUmengRegisterCallback;
|
||||||
@ -26,6 +36,7 @@ import com.umeng.message.entity.UMessage;
|
|||||||
import com.umeng.umcrash.UMCrash;
|
import com.umeng.umcrash.UMCrash;
|
||||||
import com.umeng.umcrash.UMCrashCallback;
|
import com.umeng.umcrash.UMCrashCallback;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
@ -73,23 +84,28 @@ public class UserApplication extends Application {
|
|||||||
Constant.DEVICE_TOKEN = s;
|
Constant.DEVICE_TOKEN = s;
|
||||||
Log.i("TAGEE", "Success 注册成功:deviceToken:--> " + Constant.DEVICE_TOKEN);
|
Log.i("TAGEE", "Success 注册成功:deviceToken:--> " + Constant.DEVICE_TOKEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(String s, String s1) {
|
public void onFailure(String s, String s1) {
|
||||||
Log.e("TAGEE", "Failure 注册失败:--> " + "code:" + s + ", desc:" + s1);
|
Log.e("TAGEE", "Failure 注册失败:--> " + "code:" + s + ", desc:" + s1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
instance.onAppStart();
|
||||||
UmengMessageHandler msgHandler = new UmengMessageHandler() {
|
UmengMessageHandler msgHandler = new UmengMessageHandler() {
|
||||||
//处理通知栏消息
|
//处理通知栏消息
|
||||||
@Override
|
@Override
|
||||||
public void dealWithNotificationMessage(Context context, UMessage msg) {
|
public void dealWithNotificationMessage(Context context, UMessage msg) {
|
||||||
super.dealWithNotificationMessage(context, msg);
|
super.dealWithNotificationMessage(context, msg);
|
||||||
Log.i("TAGEE", "dealWithNotificationMessage:" + msg.getRaw().toString());
|
Log.i("TAGEE", "dealWithNotificationMessage:" + msg.getRaw().toString());
|
||||||
|
Constant.NOTIFICATION=msg.getRaw().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
//自定义通知样式,此方法可以修改通知样式等
|
//自定义通知样式,此方法可以修改通知样式等
|
||||||
@Override
|
@Override
|
||||||
public Notification getNotification(Context context, UMessage msg) {
|
public Notification getNotification(Context context, UMessage msg) {
|
||||||
Log.i("TAGEE", "notification receiver:" + msg.getRaw().toString());
|
Log.i("TAGEE", "getNotification: "+msg.getRaw().toString());
|
||||||
return super.getNotification(context, msg);
|
return super.getNotification(context, msg);
|
||||||
|
|
||||||
}
|
}
|
||||||
//处理透传消息
|
//处理透传消息
|
||||||
@Override
|
@Override
|
||||||
@ -102,7 +118,7 @@ public class UserApplication extends Application {
|
|||||||
//App处于前台时不显示通知
|
//App处于前台时不显示通知
|
||||||
//instance.setNotificationOnForeground(false);
|
//instance.setNotificationOnForeground(false);
|
||||||
//设置显示通知的数量
|
//设置显示通知的数量
|
||||||
//instance.setDisplayNotificationNumber(0);
|
instance.setDisplayNotificationNumber(0);
|
||||||
//服务端控制声音
|
//服务端控制声音
|
||||||
//instance.setNotificationPlaySound(MsgConstant.NOTIFICATION_PLAY_SERVER);
|
//instance.setNotificationPlaySound(MsgConstant.NOTIFICATION_PLAY_SERVER);
|
||||||
//通知免打扰时段
|
//通知免打扰时段
|
||||||
|
@ -30,6 +30,7 @@ import com.navinfo.outdoor.util.NetWorkUtils;
|
|||||||
import com.umeng.message.PushAgent;
|
import com.umeng.message.PushAgent;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
|
|
||||||
@ -83,12 +84,10 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
alertDialog.dismiss();
|
alertDialog.dismiss();
|
||||||
}
|
}
|
||||||
alertDialog = new AlertDialog.Builder(this).create();
|
alertDialog = new AlertDialog.Builder(this).create();
|
||||||
alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable());
|
Objects.requireNonNull(alertDialog.getWindow()).setBackgroundDrawable(new ColorDrawable());
|
||||||
alertDialog.setCancelable(false);
|
alertDialog.setCancelable(false);
|
||||||
alertDialog.setOnKeyListener((dialog, keyCode, event) -> {
|
alertDialog.setOnKeyListener((dialog, keyCode, event) -> {
|
||||||
if (keyCode == KeyEvent.KEYCODE_SEARCH || keyCode == KeyEvent.KEYCODE_BACK)
|
return keyCode == KeyEvent.KEYCODE_SEARCH || keyCode == KeyEvent.KEYCODE_BACK;
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
|
|
||||||
});
|
});
|
||||||
//loading样式
|
//loading样式
|
||||||
|
@ -89,8 +89,8 @@ public abstract class BaseDrawerFragment extends BaseFragment {
|
|||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.POI_DRAWER;
|
obtain.what = Constant.POI_DRAWER;
|
||||||
LatLng latLng = new LatLng();
|
LatLng latLng = new LatLng();
|
||||||
latLng.setLatitude(Double.valueOf(showPoiEntity.getY()));
|
latLng.setLatitude(Double.parseDouble(showPoiEntity.getY()));
|
||||||
latLng.setLongitude(Double.valueOf(showPoiEntity.getX()));
|
latLng.setLongitude(Double.parseDouble(showPoiEntity.getX()));
|
||||||
obtain.obj = latLng;
|
obtain.obj = latLng;
|
||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
MapManager.getInstance().getTencentMap().setOnMarkerClickListener(null);
|
MapManager.getInstance().getTencentMap().setOnMarkerClickListener(null);
|
||||||
|
@ -45,11 +45,11 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
|
|||||||
private AlertDialog alertDialog;
|
private AlertDialog alertDialog;
|
||||||
public View mView;
|
public View mView;
|
||||||
protected FragmentManager supportFragmentManager;
|
protected FragmentManager supportFragmentManager;
|
||||||
// private HomeActivity homeActivity;
|
// private HomeActivity homeActivity;
|
||||||
private Handler handler = new Handler(new Handler.Callback() {
|
private Handler handler = new Handler(new Handler.Callback() {
|
||||||
@Override
|
@Override
|
||||||
public boolean handleMessage(@NonNull Message msg) {
|
public boolean handleMessage(@NonNull Message msg) {
|
||||||
if(msg.what==0x200){
|
if (msg.what == 0x200) {
|
||||||
View view = (View) msg.obj;
|
View view = (View) msg.obj;
|
||||||
view.setEnabled(true);
|
view.setEnabled(true);
|
||||||
}
|
}
|
||||||
@ -97,17 +97,14 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
|
|||||||
protected abstract int getLayout();
|
protected abstract int getLayout();
|
||||||
|
|
||||||
public void showLoadingDialog() {
|
public void showLoadingDialog() {
|
||||||
if (alertDialog!=null) {
|
if (alertDialog != null) {
|
||||||
alertDialog.dismiss();
|
alertDialog.dismiss();
|
||||||
}
|
}
|
||||||
alertDialog = new AlertDialog.Builder(getContext()).create();
|
alertDialog = new AlertDialog.Builder(Objects.requireNonNull(getActivity())).create();
|
||||||
alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable());
|
Objects.requireNonNull(alertDialog.getWindow()).setBackgroundDrawable(new ColorDrawable());
|
||||||
alertDialog.setCancelable(false);
|
alertDialog.setCancelable(false);
|
||||||
alertDialog.setOnKeyListener((dialog, keyCode, event) -> {
|
alertDialog.setOnKeyListener((dialog, keyCode, event) -> {
|
||||||
if (keyCode == KeyEvent.KEYCODE_SEARCH || keyCode == KeyEvent.KEYCODE_BACK)
|
return keyCode == KeyEvent.KEYCODE_SEARCH || keyCode == KeyEvent.KEYCODE_BACK;
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
|
|
||||||
});
|
});
|
||||||
//loading样式
|
//loading样式
|
||||||
View view = LayoutInflater.from(getContext()).inflate(R.layout.loading, null);
|
View view = LayoutInflater.from(getContext()).inflate(R.layout.loading, null);
|
||||||
@ -120,7 +117,7 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
|
|||||||
|
|
||||||
public void setLoadingDialogText(String s) {
|
public void setLoadingDialogText(String s) {
|
||||||
//给loading 添加文字
|
//给loading 添加文字
|
||||||
if (alertDialog!=null){
|
if (alertDialog != null) {
|
||||||
TextView view = alertDialog.findViewById(R.id.progressBar_tx);
|
TextView view = alertDialog.findViewById(R.id.progressBar_tx);
|
||||||
view.setText(s);
|
view.setText(s);
|
||||||
}
|
}
|
||||||
@ -134,7 +131,7 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
|
|||||||
|
|
||||||
protected void intentWebActivity(String url, HashMap<String, String> paramMap) {
|
protected void intentWebActivity(String url, HashMap<String, String> paramMap) {
|
||||||
Intent intent = new Intent(getContext(), WebActivity.class);
|
Intent intent = new Intent(getContext(), WebActivity.class);
|
||||||
if (paramMap !=null) {
|
if (paramMap != null) {
|
||||||
intent.putExtra("map", paramMap);
|
intent.putExtra("map", paramMap);
|
||||||
}
|
}
|
||||||
intent.putExtra("url", url);
|
intent.putExtra("url", url);
|
||||||
|
@ -29,7 +29,7 @@ public class ApkVersionBean {
|
|||||||
this.body = body;
|
this.body = body;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class bodyBean{
|
public static class bodyBean {
|
||||||
/**
|
/**
|
||||||
* "version": 155,
|
* "version": 155,
|
||||||
* "operationType": null,
|
* "operationType": null,
|
||||||
|
119
app/src/main/java/com/navinfo/outdoor/bean/NotificationBean.java
Normal file
119
app/src/main/java/com/navinfo/outdoor/bean/NotificationBean.java
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
package com.navinfo.outdoor.bean;
|
||||||
|
|
||||||
|
public class NotificationBean {
|
||||||
|
/**
|
||||||
|
* display_type : notification
|
||||||
|
* extra : {"id":10}
|
||||||
|
* body : {"after_open":"go_app","ticker":"","title":"测试2","play_sound":"true","text":"测试3"}
|
||||||
|
* msg_id : ulb4ld9163877340651501
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String display_type;
|
||||||
|
private ExtraBean extra;
|
||||||
|
private BodyBean body;
|
||||||
|
private String msg_id;
|
||||||
|
|
||||||
|
public String getDisplay_type() {
|
||||||
|
return display_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDisplay_type(String display_type) {
|
||||||
|
this.display_type = display_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExtraBean getExtra() {
|
||||||
|
return extra;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExtra(ExtraBean extra) {
|
||||||
|
this.extra = extra;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BodyBean getBody() {
|
||||||
|
return body;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBody(BodyBean body) {
|
||||||
|
this.body = body;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsg_id() {
|
||||||
|
return msg_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMsg_id(String msg_id) {
|
||||||
|
this.msg_id = msg_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ExtraBean {
|
||||||
|
/**
|
||||||
|
* id : 10
|
||||||
|
*/
|
||||||
|
|
||||||
|
private int id;
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class BodyBean {
|
||||||
|
/**
|
||||||
|
* after_open : go_app
|
||||||
|
* ticker :
|
||||||
|
* title : 测试2
|
||||||
|
* play_sound : true
|
||||||
|
* text : 测试3
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String after_open;
|
||||||
|
private String ticker;
|
||||||
|
private String title;
|
||||||
|
private String play_sound;
|
||||||
|
private String text;
|
||||||
|
|
||||||
|
public String getAfter_open() {
|
||||||
|
return after_open;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAfter_open(String after_open) {
|
||||||
|
this.after_open = after_open;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTicker() {
|
||||||
|
return ticker;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTicker(String ticker) {
|
||||||
|
this.ticker = ticker;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPlay_sound() {
|
||||||
|
return play_sound;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPlay_sound(String play_sound) {
|
||||||
|
this.play_sound = play_sound;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getText() {
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setText(String text) {
|
||||||
|
this.text = text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
@ -4,13 +4,11 @@ package com.navinfo.outdoor.bean;
|
|||||||
* 普通任务
|
* 普通任务
|
||||||
*/
|
*/
|
||||||
public class ReceivedPoiBean {
|
public class ReceivedPoiBean {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* code : 200
|
* code : 200
|
||||||
* message : 成功
|
* message : 成功
|
||||||
* body : {"id":6774,"address":"北京市海淀区","geo":"POINT(116.28759 40.049277)","type":5,"name":"启明星辰大厦(西门)","isExclusive":0}
|
* body : {"id":6774,"address":"北京市海淀区","geo":"POINT(116.28759 40.049277)","type":5,"name":"启明星辰大厦(西门)","isExclusive":0}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private int code;
|
private int code;
|
||||||
private String message;
|
private String message;
|
||||||
private BodyBean body;
|
private BodyBean body;
|
||||||
@ -47,8 +45,8 @@ public class ReceivedPoiBean {
|
|||||||
* type : 5
|
* type : 5
|
||||||
* name : 启明星辰大厦(西门)
|
* name : 启明星辰大厦(西门)
|
||||||
* isExclusive : 0
|
* isExclusive : 0
|
||||||
* memo;
|
* memo;
|
||||||
* endDate;
|
* endDate;
|
||||||
*/
|
*/
|
||||||
private int id;
|
private int id;
|
||||||
private String address;
|
private String address;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
package com.navinfo.outdoor.bean;
|
package com.navinfo.outdoor.bean;
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 道路数据的附加信息
|
* 道路数据的附加信息
|
||||||
*/
|
*/
|
||||||
|
@ -9,7 +9,6 @@ public class TaskByNetBean {
|
|||||||
* message : 成功
|
* message : 成功
|
||||||
* body : {"name":"门头沟区道路录像21","address":"","geo":"LINESTRING(115.990024 39.969285,115.991332 39.970245,115.990608 39.970906,115.993168 39.972121,115.993446 39.973038,115.99403 39.973528,115.993863 39.972142,115.995644 39.971993,115.996451 39.972078,115.998482 39.971439,115.999094 39.970607,115.9994 39.970799)","price":4.860135,"type":4,"isExclusive":0}
|
* body : {"name":"门头沟区道路录像21","address":"","geo":"LINESTRING(115.990024 39.969285,115.991332 39.970245,115.990608 39.970906,115.993168 39.972121,115.993446 39.973038,115.99403 39.973528,115.993863 39.972142,115.995644 39.971993,115.996451 39.972078,115.998482 39.971439,115.999094 39.970607,115.9994 39.970799)","price":4.860135,"type":4,"isExclusive":0}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private int code;
|
private int code;
|
||||||
private String message;
|
private String message;
|
||||||
private BodyBean body;
|
private BodyBean body;
|
||||||
@ -49,7 +48,6 @@ public class TaskByNetBean {
|
|||||||
* memo
|
* memo
|
||||||
* endDate
|
* endDate
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
private String address;
|
private String address;
|
||||||
private String geo;
|
private String geo;
|
||||||
|
@ -2,7 +2,7 @@ package com.navinfo.outdoor.bean;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class TaskExplainInfo {
|
public class TaskExplainInfo {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -11,7 +11,6 @@ public class UnPolygonTaskBean {
|
|||||||
* message : 成功
|
* message : 成功
|
||||||
* body : 1
|
* body : 1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private int code;
|
private int code;
|
||||||
private String message;
|
private String message;
|
||||||
private int body;
|
private int body;
|
||||||
|
@ -9,7 +9,6 @@ public class UserDetailBean {
|
|||||||
* message : 成功
|
* message : 成功
|
||||||
* body : {"pid":1,"username":"C10000","password":"123456","createtime":"2021-06-11T07:56:06.117+0000","name":"李心榕","sex":0,"regionId":530902,"mobile":"18811794839","fatherid":null,"registerTime":null,"photoName":null,"alipayAccountName":null,"wechat":null,"qq":"","freezed":0,"locked":0,"userBankcard":{"userid":1,"name":"李心榕","bankName":"银行名称","bankAccount":"103100000026","lastUpdateTime":null,"idNumber":"8866214489652365478","name1":"李心榕","idNumber1":null,"modifydate":null},"userAuth":{"userid":1,"name":"我得","idnum":"411381200010265236","certorg":null,"idtimelimit":null,"p1":null,"p2":null,"p3":null,"modifytime":"2021-06-28T07:22:12.160+0000","audituid":null,"audittime":null,"reaudituid":null,"reaudittime":null,"auditstatus":1,"reaudited":0,"auditmsg":null},"role":[{"id":3,"name":"admin","description":"众包管理员"}]}
|
* body : {"pid":1,"username":"C10000","password":"123456","createtime":"2021-06-11T07:56:06.117+0000","name":"李心榕","sex":0,"regionId":530902,"mobile":"18811794839","fatherid":null,"registerTime":null,"photoName":null,"alipayAccountName":null,"wechat":null,"qq":"","freezed":0,"locked":0,"userBankcard":{"userid":1,"name":"李心榕","bankName":"银行名称","bankAccount":"103100000026","lastUpdateTime":null,"idNumber":"8866214489652365478","name1":"李心榕","idNumber1":null,"modifydate":null},"userAuth":{"userid":1,"name":"我得","idnum":"411381200010265236","certorg":null,"idtimelimit":null,"p1":null,"p2":null,"p3":null,"modifytime":"2021-06-28T07:22:12.160+0000","audituid":null,"audittime":null,"reaudituid":null,"reaudittime":null,"auditstatus":1,"reaudited":0,"auditmsg":null},"role":[{"id":3,"name":"admin","description":"众包管理员"}]}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private int code;
|
private int code;
|
||||||
private String message;
|
private String message;
|
||||||
private BodyBean body;
|
private BodyBean body;
|
||||||
|
@ -26,6 +26,7 @@ public class AboutFragment extends BaseFragment implements View.OnClickListener
|
|||||||
fragment.setArguments(bundle);
|
fragment.setArguments(bundle);
|
||||||
return fragment;
|
return fragment;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayout() {
|
protected int getLayout() {
|
||||||
return R.layout.about_fragment;
|
return R.layout.about_fragment;
|
||||||
|
@ -17,6 +17,7 @@ import com.github.lazylibrary.util.FileUtils;
|
|||||||
import com.lzy.okgo.model.HttpParams;
|
import com.lzy.okgo.model.HttpParams;
|
||||||
import com.navinfo.outdoor.R;
|
import com.navinfo.outdoor.R;
|
||||||
import com.navinfo.outdoor.activity.FragmentManagement;
|
import com.navinfo.outdoor.activity.FragmentManagement;
|
||||||
|
import com.navinfo.outdoor.activity.GuidanceActivity;
|
||||||
import com.navinfo.outdoor.adapter.CapacityEvaluationAdapter;
|
import com.navinfo.outdoor.adapter.CapacityEvaluationAdapter;
|
||||||
import com.navinfo.outdoor.api.Constant;
|
import com.navinfo.outdoor.api.Constant;
|
||||||
import com.navinfo.outdoor.base.BaseFragment;
|
import com.navinfo.outdoor.base.BaseFragment;
|
||||||
@ -27,6 +28,7 @@ import com.navinfo.outdoor.http.OkGoBuilder;
|
|||||||
import com.jcodecraeer.xrecyclerview.ProgressStyle;
|
import com.jcodecraeer.xrecyclerview.ProgressStyle;
|
||||||
import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
import com.umeng.umcrash.UMCrash;
|
import com.umeng.umcrash.UMCrash;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
@ -167,7 +169,7 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), response.getMessage(), Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),response.getMessage());
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onSuccess: " + response.getMessage() + "sassafrases");
|
Log.d("TAG", "onSuccess: " + response.getMessage() + "sassafrases");
|
||||||
}
|
}
|
||||||
@ -177,10 +179,10 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),message);
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onError: " + e.getMessage());
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
/* 友盟+
|
/* 友盟+
|
||||||
@ -197,7 +199,7 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
|
|||||||
capacityList.clear();
|
capacityList.clear();
|
||||||
}
|
}
|
||||||
if (taskPrefectureBean.getBody().getList() == null) {
|
if (taskPrefectureBean.getBody().getList() == null) {
|
||||||
Toast.makeText(getActivity(), "没有相关数据", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"没有相关数据");
|
||||||
} else {
|
} else {
|
||||||
capacityList.addAll(taskPrefectureBean.getBody().getList());
|
capacityList.addAll(taskPrefectureBean.getBody().getList());
|
||||||
capacityPage++;
|
capacityPage++;
|
||||||
@ -215,7 +217,7 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), taskPrefectureBean.getMessage(), Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),taskPrefectureBean.getMessage());
|
||||||
Log.d("TAG", "" + taskPrefectureBean.getMessage());
|
Log.d("TAG", "" + taskPrefectureBean.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ import com.navinfo.outdoor.http.OkGoBuilder;
|
|||||||
import com.jcodecraeer.xrecyclerview.ProgressStyle;
|
import com.jcodecraeer.xrecyclerview.ProgressStyle;
|
||||||
import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
@ -70,6 +71,7 @@ public class CapacityEvaluationFragment2 extends BaseFragment implements View.On
|
|||||||
public void onLoadMore() {
|
public void onLoadMore() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
capacityItemAdapter.setSetOnClick(new CapacityItemAdapter.setOnClick() {
|
capacityItemAdapter.setSetOnClick(new CapacityItemAdapter.setOnClick() {
|
||||||
@Override
|
@Override
|
||||||
@ -104,7 +106,7 @@ public class CapacityEvaluationFragment2 extends BaseFragment implements View.On
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),response.getMessage());
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onSuccess: " + response.getMessage() + "sassafras's" + aBoolean);
|
Log.d("TAG", "onSuccess: " + response.getMessage() + "sassafras's" + aBoolean);
|
||||||
}
|
}
|
||||||
@ -114,10 +116,10 @@ public class CapacityEvaluationFragment2 extends BaseFragment implements View.On
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout")|| message.contains("Read time out")) {
|
if (message.equals("timeout")|| message.equals("Read time out")) {
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -40,6 +40,7 @@ import com.kongzue.dialog.util.BaseDialog;
|
|||||||
import com.kongzue.dialog.v3.MessageDialog;
|
import com.kongzue.dialog.v3.MessageDialog;
|
||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
@ -132,64 +133,64 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
|||||||
if (id == null) {
|
if (id == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
showLoadingDialog();
|
||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
httpParams.put("id", id);
|
httpParams.put("id", id);
|
||||||
showLoadingDialog();
|
OkGoBuilder okGoBuilder = OkGoBuilder.getInstance()
|
||||||
OkGoBuilder.getInstance()
|
|
||||||
.time(30)
|
.time(30)
|
||||||
.Builder(getActivity())
|
.Builder(getActivity())
|
||||||
.url(HttpInterface.EXAM_CONTENT)
|
.url(HttpInterface.EXAM_CONTENT)
|
||||||
.cls(MeasureBean.class)
|
.cls(MeasureBean.class)
|
||||||
.params(httpParams)
|
.params(httpParams)
|
||||||
.token(Constant.ACCESS_TOKEN)
|
.token(Constant.ACCESS_TOKEN);
|
||||||
.getRequest(new Callback<MeasureBean>() {
|
okGoBuilder.getRequest(new Callback<MeasureBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(MeasureBean response, int id) {
|
public void onSuccess(MeasureBean response, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String title = response.getBody().getTitle();
|
String title = response.getBody().getTitle();
|
||||||
if (title != null) {
|
if (title != null) {
|
||||||
tvCapacity.setText(title);
|
tvCapacity.setText(title);
|
||||||
}
|
}
|
||||||
//单选
|
//单选
|
||||||
if (response.getBody().getSingleChoice() != null) {
|
if (response.getBody().getSingleChoice() != null) {
|
||||||
List<MeasureBean.BodyBean.SingleChoiceBean> singleChoice = response.getBody().getSingleChoice();
|
List<MeasureBean.BodyBean.SingleChoiceBean> singleChoice = response.getBody().getSingleChoice();
|
||||||
for (int i = 0; i < singleChoice.size(); i++) {
|
for (int i = 0; i < singleChoice.size(); i++) {
|
||||||
baleen.add(new BolBean(singleChoice.get(i).getId(), singleChoice.get(i).getQuestion(), singleChoice.get(i).getOption(), true));
|
baleen.add(new BolBean(singleChoice.get(i).getId(), singleChoice.get(i).getQuestion(), singleChoice.get(i).getOption(), true));
|
||||||
examId = singleChoice.get(i).getExamId();
|
examId = singleChoice.get(i).getExamId();
|
||||||
}
|
|
||||||
}
|
|
||||||
//多选
|
|
||||||
if (response.getBody().getMultiChoice() != null) {
|
|
||||||
List<MeasureBean.BodyBean.MultiChoiceBean> multiChoice = response.getBody().getMultiChoice();
|
|
||||||
for (int i = 0; i < multiChoice.size(); i++) {
|
|
||||||
baleen.add(new BolBean(multiChoice.get(i).getId(), multiChoice.get(i).getQuestion(), multiChoice.get(i).getOption(), false));
|
|
||||||
examId = multiChoice.get(i).getExamId();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (baleen != null) {
|
|
||||||
if (baleen.size() > 0) {
|
|
||||||
capacityMeasureAdapter.setMeasureList(baleen);
|
|
||||||
btnSubmit.setVisibility(View.VISIBLE);
|
|
||||||
tvCapacity.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
btnSubmit.setVisibility(View.GONE);
|
|
||||||
tvCapacity.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
//多选
|
||||||
|
if (response.getBody().getMultiChoice() != null) {
|
||||||
|
List<MeasureBean.BodyBean.MultiChoiceBean> multiChoice = response.getBody().getMultiChoice();
|
||||||
|
for (int i = 0; i < multiChoice.size(); i++) {
|
||||||
|
baleen.add(new BolBean(multiChoice.get(i).getId(), multiChoice.get(i).getQuestion(), multiChoice.get(i).getOption(), false));
|
||||||
|
examId = multiChoice.get(i).getExamId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (baleen != null) {
|
||||||
|
if (baleen.size() > 0) {
|
||||||
|
capacityMeasureAdapter.setMeasureList(baleen);
|
||||||
|
btnSubmit.setVisibility(View.VISIBLE);
|
||||||
|
tvCapacity.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
btnSubmit.setVisibility(View.GONE);
|
||||||
|
tvCapacity.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable e, int id) {
|
public void onError(Throwable e, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -209,7 +210,7 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
|||||||
for (int i = 0; i < baleen.size(); i++) {
|
for (int i = 0; i < baleen.size(); i++) {
|
||||||
final String id = baleen.get(i).getId();
|
final String id = baleen.get(i).getId();
|
||||||
if (!checkedMap.containsKey(id) || checkedMap.get(id) == null || ("").equals(checkedMap.get(id))) {
|
if (!checkedMap.containsKey(id) || checkedMap.get(id) == null || ("").equals(checkedMap.get(id))) {
|
||||||
Toast.makeText(getActivity(), "有题目未填写答案,请仔细检查!", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"有题目未填写答案,请仔细检查!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -229,7 +230,7 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
|||||||
}
|
}
|
||||||
initExamSubmit();
|
initExamSubmit();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "无数据,无法提交", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"无数据,无法提交");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -278,7 +279,7 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), response.getMessage(), Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),response.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,10 +288,10 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -53,6 +53,7 @@ import com.navinfo.outdoor.util.GeometryTools;
|
|||||||
import com.navinfo.outdoor.util.PhotoUtils;
|
import com.navinfo.outdoor.util.PhotoUtils;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
import com.navinfo.outdoor.util.ToastUtil;
|
import com.navinfo.outdoor.util.ToastUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.TencentMap;
|
import com.tencent.tencentmap.mapsdk.maps.TencentMap;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
|
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptorFactory;
|
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptorFactory;
|
||||||
@ -186,7 +187,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
checkBoxLife.setTextColor(Color.WHITE);
|
checkBoxLife.setTextColor(Color.WHITE);
|
||||||
checkBoxLife.setChecked(true);
|
checkBoxLife.setChecked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCancel() {
|
public void onCancel() {
|
||||||
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_pile_show);
|
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_pile_show);
|
||||||
@ -312,7 +312,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
public void onNothingSelected(AdapterView<?> parent) {
|
public void onNothingSelected(AdapterView<?> parent) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
spinnerType = findViewById(R.id.spinner_type);
|
spinnerType = findViewById(R.id.spinner_type);
|
||||||
ArrayAdapter<String> adapterType = new ArrayAdapter<>(Objects.requireNonNull(getContext()), android.R.layout.simple_spinner_item, type);
|
ArrayAdapter<String> adapterType = new ArrayAdapter<>(Objects.requireNonNull(getContext()), android.R.layout.simple_spinner_item, type);
|
||||||
adapterType.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //设置下拉列表框的下拉选项样式
|
adapterType.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //设置下拉列表框的下拉选项样式
|
||||||
@ -1006,7 +1005,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
chargingPileEntity = initChargingPileEntityByUI(chargingPileEntity);
|
chargingPileEntity = initChargingPileEntityByUI(chargingPileEntity);
|
||||||
PoiCheckResult poiCheckResult = checkChargingPileEntity(chargingPileEntity);
|
PoiCheckResult poiCheckResult = checkChargingPileEntity(chargingPileEntity);
|
||||||
if (poiCheckResult.getCode() == 1) {
|
if (poiCheckResult.getCode() == 1) {
|
||||||
Toast.makeText(getActivity(), poiCheckResult.getMsg() + "", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),poiCheckResult.getMsg());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@ -1018,7 +1017,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
public void run() {
|
public void run() {
|
||||||
if (result[0] != 0) {
|
if (result[0] != 0) {
|
||||||
chargingPileEntity.setPileId(result[0]);
|
chargingPileEntity.setPileId(result[0]);
|
||||||
ToastUtil.showShort(getActivity(), "充电桩保存成功");
|
ToastUtils.Message(getActivity(),"充电桩保存成功");
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.CHARGING_PILE_STATION;
|
obtain.what = Constant.CHARGING_PILE_STATION;
|
||||||
obtain.obj = chargingPileEntity;
|
obtain.obj = chargingPileEntity;
|
||||||
@ -1031,7 +1030,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
// chargingPileByWork(chargingPileEntity);
|
// chargingPileByWork(chargingPileEntity);
|
||||||
getActivity().onBackPressed();
|
getActivity().onBackPressed();
|
||||||
} else {
|
} else {
|
||||||
ToastUtil.showShort(getActivity(), "充电桩保存失败,请重试!");
|
ToastUtils.Message(getActivity(),"充电桩保存失败,请重试!");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1040,14 +1039,14 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
}).start();
|
}).start();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"没有申请权限,请手动申请");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDenied(List<String> permissions, boolean never) {
|
public void onDenied(List<String> permissions, boolean never) {
|
||||||
if (never) {
|
if (never) {
|
||||||
Toast.makeText(getActivity(), "被永久拒绝授权,请手动授予权限", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"被永久拒绝授权,请手动授予权限");
|
||||||
// 如果是被永久拒绝就跳转到应用权限系统设置页面
|
// 如果是被永久拒绝就跳转到应用权限系统设置页面
|
||||||
XXPermissions.startPermissionActivity(Objects.requireNonNull(getActivity()), permissions);
|
XXPermissions.startPermissionActivity(Objects.requireNonNull(getActivity()), permissions);
|
||||||
}
|
}
|
||||||
@ -1124,7 +1123,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
intentNumber.putExtra(Constant.INTENT_PHOTO_PATH, numberFile.getPath());
|
intentNumber.putExtra(Constant.INTENT_PHOTO_PATH, numberFile.getPath());
|
||||||
startActivityForResult(intentNumber, 110);
|
startActivityForResult(intentNumber, 110);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ import com.kongzue.dialog.v3.WaitDialog;
|
|||||||
import com.lzy.okgo.model.HttpParams;
|
import com.lzy.okgo.model.HttpParams;
|
||||||
import com.navinfo.outdoor.R;
|
import com.navinfo.outdoor.R;
|
||||||
import com.navinfo.outdoor.activity.FragmentManagement;
|
import com.navinfo.outdoor.activity.FragmentManagement;
|
||||||
|
import com.navinfo.outdoor.activity.LoginActivity;
|
||||||
import com.navinfo.outdoor.activity.PhotographActivity;
|
import com.navinfo.outdoor.activity.PhotographActivity;
|
||||||
import com.navinfo.outdoor.adapter.ChargingPileAdapter;
|
import com.navinfo.outdoor.adapter.ChargingPileAdapter;
|
||||||
import com.navinfo.outdoor.api.Constant;
|
import com.navinfo.outdoor.api.Constant;
|
||||||
@ -53,6 +54,7 @@ import com.navinfo.outdoor.base.BaseDrawerFragment;
|
|||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
import com.navinfo.outdoor.util.PreserveUtils;
|
import com.navinfo.outdoor.util.PreserveUtils;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
import com.navinfo.outdoor.util.UploadUtils;
|
import com.navinfo.outdoor.util.UploadUtils;
|
||||||
import com.navinfo.outdoor.bean.ChargingPileSaveBean;
|
import com.navinfo.outdoor.bean.ChargingPileSaveBean;
|
||||||
import com.navinfo.outdoor.bean.ChargingStationBean;
|
import com.navinfo.outdoor.bean.ChargingStationBean;
|
||||||
@ -106,18 +108,18 @@ import okhttp3.Response;
|
|||||||
*/
|
*/
|
||||||
public class ChargingStationFragment extends BaseDrawerFragment implements View.OnClickListener {
|
public class ChargingStationFragment extends BaseDrawerFragment implements View.OnClickListener {
|
||||||
private EditText editDescribe;
|
private EditText editDescribe;
|
||||||
private RelativeLayout rlPanorama, rlName, rlInternalPhotos, rlElse, rlScutcheon, rlNull,linearExist;
|
private RelativeLayout rlPanorama, rlName, rlInternalPhotos, rlElse, rlScutcheon, rlNull, linearExist;
|
||||||
private ImageView ivPanorama, ivName, ivInternal, ivElse, ivScutcheon;
|
private ImageView ivPanorama, ivName, ivInternal, ivElse, ivScutcheon;
|
||||||
private TextView tvExamine, tvPanorama, tvNamePic, tvInternal, tvElse, tvScutcheon;
|
private TextView tvExamine, tvPanorama, tvNamePic, tvInternal, tvElse, tvScutcheon;
|
||||||
private EditText editNameContent, editSiteContent;
|
private EditText editNameContent, editSiteContent;
|
||||||
private ArrayList<PhoneBean> poiBeans;
|
private ArrayList<PhoneBean> poiBeans;
|
||||||
private Button btnSaveLocal, btnUploading;
|
private Button btnSaveLocal, btnUploading;
|
||||||
private CheckBox checkBoxLife;
|
private CheckBox checkBoxLife;
|
||||||
private Spinner spinnerType,spinnerExist;
|
private Spinner spinnerType, spinnerExist;
|
||||||
String[] caye = new String[]{"充电站", "充换电站", "充电桩组", "换电站"};//1."充电站"2 "充换电站"3 "充电桩组"4 "换电站"5 ,
|
String[] caye = new String[]{"充电站", "充换电站", "充电桩组", "换电站"};//1."充电站"2 "充换电站"3 "充电桩组"4 "换电站"5 ,
|
||||||
String[] spinner = new String[]{"存在", "不存在", "无法验证"};
|
String[] spinner = new String[]{"存在", "不存在", "无法验证"};
|
||||||
private int existence = 0;
|
private int existence = 0;
|
||||||
private LinearLayout linearChargingPile,linearContact;
|
private LinearLayout linearChargingPile, linearContact;
|
||||||
private ChargingPileAdapter chargingPileAdapter;
|
private ChargingPileAdapter chargingPileAdapter;
|
||||||
private int station_type = 1;
|
private int station_type = 1;
|
||||||
private LatLng latLng;
|
private LatLng latLng;
|
||||||
@ -278,8 +280,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
checkBoxLife = findViewById(R.id.check_pot_life);
|
|
||||||
CheckBox checkBoxRight = findViewById(R.id.check_pot_right);
|
CheckBox checkBoxRight = findViewById(R.id.check_pot_right);
|
||||||
|
checkBoxLife = findViewById(R.id.check_pot_life);
|
||||||
nestedScrollView = findViewById(R.id.nested_scroll_view);
|
nestedScrollView = findViewById(R.id.nested_scroll_view);
|
||||||
removablesLocality = new ArrayList<>();
|
removablesLocality = new ArrayList<>();
|
||||||
setSlidingUpPanelLayout(Constant.SLIDING_LAYOUT);
|
setSlidingUpPanelLayout(Constant.SLIDING_LAYOUT);
|
||||||
@ -756,18 +758,18 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
private void initPhone() {
|
private void initPhone() {
|
||||||
String encode = Geohash.getInstance().encode(latLng.latitude, latLng.longitude);
|
String encode = Geohash.getInstance().encode(latLng.latitude, latLng.longitude);
|
||||||
if (encode == null) {
|
if (encode == null) {
|
||||||
Toast.makeText(getActivity(), "没有确定经纬度", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"没有确定经纬度");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
showLoadingDialog();
|
showLoadingDialog();
|
||||||
OkGoBuilder.getInstance()
|
OkGoBuilder okGoBuilder = OkGoBuilder.getInstance()
|
||||||
.time(30)
|
.time(30)
|
||||||
.Builder(getActivity())
|
.Builder(getActivity())
|
||||||
.url(HttpInterface.GET_PHONES)
|
.url(HttpInterface.GET_PHONES)
|
||||||
.params(new HttpParams("geo", encode))
|
.params(new HttpParams("geo", encode))
|
||||||
.cls(GetPhoneBean.class)
|
.cls(GetPhoneBean.class)
|
||||||
.token(Constant.ACCESS_TOKEN)
|
.token(Constant.ACCESS_TOKEN);
|
||||||
.getRequest(new Callback<GetPhoneBean>() {
|
okGoBuilder.getRequest(new Callback<GetPhoneBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(GetPhoneBean getPhoneBean, int id) {
|
public void onSuccess(GetPhoneBean getPhoneBean, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
@ -788,14 +790,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
} else if (getPhoneBean.getCode() == 230) {
|
} else if (getPhoneBean.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),getPhoneBean.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), getPhoneBean.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -804,30 +799,16 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void initRemovePileSharePre() {
|
public void initRemovePileSharePre() {
|
||||||
//获取SharedPreferences对象,方法中两个参数的意思为:第一个name
|
//获取SharedPreferences对象,方法中两个参数的意思为:第一个name
|
||||||
//表示文件名,系统将会在/dada/dada/包名/shared_prefs目录下生成
|
//表示文件名,系统将会在/dada/dada/包名/shared_prefs目录下生成
|
||||||
@ -955,11 +936,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
String name = editNameContent.getText().toString().trim();//名称
|
String name = editNameContent.getText().toString().trim();//名称
|
||||||
if (name.equals("")) {
|
if (name.equals("")) {
|
||||||
Toast.makeText(getActivity(), "请输入充电站 名称", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请输入充电站 名称");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (latLng == null) {
|
if (latLng == null) {
|
||||||
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请确定点位");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (chargingStationList != null) {
|
if (chargingStationList != null) {
|
||||||
@ -967,14 +948,14 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
}
|
}
|
||||||
String tagPanorama = (String) tvPanorama.getTag();
|
String tagPanorama = (String) tvPanorama.getTag();
|
||||||
if (tagPanorama == null) {
|
if (tagPanorama == null) {
|
||||||
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请拍照");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
chargingStationList.add(new File(tagPanorama));
|
chargingStationList.add(new File(tagPanorama));
|
||||||
}
|
}
|
||||||
String tagName = (String) tvNamePic.getTag();
|
String tagName = (String) tvNamePic.getTag();
|
||||||
if (tagName == null) {
|
if (tagName == null) {
|
||||||
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请拍照");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
chargingStationList.add(new File(tagName));
|
chargingStationList.add(new File(tagName));
|
||||||
@ -982,21 +963,21 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
if (existence == 0) {
|
if (existence == 0) {
|
||||||
String tagInternal = (String) tvInternal.getTag();
|
String tagInternal = (String) tvInternal.getTag();
|
||||||
if (tagInternal == null) {
|
if (tagInternal == null) {
|
||||||
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请拍照");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
chargingStationList.add(new File(tagInternal));
|
chargingStationList.add(new File(tagInternal));
|
||||||
}
|
}
|
||||||
String tagElse = (String) tvElse.getTag();
|
String tagElse = (String) tvElse.getTag();
|
||||||
if (tagElse == null) {
|
if (tagElse == null) {
|
||||||
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请拍照");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
chargingStationList.add(new File(tagElse));
|
chargingStationList.add(new File(tagElse));
|
||||||
}
|
}
|
||||||
String tagScutcheon = (String) tvScutcheon.getTag();
|
String tagScutcheon = (String) tvScutcheon.getTag();
|
||||||
if (tagScutcheon == null) {
|
if (tagScutcheon == null) {
|
||||||
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请拍照");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
chargingStationList.add(new File(tagScutcheon));
|
chargingStationList.add(new File(tagScutcheon));
|
||||||
@ -1051,7 +1032,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getContext(), "该任务正在提交中", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"该任务正在提交中");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case R.id.tv_station_examine:
|
case R.id.tv_station_examine:
|
||||||
@ -1130,7 +1111,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initRoadSaveLocal(boolean isLocal) {
|
private void initRoadSaveLocal(boolean isLocal) {
|
||||||
XXPermissions.with(this)
|
XXPermissions.with(this)
|
||||||
//读写权限
|
//读写权限
|
||||||
.permission(Permission.MANAGE_EXTERNAL_STORAGE)
|
.permission(Permission.MANAGE_EXTERNAL_STORAGE)
|
||||||
@ -1142,7 +1123,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
PoiEntity poiEntity = initPoiEntityByUI(showPoiEntity);
|
PoiEntity poiEntity = initPoiEntityByUI(showPoiEntity);
|
||||||
PoiCheckResult poiCheckResult = checkPoiEntity(poiEntity);
|
PoiCheckResult poiCheckResult = checkPoiEntity(poiEntity);
|
||||||
if (poiCheckResult.getCode() == 1) {
|
if (poiCheckResult.getCode() == 1) {
|
||||||
Toast.makeText(getActivity(), poiCheckResult.getMsg() + "", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),poiCheckResult.getMsg() );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
poiEntity.setTaskStatus(2);
|
poiEntity.setTaskStatus(2);
|
||||||
@ -1164,16 +1145,15 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"没有申请权限,请手动申请");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDenied(List<String> permissions, boolean never) {
|
public void onDenied(List<String> permissions, boolean never) {
|
||||||
if (never) {
|
if (never) {
|
||||||
Toast.makeText(getActivity(), "被永久拒绝授权,请手动授予权限", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"被永久拒绝授权,请手动授予权限");
|
||||||
// 如果是被永久拒绝就跳转到应用权限系统设置页面
|
// 如果是被永久拒绝就跳转到应用权限系统设置页面
|
||||||
XXPermissions.startPermissionActivity(Objects.requireNonNull(getActivity()), permissions);
|
XXPermissions.startPermissionActivity(Objects.requireNonNull(getActivity()), permissions);
|
||||||
}
|
}
|
||||||
@ -1198,13 +1178,14 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
.cls(ChargingStationBean.class)
|
.cls(ChargingStationBean.class)
|
||||||
.params(httpParams)
|
.params(httpParams)
|
||||||
.token(Constant.ACCESS_TOKEN);
|
.token(Constant.ACCESS_TOKEN);
|
||||||
|
okGoBuilder.getRequest(PreserveUtils.getInstance().getChargingPreserveCallback(getActivity(), poiEntity));
|
||||||
if (getActivity() != null) {
|
if (getActivity() != null) {
|
||||||
okGoBuilder.getRequest(PreserveUtils.getInstance().getChargingPreserveCallback(getActivity(), poiEntity));
|
|
||||||
getActivity().getSupportFragmentManager().popBackStack();//回退
|
getActivity().getSupportFragmentManager().popBackStack();//回退
|
||||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务已保存本地,请稍后");
|
WaitDialog.show((AppCompatActivity) getActivity(), "任务已保存本地,请稍后");
|
||||||
WaitDialog.dismiss(1000);
|
WaitDialog.dismiss(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*根据充电站数据检查充电桩数据,如果没有网络保存,则批量网络上传*/
|
/*根据充电站数据检查充电桩数据,如果没有网络保存,则批量网络上传*/
|
||||||
private void saveChargingPileUploadChargingStation(PoiEntity chargingStationPoiEntity) {
|
private void saveChargingPileUploadChargingStation(PoiEntity chargingStationPoiEntity) {
|
||||||
if (chargingStationPoiEntity != null) {
|
if (chargingStationPoiEntity != null) {
|
||||||
@ -1219,6 +1200,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*上传充电桩数据*/
|
/*上传充电桩数据*/
|
||||||
private void chargingPileUploadNetWork(ChargingPileEntity chargingPileEntity) {
|
private void chargingPileUploadNetWork(ChargingPileEntity chargingPileEntity) {
|
||||||
List<File> chargingPileFileList = new ArrayList<>();
|
List<File> chargingPileFileList = new ArrayList<>();
|
||||||
@ -1258,7 +1240,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
|
|
||||||
private void stationUploadByNetWork(PoiEntity poiEntity, ArrayList<File> chargingStationList) {
|
private void stationUploadByNetWork(PoiEntity poiEntity, ArrayList<File> chargingStationList) {
|
||||||
if (poiEntity == null) {
|
if (poiEntity == null) {
|
||||||
Toast.makeText(getActivity(), "没有保存本地", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"没有保存本地");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
showLoadingDialog();
|
showLoadingDialog();
|
||||||
@ -1293,6 +1275,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*保存充电站数据到服务器*/
|
/*保存充电站数据到服务器*/
|
||||||
private void chargingStationSaveByWork(PoiEntity poiEntity) {
|
private void chargingStationSaveByWork(PoiEntity poiEntity) {
|
||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
@ -1340,26 +1323,13 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),chargingStationBean.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), chargingStationBean.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (chargingStationBean.getCode() == 230) {
|
} else if (chargingStationBean.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),chargingStationBean.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), chargingStationBean.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1368,24 +1338,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onError: " + e.getMessage());
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
}
|
}
|
||||||
@ -1421,9 +1377,9 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
for (int i = 0; i < body.size(); i++) {
|
for (int i = 0; i < body.size(); i++) {
|
||||||
stringBuilder.append(body.get(i)).append(";");
|
stringBuilder.append(body.get(i)).append(";");
|
||||||
}
|
}
|
||||||
Toast.makeText(getActivity(), " 存在类似名称--" + stringBuilder.toString(), Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity()," 存在类似名称--");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "没有类似名称,可以作业", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"没有类似名称,可以作业");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -1442,7 +1398,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Toast.makeText(getActivity(), taskNameBean.getMessage() + "", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),taskNameBean.getMessage());
|
||||||
editNameContent.setTextColor(Color.RED);
|
editNameContent.setTextColor(Color.RED);
|
||||||
btnSaveLocal.setEnabled(false);
|
btnSaveLocal.setEnabled(false);
|
||||||
btnUploading.setEnabled(false);
|
btnUploading.setEnabled(false);
|
||||||
@ -1460,20 +1416,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
}
|
}
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
ToastUtils.Message(getActivity(),message);
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onError: " + e.getMessage());
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
}
|
}
|
||||||
@ -1607,7 +1553,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
hashMap.put("cp_availableState", chargingPileEntity.getCp_availableState());
|
hashMap.put("cp_availableState", chargingPileEntity.getCp_availableState());
|
||||||
hashMap.put("sign_exist", chargingPileEntity.getSign_exist());
|
hashMap.put("sign_exist", chargingPileEntity.getSign_exist());
|
||||||
String s = new Gson().toJson(hashMap);
|
String s = new Gson().toJson(hashMap);
|
||||||
httpParams.put("detail",s);
|
httpParams.put("detail", s);
|
||||||
try {
|
try {
|
||||||
Response execute = OkGoBuilder
|
Response execute = OkGoBuilder
|
||||||
.getInstance()
|
.getInstance()
|
||||||
@ -1692,12 +1638,12 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
|
|
||||||
private void initEndReceiveTask(String url, PoiEntity poiEntity) {
|
private void initEndReceiveTask(String url, PoiEntity poiEntity) {
|
||||||
if (poiEntity.getTaskId() == 0) {
|
if (poiEntity.getTaskId() == 0) {
|
||||||
Toast.makeText(getActivity(), "无此任务", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"无此任务");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
httpParams.put("taskIds", poiEntity.getTaskId());
|
httpParams.put("taskIds", poiEntity.getTaskId());
|
||||||
httpParams.put("auditIds", "");
|
httpParams.put("auditIds","");
|
||||||
OkGoBuilder okGoBuilder = OkGoBuilder.getInstance()
|
OkGoBuilder okGoBuilder = OkGoBuilder.getInstance()
|
||||||
.time(30)
|
.time(30)
|
||||||
.Builder(getActivity())
|
.Builder(getActivity())
|
||||||
@ -1741,14 +1687,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), response.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1758,23 +1697,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onError: " + e.getMessage());
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ import java.util.Objects;
|
|||||||
* 联系我们的Fragment
|
* 联系我们的Fragment
|
||||||
*/
|
*/
|
||||||
public class ContactFragment extends BaseFragment implements View.OnClickListener {
|
public class ContactFragment extends BaseFragment implements View.OnClickListener {
|
||||||
|
|
||||||
public static ContactFragment newInstance(Bundle bundle) {
|
public static ContactFragment newInstance(Bundle bundle) {
|
||||||
ContactFragment fragment = new ContactFragment();
|
ContactFragment fragment = new ContactFragment();
|
||||||
fragment.setArguments(bundle);
|
fragment.setArguments(bundle);
|
||||||
@ -26,11 +27,6 @@ public class ContactFragment extends BaseFragment implements View.OnClickListene
|
|||||||
return R.layout.contact_fragment;
|
return R.layout.contact_fragment;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void initData() {
|
|
||||||
super.initData();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
|
@ -30,6 +30,7 @@ import com.jcodecraeer.xrecyclerview.ProgressStyle;
|
|||||||
import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
@ -108,32 +109,32 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
|
|||||||
.params(httpParams)
|
.params(httpParams)
|
||||||
.token(Constant.ACCESS_TOKEN);
|
.token(Constant.ACCESS_TOKEN);
|
||||||
okGoBuilder.getRequest(new Callback<TaskPrefectureBean>() {
|
okGoBuilder.getRequest(new Callback<TaskPrefectureBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(TaskPrefectureBean taskPrefectureBean, int id) {
|
public void onSuccess(TaskPrefectureBean taskPrefectureBean, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
if (taskPrefectureBean.getCode() == 200){
|
if (taskPrefectureBean.getCode() == 200) {
|
||||||
initTaskPrefectureBean(taskPrefectureBean,aNet);
|
initTaskPrefectureBean(taskPrefectureBean, aNet);
|
||||||
}else if (taskPrefectureBean.getCode()==230){
|
} else if (taskPrefectureBean.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
}else {
|
} else {
|
||||||
Toast.makeText(getActivity(), taskPrefectureBean.getMessage()+"", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),taskPrefectureBean.getMessage());
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onSuccess: " + taskPrefectureBean.getMessage());
|
Log.d("TAG", "onSuccess: " + taskPrefectureBean.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable e, int id) {
|
public void onError(Throwable e, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout")|| message.contains("Read time out")){
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
}else {
|
} else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),message);
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onError: " + e.getMessage());
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initTaskPrefectureBean(TaskPrefectureBean taskPrefectureBean, boolean aBoolean) {
|
private void initTaskPrefectureBean(TaskPrefectureBean taskPrefectureBean, boolean aBoolean) {
|
||||||
@ -142,8 +143,8 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
|
|||||||
if (taskExplainBean.size() > 0) {
|
if (taskExplainBean.size() > 0) {
|
||||||
taskExplainBean.clear();
|
taskExplainBean.clear();
|
||||||
}
|
}
|
||||||
if (taskPrefectureBean.getBody().getList()== null) {
|
if (taskPrefectureBean.getBody().getList() == null) {
|
||||||
Toast.makeText(getActivity(), "没有相关数据", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"没有相关数据");
|
||||||
} else {
|
} else {
|
||||||
taskExplainBean.addAll(taskPrefectureBean.getBody().getList());
|
taskExplainBean.addAll(taskPrefectureBean.getBody().getList());
|
||||||
eventPage++;
|
eventPage++;
|
||||||
@ -161,7 +162,7 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), taskPrefectureBean.getMessage(), Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),taskPrefectureBean.getMessage());
|
||||||
Log.d("TAG", "" + taskPrefectureBean.getMessage());
|
Log.d("TAG", "" + taskPrefectureBean.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -175,12 +176,12 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
|
|||||||
eventRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
|
eventRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
eventRecycler.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
|
eventRecycler.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
|
||||||
eventRecycler.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
|
eventRecycler.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
|
||||||
eventPrefectureAdapter = new EventPrefectureAdapter(taskExplainBean,getActivity());
|
eventPrefectureAdapter = new EventPrefectureAdapter(taskExplainBean, getActivity());
|
||||||
eventRecycler.setAdapter(eventPrefectureAdapter);
|
eventRecycler.setAdapter(eventPrefectureAdapter);
|
||||||
eventRecycler.setLoadingListener(new XRecyclerView.LoadingListener() {
|
eventRecycler.setLoadingListener(new XRecyclerView.LoadingListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onRefresh() {
|
public void onRefresh() {
|
||||||
eventPage=1;
|
eventPage = 1;
|
||||||
initNetwork(true);
|
initNetwork(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,7 +195,7 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
|
|||||||
public void item(int aInt) {
|
public void item(int aInt) {
|
||||||
eventPrefectureBuilder.append(TimestampUtil.time()).append(",").append("点击了item ,");
|
eventPrefectureBuilder.append(TimestampUtil.time()).append(",").append("点击了item ,");
|
||||||
HashMap<String, String> paramMap = new HashMap<>();
|
HashMap<String, String> paramMap = new HashMap<>();
|
||||||
paramMap.put("id",aInt+"");
|
paramMap.put("id", aInt + "");
|
||||||
intentWebActivity(HttpInterface.MSG_CONTENT, paramMap);
|
intentWebActivity(HttpInterface.MSG_CONTENT, paramMap);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -43,6 +43,7 @@ import com.navinfo.outdoor.util.FlushTokenUtil;
|
|||||||
import com.navinfo.outdoor.util.Geohash;
|
import com.navinfo.outdoor.util.Geohash;
|
||||||
import com.navinfo.outdoor.util.GeometryTools;
|
import com.navinfo.outdoor.util.GeometryTools;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||||
import com.vividsolutions.jts.geom.Geometry;
|
import com.vividsolutions.jts.geom.Geometry;
|
||||||
|
|
||||||
@ -277,12 +278,15 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
}
|
}
|
||||||
Button btnFilter = findViewById(R.id.btn_filter);
|
Button btnFilter = findViewById(R.id.btn_filter);
|
||||||
btnFilter.setOnClickListener(this);
|
btnFilter.setOnClickListener(this);
|
||||||
|
RelativeLayout rlDraw = findViewById(R.id.rl_draw);
|
||||||
checkOk = findViewById(R.id.check_ok);
|
checkOk = findViewById(R.id.check_ok);
|
||||||
Button btnDraw = findViewById(R.id.btn_draw);
|
Button btnDraw = findViewById(R.id.btn_draw);
|
||||||
btnDraw.setOnClickListener(this);
|
btnDraw.setOnClickListener(this);
|
||||||
if (Constant.LEVEL == 1 || Constant.LEVEL == 2) {
|
if (Constant.LEVEL == 1 || Constant.LEVEL == 2) {
|
||||||
|
rlDraw.setVisibility(View.VISIBLE);
|
||||||
btnDraw.setBackgroundResource(R.drawable.shape_radius_bg);
|
btnDraw.setBackgroundResource(R.drawable.shape_radius_bg);
|
||||||
} else {
|
} else {
|
||||||
|
rlDraw.setVisibility(View.GONE);
|
||||||
btnDraw.setBackgroundResource(R.drawable.shape_red_bg_disable);
|
btnDraw.setBackgroundResource(R.drawable.shape_red_bg_disable);
|
||||||
}
|
}
|
||||||
setSlidingUpPanelLayout(Constant.SLIDING_LAYOUT);
|
setSlidingUpPanelLayout(Constant.SLIDING_LAYOUT);
|
||||||
@ -330,7 +334,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
btnChock.clear();
|
btnChock.clear();
|
||||||
} else {
|
} else {
|
||||||
checkOk.setChecked(false);
|
checkOk.setChecked(false);
|
||||||
Toast.makeText(getActivity(), "您的等级暂不具备此权限哦", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "您的等级暂不具备此权限哦");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -371,6 +375,10 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
if (btnChock == null) {
|
if (btnChock == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (btnChock.size() == 0) {
|
||||||
|
ToastUtils.Message(getActivity(), "请选择任务");
|
||||||
|
return;
|
||||||
|
}
|
||||||
StringBuilder a = new StringBuilder();
|
StringBuilder a = new StringBuilder();
|
||||||
for (int i = 0; i < btnChock.size(); i++) {
|
for (int i = 0; i < btnChock.size(); i++) {
|
||||||
if (i == btnChock.size() - 1) {
|
if (i == btnChock.size() - 1) {
|
||||||
@ -381,7 +389,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
}
|
}
|
||||||
initBatch(a.toString());
|
initBatch(a.toString());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "您的等级暂不具备此权限哦", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "您的等级暂不具备此权限哦");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case R.id.btn_filter:
|
case R.id.btn_filter:
|
||||||
@ -395,6 +403,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
obtains.what = Constant.JOB_WORD_MONITOR;
|
obtains.what = Constant.JOB_WORD_MONITOR;
|
||||||
obtains.obj = true;
|
obtains.obj = true;
|
||||||
EventBus.getDefault().post(obtains);
|
EventBus.getDefault().post(obtains);
|
||||||
|
|
||||||
onBackPressed();
|
onBackPressed();
|
||||||
break;
|
break;
|
||||||
case R.id.cl_number:
|
case R.id.cl_number:
|
||||||
@ -459,11 +468,10 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
/*
|
||||||
|
*1 "POI",2 "充电站",3 "POI录像",4 "道路录像",5 "其他",6 "面状任务"
|
||||||
|
*/
|
||||||
case R.id.cl_exclusive:
|
case R.id.cl_exclusive:
|
||||||
/*
|
|
||||||
*1 "POI",2 "充电站",3 "POI录像",4 "道路录像",5 "其他",6 "面状任务"
|
|
||||||
*/
|
|
||||||
filterBuilder.append(TimestampUtil.time()).append(",").append("点击了任务类型的按钮 ,");
|
filterBuilder.append(TimestampUtil.time()).append(",").append("点击了任务类型的按钮 ,");
|
||||||
BottomMenu.show((AppCompatActivity) Objects.requireNonNull(getContext()), new String[]{"全部", "POI", "充电站", "POI录像", "道路录像", "其他", "面状任务"}, new OnMenuItemClickListener() {
|
BottomMenu.show((AppCompatActivity) Objects.requireNonNull(getContext()), new String[]{"全部", "POI", "充电站", "POI录像", "道路录像", "其他", "面状任务"}, new OnMenuItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -506,10 +514,10 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
/*
|
||||||
|
*任务状态 0.未领取 1.已领取,2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功),4已上传(结束采集),
|
||||||
|
*/
|
||||||
case R.id.cl_type:
|
case R.id.cl_type:
|
||||||
/*
|
|
||||||
任务状态 0.未领取 1.已领取,2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功),4已上传(结束采集),
|
|
||||||
*/
|
|
||||||
filterBuilder.append(TimestampUtil.time()).append("点击了任务状态的按钮 ,");
|
filterBuilder.append(TimestampUtil.time()).append("点击了任务状态的按钮 ,");
|
||||||
BottomMenu.show((AppCompatActivity) Objects.requireNonNull(getContext()), new String[]{"全部", "未领取", "已领取", "已领取(网络)"/*, "未保存", "已保存"*/}, new OnMenuItemClickListener() {
|
BottomMenu.show((AppCompatActivity) Objects.requireNonNull(getContext()), new String[]{"全部", "未领取", "已领取", "已领取(网络)"/*, "未保存", "已保存"*/}, new OnMenuItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -574,11 +582,11 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||||
obtain.obj = true;
|
obtain.obj = true;
|
||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
Toast.makeText(getContext(), "领取成功", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "领取成功");
|
||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getContext(), response.getMessage(), Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), response.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -587,10 +595,10 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请求超时");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -732,13 +740,17 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
@Override
|
@Override
|
||||||
public void onPause() {
|
public void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
filterBuilder.append(TimestampUtil.time()).append(",").append("onPause ,");
|
if (filterBuilder != null) {
|
||||||
|
filterBuilder.append(TimestampUtil.time()).append(",").append("onPause ,");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStop() {
|
public void onStop() {
|
||||||
super.onStop();
|
super.onStop();
|
||||||
filterBuilder.append(TimestampUtil.time()).append(",").append("onStop ,");
|
if (filterBuilder != null) {
|
||||||
|
filterBuilder.append(TimestampUtil.time()).append(",").append("onStop ,");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -746,9 +758,11 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
if (EventBus.getDefault().isRegistered(this))//加上判断
|
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||||
EventBus.getDefault().unregister(this);
|
EventBus.getDefault().unregister(this);
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
filterBuilder.append(TimestampUtil.time()).append(",").append("onDestroy");
|
if (filterBuilder != null) {
|
||||||
filterBuilder.append("\r\n");
|
filterBuilder.append(TimestampUtil.time()).append(",").append("onDestroy");
|
||||||
FileUtils.writeFile(logFile.getAbsolutePath(), filterBuilder.toString(), true);
|
filterBuilder.append("\r\n");
|
||||||
|
FileUtils.writeFile(logFile.getAbsolutePath(), filterBuilder.toString(), true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -87,7 +87,7 @@ public class FindFragment extends BaseFragment implements View.OnClickListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()) {
|
switch (v.getId()) {
|
||||||
case R.id.linear_task_prefecture:
|
case R.id.linear_task_prefecture:
|
||||||
findBuilder.append(TimestampUtil.time()).append(",").append("点击了最新公告:任务专区 跳转 ,");
|
findBuilder.append(TimestampUtil.time()).append(",").append("点击了最新公告:任务专区 跳转 ,");
|
||||||
|
@ -31,6 +31,7 @@ import com.navinfo.outdoor.http.UploadCallBack;
|
|||||||
import com.navinfo.outdoor.util.Base64;
|
import com.navinfo.outdoor.util.Base64;
|
||||||
import com.navinfo.outdoor.util.RegexUtil;
|
import com.navinfo.outdoor.util.RegexUtil;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
@ -71,20 +72,20 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
|
|||||||
DateFormat formatter = new SimpleDateFormat("yyyyMMdd");
|
DateFormat formatter = new SimpleDateFormat("yyyyMMdd");
|
||||||
String newFormat = formatter.format(new Date(System.currentTimeMillis()));
|
String newFormat = formatter.format(new Date(System.currentTimeMillis()));
|
||||||
String pictures_time = sharedPreferences.getString("pictures_time", null);
|
String pictures_time = sharedPreferences.getString("pictures_time", null);
|
||||||
if (pictures_time==null){
|
if (pictures_time == null) {
|
||||||
sharedEdit.putString("pictures_time",newFormat);
|
sharedEdit.putString("pictures_time", newFormat);
|
||||||
sharedEdit.apply();
|
sharedEdit.apply();
|
||||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||||
}else {
|
} else {
|
||||||
if (pictures_time.equals(newFormat)){
|
if (pictures_time.equals(newFormat)) {
|
||||||
logFile = new File(Constant.LOG_FOLDER + "/" + pictures_time + ".txt");
|
logFile = new File(Constant.LOG_FOLDER + "/" + pictures_time + ".txt");
|
||||||
}else {
|
} else {
|
||||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
forgetPawBuilder = new StringBuilder();
|
forgetPawBuilder = new StringBuilder();
|
||||||
forgetPawBuilder.append(TimestampUtil.time()).append(",").append("ForgetPawFragment-onViewCreated-initData,");
|
forgetPawBuilder.append(TimestampUtil.time()).append(",").append("ForgetPawFragment-onViewCreated-initData,");
|
||||||
if (Constant.USHERED!=null){
|
if (Constant.USHERED != null) {
|
||||||
forgetPawBuilder.append("userId:").append(Constant.USHERED).append(",");
|
forgetPawBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -114,11 +115,10 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
|
|||||||
case R.id.forgetPaw_get_note:
|
case R.id.forgetPaw_get_note:
|
||||||
forgetPawBuilder.append(TimestampUtil.time()).append(",").append("点击了获取短信验证码,");
|
forgetPawBuilder.append(TimestampUtil.time()).append(",").append("点击了获取短信验证码,");
|
||||||
if (!RegexUtil.isPhone(etForgetPawPhone.getText().toString())) {
|
if (!RegexUtil.isPhone(etForgetPawPhone.getText().toString())) {
|
||||||
Toast.makeText(getActivity(), "手机号错误,请重新输入", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"手机号错误,请重新输入");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
initGetNote();
|
initGetNote();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case R.id.btn_forgetPaw:
|
case R.id.btn_forgetPaw:
|
||||||
forgetPawBuilder.append(TimestampUtil.time()).append(",").append("点击了提交,");
|
forgetPawBuilder.append(TimestampUtil.time()).append(",").append("点击了提交,");
|
||||||
@ -131,21 +131,21 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
|
|||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
String mobile = etForgetPawPhone.getText().toString().trim();
|
String mobile = etForgetPawPhone.getText().toString().trim();
|
||||||
if (!RegexUtil.isPhone(mobile)) {
|
if (!RegexUtil.isPhone(mobile)) {
|
||||||
Toast.makeText(getActivity(), "手机号输入错误", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"手机号输入错误");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
httpParams.put("mobile", mobile);
|
httpParams.put("mobile", mobile);
|
||||||
}
|
}
|
||||||
String code = etForgetPawNote.getText().toString().trim();
|
String code = etForgetPawNote.getText().toString().trim();
|
||||||
if (code.equals("")) {
|
if (code.equals("")) {
|
||||||
Toast.makeText(getActivity(), "请获取短信验证码", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请获取短信验证码");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
httpParams.put("code", code);
|
httpParams.put("code", code);
|
||||||
}
|
}
|
||||||
String password = etForgetPawPaw.getText().toString().trim();
|
String password = etForgetPawPaw.getText().toString().trim();
|
||||||
if (password.equals("")) {
|
if (password.equals("")) {
|
||||||
Toast.makeText(getActivity(), "请输入密码", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请输入密码");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
@ -156,14 +156,14 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
String conFirmPaw = etForgetPawConfirmPaw.getText().toString().trim();
|
String conFirmPaw = etForgetPawConfirmPaw.getText().toString().trim();
|
||||||
if (conFirmPaw.equals("")) {
|
if (conFirmPaw.equals("")) {
|
||||||
Toast.makeText(getActivity(), "请输入确认密码", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请输入确认密码");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!conFirmPaw.equals(password)) {
|
if (!conFirmPaw.equals(password)) {
|
||||||
Toast.makeText(getActivity(), "密码和确认密码请保持一致", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"密码和确认密码请保持一致");
|
||||||
}
|
}
|
||||||
if (sessionId == null || sessionId.equals("")) {
|
if (sessionId == null || sessionId.equals("")) {
|
||||||
Toast.makeText(getActivity(), "请短信获取验证码", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请短信获取验证码");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
httpParams.put("sessionId", sessionId);
|
httpParams.put("sessionId", sessionId);
|
||||||
@ -171,49 +171,48 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
|
|||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
httpParams.put("datetime", time);
|
httpParams.put("datetime", time);
|
||||||
showLoadingDialog();
|
showLoadingDialog();
|
||||||
OkGoBuilder.getInstance()
|
OkGoBuilder okGoBuilder = OkGoBuilder.getInstance()
|
||||||
.time(30)
|
.time(30)
|
||||||
.Builder(getActivity())
|
.Builder(getActivity())
|
||||||
.url(HttpInterface.USER_FORGET_PASSWORD)
|
.url(HttpInterface.USER_FORGET_PASSWORD)
|
||||||
.token(null)
|
.token(null)
|
||||||
.params(httpParams)
|
|
||||||
.cls(UserBean.class)
|
.cls(UserBean.class)
|
||||||
.postRequest(new UploadCallBack<UserBean>() {
|
.params(httpParams);
|
||||||
@Override
|
okGoBuilder.postRequest(new UploadCallBack<UserBean>() {
|
||||||
public void onSuccess(UserBean response, int id) {
|
@Override
|
||||||
dismissLoadingDialog();
|
public void onSuccess(UserBean response, int id) {
|
||||||
if (response.getCode() == 200) {
|
dismissLoadingDialog();
|
||||||
Toast.makeText(getActivity(), "修改成功", Toast.LENGTH_SHORT).show();
|
if (response.getCode() == 200) {
|
||||||
Constant.USER_NAME = mobile;
|
Constant.USER_NAME = mobile;
|
||||||
Constant.PASS_WORD = password;
|
Constant.PASS_WORD = password;
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.REGISTER_WORD;
|
obtain.what = Constant.REGISTER_WORD;
|
||||||
obtain.obj = true;
|
obtain.obj = true;
|
||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
Objects.requireNonNull(getActivity()).finish();
|
ToastUtils.Message(getActivity(),"修改成功");
|
||||||
} else {
|
Objects.requireNonNull(getActivity()).finish();
|
||||||
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
} else {
|
||||||
}
|
ToastUtils.Message(getActivity(),response.getMessage());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void uploadProgress(Progress progress) {
|
public void uploadProgress(Progress progress) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable e, int id) {
|
public void onError(Throwable e, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout")|| message.contains("Read time out")){
|
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
}else {
|
} else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerNote() {
|
private void registerNote() {
|
||||||
@ -227,7 +226,6 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
|
|||||||
public void onTick(long millisUntilFinished) {
|
public void onTick(long millisUntilFinished) {
|
||||||
forgetPawGetNote.setText(millisUntilFinished / 1000 + "秒后重新获取验证码");
|
forgetPawGetNote.setText(millisUntilFinished / 1000 + "秒后重新获取验证码");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFinish() {
|
public void onFinish() {
|
||||||
forgetPawGetNote.setEnabled(true);
|
forgetPawGetNote.setEnabled(true);
|
||||||
@ -245,44 +243,45 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
|
|||||||
timer.cancel();
|
timer.cancel();
|
||||||
timer = null;
|
timer = null;
|
||||||
}
|
}
|
||||||
Toast.makeText(getActivity(), "请输入手机号", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请输入手机号");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
httpParams.put("mobile", mobile);
|
httpParams.put("mobile", mobile);
|
||||||
}
|
}
|
||||||
httpParams.put("type", 2);
|
httpParams.put("type", 2);
|
||||||
showLoadingDialog();
|
showLoadingDialog();
|
||||||
OkGoBuilder.getInstance()
|
OkGoBuilder okGoBuilder = OkGoBuilder.getInstance()
|
||||||
.time(30)
|
.time(30)
|
||||||
.Builder(getActivity())
|
.Builder(getActivity())
|
||||||
.url(HttpInterface.USER_MESSAGE)
|
.url(HttpInterface.USER_MESSAGE)
|
||||||
.cls(MessageCodeBean.class)
|
.cls(MessageCodeBean.class)
|
||||||
.params(httpParams)
|
.params(httpParams)
|
||||||
.token(null)
|
.token(null);
|
||||||
.getRequest(new Callback<MessageCodeBean>() {
|
okGoBuilder.getRequest(new Callback<MessageCodeBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(MessageCodeBean response, int id) {
|
public void onSuccess(MessageCodeBean response, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
if (response.getCode() == 200) {
|
if (response.getCode() == 200) {
|
||||||
sessionId = response.getBody();
|
sessionId = response.getBody();
|
||||||
registerNote();
|
registerNote();
|
||||||
Toast.makeText(getActivity(), "验证码已发送", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"验证码已发送");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),response.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
|
||||||
public void onError(Throwable e, int id) {
|
@Override
|
||||||
dismissLoadingDialog();
|
public void onError(Throwable e, int id) {
|
||||||
String message = e.getMessage();
|
dismissLoadingDialog();
|
||||||
assert message != null;
|
String message = e.getMessage();
|
||||||
if (message.contains("timeout")|| message.contains("Read time out")){
|
assert message != null;
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
}else {
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
} else {
|
||||||
}
|
ToastUtils.Message(getActivity(),message);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -41,6 +41,7 @@ import com.navinfo.outdoor.util.FlushTokenUtil;
|
|||||||
import com.navinfo.outdoor.util.Geohash;
|
import com.navinfo.outdoor.util.Geohash;
|
||||||
import com.navinfo.outdoor.util.GeometryTools;
|
import com.navinfo.outdoor.util.GeometryTools;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
import com.tencent.lbssearch.httpresponse.Poi;
|
import com.tencent.lbssearch.httpresponse.Poi;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||||
import com.vividsolutions.jts.geom.Geometry;
|
import com.vividsolutions.jts.geom.Geometry;
|
||||||
@ -189,6 +190,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存小数点后两位
|
* 保存小数点后两位
|
||||||
|
*
|
||||||
* @param value value
|
* @param value value
|
||||||
*/
|
*/
|
||||||
public static String format2(double value) {
|
public static String format2(double value) {
|
||||||
@ -277,7 +279,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
LatLng endLatLng = new LatLng(Double.parseDouble(poiEntity.getY()), Double.parseDouble(poiEntity.getX()));
|
LatLng endLatLng = new LatLng(Double.parseDouble(poiEntity.getY()), Double.parseDouble(poiEntity.getX()));
|
||||||
double geometry = GeometryTools.distanceToDouble(startLatLng, endLatLng);
|
double geometry = GeometryTools.distanceToDouble(startLatLng, endLatLng);
|
||||||
if (geometry > 5000) {
|
if (geometry > 5000) {
|
||||||
Toast.makeText(getActivity(), "作业不在领取范围内,无法领取", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"作业不在领取范围内,无法采集");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
if (geometry > 50) {
|
if (geometry > 50) {
|
||||||
@ -469,7 +471,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),response.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -478,10 +480,10 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),message);
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onError: " + e.getMessage());
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
}
|
}
|
||||||
@ -493,7 +495,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
*/
|
*/
|
||||||
private void initPolygonTask(String url, PoiEntity poiEntity, boolean aBoolean) {
|
private void initPolygonTask(String url, PoiEntity poiEntity, boolean aBoolean) {
|
||||||
if (poiEntity.getTaskId() == 0) {
|
if (poiEntity.getTaskId() == 0) {
|
||||||
Toast.makeText(getActivity(), "无此任务", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"无此任务");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
showLoadingDialog();
|
showLoadingDialog();
|
||||||
@ -545,7 +547,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
initViewByTaskStatus(1);
|
initViewByTaskStatus(1);
|
||||||
Toast.makeText(getActivity(), "领取成功", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"领取成功");
|
||||||
if (aBoolean) {
|
if (aBoolean) {
|
||||||
initCompleteTask(HttpInterface.SUBMIT_POLYGON_TASK, polygonEntity);
|
initCompleteTask(HttpInterface.SUBMIT_POLYGON_TASK, polygonEntity);
|
||||||
} else {
|
} else {
|
||||||
@ -562,7 +564,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),response.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -571,10 +573,10 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),message);
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onError: " + e.getMessage());
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
}
|
}
|
||||||
@ -587,7 +589,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
*/
|
*/
|
||||||
private void initEndReceiveTask(String url, PoiEntity poiEntity) {
|
private void initEndReceiveTask(String url, PoiEntity poiEntity) {
|
||||||
if (poiEntity.getTaskId() == 0) {
|
if (poiEntity.getTaskId() == 0) {
|
||||||
Toast.makeText(getActivity(), "无此任务", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"无此任务");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
showLoadingDialog();
|
showLoadingDialog();
|
||||||
@ -631,7 +633,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),response.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -640,10 +642,10 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -654,7 +656,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
*/
|
*/
|
||||||
private void initCompleteTask(String url, PoiEntity poiEntity) {
|
private void initCompleteTask(String url, PoiEntity poiEntity) {
|
||||||
if (poiEntity.getTaskId() == 0) {
|
if (poiEntity.getTaskId() == 0) {
|
||||||
Toast.makeText(getActivity(), "无此任务", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"无此任务");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
showLoadingDialog();
|
showLoadingDialog();
|
||||||
@ -698,7 +700,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),response.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -707,10 +709,10 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -721,7 +723,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
*/
|
*/
|
||||||
private void initSubmitPolygonTask(String url, PoiEntity poiEntity) {
|
private void initSubmitPolygonTask(String url, PoiEntity poiEntity) {
|
||||||
if (poiEntity.getTaskId() == 0) {
|
if (poiEntity.getTaskId() == 0) {
|
||||||
Toast.makeText(getActivity(), "无此任务", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"无此任务");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
@ -748,7 +750,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),response.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -757,10 +759,10 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -771,7 +773,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
*/
|
*/
|
||||||
private void receivedTaskByNet(String url, PoiEntity poiEntity, boolean isSaver, int statusId) {
|
private void receivedTaskByNet(String url, PoiEntity poiEntity, boolean isSaver, int statusId) {
|
||||||
if (poiEntity.getTaskId() != 0) {
|
if (poiEntity.getTaskId() != 0) {
|
||||||
Toast.makeText(getActivity(), "无此任务", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"无此任务");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
showLoadingDialog();
|
showLoadingDialog();
|
||||||
@ -879,7 +881,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),response.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -888,10 +890,10 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -1009,7 +1011,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),response.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1018,10 +1020,10 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -43,7 +43,6 @@ import com.navinfo.outdoor.base.BaseFragment;
|
|||||||
import com.navinfo.outdoor.bean.BankCardBean;
|
import com.navinfo.outdoor.bean.BankCardBean;
|
||||||
import com.navinfo.outdoor.bean.BankPathBean;
|
import com.navinfo.outdoor.bean.BankPathBean;
|
||||||
import com.navinfo.outdoor.bean.BankPhoneBean;
|
import com.navinfo.outdoor.bean.BankPhoneBean;
|
||||||
import com.navinfo.outdoor.http.Callback;
|
|
||||||
import com.navinfo.outdoor.http.HttpInterface;
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||||
import com.navinfo.outdoor.http.UploadCallBack;
|
import com.navinfo.outdoor.http.UploadCallBack;
|
||||||
@ -51,6 +50,7 @@ import com.navinfo.outdoor.util.FlushTokenUtil;
|
|||||||
import com.navinfo.outdoor.util.GetJsonDataUtil;
|
import com.navinfo.outdoor.util.GetJsonDataUtil;
|
||||||
import com.navinfo.outdoor.util.PhotoUtils;
|
import com.navinfo.outdoor.util.PhotoUtils;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
|
|
||||||
@ -226,7 +226,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
|||||||
case R.id.btn_bank:
|
case R.id.btn_bank:
|
||||||
gatheringBuilder.append(TimestampUtil.time()).append(",").append("点击绑定银行卡 ,");
|
gatheringBuilder.append(TimestampUtil.time()).append(",").append("点击绑定银行卡 ,");
|
||||||
if (etBankNum.getText().toString().equals("")) {
|
if (etBankNum.getText().toString().equals("")) {
|
||||||
Toast.makeText(getActivity(), "银行卡号不能为空", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"银行卡号不能为空");
|
||||||
Log.e("TAG", "onClick: " + etBankNum);
|
Log.e("TAG", "onClick: " + etBankNum);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -249,9 +249,9 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
|||||||
ArrayList<File> gatheringList = new ArrayList<>();
|
ArrayList<File> gatheringList = new ArrayList<>();
|
||||||
if (gatheringCamera.getTag() == null) {
|
if (gatheringCamera.getTag() == null) {
|
||||||
if (Constant.BACKGROUND == null) {
|
if (Constant.BACKGROUND == null) {
|
||||||
Toast.makeText(getActivity(), "请先拍银行卡", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请先拍银行卡");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "如果需要重新绑定请先拍照银行卡", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"如果需要重新绑定请先拍照银行卡");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -260,7 +260,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
|||||||
String etBankAccount = etBankNum.getText().toString().trim();
|
String etBankAccount = etBankNum.getText().toString().trim();
|
||||||
if (etBankAccount.equals("")) {
|
if (etBankAccount.equals("")) {
|
||||||
if (!etBankAccount.matches("^\\\\d{19}$\"")) {
|
if (!etBankAccount.matches("^\\\\d{19}$\"")) {
|
||||||
Toast.makeText(getActivity(), "银行卡号不能为空", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"银行卡号不能为空");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -301,7 +301,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "绑定失败!", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"绑定失败!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -316,10 +316,10 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout")||message.contains("Read time out")){
|
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
}else {
|
} else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -341,22 +341,22 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
|||||||
//银行卡识别
|
//银行卡识别
|
||||||
BankCardBean bankCardBean = new Gson().fromJson(BankCard.bankCard(), BankCardBean.class);
|
BankCardBean bankCardBean = new Gson().fromJson(BankCard.bankCard(), BankCardBean.class);
|
||||||
if (bankCardBean == null) {
|
if (bankCardBean == null) {
|
||||||
Toast.makeText(getContext(), "识别失败,可以重新识别或则进行手动输入", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"识别失败,可以重新识别或则进行手动输入");
|
||||||
} else {
|
} else {
|
||||||
if (bankCardBean.getResult() != null) {
|
if (bankCardBean.getResult() != null) {
|
||||||
if (bankCardBean.getResult().getBank_card_number() != null) {
|
if (bankCardBean.getResult().getBank_card_number() != null) {
|
||||||
String bankCardNumber = bankCardBean.getResult().getBank_card_number().trim();
|
String bankCardNumber = bankCardBean.getResult().getBank_card_number().trim();
|
||||||
String bank_card_number = bankCardNumber.replace(" ", "");
|
String bank_card_number = bankCardNumber.replace(" ", "");
|
||||||
if (StringUtils.isEmpty(bank_card_number)) {
|
if (StringUtils.isEmpty(bank_card_number)) {
|
||||||
Toast.makeText(getActivity(), "识别失败,可以重新识别或则进行手动输入", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"识别失败,可以重新识别或则进行手动输入");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
etBankNum.setText(bank_card_number);
|
etBankNum.setText(bank_card_number);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "识别失败,可以重新识别或则进行手动输入", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"识别失败,可以重新识别或则进行手动输入");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "识别失败,可以重新识别或则进行手动输入", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"识别失败,可以重新识别或则进行手动输入");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ import java.util.Objects;
|
|||||||
* 我的等级页面的fragment
|
* 我的等级页面的fragment
|
||||||
*/
|
*/
|
||||||
public class GradeFragment extends BaseFragment implements View.OnClickListener{
|
public class GradeFragment extends BaseFragment implements View.OnClickListener{
|
||||||
|
|
||||||
public static GradeFragment newInstance(Bundle bundle) {
|
public static GradeFragment newInstance(Bundle bundle) {
|
||||||
GradeFragment fragment = new GradeFragment();
|
GradeFragment fragment = new GradeFragment();
|
||||||
fragment.setArguments(bundle);
|
fragment.setArguments(bundle);
|
||||||
@ -29,7 +30,6 @@ public class GradeFragment extends BaseFragment implements View.OnClickListener{
|
|||||||
super.initData();
|
super.initData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
ImageView ivGrade = findViewById(R.id.iv_grade);
|
ImageView ivGrade = findViewById(R.id.iv_grade);
|
||||||
@ -44,4 +44,18 @@ public class GradeFragment extends BaseFragment implements View.OnClickListener{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStop() {
|
||||||
|
super.onStop();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ import com.navinfo.outdoor.room.PoiDatabase;
|
|||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
import com.navinfo.outdoor.util.ToastUtil;
|
import com.navinfo.outdoor.util.ToastUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
@ -80,25 +81,21 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
|||||||
poiAuditProcess = findViewById(R.id.poi_audit_process);
|
poiAuditProcess = findViewById(R.id.poi_audit_process);
|
||||||
poiAuditThrough = findViewById(R.id.poi_audit_through);
|
poiAuditThrough = findViewById(R.id.poi_audit_through);
|
||||||
poiAuditNotThrough = findViewById(R.id.poi_audit_not_through);
|
poiAuditNotThrough = findViewById(R.id.poi_audit_not_through);
|
||||||
|
|
||||||
ConstraintLayout clRoad = findViewById(R.id.cl_road);
|
ConstraintLayout clRoad = findViewById(R.id.cl_road);
|
||||||
clRoad.setOnClickListener(this);
|
clRoad.setOnClickListener(this);
|
||||||
roadAuditProcess = findViewById(R.id.road_audit_process);
|
roadAuditProcess = findViewById(R.id.road_audit_process);
|
||||||
roadAuditThrough = findViewById(R.id.road_audit_through);
|
roadAuditThrough = findViewById(R.id.road_audit_through);
|
||||||
roadAuditNotThrough = findViewById(R.id.road_audit_not_through);
|
roadAuditNotThrough = findViewById(R.id.road_audit_not_through);
|
||||||
|
|
||||||
ConstraintLayout clCharging = findViewById(R.id.cl_charging);
|
ConstraintLayout clCharging = findViewById(R.id.cl_charging);
|
||||||
clCharging.setOnClickListener(this);
|
clCharging.setOnClickListener(this);
|
||||||
chargingAuditProcess = findViewById(R.id.charging_audit_process);
|
chargingAuditProcess = findViewById(R.id.charging_audit_process);
|
||||||
chargingAuditThrough = findViewById(R.id.charging_audit_through);
|
chargingAuditThrough = findViewById(R.id.charging_audit_through);
|
||||||
chargingAuditNotThrough = findViewById(R.id.charging_audit_not_through);
|
chargingAuditNotThrough = findViewById(R.id.charging_audit_not_through);
|
||||||
|
|
||||||
ConstraintLayout clOther = findViewById(R.id.cl_other);
|
ConstraintLayout clOther = findViewById(R.id.cl_other);
|
||||||
clOther.setOnClickListener(this);
|
clOther.setOnClickListener(this);
|
||||||
otherAuditProcess = findViewById(R.id.other_audit_process);
|
otherAuditProcess = findViewById(R.id.other_audit_process);
|
||||||
otherAuditThrough = findViewById(R.id.other_audit_through);
|
otherAuditThrough = findViewById(R.id.other_audit_through);
|
||||||
otherAuditNotThrough = findViewById(R.id.other_audit_not_through);
|
otherAuditNotThrough = findViewById(R.id.other_audit_not_through);
|
||||||
|
|
||||||
ConstraintLayout clPoiVideo = findViewById(R.id.cl_poiVideo);
|
ConstraintLayout clPoiVideo = findViewById(R.id.cl_poiVideo);
|
||||||
clPoiVideo.setOnClickListener(this);
|
clPoiVideo.setOnClickListener(this);
|
||||||
poiVideoAuditProcess = findViewById(R.id.poiVideo_audit_process);
|
poiVideoAuditProcess = findViewById(R.id.poiVideo_audit_process);
|
||||||
@ -168,14 +165,7 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
|||||||
} else if (hasSubmitBean.getCode() == 230) {
|
} else if (hasSubmitBean.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),hasSubmitBean.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getContext(), hasSubmitBean.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -184,24 +174,10 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -241,14 +217,7 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
|||||||
} else if (hasSubmitBean.getCode() == 230) {
|
} else if (hasSubmitBean.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),hasSubmitBean.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getContext(), hasSubmitBean.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -257,24 +226,10 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -314,14 +269,7 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
|||||||
} else if (hasSubmitBean.getCode() == 230) {
|
} else if (hasSubmitBean.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),hasSubmitBean.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getContext(), hasSubmitBean.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,24 +278,10 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -387,14 +321,7 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
|||||||
} else if (hasSubmitBean.getCode() == 230) {
|
} else if (hasSubmitBean.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),hasSubmitBean.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getContext(), hasSubmitBean.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -403,24 +330,10 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -461,14 +374,7 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
|||||||
} else if (hasSubmitBean.getCode() == 230) {
|
} else if (hasSubmitBean.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),hasSubmitBean.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getContext(), hasSubmitBean.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -477,24 +383,10 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -27,6 +27,7 @@ import com.navinfo.outdoor.http.Callback;
|
|||||||
import com.navinfo.outdoor.http.HttpInterface;
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
import com.umeng.umcrash.UMCrash;
|
import com.umeng.umcrash.UMCrash;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
@ -85,7 +86,7 @@ public class IssueFragment extends BaseFragment implements View.OnClickListener
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),response.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,10 +95,10 @@ public class IssueFragment extends BaseFragment implements View.OnClickListener
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout")||message.contains("Read time out")){
|
if (message.equals("timeout")||message.equals("Read time out")){
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
}else {
|
}else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -120,7 +121,6 @@ public class IssueFragment extends BaseFragment implements View.OnClickListener
|
|||||||
issueProblemAdapter = new IssueProblemAdapter(getActivity());
|
issueProblemAdapter = new IssueProblemAdapter(getActivity());
|
||||||
mainIssueRecycler.setAdapter(issueProblemAdapter);
|
mainIssueRecycler.setAdapter(issueProblemAdapter);
|
||||||
mainIssueRecycler.getDefaultFootView().setNoMoreHint("成功加载完毕");
|
mainIssueRecycler.getDefaultFootView().setNoMoreHint("成功加载完毕");
|
||||||
|
|
||||||
issueProblemAdapter.setOnIssueClick(new IssueProblemAdapter.OnIssueClick() {
|
issueProblemAdapter.setOnIssueClick(new IssueProblemAdapter.OnIssueClick() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(int pos) {
|
public void onClick(int pos) {
|
||||||
|
@ -16,7 +16,6 @@ import com.navinfo.outdoor.activity.WebActivity;
|
|||||||
import com.navinfo.outdoor.api.Constant;
|
import com.navinfo.outdoor.api.Constant;
|
||||||
import com.navinfo.outdoor.base.BaseFragment;
|
import com.navinfo.outdoor.base.BaseFragment;
|
||||||
import com.navinfo.outdoor.bean.RichTextBean;
|
import com.navinfo.outdoor.bean.RichTextBean;
|
||||||
import com.navinfo.outdoor.http.Callback;
|
|
||||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -14,7 +14,6 @@ import java.util.Objects;
|
|||||||
* 地图下载的Fragment
|
* 地图下载的Fragment
|
||||||
*/
|
*/
|
||||||
public class MapDownloadFragment extends BaseFragment implements View.OnClickListener{
|
public class MapDownloadFragment extends BaseFragment implements View.OnClickListener{
|
||||||
|
|
||||||
public static MapDownloadFragment newInstance(Bundle bundle) {
|
public static MapDownloadFragment newInstance(Bundle bundle) {
|
||||||
MapDownloadFragment fragment = new MapDownloadFragment();
|
MapDownloadFragment fragment = new MapDownloadFragment();
|
||||||
fragment.setArguments(bundle);
|
fragment.setArguments(bundle);
|
||||||
|
@ -30,6 +30,7 @@ import com.navinfo.outdoor.http.HttpInterface;
|
|||||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
@ -77,7 +78,6 @@ public class MessageFragment extends BaseFragment implements View.OnClickListene
|
|||||||
messageAdapter.setMessageClickItem(new MessageAdapter.messageClickItem() {
|
messageAdapter.setMessageClickItem(new MessageAdapter.messageClickItem() {
|
||||||
@Override
|
@Override
|
||||||
public void item(int id) {
|
public void item(int id) {
|
||||||
|
|
||||||
messageBuilder.append(TimestampUtil.time()).append(",").append("点击item ,");
|
messageBuilder.append(TimestampUtil.time()).append(",").append("点击item ,");
|
||||||
HashMap<String, String> paramMap = new HashMap<>();
|
HashMap<String, String> paramMap = new HashMap<>();
|
||||||
paramMap.put("id", id + "");
|
paramMap.put("id", id + "");
|
||||||
@ -86,11 +86,9 @@ public class MessageFragment extends BaseFragment implements View.OnClickListene
|
|||||||
});
|
});
|
||||||
messageRecycler.getDefaultFootView().setNoMoreHint("已全部加载完毕");
|
messageRecycler.getDefaultFootView().setNoMoreHint("已全部加载完毕");
|
||||||
messageRecycler.setLoadingListener(new XRecyclerView.LoadingListener() {
|
messageRecycler.setLoadingListener(new XRecyclerView.LoadingListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRefresh() {
|
public void onRefresh() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoadMore() {
|
public void onLoadMore() {
|
||||||
}
|
}
|
||||||
@ -120,9 +118,8 @@ public class MessageFragment extends BaseFragment implements View.OnClickListene
|
|||||||
} else if (taskPrefectureBean.getCode() == 230) {
|
} else if (taskPrefectureBean.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), taskPrefectureBean.getMessage() + "", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),taskPrefectureBean.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -130,10 +127,10 @@ public class MessageFragment extends BaseFragment implements View.OnClickListene
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout")||message.contains("Read time out")){
|
if (message.equals("timeout")||message.equals("Read time out")){
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
}else {
|
}else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),message);
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onError: " + e.getMessage());
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -29,8 +29,10 @@ import com.navinfo.outdoor.bean.GetPriceBean;
|
|||||||
import com.navinfo.outdoor.http.Callback;
|
import com.navinfo.outdoor.http.Callback;
|
||||||
import com.navinfo.outdoor.http.HttpInterface;
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||||
|
import com.navinfo.outdoor.util.DoubleUtil;
|
||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
@ -146,7 +148,7 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
|||||||
if (response.getCode() == 200) {
|
if (response.getCode() == 200) {
|
||||||
GetPriceBean.BodyBean body = response.getBody();
|
GetPriceBean.BodyBean body = response.getBody();
|
||||||
if (body != null) {
|
if (body != null) {
|
||||||
String minePrice = format2( body.getUserPrice());
|
String minePrice = DoubleUtil.format2( body.getUserPrice());
|
||||||
if (getActivity() != null) {
|
if (getActivity() != null) {
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
@ -160,14 +162,7 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity()!=null){
|
ToastUtils.Message(getActivity(),response.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), response.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onSuccess: " + response.toString());
|
Log.d("TAG", "onSuccess: " + response.toString());
|
||||||
}
|
}
|
||||||
@ -177,24 +172,10 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout")||message.contains("Read time out")){
|
if (message.equals("timeout")||message.equals("Read time out")){
|
||||||
if (getActivity()!=null){
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}else {
|
}else {
|
||||||
if (getActivity()!=null){
|
ToastUtils.Message(getActivity(),message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onError: " + e.getMessage());
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
}
|
}
|
||||||
@ -254,8 +235,7 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
|||||||
Intent intentGrade = new Intent(getActivity(), FragmentManagement.class);
|
Intent intentGrade = new Intent(getActivity(), FragmentManagement.class);
|
||||||
intentGrade.putExtra("tag", 17);
|
intentGrade.putExtra("tag", 17);
|
||||||
startActivity(intentGrade);*/
|
startActivity(intentGrade);*/
|
||||||
|
ToastUtils.Message(getActivity(),"该功能以后上新,敬请期待");
|
||||||
Toast.makeText(getActivity(), "该功能以后上新,敬请期待", Toast.LENGTH_SHORT).show();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.btn_withdraw://提现页面
|
case R.id.btn_withdraw://提现页面
|
||||||
@ -286,7 +266,6 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
|||||||
intentAbout.putExtra("tag", 23);
|
intentAbout.putExtra("tag", 23);
|
||||||
startActivity(intentAbout);
|
startActivity(intentAbout);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.btn_quit://退出登录
|
case R.id.btn_quit://退出登录
|
||||||
mainBuilder.append(TimestampUtil.time()).append(",").append("点击了退出登录的按钮 ,");
|
mainBuilder.append(TimestampUtil.time()).append(",").append("点击了退出登录的按钮 ,");
|
||||||
Intent intent = new Intent(getContext(), LoginActivity.class);
|
Intent intent = new Intent(getContext(), LoginActivity.class);
|
||||||
@ -308,14 +287,6 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
|||||||
mainBuilder.append(TimestampUtil.time()).append(",").append("onStop ,");
|
mainBuilder.append(TimestampUtil.time()).append(",").append("onStop ,");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存小数点后两位
|
|
||||||
*/
|
|
||||||
public static String format2(double value) {
|
|
||||||
DecimalFormat df = new DecimalFormat("0.00");
|
|
||||||
df.setRoundingMode(RoundingMode.HALF_UP);
|
|
||||||
return df.format(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
|
@ -46,6 +46,7 @@ import com.navinfo.outdoor.base.BaseDrawerFragment;
|
|||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
import com.navinfo.outdoor.util.PreserveUtils;
|
import com.navinfo.outdoor.util.PreserveUtils;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
import com.navinfo.outdoor.util.UploadUtils;
|
import com.navinfo.outdoor.util.UploadUtils;
|
||||||
import com.navinfo.outdoor.bean.Info;
|
import com.navinfo.outdoor.bean.Info;
|
||||||
import com.navinfo.outdoor.bean.PoiSaveBean;
|
import com.navinfo.outdoor.bean.PoiSaveBean;
|
||||||
@ -331,6 +332,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNothingSelected(AdapterView<?> parent) {
|
public void onNothingSelected(AdapterView<?> parent) {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//数据展示
|
//数据展示
|
||||||
@ -537,23 +539,23 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
}
|
}
|
||||||
String name = editTaskName.getText().toString().trim();//名称
|
String name = editTaskName.getText().toString().trim();//名称
|
||||||
if (name.equals("")) {
|
if (name.equals("")) {
|
||||||
Toast.makeText(getActivity(), "请输入poi 名称", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请输入poi 名称");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (latLng == null) {
|
if (latLng == null) {
|
||||||
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请确定点位");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String tagPicture = (String) tvPicture.getTag();
|
String tagPicture = (String) tvPicture.getTag();
|
||||||
if (tagPicture == null) {
|
if (tagPicture == null) {
|
||||||
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请拍照");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
otherUploadList.add(new File(tagPicture));
|
otherUploadList.add(new File(tagPicture));
|
||||||
}
|
}
|
||||||
String tagPictures = (String) tvPictures.getTag();
|
String tagPictures = (String) tvPictures.getTag();
|
||||||
if (tagPictures == null) {
|
if (tagPictures == null) {
|
||||||
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请拍照");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
otherUploadList.add(new File(tagPictures));
|
otherUploadList.add(new File(tagPictures));
|
||||||
@ -606,7 +608,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getContext(), "该任务正在提交中", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"该任务正在提交中");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -624,7 +626,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
PoiEntity poiEntity = initPoiEntityByUI(showPoiEntity);
|
PoiEntity poiEntity = initPoiEntityByUI(showPoiEntity);
|
||||||
PoiCheckResult poiCheckResult = checkPoiEntity(poiEntity);
|
PoiCheckResult poiCheckResult = checkPoiEntity(poiEntity);
|
||||||
if (poiCheckResult.getCode() == 1) {
|
if (poiCheckResult.getCode() == 1) {
|
||||||
Toast.makeText(getActivity(), poiCheckResult.getMsg() + "", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),poiCheckResult.getMsg());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
poiEntity.setTaskStatus(2);
|
poiEntity.setTaskStatus(2);
|
||||||
@ -646,14 +648,14 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"没有申请权限,请手动申请");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDenied(List<String> permissions, boolean never) {
|
public void onDenied(List<String> permissions, boolean never) {
|
||||||
if (never) {
|
if (never) {
|
||||||
Toast.makeText(getActivity(), "被永久拒绝授权,请手动授予权限", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"被永久拒绝授权,请手动授予权限");
|
||||||
// 如果是被永久拒绝就跳转到应用权限系统设置页面
|
// 如果是被永久拒绝就跳转到应用权限系统设置页面
|
||||||
XXPermissions.startPermissionActivity(Objects.requireNonNull(getActivity()), permissions);
|
XXPermissions.startPermissionActivity(Objects.requireNonNull(getActivity()), permissions);
|
||||||
}
|
}
|
||||||
@ -686,7 +688,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
|
|
||||||
private void otherUploadByNet(int body, List<File> otherUploadList) {
|
private void otherUploadByNet(int body, List<File> otherUploadList) {
|
||||||
if (body == 0) {
|
if (body == 0) {
|
||||||
Toast.makeText(getActivity(), "没有保存本地", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"没有保存本地");
|
||||||
Log.e("TAG", "poiUploadByNetWork: " + body + otherUploadList);
|
Log.e("TAG", "poiUploadByNetWork: " + body + otherUploadList);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -750,26 +752,12 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),poiSaveBean.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), poiSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (poiSaveBean.getCode() == 230) {
|
} else if (poiSaveBean.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),poiSaveBean.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), poiSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -779,23 +767,9 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(),message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -909,7 +883,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
|
|
||||||
private void initEndReceiveTask(String url, PoiEntity poiEntity) {
|
private void initEndReceiveTask(String url, PoiEntity poiEntity) {
|
||||||
if (poiEntity.getTaskId() == 0) {
|
if (poiEntity.getTaskId() == 0) {
|
||||||
Toast.makeText(getActivity(), "无此任务", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"无此任务");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
@ -942,14 +916,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), response.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), response.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -959,23 +926,9 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), "请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "" + message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -51,9 +51,8 @@ import java.util.Objects;
|
|||||||
public class PhotoFragment extends BaseFragment implements View.OnClickListener {
|
public class PhotoFragment extends BaseFragment implements View.OnClickListener {
|
||||||
private ArrayList<FileBean> fileBeans;
|
private ArrayList<FileBean> fileBeans;
|
||||||
private PhotoAdapter photoAdapter;
|
private PhotoAdapter photoAdapter;
|
||||||
private File logFile;
|
private File logFile,fileTxt;
|
||||||
private StringBuilder photoBuilder;
|
private StringBuilder photoBuilder;
|
||||||
private File fileTxt;
|
|
||||||
|
|
||||||
public static PhotoFragment newInstance(Bundle bundle) {
|
public static PhotoFragment newInstance(Bundle bundle) {
|
||||||
PhotoFragment fragment = new PhotoFragment();
|
PhotoFragment fragment = new PhotoFragment();
|
||||||
@ -104,9 +103,9 @@ public class PhotoFragment extends BaseFragment implements View.OnClickListener
|
|||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
PoiEntity showPoiEntity = (PoiEntity) Objects.requireNonNull(getActivity()).getIntent().getSerializableExtra("showPoiEntity");
|
PoiEntity showPoiEntity = (PoiEntity) Objects.requireNonNull(getActivity()).getIntent().getSerializableExtra("showPoiEntity");
|
||||||
ImageView ivPhotoFinal = (ImageView) findViewById(R.id.iv_photo_final);
|
ImageView ivPhotoFinal = findViewById(R.id.iv_photo_final);
|
||||||
ivPhotoFinal.setOnClickListener(this);
|
ivPhotoFinal.setOnClickListener(this);
|
||||||
TextView tvPhotoAlbumDelete = (TextView) findViewById(R.id.tv_photo_album_delete);
|
TextView tvPhotoAlbumDelete = findViewById(R.id.tv_photo_album_delete);
|
||||||
tvPhotoAlbumDelete.setOnClickListener(this);
|
tvPhotoAlbumDelete.setOnClickListener(this);
|
||||||
if (showPoiEntity != null) {
|
if (showPoiEntity != null) {
|
||||||
String id = showPoiEntity.getId();
|
String id = showPoiEntity.getId();
|
||||||
@ -126,8 +125,8 @@ public class PhotoFragment extends BaseFragment implements View.OnClickListener
|
|||||||
@Override
|
@Override
|
||||||
public int compare(File o1, File o2) {
|
public int compare(File o1, File o2) {
|
||||||
String[] split = o1.getName().split(".webp");
|
String[] split = o1.getName().split(".webp");
|
||||||
String[] split2 = o2.getName().split(".webp");
|
|
||||||
int i = Integer.parseInt(split[0]);
|
int i = Integer.parseInt(split[0]);
|
||||||
|
String[] split2 = o2.getName().split(".webp");
|
||||||
int i2 = Integer.parseInt(split2[0]);
|
int i2 = Integer.parseInt(split2[0]);
|
||||||
if (i > i2) {
|
if (i > i2) {
|
||||||
return 1;
|
return 1;
|
||||||
@ -150,10 +149,15 @@ public class PhotoFragment extends BaseFragment implements View.OnClickListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
RecyclerView photoRecycler = findViewById(R.id.photo_album_recycler);
|
RecyclerView photoRecycler = findViewById(R.id.photo_album_recycler);
|
||||||
photoRecycler.setLayoutManager(new GridLayoutManager(getContext(), 2));
|
try {
|
||||||
photoAdapter = new PhotoAdapter(fileTxt, getContext());
|
photoRecycler.setLayoutManager(new GridLayoutManager(getContext(), 2));
|
||||||
photoAdapter.setFileBeans(fileBeans);
|
photoAdapter = new PhotoAdapter(fileTxt, getContext());
|
||||||
photoRecycler.setAdapter(photoAdapter);
|
photoAdapter.setFileBeans(fileBeans);
|
||||||
|
photoRecycler.setAdapter(photoAdapter);
|
||||||
|
}catch (Exception e){
|
||||||
|
e.getLocalizedMessage();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -177,7 +181,7 @@ public class PhotoFragment extends BaseFragment implements View.OnClickListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
photoBuilder = new StringBuilder();
|
photoBuilder = new StringBuilder();
|
||||||
photoBuilder.append(TimestampUtil.time()).append("PhotoActivity-onCreate-initData ,");
|
photoBuilder.append(TimestampUtil.time()).append("PhotoFragment-onCreate-initData ,");
|
||||||
if (Constant.USHERED != null) {
|
if (Constant.USHERED != null) {
|
||||||
photoBuilder.append("userId:").append(Constant.USHERED).append(",");
|
photoBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,7 @@ import com.navinfo.outdoor.util.AWMp4ParserHelper;
|
|||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
import com.navinfo.outdoor.util.PreserveUtils;
|
import com.navinfo.outdoor.util.PreserveUtils;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
import com.navinfo.outdoor.util.UploadUtils;
|
import com.navinfo.outdoor.util.UploadUtils;
|
||||||
import com.navinfo.outdoor.bean.GetPhoneBean;
|
import com.navinfo.outdoor.bean.GetPhoneBean;
|
||||||
import com.navinfo.outdoor.bean.Info;
|
import com.navinfo.outdoor.bean.Info;
|
||||||
@ -259,6 +260,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
checkBoxLife.setTextColor(Color.BLACK);
|
checkBoxLife.setTextColor(Color.BLACK);
|
||||||
checkBoxLife.setChecked(false);
|
checkBoxLife.setChecked(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_show);
|
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_show);
|
||||||
@ -595,7 +597,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
private void initPhone() {
|
private void initPhone() {
|
||||||
String encode = Geohash.getInstance().encode(latLng.latitude, latLng.longitude);
|
String encode = Geohash.getInstance().encode(latLng.latitude, latLng.longitude);
|
||||||
if (encode == null) {
|
if (encode == null) {
|
||||||
Toast.makeText(getActivity(), "没有确定经纬度", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "没有确定经纬度");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
showLoadingDialog();
|
showLoadingDialog();
|
||||||
@ -627,15 +629,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
} else if (getPhoneBean.getCode() == 230) {
|
} else if (getPhoneBean.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), getPhoneBean.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), getPhoneBean.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -645,24 +639,9 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), "请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -746,23 +725,23 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
String name = editNameContent.getText().toString().trim();//名称
|
String name = editNameContent.getText().toString().trim();//名称
|
||||||
if (name.equals("")) {
|
if (name.equals("")) {
|
||||||
Toast.makeText(getActivity(), "请输入poi 名称", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请输入poi 名称");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (latLng == null) {
|
if (latLng == null) {
|
||||||
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请确定点位");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String tagPanorama = (String) tvPanorama.getTag();
|
String tagPanorama = (String) tvPanorama.getTag();
|
||||||
if (tagPanorama == null) {
|
if (tagPanorama == null) {
|
||||||
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请拍照");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
poiPicList.add(new File(tagPanorama));
|
poiPicList.add(new File(tagPanorama));
|
||||||
}
|
}
|
||||||
String tagName = (String) tvPoiNamePic.getTag();
|
String tagName = (String) tvPoiNamePic.getTag();
|
||||||
if (tagName == null) {
|
if (tagName == null) {
|
||||||
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请拍照");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
poiPicList.add(new File(tagName));
|
poiPicList.add(new File(tagName));
|
||||||
@ -827,7 +806,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getContext(), "该任务正在提交中", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "该任务正在提交中");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case R.id.tv_poi_examine:
|
case R.id.tv_poi_examine:
|
||||||
@ -889,39 +868,35 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
public void onSuccess(TaskNameBean taskNameBean, int id) {
|
public void onSuccess(TaskNameBean taskNameBean, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
if (taskNameBean.getCode() == 200) {
|
if (taskNameBean.getCode() == 200) {
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
if (getActivity()!=null){
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
btnUploading.setEnabled(true);
|
|
||||||
btnSaveLocal.setEnabled(true);
|
|
||||||
editNameContent.setTextColor(Color.BLACK);
|
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
|
||||||
List<String> body = taskNameBean.getBody();
|
|
||||||
if (body != null) {
|
|
||||||
for (int i = 0; i < body.size(); i++) {
|
|
||||||
stringBuilder.append(body.get(i)).append(";");
|
|
||||||
}
|
|
||||||
Toast.makeText(getActivity(), "存在类似名称---" + stringBuilder.toString(), Toast.LENGTH_SHORT).show();
|
|
||||||
} else {
|
|
||||||
Toast.makeText(getActivity(), "没有类似名称,可以作业", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (taskNameBean.getCode() == 230) {
|
|
||||||
if (getActivity() != null) {
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
btnUploading.setEnabled(true);
|
||||||
|
btnSaveLocal.setEnabled(true);
|
||||||
|
editNameContent.setTextColor(Color.BLACK);
|
||||||
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
|
List<String> body = taskNameBean.getBody();
|
||||||
|
if (body != null) {
|
||||||
|
for (int i = 0; i < body.size(); i++) {
|
||||||
|
stringBuilder.append(body.get(i)).append(";");
|
||||||
|
}
|
||||||
|
ToastUtils.Message(getActivity(), "存在类似名称---"+stringBuilder.toString());
|
||||||
|
} else {
|
||||||
|
ToastUtils.Message(getActivity(), "没有类似名称,可以作业");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
} else if (taskNameBean.getCode() == 230) {
|
||||||
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
if (getActivity() != null) {
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Toast.makeText(getActivity(), taskNameBean.getMessage() + "", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), taskNameBean.getMessage());
|
||||||
btnUploading.setEnabled(false);
|
btnUploading.setEnabled(false);
|
||||||
btnSaveLocal.setEnabled(false);
|
btnSaveLocal.setEnabled(false);
|
||||||
editNameContent.setTextColor(Color.RED);
|
editNameContent.setTextColor(Color.RED);
|
||||||
@ -939,24 +914,10 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), "请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -974,7 +935,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
PoiEntity poiEntity = initPoiEntityByUI(showPoiEntity);
|
PoiEntity poiEntity = initPoiEntityByUI(showPoiEntity);
|
||||||
PoiCheckResult poiCheckResult = checkPoiEntity(poiEntity);
|
PoiCheckResult poiCheckResult = checkPoiEntity(poiEntity);
|
||||||
if (poiCheckResult.getCode() == 1) {
|
if (poiCheckResult.getCode() == 1) {
|
||||||
Toast.makeText(getActivity(), poiCheckResult.getMsg() + "", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), poiCheckResult.getMsg());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
poiEntity.setTaskStatus(2);
|
poiEntity.setTaskStatus(2);
|
||||||
@ -996,14 +957,14 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "没有申请权限,请手动申请");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDenied(List<String> permissions, boolean never) {
|
public void onDenied(List<String> permissions, boolean never) {
|
||||||
if (never) {
|
if (never) {
|
||||||
Toast.makeText(getActivity(), "被永久拒绝授权,请手动授予权限", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "被永久拒绝授权,请手动授予权限");
|
||||||
// 如果是被永久拒绝就跳转到应用权限系统设置页面
|
// 如果是被永久拒绝就跳转到应用权限系统设置页面
|
||||||
XXPermissions.startPermissionActivity(Objects.requireNonNull(getActivity()), permissions);
|
XXPermissions.startPermissionActivity(Objects.requireNonNull(getActivity()), permissions);
|
||||||
}
|
}
|
||||||
@ -1037,7 +998,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
|
|
||||||
private void poiUploadByNetWork(int body, ArrayList<File> poiPicList) {
|
private void poiUploadByNetWork(int body, ArrayList<File> poiPicList) {
|
||||||
if (body == 0) {
|
if (body == 0) {
|
||||||
Toast.makeText(getActivity(), "没有保存本地", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "没有保存本地");
|
||||||
Log.e("TAG", "poiUploadByNetWork: " + body + poiPicList);
|
Log.e("TAG", "poiUploadByNetWork: " + body + poiPicList);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1101,26 +1062,12 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), poiSaveBean.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), poiSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (poiSaveBean.getCode() == 230) {
|
} else if (poiSaveBean.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), poiSaveBean.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), poiSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1129,24 +1076,10 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), "请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onError: " + e.getMessage());
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
}
|
}
|
||||||
@ -1314,7 +1247,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
|
|
||||||
private void initEndReceiveTask(String url, PoiEntity poiEntity) {
|
private void initEndReceiveTask(String url, PoiEntity poiEntity) {
|
||||||
if (poiEntity.getTaskId() == 0) {
|
if (poiEntity.getTaskId() == 0) {
|
||||||
Toast.makeText(getActivity(), "无此任务", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "无此任务");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
showLoadingDialog();
|
showLoadingDialog();
|
||||||
@ -1347,14 +1280,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), response.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1363,24 +1289,10 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), "请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "" + message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onError: " + e.getMessage());
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,7 @@ import com.navinfo.outdoor.http.HttpInterface;
|
|||||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
import com.umeng.commonsdk.debug.D;
|
import com.umeng.commonsdk.debug.D;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -43,6 +44,7 @@ import java.util.List;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* 记录-已提交-poi任务列表
|
* 记录-已提交-poi任务列表
|
||||||
*/
|
*/
|
||||||
public class PoiTaskFragment extends BaseFragment implements View.OnClickListener {
|
public class PoiTaskFragment extends BaseFragment implements View.OnClickListener {
|
||||||
@ -65,6 +67,7 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
|
|||||||
return R.layout.fragment_poi_task;
|
return R.layout.fragment_poi_task;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
@ -167,7 +170,7 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
|
|||||||
} else if (hasSubmitBean.getCode() == 230) {
|
} else if (hasSubmitBean.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), hasSubmitBean.getMessage() + "", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), hasSubmitBean.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,9 +180,9 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
|
|||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.equals("timeout")||message.equals("Read time out")){
|
if (message.equals("timeout")||message.equals("Read time out")){
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请求超时");
|
||||||
}else {
|
}else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -192,7 +195,7 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
|
|||||||
listBeans.clear();
|
listBeans.clear();
|
||||||
}
|
}
|
||||||
if (hasSubmitBean.getBody().getList() == null) {
|
if (hasSubmitBean.getBody().getList() == null) {
|
||||||
Toast.makeText(getActivity(), "没有相关数据", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "没有相关数据");
|
||||||
} else {
|
} else {
|
||||||
listBeans.addAll(hasSubmitBean.getBody().getList());
|
listBeans.addAll(hasSubmitBean.getBody().getList());
|
||||||
page++;
|
page++;
|
||||||
@ -210,7 +213,7 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), hasSubmitBean.getMessage(), Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), hasSubmitBean.getMessage());
|
||||||
Log.d("TAG", "" + hasSubmitBean.getMessage());
|
Log.d("TAG", "" + hasSubmitBean.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -218,8 +221,8 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (v.getId() == R.id.iv_poiTask_finish) {
|
if (v.getId() == R.id.iv_poiTask_finish) {
|
||||||
Objects.requireNonNull(getActivity()).finish();
|
|
||||||
poiTaskBuilder.append(TimestampUtil.time()).append(",").append("点击返回按钮 ,");
|
poiTaskBuilder.append(TimestampUtil.time()).append(",").append("点击返回按钮 ,");
|
||||||
|
Objects.requireNonNull(getActivity()).finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,4 +245,5 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
|
|||||||
poiTaskBuilder.append("\r\n");
|
poiTaskBuilder.append("\r\n");
|
||||||
FileUtils.writeFile(logFile.getAbsolutePath(), poiTaskBuilder.toString(), true);
|
FileUtils.writeFile(logFile.getAbsolutePath(), poiTaskBuilder.toString(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -57,6 +57,7 @@ import com.navinfo.outdoor.util.Geohash;
|
|||||||
import com.navinfo.outdoor.util.GeometryTools;
|
import com.navinfo.outdoor.util.GeometryTools;
|
||||||
import com.navinfo.outdoor.util.PreserveUtils;
|
import com.navinfo.outdoor.util.PreserveUtils;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
import com.navinfo.outdoor.util.UploadUtils;
|
import com.navinfo.outdoor.util.UploadUtils;
|
||||||
import com.navinfo.outdoor.util.ZipUtils;
|
import com.navinfo.outdoor.util.ZipUtils;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
|
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
|
||||||
@ -78,9 +79,9 @@ import java.util.List;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* 寻宝-点击上传弹窗-poi录像
|
* 寻宝-点击上传弹窗-poi录像
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClickListener {
|
public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClickListener {
|
||||||
private EditText etRoadName, etDesc;
|
private EditText etRoadName, etDesc;
|
||||||
private ImageView ivPoiVideoPicture;
|
private ImageView ivPoiVideoPicture;
|
||||||
@ -342,7 +343,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
moveLatlng(latLng, null);
|
moveLatlng(latLng, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
String memo = showPoiEntity.getMemo();//任务描述
|
String memo = showPoiEntity.getMemo();//任务描述
|
||||||
if (memo != null && !memo.equals("")) {
|
if (memo != null && !memo.equals("")) {
|
||||||
@ -425,7 +425,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
photoAlbumIntent.putExtra("showPoiEntity", showPoiEntity);
|
photoAlbumIntent.putExtra("showPoiEntity", showPoiEntity);
|
||||||
startActivity(photoAlbumIntent);
|
startActivity(photoAlbumIntent);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getContext(), "请拍摄", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请拍摄");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case R.id.btn_poi_video_save:
|
case R.id.btn_poi_video_save:
|
||||||
@ -441,12 +441,12 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
double rearGeometry = GeometryTools.distanceToDouble(startLatLng, rearLatLng);//終點于用戶的距離
|
double rearGeometry = GeometryTools.distanceToDouble(startLatLng, rearLatLng);//終點于用戶的距離
|
||||||
if (geometry > rearGeometry) {//用戶在终点开始作业
|
if (geometry > rearGeometry) {//用戶在终点开始作业
|
||||||
if (rearGeometry > 5000) {
|
if (rearGeometry > 5000) {
|
||||||
Toast.makeText(getActivity(), "用户距离作业终点五公里以内才能拍摄", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {//用户在起点开始作业
|
} else {//用户在起点开始作业
|
||||||
if (geometry > 5000) {
|
if (geometry > 5000) {
|
||||||
Toast.makeText(getActivity(), "用户距离作业起点五公里以内才能拍摄", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -465,12 +465,12 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
double rearGeom = GeometryTools.distanceToDouble(startLng, rearLatLng);
|
double rearGeom = GeometryTools.distanceToDouble(startLng, rearLatLng);
|
||||||
if (geom > rearGeom) {//用戶在终点开始作业
|
if (geom > rearGeom) {//用戶在终点开始作业
|
||||||
if (rearGeom > 5000) {
|
if (rearGeom > 5000) {
|
||||||
Toast.makeText(getActivity(), "用户距离作业终点五公里以内才能拍摄", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {//用户在起点开始作业
|
} else {//用户在起点开始作业
|
||||||
if (geom > 5000) {
|
if (geom > 5000) {
|
||||||
Toast.makeText(getActivity(), "用户距离作业起点五公里以内才能拍摄", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -516,7 +516,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
fileZip.delete();
|
fileZip.delete();
|
||||||
Toast.makeText(getActivity(), "压缩文件失败,请重新提交", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "压缩文件失败,请重新提交");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -525,11 +525,11 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
}).start();
|
}).start();
|
||||||
} else {
|
} else {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
Toast.makeText(getActivity(), "请录像", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请录像");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getContext(), "该任务正在提交中", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "该任务正在提交中");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -545,7 +545,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
PoiEntity poiEntity = initPoiEntityByUI(showPoiEntity);
|
PoiEntity poiEntity = initPoiEntityByUI(showPoiEntity);
|
||||||
PoiCheckResult poiCheckResult = checkPoiEntity(poiEntity);
|
PoiCheckResult poiCheckResult = checkPoiEntity(poiEntity);
|
||||||
if (poiCheckResult.getCode() == 1) {
|
if (poiCheckResult.getCode() == 1) {
|
||||||
Toast.makeText(getActivity(), poiCheckResult.getMsg() + "", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), poiCheckResult.getMsg());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
poiEntity.setTaskStatus(2);
|
poiEntity.setTaskStatus(2);
|
||||||
@ -569,14 +569,14 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "没有申请权限,请手动申请");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDenied(List<String> permissions, boolean never) {
|
public void onDenied(List<String> permissions, boolean never) {
|
||||||
if (never) {
|
if (never) {
|
||||||
Toast.makeText(getActivity(), "被永久拒绝授权,请手动授予权限", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "被永久拒绝授权,请手动授予权限");
|
||||||
// 如果是被永久拒绝就跳转到应用权限系统设置页面
|
// 如果是被永久拒绝就跳转到应用权限系统设置页面
|
||||||
XXPermissions.startPermissionActivity(Objects.requireNonNull(getActivity()), permissions);
|
XXPermissions.startPermissionActivity(Objects.requireNonNull(getActivity()), permissions);
|
||||||
}
|
}
|
||||||
@ -609,11 +609,11 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
|
|
||||||
private void poiVideoUpload(int poiVideoBody, File fileZip) {
|
private void poiVideoUpload(int poiVideoBody, File fileZip) {
|
||||||
if (poiVideoBody == 0) {
|
if (poiVideoBody == 0) {
|
||||||
Toast.makeText(getActivity(), "请先保存本地在上传", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请先保存本地在上传");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (fileZip == null) {
|
if (fileZip == null) {
|
||||||
Toast.makeText(getActivity(), "未压缩完成", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "未压缩完成");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
@ -676,26 +676,12 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), poiVideoBean.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getContext(), "" + poiVideoBean.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (poiVideoBean.getCode() == 230) {
|
} else if (poiVideoBean.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), poiVideoBean.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getContext(), poiVideoBean.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -704,24 +690,10 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), "请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -795,8 +767,12 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initEndReceiveTask(String url, PoiEntity poiEntity) {
|
private void initEndReceiveTask(String url, PoiEntity poiEntity) {
|
||||||
|
if (poiEntity==null){
|
||||||
|
ToastUtils.Message(getActivity(), "无此任务");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (poiEntity.getTaskId() == 0) {
|
if (poiEntity.getTaskId() == 0) {
|
||||||
Toast.makeText(getActivity(), "无此任务", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "无此任务");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
@ -835,14 +811,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), response.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -851,24 +820,10 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), "请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -12,7 +12,7 @@ import java.util.Objects;
|
|||||||
/**
|
/**
|
||||||
* 我的等级页面的fragment
|
* 我的等级页面的fragment
|
||||||
*/
|
*/
|
||||||
public class PrivilegeFragment extends BaseFragment implements View.OnClickListener{
|
public class PrivilegeFragment extends BaseFragment implements View.OnClickListener {
|
||||||
|
|
||||||
public static PrivilegeFragment newInstance(Bundle bundle) {
|
public static PrivilegeFragment newInstance(Bundle bundle) {
|
||||||
PrivilegeFragment fragment = new PrivilegeFragment();
|
PrivilegeFragment fragment = new PrivilegeFragment();
|
||||||
@ -37,6 +37,7 @@ public class PrivilegeFragment extends BaseFragment implements View.OnClickListe
|
|||||||
ivPrivilege.setOnClickListener(this);
|
ivPrivilege.setOnClickListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (v.getId() == R.id.iv_privilege) {
|
if (v.getId() == R.id.iv_privilege) {
|
||||||
|
@ -45,8 +45,8 @@ public class RecordFragment extends BaseFragment {
|
|||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
TabLayout tabRecord = (TabLayout) findViewById(R.id.tab_record);
|
TabLayout tabRecord = findViewById(R.id.tab_record);
|
||||||
NoSlideViewPager vpRecord = (NoSlideViewPager) findViewById(R.id.vp_record);
|
NoSlideViewPager vpRecord = findViewById(R.id.vp_record);
|
||||||
ArrayList<Fragment> fragments = new ArrayList<>();
|
ArrayList<Fragment> fragments = new ArrayList<>();
|
||||||
// 待提交
|
// 待提交
|
||||||
fragments.add(new StaySubmitFragment());
|
fragments.add(new StaySubmitFragment());
|
||||||
@ -91,4 +91,24 @@ public class RecordFragment extends BaseFragment {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initData() {
|
||||||
|
super.initData();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStop() {
|
||||||
|
super.onStop();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -34,6 +34,7 @@ import com.navinfo.outdoor.util.Base64;
|
|||||||
import com.navinfo.outdoor.util.Md5Util;
|
import com.navinfo.outdoor.util.Md5Util;
|
||||||
import com.navinfo.outdoor.util.RegexUtil;
|
import com.navinfo.outdoor.util.RegexUtil;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
@ -48,16 +49,14 @@ import java.util.Objects;
|
|||||||
* 注册页面
|
* 注册页面
|
||||||
*/
|
*/
|
||||||
public class RegisterFragment extends BaseFragment implements View.OnClickListener {
|
public class RegisterFragment extends BaseFragment implements View.OnClickListener {
|
||||||
private EditText etRegisterPhone;
|
private EditText etRegisterPhone, etRegisterNote, etRegisterPaw, etRegisterConfirmPaw;
|
||||||
private EditText etRegisterNote;
|
|
||||||
private EditText etRegisterPaw;
|
|
||||||
private EditText etRegisterConfirmPaw;
|
|
||||||
private TextView registerGetNote;
|
private TextView registerGetNote;
|
||||||
private String sessionId;
|
private String sessionId;
|
||||||
private CountDownTimer timer;
|
private CountDownTimer timer;
|
||||||
private CheckBox ivRegisterCheck;
|
private CheckBox ivRegisterCheck;
|
||||||
private File logFile;
|
private File logFile;
|
||||||
private StringBuilder registerBuilder;
|
private StringBuilder registerBuilder;
|
||||||
|
private EditText etRegisterReferrer;
|
||||||
|
|
||||||
public static RegisterFragment newInstance(Bundle bundle) {
|
public static RegisterFragment newInstance(Bundle bundle) {
|
||||||
RegisterFragment fragment = new RegisterFragment();
|
RegisterFragment fragment = new RegisterFragment();
|
||||||
@ -79,7 +78,7 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
|
|||||||
etRegisterNote = findViewById(R.id.et_register_note);
|
etRegisterNote = findViewById(R.id.et_register_note);
|
||||||
registerGetNote = findViewById(R.id.register_get_note);
|
registerGetNote = findViewById(R.id.register_get_note);
|
||||||
registerGetNote.setOnClickListener(this);
|
registerGetNote.setOnClickListener(this);
|
||||||
EditText etRegisterReferrer = findViewById(R.id.et_register_referrer);
|
etRegisterReferrer = findViewById(R.id.et_register_referrer);
|
||||||
etRegisterPaw = findViewById(R.id.et_register_paw);
|
etRegisterPaw = findViewById(R.id.et_register_paw);
|
||||||
etRegisterConfirmPaw = findViewById(R.id.et_register_confirm_paw);
|
etRegisterConfirmPaw = findViewById(R.id.et_register_confirm_paw);
|
||||||
ivRegisterCheck = findViewById(R.id.iv_register_check);
|
ivRegisterCheck = findViewById(R.id.iv_register_check);
|
||||||
@ -135,7 +134,7 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
|
|||||||
case R.id.register_get_note:
|
case R.id.register_get_note:
|
||||||
registerBuilder.append(TimestampUtil.time()).append(",").append("点击了获取短信验证码,");
|
registerBuilder.append(TimestampUtil.time()).append(",").append("点击了获取短信验证码,");
|
||||||
if (!RegexUtil.isPhone(etRegisterPhone.getText().toString())) {
|
if (!RegexUtil.isPhone(etRegisterPhone.getText().toString())) {
|
||||||
Toast.makeText(getActivity(), "手机号错误,请重新输入", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "手机号错误,请重新输入");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
initGetNote();
|
initGetNote();
|
||||||
@ -151,7 +150,7 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
|
|||||||
timer.cancel();
|
timer.cancel();
|
||||||
timer = null;
|
timer = null;
|
||||||
}
|
}
|
||||||
Toast.makeText(getActivity(), "请输入手机号", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请输入手机号");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
httpParams.put("mobile", mobile);
|
httpParams.put("mobile", mobile);
|
||||||
@ -172,11 +171,9 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
|
|||||||
if (response.getCode() == 200) {
|
if (response.getCode() == 200) {
|
||||||
sessionId = response.getBody();
|
sessionId = response.getBody();
|
||||||
registerNote();
|
registerNote();
|
||||||
Toast.makeText(getActivity(), "验证码已发送", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "验证码已发送");
|
||||||
} else {
|
} else {
|
||||||
if (response.getMessage() != null) {
|
ToastUtils.Message(getActivity(), response.getMessage());
|
||||||
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,10 +182,10 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.equals("timeout")||message.equals("Read time out")){
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请求超时");
|
||||||
}else {
|
} else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -198,21 +195,21 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
|
|||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
String mobile = etRegisterPhone.getText().toString().trim();
|
String mobile = etRegisterPhone.getText().toString().trim();
|
||||||
if (!RegexUtil.isPhone(mobile)) {
|
if (!RegexUtil.isPhone(mobile)) {
|
||||||
Toast.makeText(getActivity(), "手机号错误", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "手机号错误");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
httpParams.put("mobile", mobile);
|
httpParams.put("mobile", mobile);
|
||||||
}
|
}
|
||||||
String code = etRegisterNote.getText().toString().trim();
|
String code = etRegisterNote.getText().toString().trim();
|
||||||
if (code.equals("")) {
|
if (code.equals("")) {
|
||||||
Toast.makeText(getActivity(), "请获取短信验证码", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请获取短信验证码");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
httpParams.put("code", code);
|
httpParams.put("code", code);
|
||||||
}
|
}
|
||||||
String password = etRegisterPaw.getText().toString().trim();
|
String password = etRegisterPaw.getText().toString().trim();
|
||||||
if (password.equals("")) {
|
if (password.equals("")) {
|
||||||
Toast.makeText(getActivity(), "请输入密码", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请输入密码");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
@ -223,21 +220,21 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
|
|||||||
}
|
}
|
||||||
String conFirmPaw = etRegisterConfirmPaw.getText().toString().trim();
|
String conFirmPaw = etRegisterConfirmPaw.getText().toString().trim();
|
||||||
if (conFirmPaw.equals("")) {
|
if (conFirmPaw.equals("")) {
|
||||||
Toast.makeText(getActivity(), "请输入确认密码", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请输入确认密码");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!conFirmPaw.equals(password)) {
|
if (!conFirmPaw.equals(password)) {
|
||||||
Toast.makeText(getActivity(), "密码和确认密码请保持一致", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "密码和确认密码请保持一致");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (sessionId == null || sessionId.equals("")) {
|
if (sessionId == null || sessionId.equals("")) {
|
||||||
Toast.makeText(getActivity(), "请短信获取验证码", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请短信获取验证码");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
httpParams.put("sessionId", sessionId);
|
httpParams.put("sessionId", sessionId);
|
||||||
}
|
}
|
||||||
if (!ivRegisterCheck.isChecked()) {
|
if (!ivRegisterCheck.isChecked()) {
|
||||||
Toast.makeText(getActivity(), "请先同意用户协议", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请先同意用户协议");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
@ -255,7 +252,7 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
|
|||||||
public void onSuccess(UserBean response, int id) {
|
public void onSuccess(UserBean response, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
if (response.getCode() == 200) {
|
if (response.getCode() == 200) {
|
||||||
Toast.makeText(getActivity(), "注册成功", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "注册成功");
|
||||||
Constant.USER_NAME = mobile;
|
Constant.USER_NAME = mobile;
|
||||||
Constant.PASS_WORD = password;
|
Constant.PASS_WORD = password;
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
@ -264,9 +261,7 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
|
|||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
Objects.requireNonNull(getActivity()).finish();
|
Objects.requireNonNull(getActivity()).finish();
|
||||||
} else {
|
} else {
|
||||||
if (response.getMessage() != null) {
|
ToastUtils.Message(getActivity(), response.getMessage());
|
||||||
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,10 +275,10 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout")||message.contains("Read time out")){
|
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请求超时");
|
||||||
}else {
|
} else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -43,6 +43,7 @@ import com.navinfo.outdoor.base.BaseDrawerFragment;
|
|||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
import com.navinfo.outdoor.util.PreserveUtils;
|
import com.navinfo.outdoor.util.PreserveUtils;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
import com.navinfo.outdoor.util.UploadUtils;
|
import com.navinfo.outdoor.util.UploadUtils;
|
||||||
import com.navinfo.outdoor.bean.OtherUploadPicBean;
|
import com.navinfo.outdoor.bean.OtherUploadPicBean;
|
||||||
import com.navinfo.outdoor.bean.RoadSaveBean;
|
import com.navinfo.outdoor.bean.RoadSaveBean;
|
||||||
@ -337,7 +338,6 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
moveLatlng(latLng, null);
|
moveLatlng(latLng, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
String describe = showPoiEntity.getMemo();//任务描述
|
String describe = showPoiEntity.getMemo();//任务描述
|
||||||
if (describe != null && !describe.equals("")) {
|
if (describe != null && !describe.equals("")) {
|
||||||
@ -385,7 +385,6 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
}
|
}
|
||||||
fmRoadPic.setTag(videoFileList);
|
fmRoadPic.setTag(videoFileList);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//禁用控件
|
//禁用控件
|
||||||
@ -445,7 +444,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
photoAlbumIntent.putExtra("showPoiEntity", showPoiEntity);
|
photoAlbumIntent.putExtra("showPoiEntity", showPoiEntity);
|
||||||
startActivity(photoAlbumIntent);
|
startActivity(photoAlbumIntent);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getContext(), "请拍摄", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请拍摄");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case R.id.tv_pictures:
|
case R.id.tv_pictures:
|
||||||
@ -457,12 +456,12 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
double rearGeometry = GeometryTools.distanceToDouble(startLatLng, rearLatLng);
|
double rearGeometry = GeometryTools.distanceToDouble(startLatLng, rearLatLng);
|
||||||
if (geometry > rearGeometry) {//用戶在终点开始作业
|
if (geometry > rearGeometry) {//用戶在终点开始作业
|
||||||
if (rearGeometry > 5000) {
|
if (rearGeometry > 5000) {
|
||||||
Toast.makeText(getActivity(), "用户距离作业终点五公里以内才能拍摄", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {//用户在起点开始作业
|
} else {//用户在起点开始作业
|
||||||
if (geometry > 5000) {
|
if (geometry > 5000) {
|
||||||
Toast.makeText(getActivity(), "用户距离作业起点五公里以内才能拍摄", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -508,7 +507,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
fileZip.delete();
|
fileZip.delete();
|
||||||
Toast.makeText(getActivity(), "压缩文件失败,请重新提交", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"压缩文件失败,请重新提交");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -518,11 +517,11 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
}).start();
|
}).start();
|
||||||
} else {
|
} else {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
Toast.makeText(getActivity(), "请录像", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请录像");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getContext(), "该任务正在提交中", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "该任务正在提交中");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -538,7 +537,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
PoiEntity poiEntity = initPoiEntityByUI(showPoiEntity);
|
PoiEntity poiEntity = initPoiEntityByUI(showPoiEntity);
|
||||||
PoiCheckResult poiCheckResult = checkPoiEntity(poiEntity);
|
PoiCheckResult poiCheckResult = checkPoiEntity(poiEntity);
|
||||||
if (poiCheckResult.getCode() == 1) {
|
if (poiCheckResult.getCode() == 1) {
|
||||||
Toast.makeText(getActivity(), poiCheckResult.getMsg() + "", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), poiCheckResult.getMsg());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
poiEntity.setTaskStatus(2);
|
poiEntity.setTaskStatus(2);
|
||||||
@ -559,13 +558,13 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "没有申请权限,请手动申请");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onDenied(List<String> permissions, boolean never) {
|
public void onDenied(List<String> permissions, boolean never) {
|
||||||
if (never) {
|
if (never) {
|
||||||
Toast.makeText(getActivity(), "被永久拒绝授权,请手动授予权限", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "被永久拒绝授权,请手动授予权限");
|
||||||
// 如果是被永久拒绝就跳转到应用权限系统设置页面
|
// 如果是被永久拒绝就跳转到应用权限系统设置页面
|
||||||
XXPermissions.startPermissionActivity(Objects.requireNonNull(getActivity()), permissions);
|
XXPermissions.startPermissionActivity(Objects.requireNonNull(getActivity()), permissions);
|
||||||
}
|
}
|
||||||
@ -598,11 +597,11 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
|
|
||||||
private void poiVideoUpload(int body, File fileZip) {
|
private void poiVideoUpload(int body, File fileZip) {
|
||||||
if (body == 0) {
|
if (body == 0) {
|
||||||
Toast.makeText(getActivity(), "请先保存本地上传", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请先保存本地上传");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (fileZip == null) {
|
if (fileZip == null) {
|
||||||
Toast.makeText(getActivity(), "未压缩完成", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "未压缩完成");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
@ -666,26 +665,12 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), roadSaveBean.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), roadSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (roadSaveBean.getCode() == 230) {
|
} else if (roadSaveBean.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), roadSaveBean.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), roadSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -694,24 +679,10 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), "请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -791,7 +762,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
|
|
||||||
private void initEndReceiveTask(String url, PoiEntity poiEntity) {
|
private void initEndReceiveTask(String url, PoiEntity poiEntity) {
|
||||||
if (poiEntity.getTaskId() == 0) {
|
if (poiEntity.getTaskId() == 0) {
|
||||||
Toast.makeText(getActivity(), "无此任务", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "无此任务");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
@ -830,14 +801,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), response.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), response.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -847,23 +811,9 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), "请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -15,12 +15,12 @@ import com.navinfo.outdoor.base.BaseFragment;
|
|||||||
* 记录-已提交-道路任务列表的fragment
|
* 记录-已提交-道路任务列表的fragment
|
||||||
*/
|
*/
|
||||||
public class RoadTaskFragment extends BaseFragment implements View.OnClickListener {
|
public class RoadTaskFragment extends BaseFragment implements View.OnClickListener {
|
||||||
|
|
||||||
public static RoadTaskFragment newInstance(Bundle bundle) {
|
public static RoadTaskFragment newInstance(Bundle bundle) {
|
||||||
RoadTaskFragment fragment = new RoadTaskFragment();
|
RoadTaskFragment fragment = new RoadTaskFragment();
|
||||||
fragment.setArguments(bundle);
|
fragment.setArguments(bundle);
|
||||||
return fragment;
|
return fragment;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayout() {
|
protected int getLayout() {
|
||||||
return R.layout.fragment_road_task;
|
return R.layout.fragment_road_task;
|
||||||
@ -40,4 +40,5 @@ public class RoadTaskFragment extends BaseFragment implements View.OnClickListen
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -36,7 +36,8 @@ public class SetFragment extends BaseFragment implements View.OnClickListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initData() {
|
protected void initData() {
|
||||||
super.initData(); }
|
super.initData();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
@ -93,4 +94,19 @@ public class SetFragment extends BaseFragment implements View.OnClickListener {
|
|||||||
Objects.requireNonNull(getActivity()).finish();
|
Objects.requireNonNull(getActivity()).finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStop() {
|
||||||
|
super.onStop();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,6 +43,7 @@ import com.navinfo.outdoor.util.FlushTokenUtil;
|
|||||||
import com.navinfo.outdoor.util.PoiEntityDeleteUtil;
|
import com.navinfo.outdoor.util.PoiEntityDeleteUtil;
|
||||||
import com.navinfo.outdoor.util.PoiSaveUtils;
|
import com.navinfo.outdoor.util.PoiSaveUtils;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
import com.umeng.umcrash.UMCrash;
|
import com.umeng.umcrash.UMCrash;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
@ -61,13 +62,12 @@ import java.util.Objects;
|
|||||||
*/
|
*/
|
||||||
public class StaySubmitFragment extends BaseFragment implements View.OnClickListener {
|
public class StaySubmitFragment extends BaseFragment implements View.OnClickListener {
|
||||||
private StaySubmitAdapter staySubmitAdapter;
|
private StaySubmitAdapter staySubmitAdapter;
|
||||||
private TextView tvStayType;
|
private TextView tvStayType,tvNumber;
|
||||||
private List<PoiEntity> roadEntities;
|
private List<PoiEntity> roadEntities;
|
||||||
private ArrayList<PoiEntity> poiEntities;
|
private ArrayList<PoiEntity> poiEntities;
|
||||||
private CheckBox cbSelect;
|
private CheckBox cbSelect;
|
||||||
private File logFile;
|
private File logFile;
|
||||||
private StringBuilder staySubmitBuilder;
|
private StringBuilder staySubmitBuilder;
|
||||||
private TextView tvNumber;
|
|
||||||
|
|
||||||
public static StaySubmitFragment newInstance(Bundle bundle) {
|
public static StaySubmitFragment newInstance(Bundle bundle) {
|
||||||
StaySubmitFragment fragment = new StaySubmitFragment();
|
StaySubmitFragment fragment = new StaySubmitFragment();
|
||||||
@ -116,7 +116,6 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
|||||||
subObtain.what = Constant.EVENT_WORK_HOME;
|
subObtain.what = Constant.EVENT_WORK_HOME;
|
||||||
subObtain.obj = true;
|
subObtain.obj = true;
|
||||||
EventBus.getDefault().post(subObtain);
|
EventBus.getDefault().post(subObtain);
|
||||||
|
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.EVENT_WHAT_COMPLETE_TASK;
|
obtain.what = Constant.EVENT_WHAT_COMPLETE_TASK;
|
||||||
obtain.obj = poiEntity;
|
obtain.obj = poiEntity;
|
||||||
@ -132,7 +131,8 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
|||||||
staySubmitAdapter.setAllDataChecked(isChecked);
|
staySubmitAdapter.setAllDataChecked(isChecked);
|
||||||
staySubmitAdapter.notifyDataSetChanged();
|
staySubmitAdapter.notifyDataSetChanged();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getContext(), "有正在提交的数据,等提交成功后,方可操作", Toast.LENGTH_SHORT).show();
|
cbSelect.setChecked(false);
|
||||||
|
ToastUtils.Message(getActivity(), "有正在提交的数据,等提交成功后,方可操作");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -252,11 +252,11 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "无法读取数据库,请尝试重启程序!", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "无法读取数据库,请尝试重启程序!");
|
||||||
UMCrash.generateCustomLog("无法读取数据库", "自定义");
|
UMCrash.generateCustomLog("无法读取数据库", "自定义");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "数据库创建失败,请关闭程序重新进入", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "数据库创建失败,请关闭程序重新进入");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,7 +307,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getContext(), "有正在提交的数据,等提交成功后,方可操作", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "有正在提交的数据,等提交成功后,方可操作");
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -330,10 +330,10 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
|||||||
staySubmitAdapter.setUpdateWork();
|
staySubmitAdapter.setUpdateWork();
|
||||||
PoiSaveUtils.getInstance(getActivity()).uploadPoiEntityBatch(poiEntities);
|
PoiSaveUtils.getInstance(getActivity()).uploadPoiEntityBatch(poiEntities);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "请选择要提交的数据", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请选择要提交的数据");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getContext(), "有正在提交的数据,等提交成功后,方可操作", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "有正在提交的数据,等提交成功后,方可操作");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -391,7 +391,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), response.getMessage() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -400,10 +400,10 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请求超时");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -436,7 +436,11 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (Constant.USHERED != null) {
|
if (Constant.USHERED != null) {
|
||||||
staySubmitBuilder.append("refreshData - userId:").append(Constant.USHERED).append(" path:").append(PoiDatabase.getDbName).append(",");
|
staySubmitBuilder.append("refreshData - userId:")
|
||||||
|
.append(Constant.USHERED)
|
||||||
|
.append(" path:")
|
||||||
|
.append(PoiDatabase.getDbName)
|
||||||
|
.append(",");
|
||||||
}
|
}
|
||||||
roadEntities.clear();
|
roadEntities.clear();
|
||||||
roadEntities.addAll(roadAll);
|
roadEntities.addAll(roadAll);
|
||||||
@ -454,11 +458,11 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "无法读取数据库,请尝试重启程序!", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "无法读取数据库,请尝试重启程序!");
|
||||||
UMCrash.generateCustomLog("无法读取数据库", "自定义");
|
UMCrash.generateCustomLog("无法读取数据库", "自定义");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "数据库创建失败,请关闭程序重新进入", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "数据库创建失败,请关闭程序重新进入");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,5 @@ public class TaskExWebFragment extends BaseFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) { }
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -30,6 +30,7 @@ import com.jcodecraeer.xrecyclerview.ProgressStyle;
|
|||||||
import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
@ -46,13 +47,11 @@ import java.util.Objects;
|
|||||||
*/
|
*/
|
||||||
public class TaskExplainFragment extends BaseFragment implements View.OnClickListener {
|
public class TaskExplainFragment extends BaseFragment implements View.OnClickListener {
|
||||||
private XRecyclerView taskExplainRecycle;
|
private XRecyclerView taskExplainRecycle;
|
||||||
|
|
||||||
private TaskExplainAdapter taskExplainAdapter;
|
private TaskExplainAdapter taskExplainAdapter;
|
||||||
private int taskPage = 1;
|
|
||||||
private List<TaskPrefectureBean.BodyBean.ListBean> explainList;
|
private List<TaskPrefectureBean.BodyBean.ListBean> explainList;
|
||||||
private File logFile;
|
private File logFile;
|
||||||
private StringBuilder taskExplainBuilder;
|
private StringBuilder taskExplainBuilder;
|
||||||
|
private int taskPage = 1;
|
||||||
|
|
||||||
public static TaskExplainFragment newInstance(Bundle bundle) {
|
public static TaskExplainFragment newInstance(Bundle bundle) {
|
||||||
TaskExplainFragment fragment = new TaskExplainFragment();
|
TaskExplainFragment fragment = new TaskExplainFragment();
|
||||||
@ -160,7 +159,7 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), response.getMessage() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,10 +168,10 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请求超时" );
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), message );
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onError: " + e.getMessage());
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
}
|
}
|
||||||
@ -186,7 +185,7 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
|
|||||||
explainList.clear();
|
explainList.clear();
|
||||||
}
|
}
|
||||||
if (taskPrefectureBean.getBody().getList() == null) {
|
if (taskPrefectureBean.getBody().getList() == null) {
|
||||||
Toast.makeText(getActivity(), "没有相关数据", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "没有相关数据" );
|
||||||
} else {
|
} else {
|
||||||
explainList.addAll(taskPrefectureBean.getBody().getList());
|
explainList.addAll(taskPrefectureBean.getBody().getList());
|
||||||
taskPage++;
|
taskPage++;
|
||||||
@ -205,7 +204,7 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), taskPrefectureBean.getMessage(), Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), taskPrefectureBean.getMessage() );
|
||||||
Log.d("TAG", "" + taskPrefectureBean.getMessage());
|
Log.d("TAG", "" + taskPrefectureBean.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -237,4 +236,5 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
|
|||||||
taskExplainBuilder.append("\r\n");
|
taskExplainBuilder.append("\r\n");
|
||||||
FileUtils.writeFile(logFile.getAbsolutePath(), taskExplainBuilder.toString(), true);
|
FileUtils.writeFile(logFile.getAbsolutePath(), taskExplainBuilder.toString(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@ import com.jcodecraeer.xrecyclerview.ProgressStyle;
|
|||||||
import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
@ -67,7 +68,6 @@ public class TaskExplainFragment2 extends BaseFragment implements View.OnClickLi
|
|||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
|
|
||||||
ImageView ivTaskExplain2 = findViewById(R.id.iv_task_explain2_finish);
|
ImageView ivTaskExplain2 = findViewById(R.id.iv_task_explain2_finish);
|
||||||
taskExplain2Recycler = findViewById(R.id.task_explain2_recycler);
|
taskExplain2Recycler = findViewById(R.id.task_explain2_recycler);
|
||||||
ivTaskExplain2.setOnClickListener(this);
|
ivTaskExplain2.setOnClickListener(this);
|
||||||
@ -158,7 +158,7 @@ public class TaskExplainFragment2 extends BaseFragment implements View.OnClickLi
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), response.getMessage() );
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onSuccess: " + response.getMessage() + "");
|
Log.d("TAG", "onSuccess: " + response.getMessage() + "");
|
||||||
}
|
}
|
||||||
@ -168,10 +168,10 @@ public class TaskExplainFragment2 extends BaseFragment implements View.OnClickLi
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -184,7 +184,7 @@ public class TaskExplainFragment2 extends BaseFragment implements View.OnClickLi
|
|||||||
explainList.clear();
|
explainList.clear();
|
||||||
}
|
}
|
||||||
if (taskPrefectureBean.getBody().getList() == null) {
|
if (taskPrefectureBean.getBody().getList() == null) {
|
||||||
Toast.makeText(getActivity(), "没有相关数据", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"没有相关数据");
|
||||||
} else {
|
} else {
|
||||||
explainList.addAll(taskPrefectureBean.getBody().getList());
|
explainList.addAll(taskPrefectureBean.getBody().getList());
|
||||||
taskExplainPage++;
|
taskExplainPage++;
|
||||||
@ -202,7 +202,7 @@ public class TaskExplainFragment2 extends BaseFragment implements View.OnClickLi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), taskPrefectureBean.getMessage(), Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),taskPrefectureBean.getMessage());
|
||||||
Log.d("TAG", "" + taskPrefectureBean.getMessage());
|
Log.d("TAG", "" + taskPrefectureBean.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -234,4 +234,5 @@ public class TaskExplainFragment2 extends BaseFragment implements View.OnClickLi
|
|||||||
taskExplain2Builder.append("\r\n");
|
taskExplain2Builder.append("\r\n");
|
||||||
FileUtils.writeFile(logFile.getAbsolutePath(), taskExplain2Builder.toString(), true);
|
FileUtils.writeFile(logFile.getAbsolutePath(), taskExplain2Builder.toString(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -30,6 +30,7 @@ import com.jcodecraeer.xrecyclerview.ProgressStyle;
|
|||||||
import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
@ -46,7 +47,6 @@ import java.util.Objects;
|
|||||||
* 发现-任务专区
|
* 发现-任务专区
|
||||||
*/
|
*/
|
||||||
public class TaskPrefectureFragment extends BaseFragment implements View.OnClickListener {
|
public class TaskPrefectureFragment extends BaseFragment implements View.OnClickListener {
|
||||||
|
|
||||||
private XRecyclerView taskRecycler;
|
private XRecyclerView taskRecycler;
|
||||||
private List<TaskPrefectureBean.BodyBean.ListBean> dataBeanList;
|
private List<TaskPrefectureBean.BodyBean.ListBean> dataBeanList;
|
||||||
private TaskPrefectureAdapter taskPrefectureAdapter;
|
private TaskPrefectureAdapter taskPrefectureAdapter;
|
||||||
@ -54,7 +54,6 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
|
|||||||
private File logFile;
|
private File logFile;
|
||||||
private StringBuilder taskPrefectureBuilder;
|
private StringBuilder taskPrefectureBuilder;
|
||||||
|
|
||||||
|
|
||||||
public static TaskPrefectureFragment newInstance(Bundle bundle) {
|
public static TaskPrefectureFragment newInstance(Bundle bundle) {
|
||||||
TaskPrefectureFragment fragment = new TaskPrefectureFragment();
|
TaskPrefectureFragment fragment = new TaskPrefectureFragment();
|
||||||
fragment.setArguments(bundle);
|
fragment.setArguments(bundle);
|
||||||
@ -148,16 +147,15 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
initTaskPrefectureBean(taskPrefectureBean, aNet);
|
initTaskPrefectureBean(taskPrefectureBean, aNet);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable e, int id) {
|
public void onError(Throwable e, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -170,7 +168,7 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
|
|||||||
dataBeanList.clear();
|
dataBeanList.clear();
|
||||||
}
|
}
|
||||||
if (taskPrefectureBean.getBody().getList() == null) {
|
if (taskPrefectureBean.getBody().getList() == null) {
|
||||||
Toast.makeText(getActivity(), "没有相关数据", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"没有相关数据");
|
||||||
} else {
|
} else {
|
||||||
dataBeanList.addAll(taskPrefectureBean.getBody().getList());
|
dataBeanList.addAll(taskPrefectureBean.getBody().getList());
|
||||||
taskPage++;
|
taskPage++;
|
||||||
@ -190,7 +188,7 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
|
|||||||
} else if (taskPrefectureBean.getCode() == 230) {
|
} else if (taskPrefectureBean.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), taskPrefectureBean.getMessage(), Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),taskPrefectureBean.getMessage());
|
||||||
Log.d("TAG", "" + taskPrefectureBean.getMessage());
|
Log.d("TAG", "" + taskPrefectureBean.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,8 +24,6 @@ import android.widget.CompoundButton;
|
|||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
@ -34,7 +32,6 @@ import androidx.fragment.app.FragmentTransaction;
|
|||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.github.lazylibrary.util.DensityUtil;
|
import com.github.lazylibrary.util.DensityUtil;
|
||||||
import com.github.lazylibrary.util.FileUtils;
|
import com.github.lazylibrary.util.FileUtils;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
@ -52,13 +49,17 @@ import com.lzy.okgo.model.HttpParams;
|
|||||||
import com.lzy.okgo.model.Progress;
|
import com.lzy.okgo.model.Progress;
|
||||||
import com.navinfo.outdoor.R;
|
import com.navinfo.outdoor.R;
|
||||||
import com.navinfo.outdoor.activity.FragmentManagement;
|
import com.navinfo.outdoor.activity.FragmentManagement;
|
||||||
|
import com.navinfo.outdoor.activity.HomeActivity;
|
||||||
|
import com.navinfo.outdoor.activity.WebActivity;
|
||||||
import com.navinfo.outdoor.adapter.MarkerAdapter;
|
import com.navinfo.outdoor.adapter.MarkerAdapter;
|
||||||
import com.navinfo.outdoor.api.Constant;
|
import com.navinfo.outdoor.api.Constant;
|
||||||
|
import com.navinfo.outdoor.api.UserApplication;
|
||||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||||
import com.navinfo.outdoor.base.BaseFragment;
|
import com.navinfo.outdoor.base.BaseFragment;
|
||||||
import com.navinfo.outdoor.bean.GetPhoneBean;
|
import com.navinfo.outdoor.bean.GetPhoneBean;
|
||||||
import com.navinfo.outdoor.bean.JobSearchBean;
|
import com.navinfo.outdoor.bean.JobSearchBean;
|
||||||
import com.navinfo.outdoor.bean.MessageNoticeBean;
|
import com.navinfo.outdoor.bean.MessageNoticeBean;
|
||||||
|
import com.navinfo.outdoor.bean.NotificationBean;
|
||||||
import com.navinfo.outdoor.bean.UserBean;
|
import com.navinfo.outdoor.bean.UserBean;
|
||||||
import com.navinfo.outdoor.http.Callback;
|
import com.navinfo.outdoor.http.Callback;
|
||||||
import com.navinfo.outdoor.http.HttpInterface;
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
@ -68,14 +69,13 @@ import com.navinfo.outdoor.room.ChargingPileEntity;
|
|||||||
import com.navinfo.outdoor.room.PoiDatabase;
|
import com.navinfo.outdoor.room.PoiDatabase;
|
||||||
import com.navinfo.outdoor.room.PoiEntity;
|
import com.navinfo.outdoor.room.PoiEntity;
|
||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
import com.navinfo.outdoor.util.GPSUtils;
|
|
||||||
import com.navinfo.outdoor.util.Geohash;
|
import com.navinfo.outdoor.util.Geohash;
|
||||||
import com.navinfo.outdoor.util.GeometryTools;
|
import com.navinfo.outdoor.util.GeometryTools;
|
||||||
import com.navinfo.outdoor.util.MapManager;
|
import com.navinfo.outdoor.util.MapManager;
|
||||||
import com.navinfo.outdoor.util.MyTecentLocationSource;
|
import com.navinfo.outdoor.util.MyTecentLocationSource;
|
||||||
import com.navinfo.outdoor.util.NetWorkUtils;
|
import com.navinfo.outdoor.util.NetWorkUtils;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
import com.navinfo.outdoor.util.ToastUtil;
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
import com.sothree.slidinguppanel.ScrollableViewHelper;
|
import com.sothree.slidinguppanel.ScrollableViewHelper;
|
||||||
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
|
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
|
||||||
import com.tencent.map.geolocation.TencentLocation;
|
import com.tencent.map.geolocation.TencentLocation;
|
||||||
@ -97,6 +97,8 @@ import com.tencent.tencentmap.mapsdk.maps.model.Polygon;
|
|||||||
import com.tencent.tencentmap.mapsdk.maps.model.PolygonOptions;
|
import com.tencent.tencentmap.mapsdk.maps.model.PolygonOptions;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.Polyline;
|
import com.tencent.tencentmap.mapsdk.maps.model.Polyline;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.PolylineOptions;
|
import com.tencent.tencentmap.mapsdk.maps.model.PolylineOptions;
|
||||||
|
import com.umeng.message.UmengNotificationClickHandler;
|
||||||
|
import com.umeng.message.entity.UMessage;
|
||||||
import com.vividsolutions.jts.geom.Geometry;
|
import com.vividsolutions.jts.geom.Geometry;
|
||||||
import com.vividsolutions.jts.geom.MultiPoint;
|
import com.vividsolutions.jts.geom.MultiPoint;
|
||||||
import com.vividsolutions.jts.geom.Point;
|
import com.vividsolutions.jts.geom.Point;
|
||||||
@ -164,7 +166,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
TextView tvGps;
|
|
||||||
private TextView tvTenantGaps;
|
private TextView tvTenantGaps;
|
||||||
|
|
||||||
public static TreasureFragment newInstance(Bundle bundle) {
|
public static TreasureFragment newInstance(Bundle bundle) {
|
||||||
@ -196,7 +197,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
ivSubmit.setOnClickListener(this);
|
ivSubmit.setOnClickListener(this);
|
||||||
ivMessage = findViewById(R.id.iv_message);
|
ivMessage = findViewById(R.id.iv_message);
|
||||||
ivMessage.setOnClickListener(this);
|
ivMessage.setOnClickListener(this);
|
||||||
tvGps = findViewById(R.id.tv_GPS);
|
TextView tvGps = findViewById(R.id.tv_GPS);
|
||||||
tvTenantGaps = findViewById(R.id.tv_tencent_GPS);
|
tvTenantGaps = findViewById(R.id.tv_tencent_GPS);
|
||||||
mapView = findViewById(R.id.treasure_map);
|
mapView = findViewById(R.id.treasure_map);
|
||||||
tencentMap = mapView.getMap();
|
tencentMap = mapView.getMap();
|
||||||
@ -244,10 +245,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
removables = new ArrayList<>();//存储网络数据的marker数据(线,面,点)
|
removables = new ArrayList<>();//存储网络数据的marker数据(线,面,点)
|
||||||
removablesLocality = new ArrayList<>();//存储本地的marker数据(线,面,点)
|
removablesLocality = new ArrayList<>();//存储本地的marker数据(线,面,点)
|
||||||
removableScreenMarker = new ArrayList<>();//存储点击屏幕上的marker的marker数据(线,面,点)
|
removableScreenMarker = new ArrayList<>();//存储点击屏幕上的marker的marker数据(线,面,点)
|
||||||
//key wkt value :存储的数据类型
|
removableHashMap = new HashMap<>();//key wkt value :存储的数据类型
|
||||||
removableHashMap = new HashMap<>();
|
latList = new ArrayList<>();//存储的多点latlng
|
||||||
//存储的多点latlng
|
|
||||||
latList = new ArrayList<>();
|
|
||||||
tencentMap.addOnMapLoadedCallback(new TencentMap.OnMapLoadedCallback() {
|
tencentMap.addOnMapLoadedCallback(new TencentMap.OnMapLoadedCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onMapLoaded() {
|
public void onMapLoaded() {
|
||||||
@ -269,6 +268,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
iniUserLocation();
|
iniUserLocation();
|
||||||
//得到电话区号,电话位数
|
//得到电话区号,电话位数
|
||||||
initPhone();
|
initPhone();
|
||||||
|
//跳转到消息页面
|
||||||
|
initUM();
|
||||||
//检查是否有没有填完的页面
|
//检查是否有没有填完的页面
|
||||||
initSharePre();
|
initSharePre();
|
||||||
}
|
}
|
||||||
@ -282,7 +283,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
|
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
Toast.makeText(getActivity(), "请先开启位置信息,在重新打开程序", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "请先开启位置信息,在重新打开程序");
|
||||||
getActivity().finish();
|
getActivity().finish();
|
||||||
}
|
}
|
||||||
Constant.markerClickListener = markerClickListener;
|
Constant.markerClickListener = markerClickListener;
|
||||||
@ -291,6 +292,25 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initUM() {
|
||||||
|
if (Constant.NOTIFICATION!=null){
|
||||||
|
NotificationBean notificationBean = new Gson().fromJson(Constant.NOTIFICATION, NotificationBean.class);
|
||||||
|
NotificationBean.ExtraBean extra = notificationBean.getExtra();
|
||||||
|
if (extra!=null){
|
||||||
|
HashMap<String, String> paramMap = new HashMap<>();
|
||||||
|
paramMap.put("id", extra.getId()+ "");
|
||||||
|
Intent intent = new Intent(getActivity(), WebActivity.class);
|
||||||
|
intent.putExtra("map", paramMap);
|
||||||
|
intent.putExtra("url", HttpInterface.MSG_CONTENT);
|
||||||
|
startActivity(intent);
|
||||||
|
}else {
|
||||||
|
Intent messageIntent = new Intent(getActivity(), FragmentManagement.class);
|
||||||
|
messageIntent.putExtra("tag", 35);
|
||||||
|
startActivity(messageIntent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 刷新筛选界面数据
|
* 刷新筛选界面数据
|
||||||
*/
|
*/
|
||||||
@ -329,7 +349,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
if (Constant.currentLocation != null) {
|
if (Constant.currentLocation != null) {
|
||||||
initList(Constant.currentLocation); // 刷新筛选的网络数据
|
initList(Constant.currentLocation); // 刷新筛选的网络数据
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "未开启定位服务", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "未开启定位服务");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -348,8 +369,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
if (date == null)
|
if (date == null) {
|
||||||
return "";
|
return "";
|
||||||
|
}
|
||||||
System.out.println("front:" + format.format(date)); //显示输入的日期
|
System.out.println("front:" + format.format(date)); //显示输入的日期
|
||||||
Calendar cal = Calendar.getInstance();
|
Calendar cal = Calendar.getInstance();
|
||||||
cal.setTime(date);
|
cal.setTime(date);
|
||||||
@ -394,14 +416,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
} else if (messageNoticeBean.getCode() == 230) {
|
} else if (messageNoticeBean.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), messageNoticeBean.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), messageNoticeBean.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -411,23 +426,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), "请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onError: " + e.getMessage());
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
}
|
}
|
||||||
@ -438,7 +439,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
private void initPhone() {
|
private void initPhone() {
|
||||||
String encode = Geohash.getInstance().encode(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
|
String encode = Geohash.getInstance().encode(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
|
||||||
if (encode == null) {
|
if (encode == null) {
|
||||||
Toast.makeText(getActivity(), "没有确定经纬度", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "没有确定经纬度");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
@ -465,14 +466,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
} else if (getPhoneBean.getCode() == 230) {
|
} else if (getPhoneBean.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), getPhoneBean.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), getPhoneBean.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -481,24 +475,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), "请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onError: " + e.getMessage());
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
}
|
}
|
||||||
@ -533,13 +513,16 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
private void iniUserLocation() {
|
private void iniUserLocation() {
|
||||||
String encode = Geohash.getInstance().encode(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
|
String encode = Geohash.getInstance().encode(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
|
||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
httpParams.put("geom", encode);
|
if (encode != null) {
|
||||||
|
httpParams.put("geom", encode);
|
||||||
|
}
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
httpParams.put("datetime", time);
|
if (time != 0) {
|
||||||
/* httpParams.put("appkey",Constant.UM_APP_KEY);
|
httpParams.put("datetime", time);
|
||||||
if (Constant.DEVICE_TOKEN!=null){
|
}
|
||||||
httpParams.put("device_tokens", Constant.DEVICE_TOKEN);
|
if (Constant.DEVICE_TOKEN != null) {
|
||||||
}*/
|
httpParams.put("deviceTokens", Constant.DEVICE_TOKEN);
|
||||||
|
}
|
||||||
OkGoBuilder okGoBuilder = OkGoBuilder
|
OkGoBuilder okGoBuilder = OkGoBuilder
|
||||||
.getInstance()
|
.getInstance()
|
||||||
.Builder(getActivity())
|
.Builder(getActivity())
|
||||||
@ -553,25 +536,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
public void onSuccess(UserBean response, int id) {
|
public void onSuccess(UserBean response, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
if (response.getCode() == 200) {//上传用户位置金纬度 寻宝删选接口请求成功
|
if (response.getCode() == 200) {//上传用户位置金纬度 寻宝删选接口请求成功
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), response.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), response.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -585,24 +554,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), "请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -610,7 +565,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 网络删选接口
|
* 网络删选接口
|
||||||
*
|
|
||||||
* @param tencentLocation location
|
* @param tencentLocation location
|
||||||
*/
|
*/
|
||||||
private void initList(TencentLocation tencentLocation) {
|
private void initList(TencentLocation tencentLocation) {
|
||||||
@ -751,14 +705,16 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
.anchor(0.5f, 1.0f)
|
.anchor(0.5f, 1.0f)
|
||||||
.flat(true)
|
.flat(true)
|
||||||
.clockwise(false));
|
.clockwise(false));
|
||||||
if (listBean != null) {
|
if (poiMarker != null) {
|
||||||
poiMarker.setTag(listBean);
|
if (listBean != null) {
|
||||||
|
poiMarker.setTag(listBean);
|
||||||
|
}
|
||||||
|
poiMarker.setZIndex(MARKER_DOT);
|
||||||
|
removables.add(poiMarker);
|
||||||
|
String poiGeo = initGeo(latLng);
|
||||||
|
geoMarker(poiGeo, poiMarker);
|
||||||
|
poiMarker.setClickable(true);
|
||||||
}
|
}
|
||||||
poiMarker.setZIndex(MARKER_DOT);
|
|
||||||
removables.add(poiMarker);
|
|
||||||
String poiGeo = initGeo(latLng);
|
|
||||||
geoMarker(poiGeo, poiMarker);
|
|
||||||
poiMarker.setClickable(true);
|
|
||||||
break;
|
break;
|
||||||
case 2://充电站
|
case 2://充电站
|
||||||
BitmapDescriptor chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge);
|
BitmapDescriptor chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge);
|
||||||
@ -767,14 +723,16 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
.anchor(0.5f, 1.0f)
|
.anchor(0.5f, 1.0f)
|
||||||
.flat(true)
|
.flat(true)
|
||||||
.clockwise(false));
|
.clockwise(false));
|
||||||
if (listBean != null) {
|
if (stationMarker != null) {
|
||||||
stationMarker.setTag(listBean);
|
if (listBean != null) {
|
||||||
|
stationMarker.setTag(listBean);
|
||||||
|
}
|
||||||
|
stationMarker.setZIndex(MARKER_DOT);
|
||||||
|
removables.add(stationMarker);
|
||||||
|
String stationGeo = initGeo(latLng);
|
||||||
|
geoMarker(stationGeo, stationMarker);
|
||||||
|
stationMarker.setClickable(true);
|
||||||
}
|
}
|
||||||
stationMarker.setZIndex(MARKER_DOT);
|
|
||||||
removables.add(stationMarker);
|
|
||||||
String stationGeo = initGeo(latLng);
|
|
||||||
geoMarker(stationGeo, stationMarker);
|
|
||||||
stationMarker.setClickable(true);
|
|
||||||
break;
|
break;
|
||||||
case 3://poi录像
|
case 3://poi录像
|
||||||
BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video);
|
BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video);
|
||||||
@ -783,14 +741,16 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
.anchor(0.5f, 1.0f)
|
.anchor(0.5f, 1.0f)
|
||||||
.flat(true)
|
.flat(true)
|
||||||
.clockwise(false));
|
.clockwise(false));
|
||||||
if (listBean != null) {
|
if (poiVideoMarker != null) {
|
||||||
poiVideoMarker.setTag(listBean);
|
if (listBean != null) {
|
||||||
|
poiVideoMarker.setTag(listBean);
|
||||||
|
}
|
||||||
|
poiVideoMarker.setZIndex(MARKER_DOT);
|
||||||
|
removables.add(poiVideoMarker);
|
||||||
|
String poiVideoGeo = initGeo(latLng);
|
||||||
|
geoMarker(poiVideoGeo, poiVideoMarker);
|
||||||
|
poiVideoMarker.setClickable(true);
|
||||||
}
|
}
|
||||||
poiVideoMarker.setZIndex(MARKER_DOT);
|
|
||||||
removables.add(poiVideoMarker);
|
|
||||||
String poiVideoGeo = initGeo(latLng);
|
|
||||||
geoMarker(poiVideoGeo, poiVideoMarker);
|
|
||||||
poiVideoMarker.setClickable(true);
|
|
||||||
break;
|
break;
|
||||||
case 4://道路录像
|
case 4://道路录像
|
||||||
BitmapDescriptor roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road);
|
BitmapDescriptor roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road);
|
||||||
@ -799,14 +759,16 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
.anchor(0.5f, 1.0f)
|
.anchor(0.5f, 1.0f)
|
||||||
.flat(true)
|
.flat(true)
|
||||||
.clockwise(false));
|
.clockwise(false));
|
||||||
if (listBean != null) {
|
if (roadMarker != null) {
|
||||||
roadMarker.setTag(listBean);
|
if (listBean != null) {
|
||||||
|
roadMarker.setTag(listBean);
|
||||||
|
}
|
||||||
|
roadMarker.setZIndex(MARKER_DOT);
|
||||||
|
removables.add(roadMarker);
|
||||||
|
String roadGeo = initGeo(latLng);
|
||||||
|
geoMarker(roadGeo, roadMarker);
|
||||||
|
roadMarker.setClickable(true);
|
||||||
}
|
}
|
||||||
roadMarker.setZIndex(MARKER_DOT);
|
|
||||||
removables.add(roadMarker);
|
|
||||||
String roadGeo = initGeo(latLng);
|
|
||||||
geoMarker(roadGeo, roadMarker);
|
|
||||||
roadMarker.setClickable(true);
|
|
||||||
break;
|
break;
|
||||||
case 5://其他
|
case 5://其他
|
||||||
BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other);
|
BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other);
|
||||||
@ -815,14 +777,16 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
.anchor(0.5f, 1.0f)
|
.anchor(0.5f, 1.0f)
|
||||||
.flat(true)
|
.flat(true)
|
||||||
.clockwise(false));
|
.clockwise(false));
|
||||||
if (listBean != null) {
|
if (otherMarker != null) {
|
||||||
otherMarker.setTag(listBean);
|
if (listBean != null) {
|
||||||
|
otherMarker.setTag(listBean);
|
||||||
|
}
|
||||||
|
otherMarker.setZIndex(MARKER_DOT);
|
||||||
|
removables.add(otherMarker);
|
||||||
|
String otherGeo = initGeo(latLng);
|
||||||
|
geoMarker(otherGeo, otherMarker);
|
||||||
|
otherMarker.setClickable(true);
|
||||||
}
|
}
|
||||||
otherMarker.setZIndex(MARKER_DOT);
|
|
||||||
removables.add(otherMarker);
|
|
||||||
String otherGeo = initGeo(latLng);
|
|
||||||
geoMarker(otherGeo, otherMarker);
|
|
||||||
otherMarker.setClickable(true);
|
|
||||||
break;
|
break;
|
||||||
case 6://面状任务
|
case 6://面状任务
|
||||||
BitmapDescriptor Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_facet);
|
BitmapDescriptor Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_facet);
|
||||||
@ -831,14 +795,16 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
.anchor(0.5f, 1.0f)
|
.anchor(0.5f, 1.0f)
|
||||||
.flat(true)
|
.flat(true)
|
||||||
.clockwise(false));
|
.clockwise(false));
|
||||||
if (listBean != null) {
|
if (planarMarker != null) {
|
||||||
planarMarker.setTag(listBean);
|
if (listBean != null) {
|
||||||
|
planarMarker.setTag(listBean);
|
||||||
|
}
|
||||||
|
planarMarker.setZIndex(MARKER_DOT);
|
||||||
|
removables.add(planarMarker);
|
||||||
|
String planarGeo = initGeo(latLng);
|
||||||
|
geoMarker(planarGeo, planarMarker);
|
||||||
|
planarMarker.setClickable(true);
|
||||||
}
|
}
|
||||||
planarMarker.setZIndex(MARKER_DOT);
|
|
||||||
removables.add(planarMarker);
|
|
||||||
String planarGeo = initGeo(latLng);
|
|
||||||
geoMarker(planarGeo, planarMarker);
|
|
||||||
planarMarker.setClickable(true);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -856,14 +822,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), response.getMessage());
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), response.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -872,24 +831,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), "请求超时");
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
ToastUtils.Message(getActivity(), message);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -897,7 +842,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* geo 坐标点转成
|
* geo 坐标点转成
|
||||||
*
|
|
||||||
* @param latLng lat
|
* @param latLng lat
|
||||||
*/
|
*/
|
||||||
public String initGeo(LatLng latLng) {
|
public String initGeo(LatLng latLng) {
|
||||||
@ -919,7 +863,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* marker 选中的状态
|
* marker 选中的状态
|
||||||
*
|
|
||||||
* @param poiEntity PoiEntity
|
* @param poiEntity PoiEntity
|
||||||
* @param aBoolean boolean
|
* @param aBoolean boolean
|
||||||
*/
|
*/
|
||||||
@ -1736,7 +1679,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
0));//目标旋转角 0~360° (正北方为0)
|
0));//目标旋转角 0~360° (正北方为0)
|
||||||
tencentMap.animateCamera(cameraSigma);
|
tencentMap.animateCamera(cameraSigma);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "无定位", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "无定位");
|
||||||
checkNetWork();
|
checkNetWork();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1769,7 +1712,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
private void initSubmit() {
|
private void initSubmit() {
|
||||||
debounce(ivSubmit);
|
debounce(ivSubmit);
|
||||||
if (upload == null) {
|
if (upload == null) {
|
||||||
Toast.makeText(getActivity(), "访问未授权", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "访问未授权");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//分享
|
//分享
|
||||||
@ -1802,7 +1745,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
PoiEntity poiEntity = new PoiEntity();
|
PoiEntity poiEntity = new PoiEntity();
|
||||||
// 上报时以当前用户位置为准
|
// 上报时以当前用户位置为准
|
||||||
if (Constant.currentLocation == null) {
|
if (Constant.currentLocation == null) {
|
||||||
ToastUtil.showShort(getContext(), "无法获取当前位置,请检查GPS是否打开!");
|
ToastUtils.Message(getActivity(), "无法获取当前位置,请检查GPS是否打开!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LatLng newPoiLatLng = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
|
LatLng newPoiLatLng = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
|
||||||
@ -1894,7 +1837,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
checkMyLocation();
|
checkMyLocation();
|
||||||
} else { // 当前网络不可用
|
} else { // 当前网络不可用
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
Toast.makeText(getActivity(), Constant.NETWORK_UNAVAILABLE, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), Constant.NETWORK_UNAVAILABLE + "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1921,7 +1864,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
initLocation();
|
initLocation();
|
||||||
} else {
|
} else {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
Toast.makeText(getActivity(), "申请权限失败", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "申请权限失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2056,6 +1999,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* initEntity
|
||||||
|
*
|
||||||
* @param marker marker
|
* @param marker marker
|
||||||
* @param isBack isBack
|
* @param isBack isBack
|
||||||
*/
|
*/
|
||||||
@ -2180,7 +2125,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
poiEntityArrayList.add(poiListEntity);
|
poiEntityArrayList.add(poiListEntity);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "数据为空", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(), "数据为空");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2190,7 +2135,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
return tencentMap.getCameraPosition().target;
|
return tencentMap.getCameraPosition().target;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 自定义dialog*/
|
/*自定义dialog*/
|
||||||
public void customDialog(List<PoiEntity> list, Marker marker) {
|
public void customDialog(List<PoiEntity> list, Marker marker) {
|
||||||
AlertDialog dialog = builder.create();
|
AlertDialog dialog = builder.create();
|
||||||
treasureBuilder.append(TimestampUtil.time()).append("customDialog-打开了自定义的dialog,");
|
treasureBuilder.append(TimestampUtil.time()).append("customDialog-打开了自定义的dialog,");
|
||||||
|
@ -34,13 +34,13 @@ import com.navinfo.outdoor.api.IdCard;
|
|||||||
import com.navinfo.outdoor.base.BaseFragment;
|
import com.navinfo.outdoor.base.BaseFragment;
|
||||||
import com.navinfo.outdoor.bean.IdCardNumberBean;
|
import com.navinfo.outdoor.bean.IdCardNumberBean;
|
||||||
import com.navinfo.outdoor.bean.NameAuthenticationBean;
|
import com.navinfo.outdoor.bean.NameAuthenticationBean;
|
||||||
import com.navinfo.outdoor.http.Callback;
|
|
||||||
import com.navinfo.outdoor.http.HttpInterface;
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||||
import com.navinfo.outdoor.http.UploadCallBack;
|
import com.navinfo.outdoor.http.UploadCallBack;
|
||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
import com.navinfo.outdoor.util.PhotoUtils;
|
import com.navinfo.outdoor.util.PhotoUtils;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
@ -57,7 +57,6 @@ import static android.app.Activity.RESULT_OK;
|
|||||||
* 实名认证
|
* 实名认证
|
||||||
*/
|
*/
|
||||||
public class UserAttestationFragment extends BaseFragment implements View.OnClickListener {
|
public class UserAttestationFragment extends BaseFragment implements View.OnClickListener {
|
||||||
|
|
||||||
private ImageView ivAttestation2, ivAttestation1,ivAttestation3, ivHera1,ivHera2,ivHera3,useCamera;
|
private ImageView ivAttestation2, ivAttestation1,ivAttestation3, ivHera1,ivHera2,ivHera3,useCamera;
|
||||||
private EditText etAttestationName, etNamePhone;
|
private EditText etAttestationName, etNamePhone;
|
||||||
private TextView tvCard1, tvCard2, tvCard3;
|
private TextView tvCard1, tvCard2, tvCard3;
|
||||||
@ -107,6 +106,7 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("CommitPrefEdits")
|
||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
@ -120,17 +120,17 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
ivAttestation2.setOnClickListener(this);
|
ivAttestation2.setOnClickListener(this);
|
||||||
ivAttestation3 = findViewById(R.id.iv_attestation3);
|
ivAttestation3 = findViewById(R.id.iv_attestation3);
|
||||||
ivAttestation3.setOnClickListener(this);
|
ivAttestation3.setOnClickListener(this);
|
||||||
Button btnAttestation = (Button) findViewById(R.id.btn_attestation);
|
Button btnAttestation = findViewById(R.id.btn_attestation);
|
||||||
btnAttestation.setOnClickListener(this);
|
btnAttestation.setOnClickListener(this);
|
||||||
LinearLayout linearHint = findViewById(R.id.linear_hint);
|
LinearLayout linearHint = findViewById(R.id.linear_hint);
|
||||||
etAttestationName = (EditText) findViewById(R.id.et_attestationName);
|
etAttestationName = findViewById(R.id.et_attestationName);
|
||||||
etNamePhone = (EditText) findViewById(R.id.et_namePhone);
|
etNamePhone = findViewById(R.id.et_namePhone);
|
||||||
ivHera1 = (ImageView) findViewById(R.id.iv_hera1);
|
ivHera1 = findViewById(R.id.iv_hera1);
|
||||||
tvCard1 = (TextView) findViewById(R.id.tv_card1);
|
tvCard1 = findViewById(R.id.tv_card1);
|
||||||
ivHera2 = (ImageView) findViewById(R.id.iv_hera2);
|
ivHera2 = findViewById(R.id.iv_hera2);
|
||||||
tvCard2 = (TextView) findViewById(R.id.tv_card2);
|
tvCard2 = findViewById(R.id.tv_card2);
|
||||||
ivHera3 = (ImageView) findViewById(R.id.iv_hera3);
|
ivHera3 = findViewById(R.id.iv_hera3);
|
||||||
tvCard3 = (TextView) findViewById(R.id.tv_card3);
|
tvCard3 = findViewById(R.id.tv_card3);
|
||||||
TextView tvTitle = findViewById(R.id.tv_title);
|
TextView tvTitle = findViewById(R.id.tv_title);
|
||||||
View userAttestView = findViewById(R.id.user_attestation_view);
|
View userAttestView = findViewById(R.id.user_attestation_view);
|
||||||
LinearLayout linearLayout = findViewById(R.id.ll_pic);//身份证照片
|
LinearLayout linearLayout = findViewById(R.id.ll_pic);//身份证照片
|
||||||
@ -220,15 +220,15 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
break;
|
break;
|
||||||
case R.id.btn_attestation:
|
case R.id.btn_attestation:
|
||||||
if (etAttestationName.getText().toString().equals("")) {
|
if (etAttestationName.getText().toString().equals("")) {
|
||||||
Toast.makeText(getActivity(), "姓名不能为空,请输入姓名", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"姓名不能为空,请输入姓名");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!chineseNameTest(etAttestationName.getText().toString())) {
|
if (!chineseNameTest(etAttestationName.getText().toString())) {
|
||||||
Toast.makeText(getActivity(), "请输入中文名字", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请输入中文名字");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (checkNumber(etNamePhone.getText().toString().trim())) {
|
if (checkNumber(etNamePhone.getText().toString().trim())) {
|
||||||
Toast.makeText(getActivity(), "身份证号错误,请重新输入", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"身份证号错误,请重新输入");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
nameAuthentication();
|
nameAuthentication();
|
||||||
@ -263,23 +263,23 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
|
|
||||||
private void nameAuthentication() {
|
private void nameAuthentication() {
|
||||||
if (etAttestationName.getText().toString().equals("")) {
|
if (etAttestationName.getText().toString().equals("")) {
|
||||||
Toast.makeText(getActivity(), "姓名不能为空,请输入姓名", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"姓名不能为空,请输入姓名");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (checkNumber(etNamePhone.getText().toString().trim())) {
|
if (checkNumber(etNamePhone.getText().toString().trim())) {
|
||||||
Toast.makeText(getActivity(), "身份证错误,请重新输入", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"身份证错误,请重新输入");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tvCard1.getTag() == null) {
|
if (tvCard1.getTag() == null) {
|
||||||
Toast.makeText(getActivity(), "请拍照 身份证人像面", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请拍照 身份证人像面");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tvCard2.getTag() == null) {
|
if (tvCard2.getTag() == null) {
|
||||||
Toast.makeText(getActivity(), "请拍照 身份证国徽面", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请拍照 身份证国徽面");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tvCard3.getTag() == null) {
|
if (tvCard3.getTag() == null) {
|
||||||
Toast.makeText(getActivity(), "请拍照 手持身份证", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请拍照 手持身份证");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ArrayList<File> takePhoneList = new ArrayList<>();
|
ArrayList<File> takePhoneList = new ArrayList<>();
|
||||||
@ -326,7 +326,7 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "提交失败!", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"提交失败!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,9 +341,9 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),message);
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onSuccess: 失败" + e.getMessage() + "");
|
Log.d("TAG", "onSuccess: 失败" + e.getMessage() + "");
|
||||||
}
|
}
|
||||||
@ -423,14 +423,14 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
IdCardNumberBean idCardNumberBean = new Gson().fromJson(inward, IdCardNumberBean.class);
|
IdCardNumberBean idCardNumberBean = new Gson().fromJson(inward, IdCardNumberBean.class);
|
||||||
if (idCardNumberBean == null) {
|
if (idCardNumberBean == null) {
|
||||||
userAttestationBuilder.append(TimestampUtil.time()).append("识别失败,可以重新识别或则进行手动输入 ,");
|
userAttestationBuilder.append(TimestampUtil.time()).append("识别失败,可以重新识别或则进行手动输入 ,");
|
||||||
Toast.makeText(getActivity(), "识别失败,可以重新识别或则进行手动输入", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"识别失败,可以重新识别或则进行手动输入");
|
||||||
} else {
|
} else {
|
||||||
if (idCardNumberBean.getWords_result().get公民身份号码() != null) {
|
if (idCardNumberBean.getWords_result().get公民身份号码() != null) {
|
||||||
String words = idCardNumberBean.getWords_result().get公民身份号码().getWords();
|
String words = idCardNumberBean.getWords_result().get公民身份号码().getWords();
|
||||||
etNamePhone.setText(words);
|
etNamePhone.setText(words);
|
||||||
userAttestationBuilder.append(TimestampUtil.time()).append("身份号识别成功 ,");
|
userAttestationBuilder.append(TimestampUtil.time()).append("身份号识别成功 ,");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "身份号识别失败,可以重新识别或则进行手动输入", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"身份号识别失败,可以重新识别或则进行手动输入");
|
||||||
userAttestationBuilder.append(TimestampUtil.time()).append("身份号识别失败,可以重新识别或则进行手动输入 ,");
|
userAttestationBuilder.append(TimestampUtil.time()).append("身份号识别失败,可以重新识别或则进行手动输入 ,");
|
||||||
}
|
}
|
||||||
if (idCardNumberBean.getWords_result().get姓名() != null) {
|
if (idCardNumberBean.getWords_result().get姓名() != null) {
|
||||||
@ -438,18 +438,18 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
etAttestationName.setText(words);
|
etAttestationName.setText(words);
|
||||||
userAttestationBuilder.append(TimestampUtil.time()).append("姓名识别成功 ,");
|
userAttestationBuilder.append(TimestampUtil.time()).append("姓名识别成功 ,");
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "姓名识别失败,可以重新识别或则进行手动输入", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"姓名识别失败,可以重新识别或则进行手动输入");
|
||||||
userAttestationBuilder.append(TimestampUtil.time()).append("姓名识别失败,可以重新识别或则进行手动输入 ,");
|
userAttestationBuilder.append(TimestampUtil.time()).append("姓名识别失败,可以重新识别或则进行手动输入 ,");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
userAttestationBuilder.append(TimestampUtil.time()).append("识别失败,可以重新识别或则进行手动输入 ,");
|
userAttestationBuilder.append(TimestampUtil.time()).append("识别失败,可以重新识别或则进行手动输入 ,");
|
||||||
Toast.makeText(getActivity(), "识别失败,可以重新识别或则进行手动输入", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"识别失败,可以重新识别或则进行手动输入");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getContext(), "请先拍照", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请先拍照");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package com.navinfo.outdoor.fragment;
|
|||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
@ -19,6 +20,7 @@ import com.navinfo.outdoor.base.BaseFragment;
|
|||||||
import com.navinfo.outdoor.bean.FileBean;
|
import com.navinfo.outdoor.bean.FileBean;
|
||||||
import com.navinfo.outdoor.room.PoiEntity;
|
import com.navinfo.outdoor.room.PoiEntity;
|
||||||
import com.navinfo.outdoor.util.AWMp4ParserHelper;
|
import com.navinfo.outdoor.util.AWMp4ParserHelper;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
@ -126,7 +128,6 @@ public class VideoFragment extends BaseFragment implements View.OnClickListener
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()) {
|
switch (v.getId()) {
|
||||||
case R.id.iv_video_final:
|
case R.id.iv_video_final:
|
||||||
|
|
||||||
Message message = new Message();
|
Message message = new Message();
|
||||||
message.what = Constant.VIDEO_FINISH_ROAD;
|
message.what = Constant.VIDEO_FINISH_ROAD;
|
||||||
EventBus.getDefault().post(message);
|
EventBus.getDefault().post(message);
|
||||||
@ -138,9 +139,27 @@ public class VideoFragment extends BaseFragment implements View.OnClickListener
|
|||||||
videoAdapter.deleteFile(fileBeans.get(i));
|
videoAdapter.deleteFile(fileBeans.get(i));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getContext(), "请选择要删除的数据后才可以删除", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请选择要删除的数据后才可以删除");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
Log.d("TAG", "onPause: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStop() {
|
||||||
|
super.onStop();
|
||||||
|
Log.d("TAG", "onStop: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
Log.d("TAG", "onDestroy: ");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,7 @@ import com.navinfo.outdoor.http.HttpInterface;
|
|||||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
@ -109,7 +110,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
|||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
if (Constant.BACKGROUND == null) {
|
if (Constant.BACKGROUND == null) {
|
||||||
Toast.makeText(getActivity(), "没有绑定银行卡,请先绑定银行卡", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"没有绑定银行卡,请先绑定银行卡");
|
||||||
checkBox.setChecked(false);
|
checkBox.setChecked(false);
|
||||||
withdrawBuilder.append(TimestampUtil.time()).append(",").append("点击了银行卡的勾选,");
|
withdrawBuilder.append(TimestampUtil.time()).append(",").append("点击了银行卡的勾选,");
|
||||||
} else {
|
} else {
|
||||||
@ -181,7 +182,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
|||||||
} else if (response.getCode() == 230) {
|
} else if (response.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getContext(), response.getMessage(), Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),response.getMessage());
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onSuccess: " + response.toString());
|
Log.d("TAG", "onSuccess: " + response.toString());
|
||||||
}
|
}
|
||||||
@ -191,15 +192,16 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout")||message.contains("Read time out")){
|
if (message.equals("timeout")||message.equals("Read time out")){
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
}else {
|
}else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()) {
|
switch (v.getId()) {
|
||||||
@ -219,15 +221,15 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
|||||||
if (!price.equals("")) {
|
if (!price.equals("")) {
|
||||||
double aDouble = Double.parseDouble(price);
|
double aDouble = Double.parseDouble(price);
|
||||||
if (aDouble < 10) {
|
if (aDouble < 10) {
|
||||||
Toast.makeText(getActivity(), "提现金额不能低于10元", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"提现金额不能低于10元");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "提现金额不能为空", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"提现金额不能为空");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!checkBox.isChecked()) {
|
if (!checkBox.isChecked()) {
|
||||||
Toast.makeText(getActivity(), "请勾选银行卡", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请勾选银行卡");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Constant.BACKGROUND != null) {
|
if (Constant.BACKGROUND != null) {
|
||||||
@ -241,7 +243,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "请先绑定银行卡", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请先绑定银行卡");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -286,7 +288,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
|||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
withdrawBuilder.append(TimestampUtil.time()).append(",").append("提现了失败 ,");
|
withdrawBuilder.append(TimestampUtil.time()).append(",").append("提现了失败 ,");
|
||||||
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),response.getMessage() );
|
||||||
}
|
}
|
||||||
etAllPrice.getText().clear();
|
etAllPrice.getText().clear();
|
||||||
Log.d("TAG", "onSuccess: " + response.getMessage() + response.getCode());
|
Log.d("TAG", "onSuccess: " + response.getMessage() + response.getCode());
|
||||||
@ -297,10 +299,10 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout")||message.contains("Read time out")){
|
if (message.equals("timeout")||message.equals("Read time out")){
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请求超时");
|
||||||
}else {
|
}else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),message);
|
||||||
}
|
}
|
||||||
Log.d("TAG", "onError: " + e.getMessage());
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
}
|
}
|
||||||
@ -308,6 +310,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
||||||
public void onPause() {
|
public void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
withdrawBuilder.append(TimestampUtil.time()).append(",").append("onPause,");
|
withdrawBuilder.append(TimestampUtil.time()).append(",").append("onPause,");
|
||||||
|
@ -28,6 +28,7 @@ import com.navinfo.outdoor.http.HttpInterface;
|
|||||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
import com.navinfo.outdoor.util.TimestampUtil;
|
import com.navinfo.outdoor.util.TimestampUtil;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
@ -58,8 +59,6 @@ public class WithdrawalRecordFragment extends BaseFragment implements View.OnCli
|
|||||||
return R.layout.withdrawal_record_fragment;
|
return R.layout.withdrawal_record_fragment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
@ -67,11 +66,10 @@ public class WithdrawalRecordFragment extends BaseFragment implements View.OnCli
|
|||||||
ivWithdraw.setOnClickListener(this);
|
ivWithdraw.setOnClickListener(this);
|
||||||
rxlWithdraw = (XRecyclerView) findViewById(R.id.rxl_withdraw);
|
rxlWithdraw = (XRecyclerView) findViewById(R.id.rxl_withdraw);
|
||||||
rxlWithdraw.setLayoutManager(new LinearLayoutManager(getActivity()));
|
rxlWithdraw.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
|
|
||||||
rxlWithdraw.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
|
rxlWithdraw.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
|
||||||
rxlWithdraw.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
|
rxlWithdraw.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
|
||||||
//取消上拉加载,刷新功能。
|
//取消上拉加载,刷新功能。
|
||||||
// taskRecycler.setPullRefreshEnabled(false);
|
// taskRecycler.setPullRefreshEnabled(false);
|
||||||
// taskRecycler.setLoadingMoreEnabled(false);
|
// taskRecycler.setLoadingMoreEnabled(false);
|
||||||
withdrawalAdapter = new WithdrawalAdapter(getContext());
|
withdrawalAdapter = new WithdrawalAdapter(getContext());
|
||||||
rxlWithdraw.setAdapter(withdrawalAdapter);
|
rxlWithdraw.setAdapter(withdrawalAdapter);
|
||||||
@ -142,7 +140,7 @@ public class WithdrawalRecordFragment extends BaseFragment implements View.OnCli
|
|||||||
} else if (withdrawalBean.getCode() == 230) {
|
} else if (withdrawalBean.getCode() == 230) {
|
||||||
FlushTokenUtil.flushToken(getActivity());
|
FlushTokenUtil.flushToken(getActivity());
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), withdrawalBean.getMessage() + "", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),withdrawalBean.getMessage() );
|
||||||
}
|
}
|
||||||
rxlWithdraw.loadMoreComplete();
|
rxlWithdraw.loadMoreComplete();
|
||||||
rxlWithdraw.refreshComplete();
|
rxlWithdraw.refreshComplete();
|
||||||
@ -157,9 +155,9 @@ public class WithdrawalRecordFragment extends BaseFragment implements View.OnCli
|
|||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
assert message != null;
|
assert message != null;
|
||||||
if (message.contains("timeout")||message.contains("Read time out")){
|
if (message.contains("timeout")||message.contains("Read time out")){
|
||||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),"请求超时" );
|
||||||
}else {
|
}else {
|
||||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
ToastUtils.Message(getActivity(),message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -7,20 +7,19 @@ import com.lzy.okgo.model.Progress;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public interface Callback<T> {
|
public interface Callback<T> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据成功时候回调
|
* 数据成功时候回调
|
||||||
*
|
|
||||||
* @param response 成功回调接口
|
* @param response 成功回调接口
|
||||||
* @param id 成功码
|
* @param id 成功码
|
||||||
*/
|
*/
|
||||||
void onSuccess(T response, int id);
|
void onSuccess(T response, int id);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据失败时候回调
|
* 数据失败时候回调
|
||||||
*
|
|
||||||
* @param e 失败回调异常
|
* @param e 失败回调异常
|
||||||
* @param id 失败码
|
* @param id 失败码
|
||||||
*/
|
*/
|
||||||
void onError(Throwable e, int id);
|
void onError(Throwable e, int id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,23 +10,16 @@ import com.lzy.okgo.request.base.Request;
|
|||||||
public abstract class DialogCallback<T> extends JsonCallback<T> {
|
public abstract class DialogCallback<T> extends JsonCallback<T> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Response<T> response) {
|
public void onSuccess(Response<T> response) { }
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public DialogCallback( Class<T> tClass) {
|
public DialogCallback( Class<T> tClass) {
|
||||||
super(tClass);
|
super(tClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart(Request<T, ? extends Request> request) { }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStart(Request<T, ? extends Request> request) {
|
public void onFinish() { }
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFinish() {
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,26 +1,24 @@
|
|||||||
package com.navinfo.outdoor.http;
|
package com.navinfo.outdoor.http;
|
||||||
|
|
||||||
public class HttpInterface {
|
public class HttpInterface {
|
||||||
public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
|
public static final String IP = "http://172.23.139.127:9999/m4";//测试接口
|
||||||
public static final String IP_ = "http://dtxbmaps.navinfo.com/dtxb_test/m4";//测试接口
|
public static final String IP1 = "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
|
||||||
|
public static final String IP2 = "http://dtxbmaps.navinfo.com/dtxb_test/m4";//测试接口
|
||||||
public static final String USER_PATH = "/user/";//我的
|
public static final String USER_PATH = "/user/";//我的
|
||||||
public static final String MSG_LIST_PATH = "/msgList/";//发现
|
public static final String MSG_LIST_PATH = "/msgList/";//发现
|
||||||
public static final String USER_LOGIN_PATH = "/userlogin/";//登录
|
public static final String USER_LOGIN_PATH = "/userlogin/";//登录
|
||||||
public static final String PRICE_PATH = "/price/";//提现
|
public static final String PRICE_PATH = "/price/";//提现
|
||||||
public static final String TASK_PATH = "/task/";//任务
|
public static final String TASK_PATH = "/task/";//任务
|
||||||
|
|
||||||
/*
|
/**
|
||||||
public static final String TEST_GUIDANCE_IP = "http://172.21.98.90:9999/m4";//引导页完成接口
|
public static final String TEST_GUIDANCE_IP = "http://172.21.98.90:9999/m4";//引导页完成接口
|
||||||
public static final String APK_IP = "http://172.23.139.4:8001/";
|
public static final String APK_IP = "http://172.23.139.4:8001/";
|
||||||
public static String IP1 = "http://dtxbmaps.navinfo.com/dtxb/msg/";
|
public static String IP1 = "http://dtxbmaps.navinfo.com/dtxb/msg/";
|
||||||
public static final String DATA_IP = "http://172.23.139.4:9999/m4";//接口
|
public static final String DATA_IP = "http://172.23.139.4:9999/m4";//接口
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*用户版本升级*/
|
||||||
用户版本升级
|
// dtxbmaps.navinfo.com/dtxb/m4/user/appVersion/checkVersion?version=155&operationType=android //version是版本 operationType固定值 安卓 get
|
||||||
*/
|
|
||||||
// dtxbmaps.navinfo.com/dtxb/m4/user/appVersion/checkVersion?version=155&operationType=android
|
|
||||||
// 172.23.139.4:8001/appVersion/checkVersion?version=155&operationType=android //version是版本 operationType固定值 安卓 get
|
|
||||||
public static String APP_CHECK_VERSION = null; //版本升级
|
public static String APP_CHECK_VERSION = null; //版本升级
|
||||||
|
|
||||||
public static void initAppPath(String userId) {
|
public static void initAppPath(String userId) {
|
||||||
@ -28,8 +26,8 @@ public class HttpInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 我的
|
/* 我的
|
||||||
Path=/m4/user/*
|
* Path=/m4/user/
|
||||||
*/
|
*/
|
||||||
//172.23.139.4:8001/m4/user/update
|
//172.23.139.4:8001/m4/user/update
|
||||||
public static String USER_UPDATE = null;//用户资料
|
public static String USER_UPDATE = null;//用户资料
|
||||||
//172.23.139.4:8001/m4/userBankcard/update
|
//172.23.139.4:8001/m4/userBankcard/update
|
||||||
@ -43,7 +41,7 @@ public class HttpInterface {
|
|||||||
//172.21.98.90:9999/m4/user/userGuide/1/insertUserGuide
|
//172.21.98.90:9999/m4/user/userGuide/1/insertUserGuide
|
||||||
public static String INSERT_USER_GUIDE = null;//引导页完成接口
|
public static String INSERT_USER_GUIDE = null;//引导页完成接口
|
||||||
/* 发现
|
/* 发现
|
||||||
* Path=/m4/msgList/**
|
* Path=/m4/msgList/
|
||||||
*/
|
*/
|
||||||
public static String MSG_CONTENT = null;//发现 -富文本详情页请求
|
public static String MSG_CONTENT = null;//发现 -富文本详情页请求
|
||||||
public static String LIST_TASK = null;//任务专区
|
public static String LIST_TASK = null;//任务专区
|
||||||
@ -55,8 +53,9 @@ public class HttpInterface {
|
|||||||
public static String EXAM_CONTENT = null;//发现 -能力测评获取试题接口
|
public static String EXAM_CONTENT = null;//发现 -能力测评获取试题接口
|
||||||
//172.23.139.4:8002/findAndMessage/1/submitExam
|
//172.23.139.4:8002/findAndMessage/1/submitExam
|
||||||
public static String EXAM_SUBMIT = null;//发现 -能力测评提交试卷 post
|
public static String EXAM_SUBMIT = null;//发现 -能力测评提交试卷 post
|
||||||
|
|
||||||
/* 登录
|
/* 登录
|
||||||
* Path=/m4/userlogin/**
|
* Path=/m4/userlogin/
|
||||||
*/
|
*/
|
||||||
//172.23.139.4:9999/m4/userlogin/oauth/token
|
//172.23.139.4:9999/m4/userlogin/oauth/token
|
||||||
public static String USER_LOGIN_OAUTH_TOKEN = IP + USER_LOGIN_PATH + "oauth/token"; //登录接口
|
public static String USER_LOGIN_OAUTH_TOKEN = IP + USER_LOGIN_PATH + "oauth/token"; //登录接口
|
||||||
@ -66,10 +65,11 @@ public class HttpInterface {
|
|||||||
public static String USER_MESSAGE = IP + USER_PATH + "phone/message";//获取验证码 type 1:注册获取 2:更新
|
public static String USER_MESSAGE = IP + USER_PATH + "phone/message";//获取验证码 type 1:注册获取 2:更新
|
||||||
///m4/user/user/forgetPassword
|
///m4/user/user/forgetPassword
|
||||||
public static String USER_FORGET_PASSWORD = IP + USER_PATH + "user/forgetPassword";//忘记密码
|
public static String USER_FORGET_PASSWORD = IP + USER_PATH + "user/forgetPassword";//忘记密码
|
||||||
|
|
||||||
//Flat
|
//Flat
|
||||||
//dtxbmaps.navinfo.com/dtxb/m4/user/phone/message?mobile=18811794839&type=2
|
//dtxbmaps.navinfo.com/dtxb/m4/user/phone/message?mobile=18811794839&type=2
|
||||||
/* 提现 金额
|
/* 提现-金额
|
||||||
* Path=/m4/price/**
|
* Path=/m4/price/
|
||||||
*/
|
*/
|
||||||
//172.23.139.4:8004/userPrice/1/getPrice
|
//172.23.139.4:8004/userPrice/1/getPrice
|
||||||
public static String GET_PRICE = null;//我的-总资产
|
public static String GET_PRICE = null;//我的-总资产
|
||||||
@ -77,10 +77,10 @@ public class HttpInterface {
|
|||||||
public static String USER_PRICE_EXCHANGE = null;//我的-财务信息-提现
|
public static String USER_PRICE_EXCHANGE = null;//我的-财务信息-提现
|
||||||
//dtxbmaps.navinfo.com/dtxb/m4/price/priceExchange/1/getList?datetime=1628647356815
|
//dtxbmaps.navinfo.com/dtxb/m4/price/priceExchange/1/getList?datetime=1628647356815
|
||||||
public static String PRICE_EXCHANGE = null;//提现记录
|
public static String PRICE_EXCHANGE = null;//提现记录
|
||||||
/*任务
|
|
||||||
* Path=/m4/task/**
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/* 任务
|
||||||
|
* Path=/m4/task/
|
||||||
|
*/
|
||||||
///m4/task/task/10/receiveTasks 参数:taskIds
|
///m4/task/task/10/receiveTasks 参数:taskIds
|
||||||
public static String RECEIVE_TASK = null;//批量领取
|
public static String RECEIVE_TASK = null;//批量领取
|
||||||
//172.23.139.4:8003/m4/task/1/getList
|
//172.23.139.4:8003/m4/task/1/getList
|
||||||
@ -138,96 +138,99 @@ public class HttpInterface {
|
|||||||
public static String MAP_AGREEMENT = "";//地图寻宝服务协议
|
public static String MAP_AGREEMENT = "";//地图寻宝服务协议
|
||||||
public static String MAP_PRIVACY = "";//地图寻宝隐私
|
public static String MAP_PRIVACY = "";//地图寻宝隐私
|
||||||
|
|
||||||
public static void initHttpInter(String USERID) {
|
public static void initHttpInter(String userId) {
|
||||||
/* 我的
|
/* 我的
|
||||||
* Path=/m4/user/*
|
* Path=/m4/user/
|
||||||
*/
|
*/
|
||||||
//172.23.139.4:8001/m4/user/update
|
//172.23.139.4:8001/m4/user/update
|
||||||
USER_UPDATE = IP + USER_PATH + "user/" + USERID + "/update";//用户资料
|
USER_UPDATE = IP + USER_PATH + "user/" + userId + "/update";//用户资料
|
||||||
//172.23.139.4:8001/m4/userBankcard/update
|
//172.23.139.4:8001/m4/userBankcard/update
|
||||||
USER_BANKCARD_UP_DATA = IP + USER_PATH + "userBankcard/" + USERID + "/add"; //绑定银行卡
|
USER_BANKCARD_UP_DATA = IP + USER_PATH + "userBankcard/" + userId + "/add"; //绑定银行卡
|
||||||
//172.23.139.4:8001/m4/userAuth/add
|
//172.23.139.4:8001/m4/userAuth/add
|
||||||
USER_AUTH_ADD = IP + USER_PATH + "userAuth/" + USERID + "/add"; //实名认证
|
USER_AUTH_ADD = IP + USER_PATH + "userAuth/" + userId + "/add"; //实名认证
|
||||||
//172.23.139.4:9999/m4/user/userLocation/1/userLocation post 参数 geom:geohash加密
|
//172.23.139.4:9999/m4/user/userLocation/1/userLocation post 参数 geom:geohash加密
|
||||||
USER_LOCATION = IP + USER_PATH + "userLocation/" + USERID + "/userLocation"; //上传用户坐标
|
USER_LOCATION = IP + USER_PATH + "userLocation/" + userId + "/userLocation"; //上传用户坐标
|
||||||
//dtxbmaps.navinfo.com/dtxb/m4/user/user/1/getUserDetailByUserid/1?datetime=1628749294718
|
//dtxbmaps.navinfo.com/dtxb/m4/user/user/1/getUserDetailByUserid/1?datetime=1628749294718
|
||||||
USER_DETAIL_BY_USER_ID = IP + USER_PATH + "user/" + USERID + "/getUserDetailByUserid/" + USERID; //获取用户信息
|
USER_DETAIL_BY_USER_ID = IP + USER_PATH + "user/" + userId + "/getUserDetailByUserid/" + userId; //获取用户信息
|
||||||
//172.21.98.90:9999/m4/user/userGuide/1/insertUserGuide
|
//172.21.98.90:9999/m4/user/userGuide/1/insertUserGuide
|
||||||
INSERT_USER_GUIDE = IP + USER_PATH + "userGuide/" + USERID + "/insertUserGuide";//引导页完成接口
|
INSERT_USER_GUIDE = IP + USER_PATH + "userGuide/" + userId + "/insertUserGuide";//引导页完成接口
|
||||||
/*发现
|
|
||||||
* Path=/m4/msgList/**
|
/* 发现
|
||||||
|
* Path=/m4/msgList/
|
||||||
*/
|
*/
|
||||||
MSG_CONTENT = IP + MSG_LIST_PATH + "findAndMessage/" + USERID + "/msg_content";//发现 -富文本详情页请求
|
MSG_CONTENT = IP + MSG_LIST_PATH + "findAndMessage/" + userId + "/msg_content";//发现 -富文本详情页请求
|
||||||
LIST_TASK = IP + MSG_LIST_PATH + "findAndMessage/" + USERID + "/msg_list";//任务专区
|
LIST_TASK = IP + MSG_LIST_PATH + "findAndMessage/" + userId + "/msg_list";//任务专区
|
||||||
LIST_EVENT = IP + MSG_LIST_PATH + "findAndMessage/" + USERID + "/msg_list";//活动专区
|
LIST_EVENT = IP + MSG_LIST_PATH + "findAndMessage/" + userId + "/msg_list";//活动专区
|
||||||
LIST_TASK_EXPLAIN = IP + MSG_LIST_PATH + "findAndMessage/" + USERID + "/msg_list";//任务说明
|
LIST_TASK_EXPLAIN = IP + MSG_LIST_PATH + "findAndMessage/" + userId + "/msg_list";//任务说明
|
||||||
//172.23.139.4:8002/findAndMessage/1/msg_list?fid=1&pageNum=1&pageSize=2
|
//172.23.139.4:8002/findAndMessage/1/msg_list?fid=1&pageNum=1&pageSize=2
|
||||||
MSG_LISt = IP + MSG_LIST_PATH + "findAndMessage/" + USERID + "/msg_list";//发现查询接口
|
MSG_LISt = IP + MSG_LIST_PATH + "findAndMessage/" + userId + "/msg_list";//发现查询接口
|
||||||
//172.23.139.4:8002/findAndMessage/1/exam_content?id=11
|
//172.23.139.4:8002/findAndMessage/1/exam_content?id=11
|
||||||
EXAM_CONTENT = IP + MSG_LIST_PATH + "findAndMessage/" + USERID + "/exam_content";//发现 -能力测评获取试题接口
|
EXAM_CONTENT = IP + MSG_LIST_PATH + "findAndMessage/" + userId + "/exam_content";//发现 -能力测评获取试题接口
|
||||||
//172.23.139.4:8002/findAndMessage/1/submitExam
|
//172.23.139.4:8002/findAndMessage/1/submitExam
|
||||||
EXAM_SUBMIT = IP + MSG_LIST_PATH + "findAndMessage/" + USERID + "/submitExam";//发现 -能力测评提交试卷 post
|
EXAM_SUBMIT = IP + MSG_LIST_PATH + "findAndMessage/" + userId + "/submitExam";//发现 -能力测评提交试卷 post
|
||||||
MESSAGE_INFO_PUSH = IP + MSG_LIST_PATH + "InfoPush/" + USERID + "/push";//寻宝-消息通知
|
MESSAGE_INFO_PUSH = IP + MSG_LIST_PATH + "InfoPush/" + userId + "/push";//寻宝-消息通知
|
||||||
/*提现 金额
|
|
||||||
* Path=/m4/price/**
|
/* 提现 金额
|
||||||
|
* Path=/m4/price/
|
||||||
*/
|
*/
|
||||||
//172.23.139.4:8004/userPrice/1/getPrice
|
//172.23.139.4:8004/userPrice/1/getPrice
|
||||||
GET_PRICE = IP + PRICE_PATH + "userPrice/" + USERID + "/getPrice";//我的-总资产
|
GET_PRICE = IP + PRICE_PATH + "userPrice/" + userId + "/getPrice";//我的-总资产
|
||||||
//172.23.139.4:8004/userPrice/1/userPriceExchange?exchangeMoney=10&payType=1
|
//172.23.139.4:8004/userPrice/1/userPriceExchange?exchangeMoney=10&payType=1
|
||||||
USER_PRICE_EXCHANGE = IP + PRICE_PATH + "userPrice/" + USERID + "/userPriceExchange";//我的-财务信息-提现
|
USER_PRICE_EXCHANGE = IP + PRICE_PATH + "userPrice/" + userId + "/userPriceExchange";//我的-财务信息-提现
|
||||||
//dtxbmaps.navinfo.com/dtxb/m4/price/priceExchange/1/getList?datetime=1628647356815
|
//dtxbmaps.navinfo.com/dtxb/m4/price/priceExchange/1/getList?datetime=1628647356815
|
||||||
PRICE_EXCHANGE = IP + PRICE_PATH + "priceExchange/" + USERID + "/getList";//提现记录
|
PRICE_EXCHANGE = IP + PRICE_PATH + "priceExchange/" + userId + "/getList";//提现记录
|
||||||
/*任务
|
|
||||||
*Path=/m4/task/**
|
/* 任务
|
||||||
|
* Path=/m4/task/
|
||||||
*/
|
*/
|
||||||
///m4/task/task/10/receiveTasks 参数:taskIds
|
///m4/task/task/10/receiveTasks 参数:taskIds
|
||||||
RECEIVE_TASK = IP + TASK_PATH + "task/" + USERID + "/receiveTasks";//批量领取
|
RECEIVE_TASK = IP + TASK_PATH + "task/" + userId + "/receiveTasks";//批量领取
|
||||||
//172.23.139.4:8003/m4/task/1/getList
|
//172.23.139.4:8003/m4/task/1/getList
|
||||||
TASK_LIST = IP + TASK_PATH + "task/" + USERID + "/getList"; //任务搜索
|
TASK_LIST = IP + TASK_PATH + "task/" + userId + "/getList"; //任务搜索
|
||||||
//172.23.139.4:8003/othertask/1/receivedOthertask
|
//172.23.139.4:8003/othertask/1/receivedOthertask
|
||||||
RECEIVED_OTHER_TASK = IP + TASK_PATH + "othertask/" + USERID + "/receivedOthertask";//其他-领取任务
|
RECEIVED_OTHER_TASK = IP + TASK_PATH + "othertask/" + userId + "/receivedOthertask";//其他-领取任务
|
||||||
//172.23.139.4:8003/poitask/1/receivedPoitask/1
|
//172.23.139.4:8003/poitask/1/receivedPoitask/1
|
||||||
RECEIVED_POI_TASK = IP + TASK_PATH + "poitask/" + USERID + "/receivedPoitask";//poi-领取任务
|
RECEIVED_POI_TASK = IP + TASK_PATH + "poitask/" + userId + "/receivedPoitask";//poi-领取任务
|
||||||
//172.23.139.4:8003/poitask/1/submitPoitask?taskId=5001&name=测试修改名称&address=测试修改地址&existence=1&geo=1rn7exd5uhxy&memo=测试备注...33.
|
//172.23.139.4:8003/poitask/1/submitPoitask?taskId=5001&name=测试修改名称&address=测试修改地址&existence=1&geo=1rn7exd5uhxy&memo=测试备注...33.
|
||||||
SUBMIT_POI_TASK = IP + TASK_PATH + "poitask/" + USERID + "/submitPoitask";//poi-保存本地
|
SUBMIT_POI_TASK = IP + TASK_PATH + "poitask/" + userId + "/submitPoitask";//poi-保存本地
|
||||||
//172.23.139.4:8003/othertask/1/submitOhtertask?taskId=5001&name=测试修改名称&address=测试修改地址&existence=1&geo=1rn7exd5uhxy&memo=测试备注
|
//172.23.139.4:8003/othertask/1/submitOhtertask?taskId=5001&name=测试修改名称&address=测试修改地址&existence=1&geo=1rn7exd5uhxy&memo=测试备注
|
||||||
SUBMIT_OTHER_TASK = IP + TASK_PATH + "othertask/" + USERID + "/submitOthertask";//其他-保存本地
|
SUBMIT_OTHER_TASK = IP + TASK_PATH + "othertask/" + userId + "/submitOthertask";//其他-保存本地
|
||||||
//172.23.139.4:8003/othertask/1/uploadpic
|
//172.23.139.4:8003/othertask/1/uploadpic
|
||||||
OTHER_TASK_UPLOAD_PIC = IP + TASK_PATH + "othertask/" + USERID + "/uploadpic";//其他-上传
|
OTHER_TASK_UPLOAD_PIC = IP + TASK_PATH + "othertask/" + userId + "/uploadpic";//其他-上传
|
||||||
//172.23.139.4:8003/ctask/1/receivedCtask/8608
|
//172.23.139.4:8003/ctask/1/receivedCtask/8608
|
||||||
RECEIVED_CTASK = IP + TASK_PATH + "ctask/" + USERID + "/receivedCtask";//充电站-领取任务
|
RECEIVED_CTASK = IP + TASK_PATH + "ctask/" + userId + "/receivedCtask";//充电站-领取任务
|
||||||
//172.23.139.4:8003/ctask/1/submitCtask?id=8608&name=充电站&address=地址&telephone=18812345678|14712345678&geo=1rn7exd5uhxy&memo=测试备注&sptype=1
|
//172.23.139.4:8003/ctask/1/submitCtask?id=8608&name=充电站&address=地址&telephone=18812345678|14712345678&geo=1rn7exd5uhxy&memo=测试备注&sptype=1
|
||||||
SUBMIT_CTASK = IP + TASK_PATH + "ctask/" + USERID + "/submitCtask";//充电站-保存本地
|
SUBMIT_CTASK = IP + TASK_PATH + "ctask/" + userId + "/submitCtask";//充电站-保存本地
|
||||||
//172.23.139.4:8003/cstask/1/submitCstask?taskId=0&name=充电站&geo=1rn7exd5uhxy&memo=测试备注&sptype=1&ffid=104&existence=1&detail={"cp_openType":"1,2","cp_floor":1,"cp_availableState":0,"sign_exist":0}
|
//172.23.139.4:8003/cstask/1/submitCstask?taskId=0&name=充电站&geo=1rn7exd5uhxy&memo=测试备注&sptype=1&ffid=104&existence=1&detail={"cp_openType":"1,2","cp_floor":1,"cp_availableState":0,"sign_exist":0}
|
||||||
SUBMIT_CSTASK = IP + TASK_PATH + "cstask/" + USERID + "/submitCstask";//充电桩保存
|
SUBMIT_CSTASK = IP + TASK_PATH + "cstask/" + userId + "/submitCstask";//充电桩保存
|
||||||
//172.23.139.4:8003/poitask/1/uploadpic
|
//172.23.139.4:8003/poitask/1/uploadpic
|
||||||
POI_TASK_UPLOAD_PIC = IP + TASK_PATH + "poitask/" + USERID + "/uploadpic";//poi-上传
|
POI_TASK_UPLOAD_PIC = IP + TASK_PATH + "poitask/" + userId + "/uploadpic";//poi-上传
|
||||||
//172.23.139.4:8003/roadtask/1/receivedRoadtask/8569
|
//172.23.139.4:8003/roadtask/1/receivedRoadtask/8569
|
||||||
RECEIVED_ROAD_TASK = IP + TASK_PATH + "roadtask/" + USERID + "/receivedRoadtask";//道路任务获取
|
RECEIVED_ROAD_TASK = IP + TASK_PATH + "roadtask/" + userId + "/receivedRoadtask";//道路任务获取
|
||||||
//172.23.139.4:8003/poivideotask/1/receivedPoivideotask/8569
|
//172.23.139.4:8003/poivideotask/1/receivedPoivideotask/8569
|
||||||
RECEIVED_POI_VIDEO_TASK = IP + TASK_PATH + "poivideotask/" + USERID + "/receivedPoivideotask";//poi录像任务获取
|
RECEIVED_POI_VIDEO_TASK = IP + TASK_PATH + "poivideotask/" + userId + "/receivedPoivideotask";//poi录像任务获取
|
||||||
// 172.23.139.4:8003/poivideotask/1/submitPoivideotask
|
// 172.23.139.4:8003/poivideotask/1/submitPoivideotask
|
||||||
INSIDE_API_LIST = IP + TASK_PATH + "poivideotask/" + USERID + "/submitPoivideotask";//poi录像 保存
|
INSIDE_API_LIST = IP + TASK_PATH + "poivideotask/" + userId + "/submitPoivideotask";//poi录像 保存
|
||||||
//172.23.139.4:8003/poivideotask/1/uploadpic
|
//172.23.139.4:8003/poivideotask/1/uploadpic
|
||||||
POI_VIDEO_UPLOAD_PIC = IP + TASK_PATH + "poivideotask/" + USERID + "/uploadpic";//poi录像-上传
|
POI_VIDEO_UPLOAD_PIC = IP + TASK_PATH + "poivideotask/" + userId + "/uploadpic";//poi录像-上传
|
||||||
//172.23.139.4:8003/roadtask/1/submitRoadtask?taskId=0&name=段哥&address=二娃&memo=1rn7exd5uhxy&workType=2
|
//172.23.139.4:8003/roadtask/1/submitRoadtask?taskId=0&name=段哥&address=二娃&memo=1rn7exd5uhxy&workType=2
|
||||||
ROAD_TASK_SUBMIT = IP + TASK_PATH + "roadtask/" + USERID + "/submitRoadtask";//道路录像-保存本地
|
ROAD_TASK_SUBMIT = IP + TASK_PATH + "roadtask/" + userId + "/submitRoadtask";//道路录像-保存本地
|
||||||
//172.23.139.4:8003/roadtask/1/uploadpic
|
//172.23.139.4:8003/roadtask/1/uploadpic
|
||||||
ROAD_TASK_UPLOAD_PIC = IP + TASK_PATH + "roadtask/" + USERID + "/uploadpic";//道路录像—上传
|
ROAD_TASK_UPLOAD_PIC = IP + TASK_PATH + "roadtask/" + userId + "/uploadpic";//道路录像—上传
|
||||||
//172.23.139.4:8003/m4/task/1/getPhone?geo=1rn7exd5uhxy
|
//172.23.139.4:8003/m4/task/1/getPhone?geo=1rn7exd5uhxy
|
||||||
GET_PHONES = IP + TASK_PATH + "task/" + USERID + "/getPhone";//电话区号和电话位数
|
GET_PHONES = IP + TASK_PATH + "task/" + userId + "/getPhone";//电话区号和电话位数
|
||||||
//172.23.139.4:8003/cstask/1/uploadpic
|
//172.23.139.4:8003/cstask/1/uploadpic
|
||||||
CS_TASK_UP_LOAD_PIC = IP + TASK_PATH + "cstask/" + USERID + "/uploadpic";//充电桩-上传
|
CS_TASK_UP_LOAD_PIC = IP + TASK_PATH + "cstask/" + userId + "/uploadpic";//充电桩-上传
|
||||||
//172.23.139.4:8003/ctask/1/uploadpic
|
//172.23.139.4:8003/ctask/1/uploadpic
|
||||||
C_TASK_UP_LOAD_PIC = IP + TASK_PATH + "ctask/" + USERID + "/uploadpic";//充电站-上传
|
C_TASK_UP_LOAD_PIC = IP + TASK_PATH + "ctask/" + userId + "/uploadpic";//充电站-上传
|
||||||
//172.23.139.4:8003/m4/task/1/taskName?geo=1rn7exd5uhxy&name=四维
|
//172.23.139.4:8003/m4/task/1/taskName?geo=1rn7exd5uhxy&name=四维
|
||||||
TASK_NAME = IP + TASK_PATH + "task/" + USERID + "/taskName";//poi-查重
|
TASK_NAME = IP + TASK_PATH + "task/" + userId + "/taskName";//poi-查重
|
||||||
//172.23.139.4:8003/m4/task/1/getCommitList?type=2&pageSize=10&pageNum=1
|
//172.23.139.4:8003/m4/task/1/getCommitList?type=2&pageSize=10&pageNum=1
|
||||||
GET_COMMIT_LIST = IP + TASK_PATH + "task/" + USERID + "/getCommitList";//紀錄——已提交
|
GET_COMMIT_LIST = IP + TASK_PATH + "task/" + userId + "/getCommitList";//紀錄——已提交
|
||||||
RECEIVED_POLYGON_TASK = IP + TASK_PATH + "polygonTask/" + USERID + "/receivedPolygontask"; //面状任务任务领取
|
RECEIVED_POLYGON_TASK = IP + TASK_PATH + "polygonTask/" + userId + "/receivedPolygontask"; //面状任务任务领取
|
||||||
//172.23.139.4:8003/m4/task/1/unReceivedTask?taskIds=&auditIds=214,278 取消领取的接口
|
//172.23.139.4:8003/m4/task/1/unReceivedTask?taskIds=&auditIds=214,278 取消领取的接口
|
||||||
UNRECEIVED_POLYGON_TASK = IP + TASK_PATH + "task/" + USERID + "/unReceivedTask";//所有類型结束领取
|
UNRECEIVED_POLYGON_TASK = IP + TASK_PATH + "task/" + userId + "/unReceivedTask";//所有類型结束领取
|
||||||
COMPLETE = IP + TASK_PATH + "polygonTask/" + USERID + "/complete";//面状任务结束领取
|
COMPLETE = IP + TASK_PATH + "polygonTask/" + userId + "/complete";//面状任务结束领取
|
||||||
SUBMIT_POLYGON_TASK = IP + TASK_PATH + "polygonTask/" + USERID + "/submitPolygontask";//面状任务开始采集
|
SUBMIT_POLYGON_TASK = IP + TASK_PATH + "polygonTask/" + userId + "/submitPolygontask";//面状任务开始采集
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,14 +13,12 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
public class HttpUtil {
|
public class HttpUtil {
|
||||||
|
|
||||||
public static String post(String requestUrl, String accessToken, String params)
|
public static String post(String requestUrl, String accessToken, String params) throws Exception {
|
||||||
throws Exception {
|
|
||||||
String contentType = "application/x-www-form-urlencoded";
|
String contentType = "application/x-www-form-urlencoded";
|
||||||
return HttpUtil.post(requestUrl, accessToken, contentType, params);
|
return HttpUtil.post(requestUrl, accessToken, contentType, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String post(String requestUrl, String accessToken, String contentType, String params)
|
public static String post(String requestUrl, String accessToken, String contentType, String params) throws Exception {
|
||||||
throws Exception {
|
|
||||||
String encoding = "UTF-8";
|
String encoding = "UTF-8";
|
||||||
if (requestUrl.contains("nlp")) {
|
if (requestUrl.contains("nlp")) {
|
||||||
encoding = "GBK";
|
encoding = "GBK";
|
||||||
@ -28,14 +26,12 @@ public class HttpUtil {
|
|||||||
return HttpUtil.post(requestUrl, accessToken, contentType, params, encoding);
|
return HttpUtil.post(requestUrl, accessToken, contentType, params, encoding);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String post(String requestUrl, String accessToken, String contentType, String params, String encoding)
|
public static String post(String requestUrl, String accessToken, String contentType, String params, String encoding) throws Exception {
|
||||||
throws Exception {
|
|
||||||
String url = requestUrl + "?access_token=" + accessToken;
|
String url = requestUrl + "?access_token=" + accessToken;
|
||||||
return HttpUtil.postGeneralUrl(url, contentType, params, encoding);
|
return HttpUtil.postGeneralUrl(url, contentType, params, encoding);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String postGeneralUrl(String generalUrl, String contentType, String params, String encoding)
|
public static String postGeneralUrl(String generalUrl, String contentType, String params, String encoding) throws Exception {
|
||||||
throws Exception {
|
|
||||||
URL url = new URL(generalUrl);
|
URL url = new URL(generalUrl);
|
||||||
// 打开和URL之间的连接
|
// 打开和URL之间的连接
|
||||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
||||||
@ -46,13 +42,11 @@ public class HttpUtil {
|
|||||||
connection.setUseCaches(false);
|
connection.setUseCaches(false);
|
||||||
connection.setDoOutput(true);
|
connection.setDoOutput(true);
|
||||||
connection.setDoInput(true);
|
connection.setDoInput(true);
|
||||||
|
|
||||||
// 得到请求的输出流对象
|
// 得到请求的输出流对象
|
||||||
DataOutputStream out = new DataOutputStream(connection.getOutputStream());
|
DataOutputStream out = new DataOutputStream(connection.getOutputStream());
|
||||||
out.write(params.getBytes(encoding));
|
out.write(params.getBytes(encoding));
|
||||||
out.flush();
|
out.flush();
|
||||||
out.close();
|
out.close();
|
||||||
|
|
||||||
// 建立实际的连接
|
// 建立实际的连接
|
||||||
connection.connect();
|
connection.connect();
|
||||||
// 获取所有响应头字段
|
// 获取所有响应头字段
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.navinfo.outdoor.http;
|
package com.navinfo.outdoor.http;
|
||||||
|
|
||||||
import com.navinfo.outdoor.util.Whetherisempty;
|
import com.navinfo.outdoor.util.Weatherised;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.lzy.okgo.callback.AbsCallback;
|
import com.lzy.okgo.callback.AbsCallback;
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ public abstract class JsonCallback<T> extends AbsCallback<T> {
|
|||||||
}
|
}
|
||||||
T data = null;
|
T data = null;
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
String str = Whetherisempty.getClfz(response.body().string());
|
String str = Weatherised.getCafe(response.body().string());
|
||||||
if (mType != null) {
|
if (mType != null) {
|
||||||
data = gson.fromJson(str, mType);
|
data = gson.fromJson(str, mType);
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user