poi录像,道路 横竖屏切换问题
This commit is contained in:
@@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion '29.0.2'
|
||||
ndkVersion '23.0.7123448'
|
||||
// ndkVersion '23.0.7123448'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.navinfo.outdoor"
|
||||
@@ -110,7 +110,7 @@ dependencies {
|
||||
implementation 'com.tencent.map.geolocation:TencentLocationSdk-openplatform:7.2.6'
|
||||
|
||||
// 权限请求框架:https://github.com/getActivity/XXPermissions
|
||||
implementation 'com.github.getActivity:XXPermissions:11.5'
|
||||
implementation 'com.github.getActivity:XXPermissions:11.6'
|
||||
|
||||
//room 数据库
|
||||
def room_version = "2.2.0-alpha01"
|
||||
|
||||
@@ -4,17 +4,17 @@
|
||||
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<uses-permission android:name="android.permission.READ_CALENDAR" />
|
||||
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
|
||||
<!-- <uses-permission android:name="android.permission.WRITE_CALENDAR" />-->
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.CAMERA" /> <!-- <uses-sdk android:minSdkVersion="8"></uses-sdk> -->
|
||||
<!-- 友盟检测bug -->
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" /> <!-- 腾讯地图 定位权限 -->
|
||||
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />-->
|
||||
<!-- <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />-->
|
||||
<!-- <uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
|
||||
<!-- <uses-permission android:name="android.permission.INTERNET" /> -->
|
||||
<!-- 腾讯地图 定位权限 -->
|
||||
<!-- 通过GPS得到精确位置 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- 通过网络得到粗略位置 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- 访问网络. 某些位置信息需要从网络服务器获取 -->
|
||||
@@ -36,8 +36,8 @@
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:largeHeap="true"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
@@ -74,8 +74,9 @@
|
||||
<activity android:name=".activity.LoginActivity"
|
||||
android:configChanges="keyboardHidden|orientation"
|
||||
android:screenOrientation="portrait"/>
|
||||
<!--|screenSize-->
|
||||
<activity android:name=".activity.HomeActivity"
|
||||
android:configChanges="keyboardHidden|orientation"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity android:name=".activity.WebActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
|
||||
@@ -9,12 +9,15 @@ import com.navinfo.outdoor.fragment.TreasureFragment;
|
||||
import com.navinfo.outdoor.util.BackHandlerHelper;
|
||||
import com.navinfo.outdoor.util.NoSlideViewPager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Message;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -160,4 +163,5 @@ public class HomeActivity extends BaseActivity{
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,6 +20,7 @@ import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.base.BaseActivity;
|
||||
import com.kongzue.dialog.util.DialogSettings;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -52,9 +53,9 @@ public class MainActivity extends BaseActivity {
|
||||
// 申请单个权限
|
||||
.permission(Permission.RECORD_AUDIO)
|
||||
// 申请多个权限
|
||||
.permission(Permission.Group.CALENDAR)
|
||||
// .permission(Permission.Group.CALENDAR)
|
||||
// 申请读写外部存储卡
|
||||
.permission(Permission.MANAGE_EXTERNAL_STORAGE)
|
||||
.permission(Permission.MANAGE_EXTERNAL_STORAGE/*, Permission.READ_EXTERNAL_STORAGE, Permission.WRITE_EXTERNAL_STORAGE*/)
|
||||
// 申请相机权限
|
||||
.permission(Permission.CAMERA)
|
||||
// 位置权限
|
||||
|
||||
@@ -110,7 +110,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
protected int getLayout() {
|
||||
EventBus.getDefault().register(this);
|
||||
tmpFile = new File(Constant.PICTURE_FOLDER, "temp.mp4");
|
||||
formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
formatter = new SimpleDateFormat("yyyyMMdd HHmmss");
|
||||
return R.layout.activity_picture;
|
||||
}
|
||||
|
||||
@@ -382,7 +382,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
Toast.makeText(this, "已经在拍摄中...", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
String formatVideoName = formatter.format(calendar.getTime());
|
||||
|
||||
@@ -87,6 +87,7 @@ public class Constant {
|
||||
public static final int EVENT_STAY_REFRESH = 44; // 刷新记录页面
|
||||
|
||||
public static final int EVENT_WORK_HOME = 45; //切换到寻宝
|
||||
public static final int EVENT_WORK_UNPOLYGON = 46; //面妆任务点立即采集
|
||||
public static String USER_ATTESTATION_NAME; //实名认证姓名 银行卡
|
||||
public static int NUMBER = 200; //任务个数
|
||||
public static int LIMIT_TTPE = -1; //权限类型,普通任务-0,专属任务-1
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.navinfo.outdoor.base;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.location.Location;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
@@ -8,6 +9,7 @@ import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.navinfo.outdoor.R;
|
||||
@@ -104,6 +106,10 @@ public abstract class BaseDrawerFragment extends BaseFragment {
|
||||
edit.commit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
}
|
||||
|
||||
public View getScrollerView() {
|
||||
return findViewById(R.id.scroller_view);
|
||||
|
||||
@@ -202,8 +202,13 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
poiEntity.setX(latLng.longitude + "");
|
||||
poiEntity.setY(latLng.altitude + "");
|
||||
} else if (geometry.getGeometryType().equals("LineString")) {//线
|
||||
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
||||
poiEntity.setX(latLineString.get(0).longitude + "");
|
||||
poiEntity.setY(latLineString.get(0).latitude + "");
|
||||
} else if (geometry.getGeometryType().equals("Polygon")) {//面
|
||||
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
|
||||
poiEntity.setX(latPolygon.get(0).longitude + "");
|
||||
poiEntity.setY(latPolygon.get(0).latitude + "");
|
||||
}
|
||||
poiEntities.add(poiEntity);
|
||||
}
|
||||
|
||||
@@ -131,6 +131,24 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
if (poiEntity.getDist() != null) {
|
||||
tvDistance.setText("距离:" + format5(Double.valueOf(poiEntity.getDist()) / 1000) + "km");
|
||||
}
|
||||
|
||||
if (poiEntity.getTaskStatus()<2){
|
||||
double latitude = Constant.currentLocation.getLatitude();
|
||||
double longitude = Constant.currentLocation.getLongitude();
|
||||
LatLng startLatLng = new LatLng(latitude, longitude); //用户当前位置
|
||||
LatLng endLatLng = new LatLng(Double.valueOf(poiEntity.getY()), Double.valueOf(poiEntity.getX()));
|
||||
double v = GeometryTools.distanceToDouble(startLatLng, endLatLng);
|
||||
if (v>5000){
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.EVENT_WORK_UNPOLYGON;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
int taskStatus = poiEntity.getTaskStatus();
|
||||
initViewByTaskStatus(taskStatus);
|
||||
@@ -189,7 +207,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
btnCancelGet.setVisibility(View.GONE);
|
||||
btnGather.setVisibility(View.VISIBLE);
|
||||
btnFinishGather.setVisibility(View.GONE);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -431,15 +448,14 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// poiEntity.setTaskStatus(1);
|
||||
// initViewByTaskStatus(1);
|
||||
|
||||
btnGetTask.setVisibility(View.GONE);
|
||||
btnCancelGet.setVisibility(View.VISIBLE);
|
||||
|
||||
initViewByTaskStatus(1);
|
||||
if (aBoolean) {
|
||||
initCompleteTask(HttpInterface.COMPLETE, GatherGetFragment.this.poiEntity.getTaskId(), true, polygonEntity);
|
||||
}
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.EVENT_WORK_UNPOLYGON;
|
||||
obtain.obj = false;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -457,7 +473,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
}
|
||||
|
||||
/**
|
||||
* @param url 面妆任务结束领取 ,结束采集
|
||||
* @param url 面妆任务结束领取
|
||||
* @param poiEntity
|
||||
*/
|
||||
private void initUnPolygonTask(String url, int taskId, PoiEntity poiEntity) {
|
||||
@@ -483,10 +499,11 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiEntity.setTaskStatus(0);
|
||||
initViewByTaskStatus(0);
|
||||
// btnGetTask.setVisibility(View.VISIBLE);
|
||||
// btnCancelGet.setVisibility(View.GONE);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.EVENT_WORK_UNPOLYGON;
|
||||
obtain.obj = false;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -533,14 +550,11 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
// poiEntity.setTaskStatus(1);
|
||||
// initViewByTaskStatus(1);
|
||||
|
||||
|
||||
btnGather.setVisibility(View.GONE);
|
||||
btnFinishGather.setVisibility(View.VISIBLE);
|
||||
|
||||
initViewByTaskStatus(1);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.EVENT_WORK_UNPOLYGON;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -584,12 +598,11 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiEntity.setTaskStatus(0);
|
||||
initViewByTaskStatus(0);
|
||||
onBackPressed();
|
||||
// btnGather.setVisibility(View.VISIBLE);
|
||||
// btnFinishGather.setVisibility(View.GONE);
|
||||
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.EVENT_WORK_UNPOLYGON;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -219,6 +219,8 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivPoiVideoPicture, 500);
|
||||
ivPoiVideoPicture.setTag(videoFile);
|
||||
}
|
||||
}else {
|
||||
|
||||
}
|
||||
}
|
||||
//判断是否是已做完任务并保存成功
|
||||
@@ -234,10 +236,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
tvPictures.setEnabled(false);
|
||||
etDesc.setEnabled(false);
|
||||
btnRoadSave.setEnabled(false);
|
||||
rbBicycle.setEnabled(false);
|
||||
rbCar.setEnabled(false);
|
||||
rbManual.setEnabled(false);
|
||||
rbWalking.setEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -275,12 +273,14 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
initPoiSaveLocal(false);
|
||||
break;
|
||||
case R.id.tv_pictures:
|
||||
|
||||
// 根据用户点击的时间为视频名称赋值
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String videoFormatName = formatter.format(new Date());
|
||||
Intent intent = new Intent(getContext(), PictureActivity.class);
|
||||
intent.putExtra(Constant.INTENT_VIDEO_PATH, Constant.PICTURE_FOLDER + "/" + videoFormatName + ".mp4");
|
||||
startActivityForResult(intent, 0x101);
|
||||
|
||||
break;
|
||||
|
||||
case R.id.btn_poi_video_upload:
|
||||
@@ -367,7 +367,10 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
||||
}
|
||||
}
|
||||
if (ivPoiVideoPicture.getTag() != null) {
|
||||
if (ivPoiVideoPicture.getTag() == null) {
|
||||
Toast.makeText(getActivity(), "请录像", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
File videoFile = (File) ivPoiVideoPicture.getTag();
|
||||
String path = videoFile.getPath() + ".txt";
|
||||
poiEntity.setPhoto(videoFile.getAbsolutePath());
|
||||
@@ -389,6 +392,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
poiEntity.setGeoWkt(lineString);
|
||||
}
|
||||
|
||||
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
@@ -448,7 +452,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
@Override
|
||||
public void onSuccess(Response<OtherUploadPicBean> otherUploadPicBeanResponse) {
|
||||
dismissLoadingDialog();
|
||||
Toast.makeText(getContext(), "上传成功", Toast.LENGTH_SHORT).show();
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -457,6 +460,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(getContext(), "上传成功", Toast.LENGTH_SHORT).show();
|
||||
getActivity().onBackPressed();//回退
|
||||
}
|
||||
});
|
||||
@@ -533,6 +537,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
|
||||
if (requestCode == 0x101 && resultCode == 0x101) {
|
||||
if (data != null && data.hasExtra(Constant.INTENT_VIDEO_PATH)) {
|
||||
videoPath = data.getStringExtra(Constant.INTENT_VIDEO_PATH);
|
||||
|
||||
@@ -251,8 +251,9 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
initPoiSaveLocal(false);
|
||||
break;
|
||||
case R.id.tv_pictures:
|
||||
|
||||
// 根据用户点击的时间为视频名称赋值
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String videoFormatName = formatter.format(new Date());
|
||||
Intent intent = new Intent(getContext(), PictureActivity.class);
|
||||
intent.putExtra(Constant.INTENT_VIDEO_PATH, Constant.PICTURE_FOLDER + "/" + videoFormatName + ".mp4");
|
||||
@@ -335,7 +336,10 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
||||
}
|
||||
}
|
||||
if (ivRoadPicture.getTag() != null) {
|
||||
if (ivRoadPicture.getTag() == null) {
|
||||
Toast.makeText(getActivity(), "请录像", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
File videoFile = (File) ivRoadPicture.getTag();
|
||||
String path = videoFile.getPath() + ".txt";
|
||||
poiEntity.setPhoto(videoFile.getAbsolutePath());
|
||||
@@ -509,13 +513,15 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 0x101 && resultCode == 0x101) {
|
||||
if (data != null && data.hasExtra(Constant.INTENT_VIDEO_PATH)) {
|
||||
videoPath = data.getStringExtra(Constant.INTENT_VIDEO_PATH);
|
||||
File videoFile = new File(videoPath);
|
||||
if (videoFile.exists()) {
|
||||
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivRoadPicture, 500);
|
||||
ivRoadPicture.setTag(videoFile);
|
||||
if (requestCode == 0x101) {
|
||||
if (resultCode == 0x101) {
|
||||
if (data != null && data.hasExtra(Constant.INTENT_VIDEO_PATH)) {
|
||||
videoPath = data.getStringExtra(Constant.INTENT_VIDEO_PATH);
|
||||
File videoFile = new File(videoPath);
|
||||
if (videoFile.exists()) {
|
||||
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivRoadPicture, 500);
|
||||
ivRoadPicture.setTag(videoFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,6 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
private PoiDatabase roadDatabase;
|
||||
private PoiDao roadDao;
|
||||
private TextView tvStayType;
|
||||
private TextView tvStayResult;
|
||||
private List<PoiEntity> roadEntities;
|
||||
private ArrayList<PoiEntity> newEntities;
|
||||
private ArrayList<PoiEntity> poiEntities;
|
||||
@@ -131,12 +130,17 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
}else {
|
||||
Toast.makeText(getContext(), "失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
dismissLoadingDialog();
|
||||
refreshData();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
dismissLoadingDialog();
|
||||
}
|
||||
|
||||
public List<PoiEntity> initRoadWord(int type) {
|
||||
newEntities.clear();
|
||||
@@ -214,6 +218,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
}
|
||||
}
|
||||
if (poiEntities.size()>0){
|
||||
showLoadingDialog();
|
||||
PoiSaveUtils.getInstance(getActivity()).uploadPoiEntityBatch(poiEntities);
|
||||
}else {
|
||||
Toast.makeText(getContext(), "请选择要删除的条目数据", Toast.LENGTH_SHORT).show();
|
||||
@@ -258,5 +263,6 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroy();
|
||||
dismissLoadingDialog();
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,8 @@ package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Color;
|
||||
@@ -12,6 +14,7 @@ import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.FrameLayout;
|
||||
@@ -19,6 +22,7 @@ import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
@@ -117,6 +121,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
|
||||
private BitmapDescriptor bitmapDescriptor1, bitmapDescriptor2, bitmapDescriptor3, bitmapDescriptor4, bitmapDescriptor5;
|
||||
private Marker bigMarker;
|
||||
private Marker markerPile;
|
||||
|
||||
public static TreasureFragment newInstance(Bundle bundle) {
|
||||
TreasureFragment fragment = new TreasureFragment();
|
||||
@@ -300,6 +305,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 设置地图宽高为屏幕的宽高
|
||||
int[] widtHeight = DensityUtil.getDeviceInfo(getActivity());
|
||||
treasureMap.getLayoutParams().width = widtHeight[0];
|
||||
treasureMap.getLayoutParams().height = widtHeight[1];
|
||||
}
|
||||
|
||||
private void initList(TencentLocation tencentLocation) {
|
||||
@@ -812,7 +822,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
frameLayout.setVisibility(View.GONE);
|
||||
fragmentTransaction.remove(gatherGetFragment);
|
||||
fragmentTransaction.commit();
|
||||
} else if (data.what == Constant.GATHER_GET_MAP) { //地图界面点击采集 点击开始采集
|
||||
PoiEntity poiEntity = (PoiEntity) data.obj;
|
||||
Bundle bundle = new Bundle();
|
||||
@@ -842,7 +851,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
frameLayout.setVisibility(View.GONE);
|
||||
fragmentTransaction.remove(gatherGetFragment);
|
||||
fragmentTransaction.commit();
|
||||
} else if (data.what == Constant.FILTER_LIST) { // 筛选列表所有数据地图显示
|
||||
List<PoiEntity> poiEntities = (List<PoiEntity>) data.obj;
|
||||
initFilterMarker(poiEntities);
|
||||
@@ -878,6 +886,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
if (markerPoi != null) {
|
||||
markerPoi.remove();
|
||||
}
|
||||
if (markerPile!=null){
|
||||
markerPile.remove();
|
||||
}
|
||||
}
|
||||
} else if (data.what == Constant.MAIN_BUTTON_VISIABLE) {//控制主界面各个按钮显隐状态的what值
|
||||
setMainButtonVisiable((Integer) data.obj);
|
||||
@@ -908,7 +919,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
|
||||
LatLng mapCenterPoint = getMapCenterPoint();
|
||||
markerPoi = tencentMap.addMarker(new MarkerOptions(mapCenterPoint).icon(pileDescriptor));
|
||||
markerPile = tencentMap.addMarker(new MarkerOptions(mapCenterPoint).icon(pileDescriptor));
|
||||
ChargingPileFragment chargingPileFragment = ChargingPileFragment.newInstance(bundle);
|
||||
showSlidingFragment(chargingPileFragment);
|
||||
} else if (data.what == Constant.CHARGING_STATION_PILE) {//充电站的充电桩
|
||||
@@ -940,8 +951,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
LatLng latLng = (LatLng) data.obj;
|
||||
int type = data.arg1;
|
||||
showPoiMarkerByType(type, latLng);
|
||||
}
|
||||
else if (data.what == Constant.EVENT_WHAT_COMPLETE_TASK){
|
||||
} else if (data.what == Constant.EVENT_WHAT_COMPLETE_TASK){
|
||||
// 如果当前fragment是筛选,则移除该fragment
|
||||
FilterFragment filterFragment = (FilterFragment) supportFragmentManager.findFragmentByTag(FilterFragment.class.getName());
|
||||
if (filterFragment != null) {
|
||||
@@ -975,6 +985,17 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
break;
|
||||
}
|
||||
frameLayout.setVisibility(View.GONE);
|
||||
}else if (data.what==Constant.EVENT_WORK_UNPOLYGON){//面妆任务点击立即采集或者结束采集需要回到寻宝界面
|
||||
if ((boolean)data.obj){
|
||||
setMainButtonVisiable(View.VISIBLE);
|
||||
frameLayout.setVisibility(View.GONE);
|
||||
fragmentTransaction.remove(gatherGetFragment);
|
||||
bigMarker.setVisible(false);
|
||||
Toast.makeText(getActivity(), "不在作业范围", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
frameLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1199,9 +1220,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
public void run() {
|
||||
showPoiMarkerByType(1, newPoiLatLng);
|
||||
PoiFragment poiFragment = PoiFragment.newInstance(bundle);
|
||||
|
||||
showSlidingFragment(poiFragment);
|
||||
ivMessage.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1220,7 +1239,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
showPoiMarkerByType(2, newPoiLatLng);
|
||||
PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle);
|
||||
showSlidingFragment(poiVideoFragment);
|
||||
ivMessage.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1236,7 +1254,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
showPoiMarkerByType(3, newPoiLatLng);
|
||||
RoadFragment roadFragment = RoadFragment.newInstance(bundle);
|
||||
showSlidingFragment(roadFragment);
|
||||
@@ -1432,5 +1449,15 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
return tencentMap.getCameraPosition().target;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
int measuredWidth = treasureMap.getWidth();
|
||||
int measuredHeight = treasureMap.getHeight();
|
||||
if (newConfig.orientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) {
|
||||
treasureMap.onSizeChanged(measuredHeight,measuredWidth,measuredWidth,measuredHeight);
|
||||
} else if (newConfig.orientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
|
||||
treasureMap.onSizeChanged(measuredHeight,measuredWidth,measuredWidth,measuredHeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.navinfo.outdoor.util;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.Environment;
|
||||
import android.provider.MediaStore;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.navinfo.outdoor.R;
|
||||
|
||||
@@ -12,16 +12,13 @@
|
||||
sothree:umanoPanelHeight="0dp"
|
||||
sothree:umanoScrollableView="@id/scroll_view"
|
||||
sothree:umanoShadowHeight="0dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center">
|
||||
|
||||
android:layout_height="match_parent">
|
||||
<com.tencent.tencentmap.mapsdk.maps.MapView
|
||||
android:id="@+id/treasure_map"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_marginTop="?attr/actionBarSize"
|
||||
android:focusableInTouchMode="false"
|
||||
android:gravity="center"
|
||||
@@ -33,123 +30,131 @@
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
</com.tencent.tencentmap.mapsdk.maps.MapView>
|
||||
<ImageView
|
||||
android:id="@+id/iv_message"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginTop="80dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:background="@drawable/iv_message"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
</ImageView>
|
||||
|
||||
<!--<TextView-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:text="10"-->
|
||||
<!--android:background="@drawable/small_bell_text"-->
|
||||
<!--android:textColor="@color/white"-->
|
||||
<!--app:layout_constraintTop_toTopOf="@+id/iv_message"-->
|
||||
<!--app:layout_constraintLeft_toRightOf="@+id/iv_message"/>-->
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/frame_layout"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:background="@color/white"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cb_map_type"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:background="@drawable/atlas_selector"
|
||||
android:button="@null"
|
||||
android:checked="false"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<!-- <CheckBox-->
|
||||
<!-- android:id="@+id/cb_foot_type"-->
|
||||
<!-- android:layout_width="40dp"-->
|
||||
<!-- android:layout_height="40dp"-->
|
||||
<!-- android:layout_marginTop="15dp"-->
|
||||
<!-- android:background="@drawable/foot_selector"-->
|
||||
<!-- android:button="@null"-->
|
||||
<!-- android:checked="false"-->
|
||||
<!-- app:layout_constraintRight_toRightOf="@id/cb_map_type"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/cb_map_type"-->
|
||||
<!-- />-->
|
||||
<ImageView
|
||||
android:id="@+id/iv_message"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginTop="80dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:background="@drawable/iv_message"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
</ImageView>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_submit"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:src="@mipmap/submit"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_refrish"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cb_map_type"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_zoom_del"
|
||||
/>
|
||||
<!--<TextView-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:text="10"-->
|
||||
<!--android:background="@drawable/small_bell_text"-->
|
||||
<!--android:textColor="@color/white"-->
|
||||
<!--app:layout_constraintTop_toTopOf="@+id/iv_message"-->
|
||||
<!--app:layout_constraintLeft_toRightOf="@+id/iv_message"/>-->
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_filter"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:src="@mipmap/filter"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cb_map_type"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_submit"
|
||||
/>
|
||||
<FrameLayout
|
||||
android:id="@+id/frame_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:background="@color/white"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_zoom_add"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:src="@mipmap/zoom_add"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cb_map_type"
|
||||
/>
|
||||
<CheckBox
|
||||
android:id="@+id/cb_map_type"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:background="@drawable/atlas_selector"
|
||||
android:button="@null"
|
||||
android:checked="false"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_zoom_del"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:src="@mipmap/zoom_del"
|
||||
app:layout_constraintLeft_toLeftOf="@id/iv_zoom_add"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_zoom_add"
|
||||
/>
|
||||
<!-- <CheckBox-->
|
||||
<!-- android:id="@+id/cb_foot_type"-->
|
||||
<!-- android:layout_width="40dp"-->
|
||||
<!-- android:layout_height="40dp"-->
|
||||
<!-- android:layout_marginTop="15dp"-->
|
||||
<!-- android:background="@drawable/foot_selector"-->
|
||||
<!-- android:button="@null"-->
|
||||
<!-- android:checked="false"-->
|
||||
<!-- app:layout_constraintRight_toRightOf="@id/cb_map_type"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/cb_map_type"-->
|
||||
<!-- />-->
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_refrish"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:src="@mipmap/refresh"
|
||||
app:layout_constraintLeft_toLeftOf="@id/iv_zoom_del"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_zoom_del"
|
||||
/>
|
||||
<ImageView
|
||||
android:id="@+id/iv_submit"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:src="@mipmap/submit"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_refrish"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cb_map_type"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_zoom_del"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_location"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:src="@mipmap/mine_location"
|
||||
app:layout_constraintLeft_toLeftOf="@id/iv_refrish"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_refrish"
|
||||
/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<ImageView
|
||||
android:id="@+id/iv_filter"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:src="@mipmap/filter"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cb_map_type"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_submit"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_zoom_add"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:src="@mipmap/zoom_add"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cb_map_type"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_zoom_del"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:src="@mipmap/zoom_del"
|
||||
app:layout_constraintLeft_toLeftOf="@id/iv_zoom_add"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_zoom_add"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_refrish"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:src="@mipmap/refresh"
|
||||
app:layout_constraintLeft_toLeftOf="@id/iv_zoom_del"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_zoom_del"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_location"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:src="@mipmap/mine_location"
|
||||
app:layout_constraintLeft_toLeftOf="@id/iv_refrish"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_refrish"
|
||||
/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -20,4 +20,5 @@ systemProp.http.proxyPort=1080
|
||||
systemProp.https.proxyHost=127.0.0.1
|
||||
systemProp.https.proxyPort=1080
|
||||
# Automatically convert third-party libraries to use AndroidX
|
||||
android.enableJetifier=true
|
||||
android.enableJetifier=true
|
||||
android.injected.testOnly=false
|
||||
|
||||
Reference in New Issue
Block a user