修改1级的部分bug,解决点位方向旋转问题
This commit is contained in:
parent
afa832e6fd
commit
be6f17f4cd
@ -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"
|
||||
|
@ -25,6 +25,7 @@ import com.kongzue.dialog.v3.WaitDialog;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.util.BackHandlerHelper;
|
||||
import com.navinfo.outdoor.util.FragmentBackHandler;
|
||||
import com.navinfo.outdoor.util.NetWorkUtils;
|
||||
|
||||
|
||||
public abstract class BaseFragment extends Fragment implements FragmentBackHandler {
|
||||
@ -41,6 +42,7 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
|
||||
return mView;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
@ -55,7 +57,8 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
|
||||
return false;
|
||||
}
|
||||
|
||||
public void initEvent(){}
|
||||
public void initEvent() {
|
||||
}
|
||||
|
||||
protected <T extends View> T findViewById(@IdRes int id) {
|
||||
return getView().findViewById(id);
|
||||
@ -63,7 +66,9 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
|
||||
|
||||
|
||||
protected abstract int getLayout();
|
||||
|
||||
public void showLoadingDialog() {
|
||||
if (NetWorkUtils.iConnected(getContext())) { // 当前网络可用
|
||||
alertDialog = new AlertDialog.Builder(getActivity()).create();
|
||||
alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable());
|
||||
alertDialog.setCancelable(false);
|
||||
@ -79,6 +84,9 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
|
||||
|
||||
alertDialog.setCanceledOnTouchOutside(false);
|
||||
alertDialog.show();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "网络不可用", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
public void setLoadingDialogText(String s) {
|
||||
@ -93,11 +101,21 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
|
||||
}
|
||||
}
|
||||
|
||||
protected void initMvp() { }
|
||||
public void dismissDialog() {
|
||||
if (!NetWorkUtils.iConnected(getContext())) { // 当前网络bu可用
|
||||
Toast.makeText(getActivity(), "请检查网络", Toast.LENGTH_SHORT).show();
|
||||
dismissLoadingDialog();
|
||||
}
|
||||
}
|
||||
|
||||
protected void initData() { }
|
||||
protected void initMvp() {
|
||||
}
|
||||
|
||||
protected void initView() { }
|
||||
protected void initData() {
|
||||
}
|
||||
|
||||
protected void initView() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
|
@ -125,6 +125,7 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
|
||||
UMCrash.generateCustomLog("网络请求报错-位置:CapacityEvaluationFragment"+e.getMessage(),"UmengException");
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -105,6 +105,7 @@ public class CapacityEvaluationFragment2 extends BaseFragment implements View.On
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -135,6 +135,7 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -227,5 +228,6 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
Log.d("TAG", "onError: " + response.message());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
}
|
@ -1146,7 +1146,10 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
if (requestCode == 101 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
int height = bitmap.getHeight();
|
||||
takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivPanorama.setTag(takePhotoPath1);
|
||||
ivPanorama.setImageBitmap(bitmap);//显示图像
|
||||
/* int height = bitmap.getHeight();
|
||||
int width = bitmap.getWidth();
|
||||
if (height > width) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
@ -1159,14 +1162,15 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
});
|
||||
} else {
|
||||
takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivPanorama.setTag(takePhotoPath1);
|
||||
ivPanorama.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
||||
}*/
|
||||
} else if (requestCode == 102 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
int height = bitmap.getHeight();
|
||||
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivCoding.setTag(takePhotoPath2);
|
||||
ivCoding.setImageBitmap(bitmap);//显示图像
|
||||
/* int height = bitmap.getHeight();
|
||||
int width = bitmap.getWidth();
|
||||
if (height > width) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
@ -1179,14 +1183,15 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
});
|
||||
} else {
|
||||
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivCoding.setTag(takePhotoPath2);
|
||||
ivCoding.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
||||
}*/
|
||||
} else if (requestCode == 103 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
int height = bitmap.getHeight();
|
||||
takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivEquipment.setImageBitmap(bitmap);//显示图像
|
||||
ivEquipment.setTag(takePhotoPath3);
|
||||
/* int height = bitmap.getHeight();
|
||||
int width = bitmap.getWidth();
|
||||
if (height > width) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
@ -1199,14 +1204,15 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
});
|
||||
} else {
|
||||
takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivEquipment.setImageBitmap(bitmap);//显示图像
|
||||
ivEquipment.setTag(takePhotoPath3);
|
||||
}
|
||||
|
||||
}*/
|
||||
} else if (requestCode == 104 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
int height = bitmap.getHeight();
|
||||
takePhotoPath4 = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivFacility.setTag(takePhotoPath4);
|
||||
ivFacility.setImageBitmap(bitmap);//显示图像
|
||||
/* int height = bitmap.getHeight();
|
||||
int width = bitmap.getWidth();
|
||||
if (height > width) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
@ -1219,14 +1225,15 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
});
|
||||
} else {
|
||||
takePhotoPath4 = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivFacility.setTag(takePhotoPath4);
|
||||
ivFacility.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
||||
}*/
|
||||
} else if (requestCode == 105 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
int height = bitmap.getHeight();
|
||||
takePhotoPath5 = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivScutcheon.setTag(takePhotoPath5);
|
||||
ivScutcheon.setImageBitmap(bitmap);//显示图像
|
||||
/* int height = bitmap.getHeight();
|
||||
int width = bitmap.getWidth();
|
||||
if (height > width) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
@ -1239,14 +1246,15 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
});
|
||||
} else {
|
||||
takePhotoPath5 = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivScutcheon.setTag(takePhotoPath5);
|
||||
ivScutcheon.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
||||
}*/
|
||||
} else if (requestCode == 106 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
int height = bitmap.getHeight();
|
||||
takePhotoPath6 = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivDevice.setTag(takePhotoPath6);
|
||||
ivDevice.setImageBitmap(bitmap);//显示图像
|
||||
/* int height = bitmap.getHeight();
|
||||
int width = bitmap.getWidth();
|
||||
if (height > width) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
@ -1259,14 +1267,15 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
});
|
||||
} else {
|
||||
takePhotoPath6 = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivDevice.setTag(takePhotoPath6);
|
||||
ivDevice.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
||||
}*/
|
||||
} else if (requestCode == 107 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
int height = bitmap.getHeight();
|
||||
takePhotoPath7 = PhotoPathUtil.getTakePhotoPath(data, "d",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivUsable.setTag(takePhotoPath7);
|
||||
ivUsable.setImageBitmap(bitmap);//显示图像
|
||||
/* int height = bitmap.getHeight();
|
||||
int width = bitmap.getWidth();
|
||||
if (height > width) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
@ -1279,14 +1288,15 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
});
|
||||
} else {
|
||||
takePhotoPath7 = PhotoPathUtil.getTakePhotoPath(data, "d",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivUsable.setTag(takePhotoPath7);
|
||||
ivUsable.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
||||
}*/
|
||||
} else if (requestCode == 108 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
int height = bitmap.getHeight();
|
||||
takePhotoPath8 = PhotoPathUtil.getTakePhotoPath(data, "d",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivAvailable.setTag(takePhotoPath8);
|
||||
ivAvailable.setImageBitmap(bitmap);//显示图像
|
||||
/* int height = bitmap.getHeight();
|
||||
int width = bitmap.getWidth();
|
||||
if (height > width) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
@ -1299,14 +1309,15 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
});
|
||||
} else {
|
||||
takePhotoPath8 = PhotoPathUtil.getTakePhotoPath(data, "d",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivAvailable.setTag(takePhotoPath8);
|
||||
ivAvailable.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
||||
}*/
|
||||
} else if (requestCode == 109 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
int height = bitmap.getHeight();
|
||||
takePhotoPath9 = PhotoPathUtil.getTakePhotoPath(data, "e",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivParking.setImageBitmap(bitmap);//显示图像
|
||||
ivParking.setTag(takePhotoPath9);
|
||||
/* int height = bitmap.getHeight();
|
||||
int width = bitmap.getWidth();
|
||||
if (height > width) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
@ -1319,14 +1330,15 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
});
|
||||
} else {
|
||||
takePhotoPath9 = PhotoPathUtil.getTakePhotoPath(data, "e",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivParking.setImageBitmap(bitmap);//显示图像
|
||||
ivParking.setTag(takePhotoPath9);
|
||||
}
|
||||
|
||||
}*/
|
||||
} else if (requestCode == 110 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
int height = bitmap.getHeight();
|
||||
takePhotoPath10 = PhotoPathUtil.getTakePhotoPath(data, "e",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivNumber.setImageBitmap(bitmap);//显示图像
|
||||
ivNumber.setTag(takePhotoPath10);
|
||||
/* int height = bitmap.getHeight();
|
||||
int width = bitmap.getWidth();
|
||||
if (height > width) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
@ -1339,10 +1351,8 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
});
|
||||
} else {
|
||||
takePhotoPath10 = PhotoPathUtil.getTakePhotoPath(data, "e",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivNumber.setImageBitmap(bitmap);//显示图像
|
||||
ivNumber.setTag(takePhotoPath10);
|
||||
}
|
||||
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -619,6 +619,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
public void initRemovePileSharePre() {
|
||||
@ -688,28 +689,53 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj = false;
|
||||
EventBus.getDefault().post(obtain);
|
||||
String name = editNameContent.getText().toString().trim();//名称
|
||||
if (name == null || name.equals("")) {
|
||||
Toast.makeText(getActivity(), "请输入充电站 名称", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (latLng == null) {
|
||||
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
chargingStationList = new ArrayList<>();
|
||||
String tagPanorama = (String) ivPanorama.getTag();
|
||||
if (tagPanorama != null) {
|
||||
if (tagPanorama == null) {
|
||||
Toast.makeText(getContext(), "请拍照", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
chargingStationList.add(new File(tagPanorama));
|
||||
}
|
||||
String tagName = (String) ivName.getTag();
|
||||
if (tagName != null) {
|
||||
if (tagName == null) {
|
||||
Toast.makeText(getContext(), "请拍照", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
chargingStationList.add(new File(tagName));
|
||||
}
|
||||
|
||||
if (existence == 0) {
|
||||
String tagInternal = (String) ivInternal.getTag();
|
||||
if (tagInternal != null) {
|
||||
if (tagInternal == null) {
|
||||
Toast.makeText(getContext(), "请拍照", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
chargingStationList.add(new File(tagInternal));
|
||||
}
|
||||
String tagElse = (String) ivElse.getTag();
|
||||
if (tagElse != null) {
|
||||
if (tagElse == null) {
|
||||
Toast.makeText(getContext(), "请拍照", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
chargingStationList.add(new File(tagElse));
|
||||
}
|
||||
String tagScutcheon = (String) ivScutcheon.getTag();
|
||||
if (tagScutcheon != null) {
|
||||
if (tagScutcheon == null) {
|
||||
Toast.makeText(getContext(), "请拍照", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
chargingStationList.add(new File(tagScutcheon));
|
||||
}
|
||||
}
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -1035,6 +1061,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1093,6 +1120,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
private String initShowStation() {
|
||||
@ -1242,7 +1270,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
if (requestCode == 101 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
int height = bitmap.getHeight();
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivPanorama.setTag(takePhotoPath);
|
||||
ivPanorama.setImageBitmap(bitmap);//显示图像
|
||||
/* int height = bitmap.getHeight();
|
||||
int width = bitmap.getWidth();
|
||||
if (height > width) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
@ -1255,14 +1286,15 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivPanorama.setTag(takePhotoPath);
|
||||
ivPanorama.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
||||
}*/
|
||||
} else if (requestCode == 102 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
int height = bitmap.getHeight();
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "b", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivName.setTag(takePhotoPath);
|
||||
ivName.setImageBitmap(bitmap);//显示图像
|
||||
/*int height = bitmap.getHeight();
|
||||
int width = bitmap.getWidth();
|
||||
if (height > width) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
@ -1275,14 +1307,15 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "b", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivName.setTag(takePhotoPath);
|
||||
ivName.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
||||
}*/
|
||||
} else if (requestCode == 103 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
int height = bitmap.getHeight();
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivInternal.setTag(takePhotoPath);
|
||||
ivInternal.setImageBitmap(bitmap);//显示图像
|
||||
/*int height = bitmap.getHeight();
|
||||
int width = bitmap.getWidth();
|
||||
if (height > width) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
@ -1295,14 +1328,15 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivInternal.setTag(takePhotoPath);
|
||||
ivInternal.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
||||
}*/
|
||||
} else if (requestCode == 104 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
int height = bitmap.getHeight();
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "d", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivElse.setTag(takePhotoPath);
|
||||
ivElse.setImageBitmap(bitmap);//显示图像
|
||||
/* int height = bitmap.getHeight();
|
||||
int width = bitmap.getWidth();
|
||||
if (height > width) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
@ -1315,14 +1349,15 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "d", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivElse.setTag(takePhotoPath);
|
||||
ivElse.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
||||
}*/
|
||||
} else if (requestCode == 105 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
int height = bitmap.getHeight();
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "e", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivScutcheon.setTag(takePhotoPath);
|
||||
ivScutcheon.setImageBitmap(bitmap);//显示图像
|
||||
/* int height = bitmap.getHeight();
|
||||
int width = bitmap.getWidth();
|
||||
if (height > width) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
@ -1335,10 +1370,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "e", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivScutcheon.setTag(takePhotoPath);
|
||||
ivScutcheon.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
||||
}*/
|
||||
|
||||
}
|
||||
}
|
||||
@ -1413,9 +1446,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
@Override
|
||||
public void run() {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
if (poiDaoPoiEntity != null && poiDaoPoiEntity.getMemo() == null) {
|
||||
if (poiDaoPoiEntity != null) {
|
||||
if (poiDaoPoiEntity.getTaskStatus()==5){
|
||||
poiDao.deletePoiEntity(poiDaoPoiEntity);
|
||||
chargingPileDao.deleteChargingFidPileEntity(showPoiEntity.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
|
@ -87,6 +87,7 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
// private void initEventPrefecture(TaskPrefectureBean taskPrefectureBean, boolean start) {
|
||||
|
@ -147,8 +147,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
int taskStatus = poiEntity.getTaskStatus();
|
||||
initViewByTaskStatus(taskStatus);
|
||||
@ -220,15 +218,15 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
if (type == 6) {//面状任务的领取类型
|
||||
initPolygonTask(HttpInterface.RECEIVED_POLYGON_TASK, poiEntity.getTaskId(), false, poiEntity);
|
||||
} else if (type == 1) {//poi的领取类型
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK, poiEntity.getTaskId(), false,poiEntity);
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK, poiEntity.getTaskId(), false, poiEntity, 1);
|
||||
} else if (type == 2) {//充电站的领取类型
|
||||
chargingTaskByWork(HttpInterface.RECEIVED_CTASK, poiEntity.getTaskId(), false,poiEntity);
|
||||
chargingTaskByWork(HttpInterface.RECEIVED_CTASK, poiEntity.getTaskId(), false, 1);
|
||||
} else if (type == 3) {//poi录像的领取类型
|
||||
taskByNet(HttpInterface.RECEIVED_POI_VIDEO_TASK,poiEntity.getTaskId(),false,poiEntity);
|
||||
taskByNet(HttpInterface.RECEIVED_POI_VIDEO_TASK, poiEntity.getTaskId(), false, poiEntity, 1);
|
||||
} else if (type == 4) {//道路的领取类型
|
||||
taskByNet(HttpInterface.RECEIVED_ROAD_TASK,poiEntity.getTaskId(),false,poiEntity);
|
||||
taskByNet(HttpInterface.RECEIVED_ROAD_TASK, poiEntity.getTaskId(), false, poiEntity, 1);
|
||||
} else if (type == 5) {//其他的领取类型
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK, poiEntity.getTaskId(), false, poiEntity);
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK, poiEntity.getTaskId(), false, poiEntity, 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -256,15 +254,15 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
|
||||
}
|
||||
} else if (type == 1) {//poi的领取类型
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK, poiEntity.getTaskId(), true, poiEntity);
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK, poiEntity.getTaskId(), true, poiEntity, 5);
|
||||
} else if (type == 2) {//充电站的领取类型
|
||||
chargingTaskByWork(HttpInterface.RECEIVED_CTASK, poiEntity.getTaskId(), true, poiEntity);
|
||||
chargingTaskByWork(HttpInterface.RECEIVED_CTASK, poiEntity.getTaskId(), true, 5);
|
||||
} else if (type == 3) {//poi录像的领取类型
|
||||
taskByNet(HttpInterface.RECEIVED_POI_VIDEO_TASK,poiEntity.getTaskId(),true, poiEntity);
|
||||
taskByNet(HttpInterface.RECEIVED_POI_VIDEO_TASK, poiEntity.getTaskId(), true, poiEntity, 5);
|
||||
} else if (type == 4) {//道路的领取类型
|
||||
taskByNet(HttpInterface.RECEIVED_ROAD_TASK,poiEntity.getTaskId(),true, poiEntity);
|
||||
taskByNet(HttpInterface.RECEIVED_ROAD_TASK, poiEntity.getTaskId(), true, poiEntity, 5);
|
||||
} else if (type == 5) {//其他的领取类型
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK, poiEntity.getTaskId(), true, poiEntity);
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK, poiEntity.getTaskId(), true, poiEntity, 5);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -295,9 +293,9 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
|
||||
/**
|
||||
* @param url 筛选充电站领取任务
|
||||
* @param poiEntity
|
||||
* @param
|
||||
*/
|
||||
private void chargingTaskByWork(String url, int taskId, boolean isSaver, PoiEntity poiEntity) {
|
||||
private void chargingTaskByWork(String url, int taskId, boolean isSaver,int statusId) {
|
||||
showLoadingDialog();
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
@ -310,8 +308,13 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
dismissLoadingDialog();
|
||||
if (response.getCode() == 200) {
|
||||
ReceivedBean.BodyBean stationBean = response.getBody();
|
||||
PoiEntity chargingStationEntity = new PoiEntity();
|
||||
if (stationBean != null) {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiEntity taskIdPoiEntity = poiDao.getTaskIdPoiEntity(taskId);
|
||||
if (taskIdPoiEntity == null) {
|
||||
PoiEntity chargingStationEntity = new PoiEntity();
|
||||
chargingStationEntity.setTaskId(taskId);
|
||||
chargingStationEntity.setStation_type(stationBean.getSptype());
|
||||
chargingStationEntity.setName(stationBean.getName());
|
||||
@ -321,7 +324,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
chargingStationEntity.setAddress(stationBean.getAddress());
|
||||
chargingStationEntity.setTelPhone(stationBean.getTelephone() + "");
|
||||
chargingStationEntity.setType(Integer.valueOf(stationBean.getType()));
|
||||
chargingStationEntity.setTaskStatus(1);
|
||||
chargingStationEntity.setTaskStatus(statusId);
|
||||
chargingStationEntity.setIsLocalData(1);
|
||||
String geo = stationBean.getGeo();
|
||||
chargingStationEntity.setGeoWkt(geo);
|
||||
@ -339,7 +342,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
chargingStationEntity.setX(latPolygon.get(0).longitude + "");
|
||||
chargingStationEntity.setY(latPolygon.get(0).latitude + "");
|
||||
}
|
||||
}
|
||||
|
||||
//充电桩
|
||||
List<ReceivedBean.BodyBean.CsTaskListBean> csTaskList = response.getBody().getCsTaskList();
|
||||
@ -353,25 +355,14 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
chargingPileEntity.setP(csTaskList.get(i).getGeo());
|
||||
chargingPileEntityList[i] = chargingPileEntity;
|
||||
}
|
||||
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdateChargingPile(getActivity(), chargingPileEntityList);
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
//获取当前位置的marker
|
||||
senMessageMarker(chargingStationEntity.getType(), chargingStationEntity.getY(), chargingStationEntity.getX());
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(),chargingStationEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiEntity.setTaskStatus(1);
|
||||
initViewByTaskStatus(1);
|
||||
if (isSaver) {
|
||||
Message obtain = Message.obtain();
|
||||
@ -381,12 +372,24 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
initViewByTaskStatus(1);
|
||||
if (isSaver) {
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.GATHER_GET_MAP;
|
||||
obtain.obj = taskIdPoiEntity;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}else {
|
||||
Toast.makeText(getActivity(), "本任务已锁定", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -395,6 +398,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
|
||||
}
|
||||
|
||||
@ -472,6 +476,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -521,12 +526,12 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param url 面妆任务立即采集
|
||||
* @param b
|
||||
*
|
||||
*/
|
||||
private void initCompleteTask(String url, int taskId, boolean b, PoiEntity poiEntity) {
|
||||
if (taskId == 0) {
|
||||
@ -571,6 +576,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -620,6 +626,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
|
||||
@ -627,7 +634,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
* @param url poi类型对应的url
|
||||
* @param poiEntity
|
||||
*/
|
||||
private void receivedTaskByNet(String url, int taskId, boolean isSaver, PoiEntity poiEntity) {
|
||||
private void receivedTaskByNet(String url, int taskId, boolean isSaver, PoiEntity poiEntity, int statusId) {
|
||||
showLoadingDialog();
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
@ -639,16 +646,23 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
public void onSuccess(ReceivedPoiBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
if (response.getCode() == 200) {
|
||||
ReceivedPoiBean.BodyBean body = response.getBody();
|
||||
if (body != null) {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiEntity taskIdPoiEntity = poiDao.getTaskIdPoiEntity(taskId);
|
||||
if (taskIdPoiEntity == null) {//数据库没有这条数据
|
||||
ReceivedPoiBean.BodyBean listBean = response.getBody();
|
||||
PoiEntity poiListEntity = new PoiEntity();
|
||||
poiListEntity.setTaskId(listBean.getId());
|
||||
poiListEntity.setTaskId(taskId);
|
||||
poiListEntity.setName(listBean.getName());
|
||||
poiListEntity.setDescribe(listBean.getMemo());
|
||||
poiListEntity.setCreateTime(listBean.getEndDate());
|
||||
poiListEntity.setAddress(listBean.getAddress());
|
||||
poiListEntity.setType(Integer.valueOf(listBean.getType()));
|
||||
poiListEntity.setIsExclusive(listBean.getIsExclusive());
|
||||
poiListEntity.setTaskStatus(1);
|
||||
poiListEntity.setTaskStatus(statusId);
|
||||
poiListEntity.setIsLocalData(1);
|
||||
String geo = listBean.getGeo();
|
||||
poiListEntity.setGeoWkt(geo);
|
||||
@ -668,22 +682,11 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
}
|
||||
// 通知地图界面显示当前编辑数据的marker
|
||||
senMessageMarker(poiEntity.getType(), poiEntity.getY(), poiEntity.getX());
|
||||
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
|
||||
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiEntity.setTaskStatus(1);
|
||||
initViewByTaskStatus(1);
|
||||
// btnGetTask.setVisibility(View.GONE);
|
||||
// btnCancelGet.setVisibility(View.VISIBLE);
|
||||
// btnFinishGather.setVisibility(View.GONE);
|
||||
// btnGather.setVisibility(View.VISIBLE);
|
||||
|
||||
if (isSaver) {
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.GATHER_GET_MAP;
|
||||
@ -692,10 +695,25 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
initViewByTaskStatus(1);
|
||||
if (isSaver) {
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.GATHER_GET_MAP;
|
||||
obtain.obj = taskIdPoiEntity;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
@ -704,6 +722,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
Toast.makeText(getContext(), e.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -724,7 +743,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
* @param url 不同任务类型对应的url
|
||||
* @param poiEntity
|
||||
*/
|
||||
private void taskByNet(String url, int taskId, boolean isSaver, PoiEntity poiEntity) {
|
||||
private void taskByNet(String url, int taskId, boolean isSaver, PoiEntity poiEntity, int statusId) {
|
||||
showLoadingDialog();
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
@ -737,8 +756,13 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
dismissLoadingDialog();
|
||||
if (response.getCode() == 200) {
|
||||
TaskByNetBean.BodyBean listBean = response.getBody();
|
||||
PoiEntity poiListEntity = new PoiEntity();
|
||||
if (listBean != null) {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiEntity taskIdPoiEntity = poiDao.getTaskIdPoiEntity(taskId);
|
||||
if (taskIdPoiEntity == null) {//数据库没有这条数据
|
||||
PoiEntity poiListEntity = new PoiEntity();
|
||||
poiListEntity.setTaskId(taskId);
|
||||
poiListEntity.setName(listBean.getName());
|
||||
poiListEntity.setDescribe(listBean.getMemo());
|
||||
@ -747,7 +771,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
poiListEntity.setType(Integer.valueOf(listBean.getType()));
|
||||
poiListEntity.setPrecision(String.valueOf(listBean.getPrice()));
|
||||
poiListEntity.setIsExclusive(listBean.getIsExclusive());
|
||||
poiListEntity.setTaskStatus(1);
|
||||
poiListEntity.setTaskStatus(statusId);
|
||||
poiListEntity.setIsLocalData(1);
|
||||
String geo = listBean.getGeo();
|
||||
poiListEntity.setGeoWkt(geo);
|
||||
@ -765,18 +789,12 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
poiListEntity.setX(latPolygon.get(0).longitude + "");
|
||||
poiListEntity.setY(latPolygon.get(0).latitude + "");
|
||||
}
|
||||
}
|
||||
|
||||
//获取当前位置的marker
|
||||
senMessageMarker(poiListEntity.getType(),poiListEntity.getY(),poiListEntity.getX());
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// 通知地图界面显示当前编辑数据的marker
|
||||
senMessageMarker(poiEntity.getType(), poiEntity.getY(), poiEntity.getX());
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiEntity.setTaskStatus(1);
|
||||
initViewByTaskStatus(1);
|
||||
if (isSaver) {
|
||||
Message obtain = Message.obtain();
|
||||
@ -786,9 +804,27 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
initViewByTaskStatus(1);
|
||||
if (isSaver) {
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.GATHER_GET_MAP;
|
||||
obtain.obj = taskIdPoiEntity;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -798,7 +834,9 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
Toast.makeText(getContext(), e.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
public static String format5(double value) {
|
||||
return String.format("%.2f", value).toString();
|
||||
}
|
||||
|
@ -208,6 +208,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
Log.d("TAG", "onError: " + response.message());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -82,6 +82,7 @@ public class IssueFragment extends BaseFragment implements View.OnClickListener
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -107,6 +107,7 @@ public class MessageFragment extends BaseFragment implements View.OnClickListene
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
@ -124,6 +124,7 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -86,10 +86,6 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
private PoiEntity showPoiEntity;
|
||||
private LatLng latLng;
|
||||
private int station_type = 5;
|
||||
|
||||
|
||||
private String takePhotoPath;
|
||||
private String takePhotoPath2;
|
||||
private ArrayList<File> otherUploadList;
|
||||
private CheckBox checkPot;
|
||||
|
||||
@ -291,9 +287,13 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
editOtherDescribe.setText(describe);
|
||||
}
|
||||
int station_type = showPoiEntity.getStation_type();
|
||||
|
||||
spinnerOther.setSelection(station_type, true);
|
||||
|
||||
if (station_type==5){
|
||||
spinnerOther.setSelection(0, true);
|
||||
}else if (station_type==6){
|
||||
spinnerOther.setSelection(1, true);
|
||||
}else if (station_type==7){
|
||||
spinnerOther.setSelection(2, true);
|
||||
}
|
||||
|
||||
if (showPoiEntity.getPhotoInfo() != null) {
|
||||
for (int i = 0; i < showPoiEntity.getPhotoInfo().size(); i++) {
|
||||
@ -333,12 +333,27 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
break;
|
||||
case R.id.btn_other_uploading:
|
||||
otherUploadList = new ArrayList<>();
|
||||
String name = editTaskName.getText().toString().trim();//名称
|
||||
if (name == null || name.equals("")) {
|
||||
Toast.makeText(getActivity(), "请输入poi 名称", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (latLng == null) {
|
||||
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
String tagPicture = (String) ivPicture.getTag();
|
||||
if (tagPicture != null) {
|
||||
if (tagPicture == null) {
|
||||
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
otherUploadList.add(new File(tagPicture));
|
||||
}
|
||||
String tagPictures = (String) ivPictures.getTag();
|
||||
if (tagPictures != null) {
|
||||
if (tagPictures == null) {
|
||||
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
otherUploadList.add(new File(tagPictures));
|
||||
}
|
||||
new Thread(new Runnable() {
|
||||
@ -489,6 +504,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
Log.d("TAG", "onError: " + poiUploadBeanResponse.code() + "");
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
private void otherSaveByNetWork(PoiEntity poiEntity,boolean isLocal) {
|
||||
@ -539,6 +555,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -600,7 +617,11 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
if (requestCode == 101 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
int height = bitmap.getHeight();
|
||||
//照片路径
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivPicture.setTag(takePhotoPath);
|
||||
ivPicture.setImageBitmap(bitmap);//显示图像
|
||||
/* int height = bitmap.getHeight();
|
||||
int width = bitmap.getWidth();
|
||||
if (height > width) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
@ -613,16 +634,17 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
}
|
||||
});
|
||||
} else {
|
||||
//照片路径
|
||||
takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivPicture.setTag(takePhotoPath);
|
||||
ivPicture.setImageBitmap(bitmap);//显示图像
|
||||
|
||||
}
|
||||
|
||||
}*/
|
||||
} else if (requestCode == 102 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
int height = bitmap.getHeight();
|
||||
//照片路径
|
||||
String takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivPictures.setTag(takePhotoPath2);
|
||||
ivPictures.setImageBitmap(bitmap);//显示图像
|
||||
/*int height = bitmap.getHeight();
|
||||
int width = bitmap.getWidth();
|
||||
if (height > width) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
@ -635,11 +657,8 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
}
|
||||
});
|
||||
} else {
|
||||
//照片路径
|
||||
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivPictures.setTag(takePhotoPath2);
|
||||
ivPictures.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
@ -652,10 +671,12 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
@Override
|
||||
public void run() {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
if (poiDaoPoiEntity!=null&&poiDaoPoiEntity.getMemo() == null) {
|
||||
if (poiDaoPoiEntity!=null) {
|
||||
if (poiDaoPoiEntity.getTaskStatus()==5){
|
||||
poiDao.deletePoiEntity(poiDaoPoiEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
|
@ -57,6 +57,7 @@ import com.navinfo.outdoor.room.PoiDatabase;
|
||||
import com.navinfo.outdoor.room.PoiEntity;
|
||||
import com.navinfo.outdoor.ui.view.ContactView;
|
||||
import com.navinfo.outdoor.util.Geohash;
|
||||
import com.navinfo.outdoor.util.NetWorkUtils;
|
||||
import com.navinfo.outdoor.util.PhotoPathUtil;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||
|
||||
@ -246,6 +247,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
|
||||
|
||||
}
|
||||
|
||||
//拍照长按删除
|
||||
private void onLongDel() {
|
||||
rlPanorama.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@ -460,6 +462,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
|
||||
@ -509,11 +512,26 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
case R.id.btn_uploading:
|
||||
poiPicList = new ArrayList<>();
|
||||
String tagPanorama = (String) ivPanorama.getTag();
|
||||
if (tagPanorama != null) {
|
||||
String name = editNameContent.getText().toString().trim();//名称
|
||||
if (name == null || name.equals("")) {
|
||||
Toast.makeText(getActivity(), "请输入poi 名称", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (latLng == null) {
|
||||
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (tagPanorama == null) {
|
||||
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
poiPicList.add(new File(tagPanorama));
|
||||
}
|
||||
String tagName = (String) ivName.getTag();
|
||||
if (tagName != null) {
|
||||
if (tagName == null) {
|
||||
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
poiPicList.add(new File(tagName));
|
||||
}
|
||||
|
||||
@ -599,6 +617,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
public void initPoiSaveLocal(boolean isLocal) {
|
||||
@ -705,6 +724,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void poiUploadByNetWork(int body, ArrayList<File> poiPicList) {
|
||||
@ -749,6 +769,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
Log.d("TAG", "onError: " + response.message() + "");
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
|
||||
}
|
||||
|
||||
private void poiSaveByNet(PoiEntity poiEntity, boolean isLocal) {
|
||||
@ -800,6 +822,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -887,7 +910,10 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
if (requestCode == 101 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
int height = bitmap.getHeight();
|
||||
String takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivPanorama.setTag(takePhotoPath1);
|
||||
ivPanorama.setImageBitmap(bitmap);//显示图像
|
||||
/* int height = bitmap.getHeight();
|
||||
int width = bitmap.getWidth();
|
||||
if (height > width) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
@ -900,14 +926,15 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivPanorama.setTag(takePhotoPath1);
|
||||
ivPanorama.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
||||
}*/
|
||||
} else if (requestCode == 102 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
int height = bitmap.getHeight();
|
||||
String takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivName.setTag(takePhotoPath2);
|
||||
ivName.setImageBitmap(bitmap);//显示图像
|
||||
/* int height = bitmap.getHeight();
|
||||
int width = bitmap.getWidth();
|
||||
if (height > width) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
@ -920,14 +947,15 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivName.setTag(takePhotoPath2);
|
||||
ivName.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
||||
}*/
|
||||
} else if (requestCode == 103 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
int height = bitmap.getHeight();
|
||||
String takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivInternal.setTag(takePhotoPath3);
|
||||
ivInternal.setImageBitmap(bitmap);//显示图像
|
||||
/*int height = bitmap.getHeight();
|
||||
int width = bitmap.getWidth();
|
||||
if (height > width) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
@ -940,14 +968,15 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivInternal.setTag(takePhotoPath3);
|
||||
ivInternal.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
||||
}*/
|
||||
} else if (requestCode == 104 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
int height = bitmap.getHeight();
|
||||
String takePhotoPath4 = PhotoPathUtil.getTakePhotoPath(data, "d", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivCard.setTag(takePhotoPath4);
|
||||
ivCard.setImageBitmap(bitmap);//显示图像
|
||||
/* int height = bitmap.getHeight();
|
||||
int width = bitmap.getWidth();
|
||||
if (height > width) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
@ -960,14 +989,15 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath4 = PhotoPathUtil.getTakePhotoPath(data, "d", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivCard.setTag(takePhotoPath4);
|
||||
ivCard.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
||||
}*/
|
||||
} else if (requestCode == 105 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
int height = bitmap.getHeight();
|
||||
String takePhotoPath5 = PhotoPathUtil.getTakePhotoPath(data, "e", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivElse.setTag(takePhotoPath5);
|
||||
ivElse.setImageBitmap(bitmap);//显示图像
|
||||
/* int height = bitmap.getHeight();
|
||||
int width = bitmap.getWidth();
|
||||
if (height > width) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
@ -979,11 +1009,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
return false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath5 = PhotoPathUtil.getTakePhotoPath(data, "e", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivElse.setTag(takePhotoPath5);
|
||||
ivElse.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
} else {}*/
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -1003,9 +1030,12 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
@Override
|
||||
public void run() {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
if (poiDaoPoiEntity!=null&&poiDaoPoiEntity.getMemo() == null) {
|
||||
if (poiDaoPoiEntity != null ) {
|
||||
if (poiDaoPoiEntity.getTaskStatus()==5){
|
||||
poiDao.deletePoiEntity(poiDaoPoiEntity);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
@ -286,7 +286,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
videoFileList.add(videoFile);
|
||||
File file = new File(videoFile.getPath()+".txt");
|
||||
videoFileList.add(file);
|
||||
}
|
||||
fileZip = new File(Constant.PICTURE_FOLDER, "files" + ".zip");
|
||||
ZipUtil.zipFiles(videoFileList, fileZip, null);
|
||||
new Thread(new Runnable() {
|
||||
@ -306,6 +305,10 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
|
||||
}
|
||||
}).start();
|
||||
}else {
|
||||
Toast.makeText(getContext(), "请录像", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -362,11 +365,12 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
||||
}
|
||||
}
|
||||
if (ivPoiVideoPicture.getTag() == null) {
|
||||
File videoFile = (File) ivPoiVideoPicture.getTag();
|
||||
if (videoFile == null ) {
|
||||
Toast.makeText(getActivity(), "请录像", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
File videoFile = (File) ivPoiVideoPicture.getTag();
|
||||
|
||||
String path = videoFile.getPath() + ".txt";
|
||||
poiEntity.setPhoto(videoFile.getAbsolutePath());
|
||||
List<String> strings = FileUtils.readFileToList(path, "utf-8");
|
||||
@ -473,6 +477,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
Log.d("TAG", "onError: " + response.code() + "");
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
private void poiVideoSave(PoiEntity poiEntity, boolean isLocal) {
|
||||
@ -527,6 +532,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -634,10 +640,12 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
@Override
|
||||
public void run() {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
if (poiDaoPoiEntity!=null&&poiDaoPoiEntity.getMemo() == null) {
|
||||
if (poiDaoPoiEntity!=null) {
|
||||
if (poiDaoPoiEntity.getTaskStatus()==5){
|
||||
poiDao.deletePoiEntity(poiDaoPoiEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
}
|
@ -267,7 +267,6 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
videoFileList.add(videoFile);
|
||||
File file = new File(videoFile.getPath() + ".txt");
|
||||
videoFileList.add(file);
|
||||
}
|
||||
fileZip = new File(Constant.PICTURE_FOLDER, "files" + ".zip");
|
||||
ZipUtil.zipFiles(videoFileList, fileZip, null);
|
||||
new Thread(new Runnable() {
|
||||
@ -287,6 +286,11 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
|
||||
}
|
||||
}).start();
|
||||
}else {
|
||||
Toast.makeText(getContext(), "请录像", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
@ -454,6 +458,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
Log.d("TAG", "onError: " + response.code() + "");
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
private void roadSaveBetWork(PoiEntity poiEntity, boolean isLocal) {
|
||||
@ -509,6 +514,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -617,14 +623,16 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroy();
|
||||
// new Thread(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
// if (poiDaoPoiEntity!=null&&poiDaoPoiEntity.getName() == null) {
|
||||
// poiDao.deletePoiEntity(poiDaoPoiEntity);
|
||||
// }
|
||||
// }
|
||||
// }).start();
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
if (poiDaoPoiEntity!=null) {
|
||||
if (poiDaoPoiEntity.getTaskStatus()==5){
|
||||
poiDao.deletePoiEntity(poiDaoPoiEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
}
|
@ -133,6 +133,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
dismissLoadingDialog();
|
||||
refreshData();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -121,6 +121,7 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
|
||||
|
@ -114,6 +114,7 @@ public class TaskExplainFragment2 extends BaseFragment implements View.OnClickLi
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -122,6 +122,7 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
// private void initTaskSpecification(TaskPrefectureBean taskPrefectureBean, boolean start) {
|
||||
|
@ -45,6 +45,7 @@ import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.bean.JobSearchBean;
|
||||
import com.navinfo.outdoor.bean.RoadExtend;
|
||||
import com.navinfo.outdoor.http.DialogCallback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.room.ChargingPileEntity;
|
||||
@ -244,8 +245,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
case 1:
|
||||
PoiFragment poiFragment = PoiFragment.newInstance(bundle);
|
||||
showSlidingFragment(poiFragment);
|
||||
|
||||
|
||||
break;
|
||||
case 2:
|
||||
ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle);
|
||||
@ -482,8 +481,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
Log.d("TAG", "onError: " + response.message() + "");
|
||||
}
|
||||
});
|
||||
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
public void initMarker(PoiEntity poiEntity) {
|
||||
sliding_layout.setPanelHeight(0);
|
||||
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
|
||||
@ -782,7 +782,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
gatherGetFragment = GatherGetFragment.newInstance(bundle);
|
||||
fragmentTransaction.replace(R.id.frame_layout, gatherGetFragment);
|
||||
fragmentTransaction.commit();
|
||||
|
||||
// 如果当前fragment是筛选,则移除该fragment
|
||||
FilterFragment filterFragment = (FilterFragment) supportFragmentManager.findFragmentByTag(FilterFragment.class.getName());
|
||||
if (filterFragment != null) {
|
||||
@ -883,6 +882,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
frameLayout.setVisibility(View.GONE);
|
||||
sliding_layout.setPanelHeight(0);
|
||||
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
|
||||
}
|
||||
if (markerPoi != null) {
|
||||
markerPoi.remove();
|
||||
}
|
||||
@ -892,7 +892,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
if (bigMarker != null) {
|
||||
bigMarker.setVisible(false);
|
||||
}
|
||||
}
|
||||
} else if (data.what == Constant.MAIN_BUTTON_VISIABLE) {//控制主界面各个按钮显隐状态的what值
|
||||
setMainButtonVisiable((Integer) data.obj);
|
||||
} else if (data.what == Constant.MAIN_HEADER) {// 控制主界面各个header
|
||||
@ -908,13 +907,12 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
sliding_layout.setPanelHeight(1000);
|
||||
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
|
||||
} else {
|
||||
setMainButtonVisiable(View.VISIBLE);
|
||||
frameLayout.setVisibility(View.GONE);
|
||||
fragmentTransaction.remove(gatherGetFragment);
|
||||
}
|
||||
if (bigMarker != null) {
|
||||
bigMarker.setVisible(false);
|
||||
}
|
||||
}
|
||||
} else if (data.what == Constant.CHARGING_STATION) {//充电站的充电桩-新增
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putBoolean("isSliding", false); // 通知抽屉不收回
|
||||
@ -957,12 +955,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
int type = data.arg1;
|
||||
showPoiMarkerByType(type, latLng);
|
||||
} else if (data.what == Constant.EVENT_WHAT_COMPLETE_TASK) {
|
||||
// 如果当前fragment是筛选,则移除该fragment
|
||||
FilterFragment filterFragment = (FilterFragment) supportFragmentManager.findFragmentByTag(FilterFragment.class.getName());
|
||||
if (filterFragment != null) {
|
||||
fragmentTransaction.remove(filterFragment);
|
||||
//fragmentTransaction.commit();
|
||||
}
|
||||
initRemoveFragment();
|
||||
PoiEntity poiEntity = (PoiEntity) data.obj;
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putBoolean("isSliding", true); // 通知抽屉不收回
|
||||
@ -990,6 +983,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
break;
|
||||
}
|
||||
frameLayout.setVisibility(View.GONE);
|
||||
if (gatherGetFragment != null) {
|
||||
fragmentTransaction.remove(gatherGetFragment);
|
||||
}
|
||||
} else if (data.what == Constant.EVENT_WORK_UNPOLYGON) {//面妆任务点击立即采集或者结束采集需要回到寻宝界面
|
||||
if ((boolean) data.obj) {
|
||||
setMainButtonVisiable(View.VISIBLE);
|
||||
@ -1006,6 +1002,29 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
}
|
||||
|
||||
private void initRemoveFragment() {
|
||||
PoiFragment poiFragments = (PoiFragment) supportFragmentManager.findFragmentByTag(PoiFragment.class.getName());
|
||||
if (poiFragments != null) {
|
||||
fragmentTransaction.remove(poiFragments);
|
||||
}
|
||||
ChargingStationFragment chargingStationFragment = (ChargingStationFragment) supportFragmentManager.findFragmentByTag(ChargingStationFragment.class.getName());
|
||||
if (chargingStationFragment != null) {
|
||||
fragmentTransaction.remove(chargingStationFragment);
|
||||
}
|
||||
PoiVideoFragment poiVideoFragment = (PoiVideoFragment) supportFragmentManager.findFragmentByTag(PoiVideoFragment.class.getName());
|
||||
if (poiVideoFragment != null) {
|
||||
fragmentTransaction.remove(poiVideoFragment);
|
||||
} RoadFragment roadFragment = (RoadFragment) supportFragmentManager.findFragmentByTag(RoadFragment.class.getName());
|
||||
if (roadFragment != null) {
|
||||
fragmentTransaction.remove(roadFragment);
|
||||
}
|
||||
OtherFragment otherFragment = (OtherFragment) supportFragmentManager.findFragmentByTag(OtherFragment.class.getName());
|
||||
if (otherFragment != null) {
|
||||
fragmentTransaction.remove(otherFragment);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 控制主界面各个按钮的显示状态
|
||||
@ -1057,6 +1076,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void initPileMarker(LatLng latLng) {
|
||||
LatLng mapCenterPoint = getMapCenterPoint();
|
||||
CameraUpdate cameraSigma = CameraUpdateFactory.newCameraPosition(new CameraPosition(
|
||||
@ -1083,6 +1103,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void initCheckedPileMarker(int poiWord) {
|
||||
if (screenPosition != null) {
|
||||
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
|
||||
@ -1116,7 +1137,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
*/
|
||||
private void setLocMarkerStyle() {
|
||||
locationStyle = new MyLocationStyle();
|
||||
locationStyle.myLocationType(MyLocationStyle.LOCATION_TYPE_FOLLOW_NO_CENTER);
|
||||
locationStyle.myLocationType(MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER);
|
||||
//创建图标
|
||||
BitmapDescriptor bitmapDescriptor = BitmapDescriptorFactory.fromBitmap(getBitMap(R.drawable.location));
|
||||
locationStyle.icon(bitmapDescriptor);
|
||||
@ -1417,6 +1438,18 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
fragmentTransaction.hide(poiFragment);
|
||||
}
|
||||
}
|
||||
if (!(fragment instanceof RoadFragment)) {
|
||||
RoadFragment roadFragment = (RoadFragment) supportFragmentManager.findFragmentByTag(RoadFragment.class.getName());
|
||||
if (roadFragment != null) {
|
||||
fragmentTransaction.hide(roadFragment);
|
||||
}
|
||||
}
|
||||
if (!(fragment instanceof PoiVideoFragment)) {
|
||||
PoiVideoFragment poiVideoFragment = (PoiVideoFragment) supportFragmentManager.findFragmentByTag(PoiVideoFragment.class.getName());
|
||||
if (poiVideoFragment != null) {
|
||||
fragmentTransaction.hide(poiVideoFragment);
|
||||
}
|
||||
}
|
||||
fragmentTransaction.show(fragment);
|
||||
fragmentTransaction.addToBackStack(null);
|
||||
fragmentTransaction.commit();
|
||||
@ -1426,7 +1459,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
* 检查网络状态
|
||||
*/
|
||||
private void checkNetWork() {
|
||||
if (NetWorkUtils.isNetworkAvailable(getContext())) { // 当前网络可用
|
||||
if (NetWorkUtils.iConnected(getContext())) { // 当前网络可用
|
||||
checkMyLocation();
|
||||
} else { // 当前网络不可用
|
||||
ToastUtil.showShort(getContext(), Constant.NETWORK_UNAVAILABLE);
|
||||
|
@ -213,6 +213,7 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
Log.d("TAG", "onError: " + response.message());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -118,6 +118,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -174,5 +175,6 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
dismissDialog();
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ public class PoiEntity implements Serializable {
|
||||
private String y;//纬度
|
||||
private String detail;//深度信息
|
||||
private String dist;//距离用户位置
|
||||
private int taskStatus;//任务状态 0.未领取 1.已领取,2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功),4已上传(结束采集)
|
||||
private int taskStatus;//任务状态 0.未领取 1.已领取,5 立即采集,2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功),4已上传(结束采集)
|
||||
private int type;//1 "POI"2 "充电站"3 "POI录像"4 "道路录像"5 "其他"6 "面状任务"
|
||||
private int station_type;//1."充电站"2 "充换电站"3 "充电桩组"4 "换电站"5 "门牌", "公交:6 情报:7
|
||||
private int isLocalData;//是否是本地数据 0,服务 1,本地
|
||||
|
@ -66,7 +66,7 @@ public class ContactView {
|
||||
// rootView.removeViewAt(i);
|
||||
}
|
||||
});
|
||||
holder.editPhoneNumber.setText(poiBean.getPhone());
|
||||
holder.editPhoneNumber.setText(poiBean.getPhone()+"");
|
||||
holder.editPhoneNumber.addTextChangedListener(new TextWatcher() {
|
||||
|
||||
@Override
|
||||
|
@ -2,32 +2,86 @@ package com.navinfo.outdoor.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkCapabilities;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.Build;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresPermission;
|
||||
|
||||
import static android.Manifest.permission.ACCESS_NETWORK_STATE;
|
||||
|
||||
/**
|
||||
* 项目名称:网络工具类
|
||||
*/
|
||||
* @author GreenHairTurtle
|
||||
* 网络工具类
|
||||
**/
|
||||
public class NetWorkUtils {
|
||||
/**
|
||||
* 当前网络是否可用
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
public static boolean isNetworkAvailable(Context context) {
|
||||
ConnectivityManager connectivityManager =
|
||||
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
|
||||
if (connectivityManager != null) {
|
||||
NetworkInfo info = connectivityManager.getActiveNetworkInfo();
|
||||
if (info != null && info.isConnected()) {
|
||||
// 当前网络是连接的
|
||||
if (info.getState() == NetworkInfo.State.CONNECTED) {
|
||||
// 当前所链接的网络可用
|
||||
return true;
|
||||
/**
|
||||
* 网络是否已连接
|
||||
*
|
||||
* @return true:已连接 false:未连接
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@RequiresPermission(ACCESS_NETWORK_STATE)
|
||||
public static boolean iConnected(@NonNull Context context) {
|
||||
ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
if (manager != null) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
NetworkCapabilities networkCapabilities = manager.getNetworkCapabilities(manager.getActiveNetwork());
|
||||
if (networkCapabilities != null) {
|
||||
return networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)
|
||||
|| networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR)
|
||||
|| networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_ETHERNET);
|
||||
}
|
||||
} else {
|
||||
NetworkInfo networkInfo = manager.getActiveNetworkInfo();
|
||||
return networkInfo != null && networkInfo.isConnected();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wifi是否已连接
|
||||
*
|
||||
* @return true:已连接 false:未连接
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public static boolean isWifiConnected(@NonNull Context context) {
|
||||
ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
if (manager != null) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
NetworkCapabilities networkCapabilities = manager.getNetworkCapabilities(manager.getActiveNetwork());
|
||||
if (networkCapabilities != null) {
|
||||
return networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI);
|
||||
}
|
||||
} else {
|
||||
NetworkInfo networkInfo = manager.getActiveNetworkInfo();
|
||||
return networkInfo != null && networkInfo.isConnected() && networkInfo.getType() == ConnectivityManager.TYPE_WIFI;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否为流量
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public static boolean isMobileData(@NonNull Context context) {
|
||||
ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
if (manager != null) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
NetworkCapabilities networkCapabilities = manager.getNetworkCapabilities(manager.getActiveNetwork());
|
||||
if (networkCapabilities != null) {
|
||||
return networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR);
|
||||
}
|
||||
} else {
|
||||
NetworkInfo networkInfo = manager.getActiveNetworkInfo();
|
||||
return networkInfo != null && networkInfo.isConnected() && networkInfo.getType() == ConnectivityManager.TYPE_MOBILE;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,6 +46,9 @@ public class TecentLocationUtils implements TencentLocationListener{
|
||||
//创建定位请求
|
||||
locationRequest = TencentLocationRequest.create();
|
||||
locationRequest.setInterval(1000); // 每1秒返回一次地址数据
|
||||
locationRequest.setAllowDirection(true);
|
||||
locationRequest.setAllowGPS(true);
|
||||
locationRequest.setIndoorLocationMode(true);
|
||||
}
|
||||
|
||||
public void startLocation(Context mContext) { // 启动定位服务
|
||||
@ -92,10 +95,15 @@ public class TecentLocationUtils implements TencentLocationListener{
|
||||
public void onLocationChanged(TencentLocation tencentLocation, int i, String s) {
|
||||
if (i == TencentLocation.ERROR_OK) {
|
||||
Location location = new Location(tencentLocation.getProvider());
|
||||
//设置经纬度以及精度
|
||||
// //设置经纬度以及精度
|
||||
location.setLatitude(tencentLocation.getLatitude());
|
||||
location.setLongitude(tencentLocation.getLongitude());
|
||||
location.setAccuracy(tencentLocation.getAccuracy());
|
||||
if (tencentLocation.getBearing()!=0) {
|
||||
location.setBearing(tencentLocation.getBearing());
|
||||
} else {
|
||||
location.setBearing((float) tencentLocation.getDirection());
|
||||
}
|
||||
if (locationChangedListenerList!=null) {
|
||||
for (LocationSource.OnLocationChangedListener locationChangedListener:locationChangedListenerList) {
|
||||
locationChangedListener.onLocationChanged(location);
|
||||
|
@ -21,6 +21,8 @@
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="6dp"
|
||||
app:tabMode="fixed"
|
||||
app:tabGravity="fill"
|
||||
app:tabMaxWidth="0dp"
|
||||
app:tabRippleColor="@android:color/transparent"
|
||||
app:tabIndicatorHeight="0dp"
|
||||
app:tabTextColor="#F08A8888"
|
||||
|
Loading…
x
Reference in New Issue
Block a user