查看视频相册播放
This commit is contained in:
parent
4b8a57e739
commit
13bf70c69a
@ -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"
|
||||
|
@ -56,7 +56,6 @@ public class HomeActivity extends BaseActivity{
|
||||
if (!EventBus.getDefault().isRegistered(this)) {//加上判断
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
protected void initView() {
|
||||
@ -74,15 +73,13 @@ public class HomeActivity extends BaseActivity{
|
||||
fragments.add(recordFragment);
|
||||
fragments.add(new FindFragment());
|
||||
fragments.add(new MineFragment());
|
||||
mViewPager.setOffscreenPageLimit(3);
|
||||
|
||||
mViewPager.setOffscreenPageLimit(3);
|
||||
mViewPager.setAdapter(new FragmentPagerAdapter(getSupportFragmentManager()) {
|
||||
@NotNull
|
||||
@Override
|
||||
public Fragment getItem(int i) {
|
||||
return fragments.get(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return fragments.size();
|
||||
@ -90,9 +87,7 @@ public class HomeActivity extends BaseActivity{
|
||||
});
|
||||
mViewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
|
||||
}
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { }
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
@ -102,9 +97,7 @@ public class HomeActivity extends BaseActivity{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
public void onPageScrollStateChanged(int state) { }
|
||||
});
|
||||
mViewPager.setCanScroll(true);
|
||||
mViewPager.setNoScrollAnim(false);
|
||||
@ -130,16 +123,12 @@ public class HomeActivity extends BaseActivity{
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
}
|
||||
|
||||
//点击table layout效果
|
||||
@Override
|
||||
public void onTabUnselected(TabLayout.Tab tab) {
|
||||
}
|
||||
public void onTabUnselected(TabLayout.Tab tab) {}
|
||||
|
||||
@Override
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
|
||||
}
|
||||
public void onTabReselected(TabLayout.Tab tab) {}
|
||||
});
|
||||
|
||||
}
|
||||
@ -166,7 +155,6 @@ public class HomeActivity extends BaseActivity{
|
||||
if (!BackHandlerHelper.handleBackPress(this)) {
|
||||
super.onBackPressed();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -32,7 +32,6 @@ public class ImageShowActivity extends BaseActivity implements View.OnClickListe
|
||||
super.initView();
|
||||
imgUrl = getIntent().getStringArrayListExtra("info");
|
||||
type = getIntent().getIntExtra("type", 0);
|
||||
|
||||
Log.d("ImageShowActivity", "initData: " + imgUrl);
|
||||
image_pager = findViewById(R.id.image_pager);
|
||||
ImageView imageShow = findViewById(R.id.iv_image_show);
|
||||
@ -40,7 +39,6 @@ public class ImageShowActivity extends BaseActivity implements View.OnClickListe
|
||||
initViewPager();
|
||||
}
|
||||
|
||||
|
||||
private void initViewPager() {
|
||||
if (imgUrl != null && imgUrl.size() != 0) {
|
||||
ImagePagerAdapter mAdapter = new ImagePagerAdapter(getApplicationContext(), imgUrl);
|
||||
|
@ -31,6 +31,10 @@ import com.navinfo.outdoor.util.Md5Util;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 登录页
|
||||
*/
|
||||
@ -272,6 +276,7 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
|
@ -174,7 +174,6 @@ public class MainActivity extends BaseActivity {
|
||||
} else {//不需要升级
|
||||
initTime();
|
||||
}
|
||||
|
||||
} else {
|
||||
initTime();
|
||||
}
|
||||
@ -185,11 +184,8 @@ public class MainActivity extends BaseActivity {
|
||||
dismissLoadingDialog();
|
||||
Toast.makeText(MainActivity.this, e.getMessage()+"", Toast.LENGTH_SHORT).show();
|
||||
initTime();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -232,7 +228,6 @@ public class MainActivity extends BaseActivity {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
@ -240,18 +235,14 @@ public class MainActivity extends BaseActivity {
|
||||
initTime();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
builder.create().show();
|
||||
}
|
||||
|
||||
public void initTime() {
|
||||
new CountDownTimer(3000, 1000) {
|
||||
@Override
|
||||
public void onTick(long l) {
|
||||
}
|
||||
|
||||
public void onTick(long l) {}
|
||||
@Override
|
||||
public void onFinish() {
|
||||
Intent intent = new Intent(MainActivity.this, LoginActivity.class);
|
||||
|
@ -405,7 +405,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
} else if (poiEntity.getType() == 4) {//道路录像
|
||||
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.road_arrows);
|
||||
}
|
||||
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
||||
// 构造 PolylineOnions
|
||||
PolylineOptions polylineOptions = new PolylineOptions()
|
||||
.addAll(latLineString)
|
||||
|
@ -101,6 +101,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
capturePicture.setText("开始采集");
|
||||
}
|
||||
capturePicture.setChecked(false);
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -279,7 +280,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
} else if (poiEntity.getType() == 4) {//道路录像
|
||||
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.road_arrows);
|
||||
}
|
||||
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
||||
// 构造 PolylineOnions
|
||||
PolylineOptions polylineOptions = new PolylineOptions()
|
||||
.addAll(latLineString)
|
||||
|
@ -8,20 +8,14 @@ import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.kongzue.dialog.util.BaseDialog;
|
||||
import com.kongzue.dialog.v3.CustomDialog;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.navinfo.outdoor.R;
|
||||
@ -48,8 +42,6 @@ import com.tencent.tencentmap.mapsdk.maps.interfaces.Removable;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptorFactory;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.CameraPosition;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.Circle;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.CircleOptions;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.Marker;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.MarkerOptions;
|
||||
@ -58,29 +50,21 @@ import com.tencent.tencentmap.mapsdk.maps.model.Polygon;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.PolygonOptions;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.Polyline;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.PolylineOptions;
|
||||
import com.tencent.tencentmap.mapsdk.vector.utils.clustering.Cluster;
|
||||
import com.tencent.tencentmap.mapsdk.vector.utils.clustering.ClusterItem;
|
||||
import com.tencent.tencentmap.mapsdk.vector.utils.clustering.ClusterManager;
|
||||
import com.tencent.tencentmap.mapsdk.vector.utils.clustering.algo.NonHierarchicalDistanceBasedAlgorithm;
|
||||
import com.tencent.tencentmap.mapsdk.vector.utils.clustering.view.DefaultClusterRenderer;
|
||||
import com.vividsolutions.jts.awt.PointShapeFactory;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
import com.vividsolutions.jts.geom.Geometry;
|
||||
import com.vividsolutions.jts.geom.GeometryFactory;
|
||||
import com.vividsolutions.jts.geom.MultiPoint;
|
||||
import com.vividsolutions.jts.geom.Point;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.tencent.tencentmap.mapsdk.maps.model.MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE;
|
||||
import static com.tencent.tencentmap.mapsdk.maps.model.MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER;
|
||||
|
||||
public class TestActivity extends BaseActivity {
|
||||
@ -180,7 +164,7 @@ public class TestActivity extends BaseActivity {
|
||||
} else if (listBean.getType() == 4) {//道路录像
|
||||
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.road_arrows);
|
||||
}
|
||||
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
||||
// 构造 PolylineOptions
|
||||
PolylineOptions polylineOptions = new PolylineOptions()
|
||||
.addAll(latLineString)// 折线设置圆形线头
|
||||
@ -201,7 +185,7 @@ public class TestActivity extends BaseActivity {
|
||||
}
|
||||
break;
|
||||
case "Polygon": //面
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLags(geo);
|
||||
Polygon polygon = tencentMap.addPolygon(new PolygonOptions().
|
||||
addAll(latPolygon).//连接封闭图形的点
|
||||
fillColor(Color.parseColor("#97E0E7EC")). //填充颜色为红色
|
||||
@ -431,7 +415,7 @@ public class TestActivity extends BaseActivity {
|
||||
break;
|
||||
case "LineString": //线
|
||||
case "Polygon": //面
|
||||
List<LatLng> latLineString = GeometryTools.getLatLngs(beanGeo);
|
||||
List<LatLng> latLineString = GeometryTools.getLatLags(beanGeo);
|
||||
assert latLineString != null;
|
||||
poiListEntity.setX(latLineString.get(0).longitude + "");
|
||||
poiListEntity.setY(latLineString.get(0).latitude + "");
|
||||
|
@ -62,7 +62,6 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("CommitPrefEdits")
|
||||
@ -215,7 +214,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
@Override
|
||||
public void onSuccess(UserBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
|
||||
Log.d("TAG", "onSuccess: " + response.toString());
|
||||
if (response.getCode()==200) {
|
||||
MessageDialog.show(UserActivity.this, "提示","是否保存", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
@ -304,7 +303,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
|
||||
ArrayList<JsonBean> jsonBean = parseData(JsonData);//用Gson 转成实体
|
||||
|
||||
/**
|
||||
/*
|
||||
* 添加省份数据
|
||||
*
|
||||
* 注意:如果是添加的JavaBean实体,则实体类需要实现 IPickerViewData 接口,
|
||||
@ -339,12 +338,12 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
city_AreaList.add(AreaList);//添加该省所有地区数据的bean
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 添加城市数据
|
||||
*/
|
||||
options2Items.add(CityList);
|
||||
|
||||
/**
|
||||
/*
|
||||
* 添加地区数据
|
||||
*/
|
||||
options3Items.add(Province_AreaList);
|
||||
@ -352,7 +351,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<JsonBean> parseData(String result) {//Gson 解析
|
||||
public ArrayList<JsonBean> parseData(String result) {//GOON 解析
|
||||
ArrayList<JsonBean> detail = new ArrayList<>();
|
||||
try {
|
||||
JSONArray data = new JSONArray(result);
|
||||
|
@ -97,7 +97,6 @@ public class WebActivity extends BaseActivity implements View.OnClickListener {
|
||||
private static class MyWebViewClient extends WebViewClient {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
|
||||
return super.shouldOverrideUrlLoading(view, url);
|
||||
}
|
||||
|
||||
@ -108,7 +107,6 @@ public class WebActivity extends BaseActivity implements View.OnClickListener {
|
||||
super.onPageFinished(view, url);
|
||||
// html加载完成之后,添加监听图片的点击js函数
|
||||
// addImageClickListener();
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("SetJavaScriptEnabled")
|
||||
@ -121,9 +119,7 @@ public class WebActivity extends BaseActivity implements View.OnClickListener {
|
||||
|
||||
@Override
|
||||
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
|
||||
|
||||
super.onReceivedError(view, errorCode, description, failingUrl);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import okhttp3.MediaType;
|
||||
|
||||
@ -47,7 +48,6 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
private CapacityMeasureAdapter capacityMeasureAdapter;
|
||||
private ArrayList<BolBean> baleen;
|
||||
private ArrayList<ExamBean> examBeans;
|
||||
|
||||
private String examId;
|
||||
private Gson gson;
|
||||
|
||||
@ -81,13 +81,12 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
super.initData();
|
||||
baleen = new ArrayList<>();
|
||||
examBeans = new ArrayList<>();
|
||||
|
||||
initNetWorks(true);
|
||||
initNetWorks();
|
||||
}
|
||||
|
||||
private void initNetWorks(boolean b) {
|
||||
private void initNetWorks() {
|
||||
showLoadingDialog();
|
||||
String id = getActivity().getIntent().getStringExtra("id");
|
||||
String id = Objects.requireNonNull(getActivity()).getIntent().getStringExtra("id");
|
||||
HttpParams httpParams = new HttpParams();
|
||||
httpParams.put("id", id);
|
||||
OkGoBuilder.getInstance()
|
||||
@ -100,32 +99,26 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
@Override
|
||||
public void onSuccess(MeasureBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
|
||||
//单选
|
||||
List<MeasureBean.BodyBean.MultiChoiceBean> multiChoice = response.getBody().getMultiChoice();
|
||||
//多选
|
||||
List<MeasureBean.BodyBean.SingleChoiceBean> singleChoice1 = response.getBody().getSingleChoice();
|
||||
|
||||
if (multiChoice != null) {
|
||||
for (int i = 0; i < multiChoice.size(); i++) {
|
||||
baleen.add(new BolBean(multiChoice.get(i).getId(), multiChoice.get(i).getQuestion(), multiChoice.get(i).getOption(), true));
|
||||
examId = multiChoice.get(i).getExamId();
|
||||
}
|
||||
}
|
||||
|
||||
if (singleChoice1 != null) {
|
||||
for (int i = 0; i < singleChoice1.size(); i++) {
|
||||
baleen.add(new BolBean(singleChoice1.get(i).getId(), singleChoice1.get(i).getQuestion(), singleChoice1.get(i).getOption(), false));
|
||||
examId = singleChoice1.get(i).getExamId();
|
||||
}
|
||||
}
|
||||
|
||||
if (baleen != null) {
|
||||
capacityMeasureAdapter.setMeasureList(baleen);
|
||||
}
|
||||
|
||||
Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
|
||||
|
||||
Log.d("TAG", "onSuccess: " + response.toString() );
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -141,7 +134,7 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.iv_measurement_finish:
|
||||
getActivity().finish();
|
||||
Objects.requireNonNull(getActivity()).finish();
|
||||
break;
|
||||
case R.id.btn:
|
||||
try {
|
||||
@ -165,7 +158,6 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
answerList.add(s);
|
||||
}
|
||||
}
|
||||
|
||||
examBean.setAnswer(answerList);
|
||||
examBeans.add(examBean);
|
||||
}
|
||||
@ -186,7 +178,6 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
|
||||
String json = gson.toJson(map);
|
||||
examBeans.clear();
|
||||
// Log.d("TAG", "initExamSubmit: " + jsonArray.toString());
|
||||
OkGo
|
||||
// 请求方式和请求url
|
||||
.<ExamSubmitBean>post(HttpInterface.EXAM_SUBMIT)
|
||||
@ -199,7 +190,7 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
dismissLoadingDialog();
|
||||
if (response.code()==200){
|
||||
if (response.body().equals("0")) {
|
||||
MessageDialog.show((AppCompatActivity) getActivity(), "提示", "不通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "不通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
// Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
|
||||
@ -207,7 +198,7 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
}
|
||||
});
|
||||
} else {
|
||||
MessageDialog.show((AppCompatActivity) getActivity(), "提示", "通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
// Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
|
||||
@ -218,10 +209,8 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
}else {
|
||||
Toast.makeText(getActivity(), response.message(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
|
||||
|
||||
Log.d("TAG", "onSuccess: " + response.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Response<ExamSubmitBean> response) {
|
||||
super.onError(response);
|
||||
|
@ -324,12 +324,9 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
cp_floor = -5;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
}
|
||||
public void onNothingSelected(AdapterView<?> parent) {}
|
||||
});
|
||||
spinnerScutcheon = findViewById(R.id.spinner_scutcheon);
|
||||
ArrayAdapter<String> adapterScutcheon = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, scutcheon);
|
||||
@ -882,7 +879,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
obtains.what = Constant.PILE_MARKER_SHOW;
|
||||
obtains.obj = true;
|
||||
EventBus.getDefault().post(obtains);
|
||||
// chargingPileByWork(chargingPileEntity);
|
||||
// chargingPileByWork(chargingPileEntity);
|
||||
getActivity().onBackPressed();
|
||||
} else {
|
||||
ToastUtil.showShort(getActivity(), "充电桩保存失败,请重试!");
|
||||
|
@ -14,7 +14,6 @@ import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
@ -87,6 +86,7 @@ import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import okhttp3.Response;
|
||||
|
||||
@ -108,7 +108,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
private PoiDao poiDao;
|
||||
private CheckBox checkBoxLife;
|
||||
private Spinner spinnerType;
|
||||
String[] ctype = new String[]{"充电站", "充换电站", "充电桩组", "换电站"};//1."充电站"2 "充换电站"3 "充电桩组"4 "换电站"5 ,
|
||||
String[] caye = new String[]{"充电站", "充换电站", "充电桩组", "换电站"};//1."充电站"2 "充换电站"3 "充电桩组"4 "换电站"5 ,
|
||||
String[] spinner = new String[]{"存在", "不存在", "无法验证"};
|
||||
|
||||
private int existence = 0;
|
||||
@ -312,7 +312,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
});
|
||||
checkBoxRight.setVisibility(View.GONE);
|
||||
spinnerType = findViewById(R.id.spinner_type);
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, ctype);
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<>(Objects.requireNonNull(getContext()), android.R.layout.simple_spinner_item, caye);
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //设置下拉列表框的下拉选项样式
|
||||
spinnerType.setAdapter(adapter);
|
||||
spinnerType.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@ -383,7 +383,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
ivElse.setImageDrawable(null);
|
||||
@ -397,7 +397,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
ivScutcheon.setImageDrawable(null);
|
||||
@ -411,7 +411,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
ivPanorama.setImageDrawable(null);
|
||||
@ -425,7 +425,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
ivName.setImageDrawable(null);
|
||||
@ -439,7 +439,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
ivInternal.setImageDrawable(null);
|
||||
@ -463,7 +463,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
String name = showPoiEntity.getName();//名称
|
||||
if (name != null && !name.equals("")) {
|
||||
editNameContent.setText(name + "");
|
||||
editNameContent.setText(name);
|
||||
}
|
||||
if (editNameContent.getText().toString()!=null||editNameContent!=null){
|
||||
editNameContent.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@ -566,19 +566,19 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
String photo = showPoiEntity.getPhotoInfo().get(i).getPhoto();
|
||||
String[] split = photo.split("/");
|
||||
if (split[split.length - 1].startsWith("a")) {
|
||||
Glide.with(getActivity()).load(photo).into(ivPanorama);
|
||||
Glide.with(Objects.requireNonNull(getActivity())).load(photo).into(ivPanorama);
|
||||
tvPanorama.setTag(photo);
|
||||
} else if (split[split.length - 1].startsWith("b")) {
|
||||
Glide.with(getActivity()).load(photo).into(ivName);
|
||||
Glide.with(Objects.requireNonNull(getActivity())).load(photo).into(ivName);
|
||||
tvNamePic.setTag(photo);
|
||||
} else if (split[split.length - 1].startsWith("c")) {
|
||||
Glide.with(getActivity()).load(photo).into(ivInternal);
|
||||
Glide.with(Objects.requireNonNull(getActivity())).load(photo).into(ivInternal);
|
||||
tvInternal.setTag(photo);
|
||||
} else if (split[split.length - 1].startsWith("d")) {
|
||||
Glide.with(getActivity()).load(photo).into(ivElse);
|
||||
Glide.with(Objects.requireNonNull(getActivity())).load(photo).into(ivElse);
|
||||
tvElse.setTag(photo);
|
||||
} else if (split[split.length - 1].startsWith("e")) {
|
||||
Glide.with(getActivity()).load(photo).into(ivScutcheon);
|
||||
Glide.with(Objects.requireNonNull(getActivity())).load(photo).into(ivScutcheon);
|
||||
tvScutcheon.setTag(photo);
|
||||
}
|
||||
}
|
||||
@ -587,7 +587,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
@Override
|
||||
public void run() {
|
||||
List<ChargingPileEntity> chargingPileList = chargingPileDao.getChargingPileByStationId(showPoiEntity.getId());
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
chargingPileAdapter.setChargingPileEntities(chargingPileList);
|
||||
@ -605,7 +605,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
|
||||
private void initPile() {
|
||||
//根据保存时所用的name属性,获取SharedPreferences对象
|
||||
SharedPreferences dataFile = getActivity().getSharedPreferences(Constant.DATA_FILE, 0);
|
||||
SharedPreferences dataFile = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.DATA_FILE, 0);
|
||||
String pileFileString = dataFile.getString("chargingPileEntity", null);
|
||||
if (pileFileString != null) {
|
||||
ChargingPileEntity chargingPileEntity = new Gson().fromJson(pileFileString, ChargingPileEntity.class);
|
||||
@ -646,7 +646,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
Integer telLength = getPhoneBean.getBody().getTelLength();
|
||||
if (!code.equals(Constant.CODE)){
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "此地区区号为"+code+",请手动修改", "确定","取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "此地区区号为"+code+",请手动修改", "确定","取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
Constant.CODE = code;
|
||||
@ -680,7 +680,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
//一个以该参数命名的.xml文件。第二个mode表示创建的模式,通过查看
|
||||
//方法注释得知,建议以0或者MODE_PRIVATE为默认值。
|
||||
|
||||
SharedPreferences poi = getActivity().getSharedPreferences(Constant.DATA_FILE, 0);
|
||||
SharedPreferences poi = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.DATA_FILE, 0);
|
||||
//获取Editor对象
|
||||
SharedPreferences.Editor edit = poi.edit();
|
||||
//根据要保存的数据的类型,调用对应的put方法,以键值对的形式添加新值。
|
||||
@ -821,7 +821,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
public void run() {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
if (poiDaoPoiEntity == null || poiDaoPoiEntity.getTaskStatus() == 0 || poiDaoPoiEntity.getTaskStatus() == 1 || poiDaoPoiEntity.getTaskStatus() == 2 || poiDaoPoiEntity.getTaskStatus() == 5) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
initRoadSaveLocal(true);
|
||||
@ -830,7 +830,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
} else {
|
||||
// 首先批量保存充电站对应的充电桩数据
|
||||
saveChargingPileByChargingStation(poiDaoPoiEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
stationUploadByNetWork(poiDaoPoiEntity, chargingStationList);
|
||||
@ -1002,7 +1002,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
@Override
|
||||
public void run() {
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
chargingStationSaveByWork(poiEntity, isLocal);
|
||||
@ -1021,7 +1021,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
if (never) {
|
||||
Toast.makeText(getActivity(), "被永久拒绝授权,请手动授予权限", Toast.LENGTH_SHORT).show();
|
||||
// 如果是被永久拒绝就跳转到应用权限系统设置页面
|
||||
XXPermissions.startPermissionActivity(getActivity(), permissions);
|
||||
XXPermissions.startPermissionActivity(Objects.requireNonNull(getActivity()), permissions);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1032,6 +1032,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
setLoadingDialogText("上传中...");
|
||||
if (poiEntity == null || poiEntity.getBodyId() == 0) {
|
||||
Toast.makeText(getActivity(), "没有保存本地", Toast.LENGTH_SHORT).show();
|
||||
assert poiEntity != null;
|
||||
Log.e("TAG", "poiUploadByNetWork: " + poiEntity.getBodyId() + chargingStationList);
|
||||
return;
|
||||
}
|
||||
@ -1049,7 +1050,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
}
|
||||
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
HttpParams httpParams=new HttpParams();
|
||||
@ -1184,7 +1185,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
||||
// 充电站数据已经保存在服务上,批量保存充电桩数据
|
||||
saveChargingPileByChargingStation(poiEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (isLocal) {
|
||||
@ -1296,7 +1297,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
//表示文件名,系统将会在/dada/dada/包名/shared_prefs目录下生成
|
||||
//一个以该参数命名的.xml文件。第二个mode表示创建的模式,通过查看
|
||||
//方法注释得知,建议以0或者MODE_PRIVATE为默认值。
|
||||
SharedPreferences poi = getActivity().getSharedPreferences(Constant.DATA_FILE, 0);
|
||||
SharedPreferences poi = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.DATA_FILE, 0);
|
||||
//获取Editor对象
|
||||
SharedPreferences.Editor edit = poi.edit();
|
||||
//根据要保存的数据的类型,调用对应的put方法,
|
||||
@ -1305,7 +1306,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
//以键值对的形式添加新值。
|
||||
edit.putString("poiEntity", newPoiEntity);
|
||||
//提交新值。必须执行,否则前面的操作都无效。
|
||||
edit.commit();
|
||||
edit.apply();
|
||||
Log.d("TAG", "initPoiSharePre: " + newPoiEntity);
|
||||
}
|
||||
|
||||
@ -1377,6 +1378,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
.token(Constant.ACCESS_TOKEN)
|
||||
.params(httpParams).getSynchronization();
|
||||
if(execute!=null){
|
||||
assert execute.body() != null;
|
||||
String responseBodyStr = execute.body().string();
|
||||
Gson gson = new Gson();
|
||||
ChargingPileSaveBean chargingPileSaveBean = gson.fromJson(responseBodyStr, ChargingPileSaveBean.class);
|
||||
|
@ -9,6 +9,8 @@ import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 联系我们的Fragment
|
||||
*/
|
||||
@ -95,7 +97,7 @@ public class ContactFragment extends BaseFragment implements View.OnClickListene
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v.getId() == R.id.iv_contact) {
|
||||
getActivity().finish();
|
||||
Objects.requireNonNull(getActivity()).finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ import org.json.JSONObject;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 发现-活动专区
|
||||
@ -84,7 +85,7 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
|
||||
Toast.makeText(getActivity(), taskPrefectureBean.getMessage()+"", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
Log.d("TAG", "onSuccess: " + taskPrefectureBean.getMessage() + "sssssssssssss");
|
||||
Log.d("TAG", "onSuccess: " + taskPrefectureBean.getMessage());
|
||||
|
||||
|
||||
}
|
||||
@ -132,7 +133,7 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
ImageView ivEventTask = findViewById(R.id.iv_event_task);
|
||||
ivEventTask.setOnClickListener(this::onClick);
|
||||
ivEventTask.setOnClickListener(this);
|
||||
eventRecycler = findViewById(R.id.event_recycler);
|
||||
eventRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
eventRecycler.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
|
||||
@ -167,7 +168,7 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v.getId() == R.id.iv_event_task) {
|
||||
getActivity().finish();
|
||||
Objects.requireNonNull(getActivity()).finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -177,12 +177,12 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
poiEntity.setX(latLng.longitude + "");
|
||||
poiEntity.setY(latLng.latitude + "");
|
||||
} else if (geometry.getGeometryType().equals("LineString")) {//线
|
||||
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
||||
assert latLineString != null;
|
||||
poiEntity.setX(latLineString.get(0).longitude + "");
|
||||
poiEntity.setY(latLineString.get(0).latitude + "");
|
||||
} else if (geometry.getGeometryType().equals("Polygon")) {//面
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLags(geo);
|
||||
assert latPolygon != null;
|
||||
poiEntity.setX(latPolygon.get(0).longitude + "");
|
||||
poiEntity.setY(latPolygon.get(0).latitude + "");
|
||||
@ -269,10 +269,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
recyclerFilter.setAdapter(filterAdapter);
|
||||
recyclerFilter.setScrollAlphaChangeListener(new XRecyclerView.ScrollAlphaChangeListener() {
|
||||
@Override
|
||||
public void onAlphaChange(int alpha) {
|
||||
|
||||
}
|
||||
|
||||
public void onAlphaChange(int alpha) { }
|
||||
@Override
|
||||
public int setLimitHeight() {
|
||||
return 0;
|
||||
|
@ -44,7 +44,6 @@ public class FindFragment extends BaseFragment implements View.OnClickListener{
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -202,7 +202,6 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
|
||||
dismissLoadingDialog();
|
||||
if (response.getCode() == 200) {
|
||||
sessionId = response.getBody();
|
||||
|
||||
Toast.makeText(getActivity(), "验证码已发送", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
|
@ -29,18 +29,13 @@ import com.navinfo.outdoor.room.PoiDatabase;
|
||||
import com.navinfo.outdoor.room.PoiEntity;
|
||||
import com.navinfo.outdoor.util.Geohash;
|
||||
import com.navinfo.outdoor.util.GeometryTools;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptorFactory;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.Marker;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.MarkerOptions;
|
||||
import com.vividsolutions.jts.geom.Geometry;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@ -124,13 +119,13 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
if (poiEntity != null) {
|
||||
tvTitle.setText(poiEntity.getName());
|
||||
if (poiEntity.getPrecision() == null) {
|
||||
tvMoney.setText("¥" + 0);
|
||||
tvMoney.setText("¥"+0);
|
||||
} else {
|
||||
tvMoney.setText("¥" + format2(Double.parseDouble(poiEntity.getPrecision())));
|
||||
tvMoney.setText("¥"+format2(Double.parseDouble(poiEntity.getPrecision())));
|
||||
}
|
||||
if (poiEntity != null) {
|
||||
if (poiEntity.getDescribe() != null && !"".equals(poiEntity.getDescribe())) {
|
||||
tvDescribe.setText("任务描述:" + poiEntity.getDescribe());
|
||||
tvDescribe.setText("任务描述:"+poiEntity.getDescribe());
|
||||
}
|
||||
if (poiEntity.getCreateTime() != null && !"".equals(poiEntity.getCreateTime())) {
|
||||
tvTime.setText("到期时间:" + poiEntity.getCreateTime());
|
||||
@ -151,7 +146,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
|
||||
/**
|
||||
* 保存小数点后两位
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
@ -159,7 +153,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
DecimalFormat df = new DecimalFormat("0.00");
|
||||
df.setRoundingMode(RoundingMode.HALF_UP);
|
||||
return df.format(value);
|
||||
|
||||
}
|
||||
|
||||
private void initViewByTaskStatus(int taskStatus) {
|
||||
@ -354,12 +347,12 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
chargingStationEntity.setY(latLng.latitude + "");
|
||||
break;
|
||||
case "LineString": //线
|
||||
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
||||
chargingStationEntity.setX(latLineString.get(0).longitude + "");
|
||||
chargingStationEntity.setY(latLineString.get(0).latitude + "");
|
||||
break;
|
||||
case "Polygon": //面
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLags(geo);
|
||||
chargingStationEntity.setX(latPolygon.get(0).longitude + "");
|
||||
chargingStationEntity.setY(latPolygon.get(0).latitude + "");
|
||||
break;
|
||||
@ -473,11 +466,11 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
polygonEntity.setX(latLng.longitude + "");
|
||||
polygonEntity.setY(latLng.latitude + "");
|
||||
} else if (geometry.getGeometryType().equals("LineString")) {//线
|
||||
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
||||
polygonEntity.setX(latLineString.get(0).longitude + "");
|
||||
polygonEntity.setY(latLineString.get(0).latitude + "");
|
||||
} else if (geometry.getGeometryType().equals("Polygon")) {//面
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLags(geo);
|
||||
polygonEntity.setX(latPolygon.get(0).longitude + "");
|
||||
polygonEntity.setY(latPolygon.get(0).latitude + "");
|
||||
}
|
||||
@ -722,11 +715,11 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
poiListEntity.setX(latLng.longitude + "");
|
||||
poiListEntity.setY(latLng.latitude + "");
|
||||
} else if (geometry.getGeometryType().equals("LineString")) {//线
|
||||
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
||||
poiListEntity.setX(latLineString.get(0).longitude + "");
|
||||
poiListEntity.setY(latLineString.get(0).latitude + "");
|
||||
} else if (geometry.getGeometryType().equals("Polygon")) {//面
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLags(geo);
|
||||
poiListEntity.setX(latPolygon.get(0).longitude + "");
|
||||
poiListEntity.setY(latPolygon.get(0).latitude + "");
|
||||
}
|
||||
@ -845,11 +838,11 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
poiListEntity.setX(latLng.longitude + "");
|
||||
poiListEntity.setY(latLng.latitude + "");
|
||||
} else if (geometry.getGeometryType().equals("LineString")) {//线
|
||||
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
||||
poiListEntity.setX(latLineString.get(0).longitude + "");
|
||||
poiListEntity.setY(latLineString.get(0).latitude + "");
|
||||
} else if (geometry.getGeometryType().equals("Polygon")) {//面
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLags(geo);
|
||||
poiListEntity.setX(latPolygon.get(0).longitude + "");
|
||||
poiListEntity.setY(latPolygon.get(0).latitude + "");
|
||||
}
|
||||
|
@ -71,7 +71,6 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.gathering_fragment;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -110,7 +109,6 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
Objects.requireNonNull(getActivity()).finish();
|
||||
break;
|
||||
case R.id.et_bank_num:
|
||||
|
||||
break;
|
||||
case R.id.iv_bank:
|
||||
String bankJson = new GetJsonDataUtil().getJson(Objects.requireNonNull(getContext()), "bank.json");//获取assets目录下的json文件数据
|
||||
@ -129,7 +127,6 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
bankAdapter.setOnBankClick(new BankAdapter.OnBankClick() {
|
||||
@Override
|
||||
public void onClick(int pos) {
|
||||
|
||||
tvBank.setText(jsonBean.get(pos).getLabel());
|
||||
value = jsonBean.get(pos).getValue();
|
||||
bankAdapter.notifyDataSetChanged();
|
||||
@ -177,13 +174,12 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
}
|
||||
}
|
||||
showLoadingDialog();
|
||||
|
||||
HttpParams httpParams = new HttpParams();
|
||||
|
||||
httpParams.put("userid", Constant.USHERED);
|
||||
httpParams.put("bankAccount", value);//银行id
|
||||
httpParams.put("idNumber", etBankAccount);//银行卡号
|
||||
OkGoBuilder.getInstance().Builder(getActivity())
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
.url(HttpInterface.USER_BANKCARD_UP_DATA)
|
||||
.cls(BankPhoneBean.class)
|
||||
.token(Constant.ACCESS_TOKEN)
|
||||
@ -244,10 +240,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
}else {
|
||||
Toast.makeText(getActivity(), "请拍银行卡照片", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -194,8 +194,8 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
||||
if (hasSubmitBean.getCode() == 200) {
|
||||
HasSubmitBean.BodyBean hasSubmitBeanBody = hasSubmitBean.getBody();
|
||||
if (hasSubmitBeanBody != null) {
|
||||
roadAuditProcess.setText(hasSubmitBeanBody.getAuditingCount() + "");
|
||||
roadAuditThrough.setText(hasSubmitBeanBody.getPassCount() + "");
|
||||
roadAuditProcess.setText(hasSubmitBeanBody.getAuditingCount()+"");
|
||||
roadAuditThrough.setText(hasSubmitBeanBody.getPassCount()+"");
|
||||
roadAuditNotThrough.setText(hasSubmitBeanBody.getNotPassCount() + "");
|
||||
hasPage++;
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
|
||||
import okhttp3.OkHttpClient;
|
||||
|
||||
@ -98,10 +99,10 @@ public class IssueFragment extends BaseFragment implements View.OnClickListener
|
||||
super.initView();
|
||||
ImageView ivIssueFinish = findViewById(R.id.iv_issue_finish);
|
||||
XRecyclerView mainIssueRecycler = findViewById(R.id.main_issue_recycler);
|
||||
ivIssueFinish.setOnClickListener(this::onClick);
|
||||
ivIssueFinish.setOnClickListener(this);
|
||||
mainIssueRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
//设置下划线
|
||||
mainIssueRecycler.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL));
|
||||
mainIssueRecycler.addItemDecoration(new DividerItemDecoration(Objects.requireNonNull(getActivity()), DividerItemDecoration.VERTICAL));
|
||||
mainIssueRecycler.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
|
||||
mainIssueRecycler.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
|
||||
//取消下拉刷新上拉加载
|
||||
@ -132,7 +133,7 @@ public class IssueFragment extends BaseFragment implements View.OnClickListener
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.iv_issue_finish:
|
||||
getActivity().finish();
|
||||
Objects.requireNonNull(getActivity()).finish();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ public class MessageFragment extends BaseFragment implements View.OnClickListene
|
||||
messageRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
TextView tvRoad = findViewById(R.id.tv_read);
|
||||
tvRoad.setOnClickListener(this);
|
||||
messageRecycler.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL));
|
||||
messageRecycler.addItemDecoration(new DividerItemDecoration(Objects.requireNonNull(getActivity()), DividerItemDecoration.VERTICAL));
|
||||
messageRecycler.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
|
||||
messageRecycler.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
|
||||
//取消上拉加载,刷新功能。
|
||||
|
@ -121,14 +121,12 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
||||
GetPriceBean.BodyBean body = response.getBody();
|
||||
if (body != null) {
|
||||
Double userPrice = body.getUserPrice();
|
||||
tvMoney.setText(userPrice + "");
|
||||
tvMoney.setText(userPrice+"");
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
|
||||
Log.d("TAG", "onSuccess: " + response.toString() + "tttttttt");
|
||||
Log.d("TAG", "onSuccess: " + response.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -187,7 +185,6 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
||||
intentContact.putExtra("tag", 21);
|
||||
startActivity(intentContact);
|
||||
break;
|
||||
|
||||
case R.id.rl_about://关于
|
||||
Intent intentAbout = new Intent(getActivity(), FragmentManagement.class);
|
||||
intentAbout.putExtra("tag", 23);
|
||||
|
@ -77,6 +77,7 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import static android.app.Activity.RESULT_OK;
|
||||
|
||||
@ -163,7 +164,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
PoiDatabase poiDatabase = PoiDatabase.getInstance(getContext());
|
||||
poiDao = poiDatabase.getPoiDao();
|
||||
spinnerOther = findViewById(R.id.spinner_other);
|
||||
ArrayAdapter<String> adapterOthers = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, others);
|
||||
ArrayAdapter<String> adapterOthers = new ArrayAdapter<>(Objects.requireNonNull(getContext()), android.R.layout.simple_spinner_item, others);
|
||||
adapterOthers.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //设置下拉列表框的下拉选项样式
|
||||
spinnerOther.setAdapter(adapterOthers);
|
||||
spinnerOther.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@ -260,7 +261,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
ivPicture.setImageDrawable(null);
|
||||
@ -275,7 +276,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
ivPictures.setImageDrawable(null);
|
||||
@ -311,11 +312,12 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
|
||||
private void initShowPoi() {
|
||||
// 添加信息:
|
||||
assert getArguments() != null;
|
||||
showPoiEntity = (PoiEntity) getArguments().getSerializable("poiEntity");
|
||||
if (showPoiEntity != null) {
|
||||
String name = showPoiEntity.getName();//名称
|
||||
if (name != null && !name.equals("")) {
|
||||
editTaskName.setText(name + "");
|
||||
editTaskName.setText(name);
|
||||
}
|
||||
String x = showPoiEntity.getX();
|
||||
String y = showPoiEntity.getY();
|
||||
@ -345,16 +347,17 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
String photo = showPoiEntity.getPhotoInfo().get(i).getPhoto();
|
||||
String[] split = photo.split("/");
|
||||
if (split[split.length - 1].startsWith("a")) {
|
||||
Glide.with(getActivity()).load(photo).into(ivPicture);
|
||||
Glide.with(Objects.requireNonNull(getActivity())).load(photo).into(ivPicture);
|
||||
tvPicture.setTag(photo);
|
||||
} else if (split[split.length - 1].startsWith("b")) {
|
||||
Glide.with(getActivity()).load(photo).into(ivPictures);
|
||||
Glide.with(Objects.requireNonNull(getActivity())).load(photo).into(ivPictures);
|
||||
tvPictures.setTag(photo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//判断是否是已完成作业并保存成功
|
||||
assert showPoiEntity != null;
|
||||
if (showPoiEntity.getTaskStatus() == 3) {
|
||||
disables();
|
||||
}
|
||||
@ -381,7 +384,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
case R.id.btn_other_uploading:
|
||||
otherUploadList = new ArrayList<>();
|
||||
String name = editTaskName.getText().toString().trim();//名称
|
||||
if (name == null || name.equals("")) {
|
||||
if (name.equals("")) {
|
||||
Toast.makeText(getActivity(), "请输入poi 名称", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
@ -408,7 +411,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
public void run() {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
if (poiDaoPoiEntity == null || poiDaoPoiEntity.getTaskStatus() == 1 || poiDaoPoiEntity.getTaskStatus() == 2 || poiDaoPoiEntity.getTaskStatus() == 0 || poiDaoPoiEntity.getTaskStatus() == 5) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
initPoiSaveLocal(true);
|
||||
@ -416,7 +419,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
});
|
||||
|
||||
} else {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
otherUploadByNet(poiDaoPoiEntity.getBodyId(), otherUploadList);
|
||||
@ -449,7 +452,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
@Override
|
||||
public void run() {
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
otherSaveByNetWork(poiEntity, isLocal);
|
||||
@ -469,7 +472,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
if (never) {
|
||||
Toast.makeText(getActivity(), "被永久拒绝授权,请手动授予权限", Toast.LENGTH_SHORT).show();
|
||||
// 如果是被永久拒绝就跳转到应用权限系统设置页面
|
||||
XXPermissions.startPermissionActivity(getActivity(), permissions);
|
||||
XXPermissions.startPermissionActivity(Objects.requireNonNull(getActivity()), permissions);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -503,7 +506,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
public void run() {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
poiDao.deletePoiEntity(poiDaoPoiEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(getActivity(), "上传成功", Toast.LENGTH_SHORT).show();
|
||||
@ -560,7 +563,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
@Override
|
||||
public void run() {
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (isLocal) {
|
||||
@ -720,7 +723,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
protected PoiEntity initPoiEntityByUI(PoiEntity poiEntity) {
|
||||
ArrayList<Info> arrayList = new ArrayList<>();
|
||||
String name = editTaskName.getText().toString().trim();//名称
|
||||
if (name != null && !name.equals("")) {
|
||||
if (!name.equals("")) {
|
||||
poiEntity.setName(name);
|
||||
}
|
||||
if (latLng != null) {
|
||||
@ -730,7 +733,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
poiEntity.setY(String.valueOf(latLng.latitude));
|
||||
}
|
||||
String describe = editOtherDescribe.getText().toString().trim();
|
||||
if (describe != null && !describe.equals("")) {
|
||||
if (!describe.equals("")) {
|
||||
poiEntity.setMemo(describe);
|
||||
}
|
||||
String tagPicture = (String) tvPicture.getTag();
|
||||
|
@ -148,12 +148,10 @@ public class PhotoFragment extends BaseFragment implements View.OnClickListener
|
||||
for (int i = 0; i < fileBeans.size(); i++) {
|
||||
photoAdapter.deleteFile(fileBeans.get(i));
|
||||
}
|
||||
|
||||
}else {
|
||||
Toast.makeText(getContext(), "请选择要删除的数据后才可以删除", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -146,7 +146,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
Bundle arguments = getArguments();
|
||||
if (arguments != null) {
|
||||
isSliding = arguments.getBoolean("isSliding", true);
|
||||
Log.d("TAG", "onCreatessss: " + isSliding);
|
||||
Log.d("TAG", "onCaresses: " + isSliding);
|
||||
}
|
||||
if (isSliding) {
|
||||
// 监听到返回按钮点击事件
|
||||
@ -238,10 +238,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
tvPoiNamePic = findViewById(R.id.tv_poi_name_pic);
|
||||
ivInternal = findViewById(R.id.iv_internal);
|
||||
tvInternal = findViewById(R.id.tv_internal);
|
||||
|
||||
ivCard = findViewById(R.id.iv_card);
|
||||
tvCard = findViewById(R.id.tv_card);
|
||||
|
||||
ivElse = findViewById(R.id.iv_else);
|
||||
tvElse = findViewById(R.id.tv_else);
|
||||
linearContact = findViewById(R.id.linear_contact);
|
||||
@ -276,7 +274,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
}
|
||||
@ -285,8 +282,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
initShowPoi();
|
||||
//拍照长按删除
|
||||
onLongDel();
|
||||
|
||||
|
||||
}
|
||||
|
||||
//拍照长按删除
|
||||
@ -516,7 +511,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
Integer telLength = getPhoneBean.getBody().getTelLength();
|
||||
if (!Constant.CODE.equals(code)) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "此地区区号为" + code + ",请手动修改", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "此地区区号为" + code + ",请手动修改", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
Constant.CODE = code;
|
||||
@ -587,7 +582,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
case R.id.btn_uploading:
|
||||
poiPicList = new ArrayList<>();
|
||||
String name = editNameContent.getText().toString().trim();//名称
|
||||
if (name == null || name.equals("")) {
|
||||
if (name.equals("")) {
|
||||
Toast.makeText(getActivity(), "请输入poi 名称", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
@ -627,14 +622,14 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
public void run() {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
if (poiDaoPoiEntity == null || poiDaoPoiEntity.getTaskStatus() == 1 || poiDaoPoiEntity.getTaskStatus() == 2 || poiDaoPoiEntity.getTaskStatus() == 0 || poiDaoPoiEntity.getTaskStatus() == 5) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
initPoiSaveLocal(true);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiUploadByNetWork(poiDaoPoiEntity.getBodyId(), poiPicList);
|
||||
@ -723,7 +718,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
btnSaveLocal.setEnabled(false);
|
||||
Toast.makeText(getActivity(), taskNameBean.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -775,7 +769,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
if (never) {
|
||||
Toast.makeText(getActivity(), "被永久拒绝授权,请手动授予权限", Toast.LENGTH_SHORT).show();
|
||||
// 如果是被永久拒绝就跳转到应用权限系统设置页面
|
||||
XXPermissions.startPermissionActivity(getActivity(), permissions);
|
||||
XXPermissions.startPermissionActivity(Objects.requireNonNull(getActivity()), permissions);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -808,7 +802,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
public void run() {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
poiDao.deletePoiEntity(poiDaoPoiEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(getActivity(), "上传成功", Toast.LENGTH_SHORT).show();
|
||||
@ -866,7 +860,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
@Override
|
||||
public void run() {
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (isLocal) {
|
||||
@ -910,7 +904,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
//表示文件名,系统将会在/dada/dada/包名/shared_prefs目录下生成
|
||||
//一个以该参数命名的.xml文件。第二个mode表示创建的模式,通过查看
|
||||
//方法注释得知,建议以0或者MODE_PRIVATE为默认值。
|
||||
SharedPreferences poi = getActivity().getSharedPreferences(Constant.DATA_FILE, 0);
|
||||
SharedPreferences poi = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.DATA_FILE, 0);
|
||||
//获取Editor对象
|
||||
SharedPreferences.Editor edit = poi.edit();
|
||||
//根据要保存的数据的类型,调用对应的put方法,
|
||||
@ -919,7 +913,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
//以键值对的形式添加新值。
|
||||
edit.putString("poiEntity", newPoiEntity);
|
||||
//提交新值。必须执行,否则前面的操作都无效。
|
||||
edit.commit();
|
||||
edit.apply();
|
||||
Log.d("TAG", "initPoiSharePre: " + newPoiEntity);
|
||||
}
|
||||
|
||||
@ -1130,11 +1124,11 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
protected PoiEntity initPoiEntityByUI(PoiEntity poiEntity) {
|
||||
ArrayList<Info> infoPhoto = new ArrayList<>();
|
||||
String name = editNameContent.getText().toString().trim();//名称
|
||||
if (name != null && !name.equals("")) {
|
||||
if (!name.equals("")) {
|
||||
poiEntity.setName(name);
|
||||
}
|
||||
String site = editSiteContent.getText().toString().trim();
|
||||
if (site != null && !site.equals("")) {
|
||||
if (!site.equals("")) {
|
||||
poiEntity.setAddress(site);
|
||||
}
|
||||
if (latLng != null) {
|
||||
@ -1144,7 +1138,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
poiEntity.setY(String.valueOf(latLng.latitude));
|
||||
}
|
||||
String describe = editDescribe.getText().toString().trim();
|
||||
if (describe != null && !describe.equals("")) {
|
||||
if (!describe.equals("")) {
|
||||
poiEntity.setMemo(describe);
|
||||
}
|
||||
boolean phoneBean = contactView.getPhoneBean();
|
||||
|
@ -95,9 +95,6 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
|
||||
poiTaskAdapter = new PoiTaskAdapter(getContext(), listBeans);
|
||||
poiTaskXrv.setAdapter(poiTaskAdapter);
|
||||
poiTaskAdapter.notifyDataSetChanged();
|
||||
/* xrv_yodq.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
|
||||
xrv_yodq.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
@ -133,7 +130,6 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
|
||||
}else {
|
||||
Toast.makeText(getActivity(), hasSubmitBean.getMessage()+"", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -175,16 +171,10 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v.getId() == R.id.iv_poiTask_finish) {
|
||||
Objects.requireNonNull(getActivity()).finish();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -481,7 +481,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
photoAlbumIntent.putExtra("showPoiEntity", showPoiEntity);
|
||||
startActivity(photoAlbumIntent);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -577,7 +576,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
} else {
|
||||
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -617,7 +615,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
@Override
|
||||
public void run() {
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (isLocal) {
|
||||
@ -773,7 +771,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroy();
|
||||
|
||||
if (markerPoiVideo != null) {
|
||||
markerPoiVideo.remove();
|
||||
}
|
||||
|
@ -54,7 +54,6 @@ public class RecordFragment extends BaseFragment implements View.OnClickListener
|
||||
fragments.add(hasSubmitFragment);
|
||||
assert getFragmentManager() != null;
|
||||
vpRecord.setAdapter(new FragmentPagerAdapter(getFragmentManager()) {
|
||||
@NonNull
|
||||
@NotNull
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
|
@ -164,10 +164,10 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
etDesc = (EditText) findViewById(R.id.et_desc);
|
||||
fmRoadPic = findViewById(R.id.fm_road_picture);
|
||||
btnRoadSave = (Button) findViewById(R.id.btn_road_save);
|
||||
btnRoadSave.setOnClickListener(this::onClick);
|
||||
btnRoadSave.setOnClickListener(this);
|
||||
rgType = (RadioGroup) findViewById(R.id.rg_type);
|
||||
Button roadUpload = findViewById(R.id.road_upload);
|
||||
roadUpload.setOnClickListener(this::onClick);
|
||||
roadUpload.setOnClickListener(this);
|
||||
showPictureType(1);
|
||||
/*fmRoadPic.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@ -189,7 +189,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
@ -654,11 +654,9 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||
@ -718,10 +716,10 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
if (!roadName.equals("")) {
|
||||
poiEntity.setName(roadName);
|
||||
} else {
|
||||
DateFormat formatters = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
|
||||
Calendar calendars = Calendar.getInstance();
|
||||
calendars.setTimeInMillis(System.currentTimeMillis());
|
||||
String formats = formatters.format(calendars.getTime());
|
||||
String formats = formatter.format(calendars.getTime());
|
||||
String city = Constant.currentLocation.getCity();//返回当前位置的城市.
|
||||
String district = Constant.currentLocation.getDistrict();//返回当前位置的区县.
|
||||
StringBuffer sb = new StringBuffer("道路录像上报");
|
||||
|
@ -42,7 +42,7 @@ public class SetFragment extends BaseFragment implements View.OnClickListener {
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
SharedPreferences navInfo = getActivity().getSharedPreferences(Constant.SHARED_PREFERENCES, Context.MODE_PRIVATE);
|
||||
SharedPreferences navInfo = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.SHARED_PREFERENCES, Context.MODE_PRIVATE);
|
||||
navInfoEditor = getActivity().getSharedPreferences(Constant.SHARED_PREFERENCES, Context.MODE_PRIVATE).edit();
|
||||
ImageView ivSet = findViewById(R.id.iv_set);
|
||||
ivSet.setOnClickListener(this);
|
||||
|
@ -68,7 +68,6 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
if (!EventBus.getDefault().isRegistered(this)) {//加上判断
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -150,7 +149,6 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
newEntities.add(poiEntity);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return newEntities;
|
||||
}
|
||||
@ -218,12 +216,9 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
showLoadingDialog();
|
||||
setLoadingDialogText("提交中...");
|
||||
PoiSaveUtils.getInstance(getActivity()).uploadPoiEntityBatch(poiEntities);
|
||||
|
||||
} else {
|
||||
|
||||
Toast.makeText(getActivity(), "请选择要提交的数据", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -240,7 +235,6 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
poiEntities.add(poiEntity);
|
||||
}
|
||||
}
|
||||
;
|
||||
}
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
|
@ -72,6 +72,7 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
|
||||
taskExplainAdapter = new TaskExplainAdapter(explainList,getActivity());
|
||||
taskExplainRecycle.setAdapter(taskExplainAdapter);
|
||||
taskExplainRecycle.setLoadingListener(new XRecyclerView.LoadingListener() {
|
||||
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
taskPage=1;
|
||||
@ -82,10 +83,12 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
|
||||
public void onLoadMore() {
|
||||
initNetWork(false);
|
||||
}
|
||||
|
||||
});
|
||||
taskExplainAdapter.setOnItemClick(new TaskExplainAdapter.OnItemClick() {
|
||||
@Override
|
||||
public void onClick(int pos) {
|
||||
|
||||
Intent itemIntent = new Intent(getActivity(), FragmentManagement.class);
|
||||
itemIntent.putExtra("tag", 10);
|
||||
itemIntent.putExtra("id",pos+"");
|
||||
@ -129,7 +132,6 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
@ -152,6 +154,7 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
|
||||
} else {
|
||||
if (taskPrefectureBean.getBody().getList() == null) {
|
||||
taskExplainRecycle.setNoMore(true);
|
||||
|
||||
} else {
|
||||
explainList.addAll(taskPrefectureBean.getBody().getList());
|
||||
taskExplainAdapter.notifyDataSetChanged();
|
||||
|
@ -139,10 +139,8 @@ public class TaskExplainFragment2 extends BaseFragment implements View.OnClickLi
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.iv_task_explain2_finish:
|
||||
getActivity().finish();
|
||||
break;
|
||||
if (v.getId() == R.id.iv_task_explain2_finish) {
|
||||
Objects.requireNonNull(getActivity()).finish();
|
||||
}
|
||||
}
|
||||
}
|
@ -48,7 +48,6 @@ import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.FragmentManagement;
|
||||
import com.navinfo.outdoor.activity.TestActivity;
|
||||
import com.navinfo.outdoor.adapter.MarkerAdapter;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||
@ -190,13 +189,16 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
int messageTypeSpInt = messageTypeSp.getInt("messageType", 0);
|
||||
try {
|
||||
Date parse = formatter.parse(format);
|
||||
Date parse1 = formatter.parse(dataTime);
|
||||
if (parse.getTime() + parse1.getTime() >= 1) {
|
||||
initMessageNotice();
|
||||
Log.d("TAG", "refreshFilterData: " + parse + "和" + parse1);
|
||||
} else {
|
||||
return;
|
||||
if (dataTime!=null){
|
||||
Date parse1 = formatter.parse(dataTime);
|
||||
if (parse.getTime() + parse1.getTime() >= 1) {
|
||||
initMessageNotice();
|
||||
Log.d("TAG", "refreshFilterData: " + parse + "和" + parse1);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -562,7 +564,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
} else if (listBean.getType() == 4) {//道路录像
|
||||
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.road_arrows);
|
||||
}
|
||||
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
||||
// 构造 PolylineOptions
|
||||
PolylineOptions polylineOptions = new PolylineOptions()
|
||||
.addAll(latLineString)
|
||||
@ -588,7 +590,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
break;
|
||||
case "Polygon": //面
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLags(geo);
|
||||
Polygon polygon = tencentMap.addPolygon(new PolygonOptions().
|
||||
//连接封闭图形的点
|
||||
addAll(latPolygon).
|
||||
@ -763,7 +765,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
} else if (poiEntity.getType() == 4) {//道路录像
|
||||
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.road_arrows);
|
||||
}
|
||||
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
||||
// 构造 PolylineOnions
|
||||
PolylineOptions polylineOptions = new PolylineOptions()
|
||||
.addAll(latLineString)
|
||||
@ -785,7 +787,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
break;
|
||||
case "Polygon": //面
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLags(geo);
|
||||
Polygon polygon = tencentMap.addPolygon(new PolygonOptions().
|
||||
//连接封闭图形的点
|
||||
addAll(latPolygon).
|
||||
@ -887,7 +889,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
} else if (type == 4) {//道路录像
|
||||
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.road_arrows);
|
||||
}
|
||||
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
||||
// 构造 PolylineOnions
|
||||
PolylineOptions polylineOptions = new PolylineOptions()
|
||||
.alpha(0.5f)
|
||||
@ -909,16 +911,12 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
break;
|
||||
case "Polygon": //面
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
|
||||
Polygon polygon = tencentMap.addPolygon(new PolygonOptions().
|
||||
//连接封闭图形的点
|
||||
addAll(latPolygon).
|
||||
//填充颜色为浅蓝色
|
||||
fillColor(Color.parseColor("#97E0E7EC")).
|
||||
//边线颜色为黑色
|
||||
strokeColor(0xff00ff00).
|
||||
//边线宽度15像素
|
||||
strokeWidth(5));
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLags(geo);
|
||||
Polygon polygon = tencentMap.addPolygon(new PolygonOptions().//连接封闭图形的点
|
||||
addAll(latPolygon).//填充颜色为浅蓝色
|
||||
fillColor(Color.parseColor("#97E0E7EC")).//边线颜色为黑色
|
||||
strokeColor(0xff00ff00).//边线宽度15像素
|
||||
strokeWidth(5));
|
||||
polygon.setZIndex(MARKER_FACE);
|
||||
removablesLocality.add(polygon);
|
||||
com.vividsolutions.jts.geom.Point centroid = geometry.getCentroid();
|
||||
@ -1675,7 +1673,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
if (intersection == null) {
|
||||
initEntity(marker, true);
|
||||
} else {
|
||||
if (intersection.getGeometryType().equals("MultiPoint")) {
|
||||
initEntity(marker, true);
|
||||
/*if (intersection.getGeometryType().equals("MultiPoint")) {
|
||||
List<LatLng> latList = GeometryTools.getLatList(intersection);
|
||||
for (int i = 0; i < latList.size(); i++) {
|
||||
LatLng latL = latList.get(i);
|
||||
@ -1691,7 +1690,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
customDialog(poiEntityArrayList, marker);
|
||||
} else {
|
||||
initEntity(marker, true);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -1795,7 +1794,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
break;
|
||||
case "LineString": //线
|
||||
case "Polygon": //面
|
||||
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
||||
assert latLineString != null;
|
||||
poiListEntity.setX(latLineString.get(0).longitude + "");
|
||||
poiListEntity.setY(latLineString.get(0).latitude + "");
|
||||
|
@ -77,7 +77,6 @@ public class VideoFragment extends BaseFragment implements View.OnClickListener
|
||||
PoiEntity showPoiEntity = (PoiEntity) Objects.requireNonNull(getActivity()).getIntent().getSerializableExtra("showPoiEntity");
|
||||
deleteFiles = new ArrayList<>();
|
||||
ArrayList<File> textFile = new ArrayList<>();
|
||||
|
||||
if (showPoiEntity != null) {
|
||||
String id = showPoiEntity.getId();
|
||||
if (showPoiEntity.getRecord_way() == 1) {
|
||||
@ -143,8 +142,6 @@ public class VideoFragment extends BaseFragment implements View.OnClickListener
|
||||
Toast.makeText(getContext(), "请选择要删除的数据后才可以删除", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -76,12 +76,12 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
tvAlready = findViewById(R.id.tv_already);//已提现
|
||||
tvTotal = findViewById(R.id.tv_total);//总资产
|
||||
TextView tvAll = findViewById(R.id.tv_all);
|
||||
tvAll.setOnClickListener(this::onClick);
|
||||
tvAll.setOnClickListener(this);
|
||||
etAllPrice = findViewById(R.id.et_allPrice);
|
||||
ImageView ivWithDraw = findViewById(R.id.iv_withdraw);
|
||||
ivWithDraw.setOnClickListener(this);
|
||||
TextView tvText = findViewById(R.id.tv_text);
|
||||
tvText.setOnClickListener(this::onClick);
|
||||
tvText.setOnClickListener(this);
|
||||
checkBox = findViewById(R.id.checkBox);
|
||||
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
@ -97,7 +97,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
});
|
||||
Button btWithdraw = findViewById(R.id.button);
|
||||
btWithdraw.setOnClickListener(this::onClick);
|
||||
btWithdraw.setOnClickListener(this);
|
||||
poiPushMoney = (TextView) findViewById(R.id.poi_push_money);
|
||||
poiReportMoney = (TextView) findViewById(R.id.poi_report_money);
|
||||
poiVideoPushMoney = (TextView) findViewById(R.id.poiVideo_push_money);
|
||||
@ -108,9 +108,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
chargingReportMoney = (TextView) findViewById(R.id.charging_report_money);
|
||||
otherPushMoney = (TextView) findViewById(R.id.other_push_money);
|
||||
otherReportMoney = (TextView) findViewById(R.id.other_report_money);
|
||||
|
||||
initNetWork();
|
||||
|
||||
}
|
||||
|
||||
private void initNetWork() {
|
||||
@ -128,8 +126,8 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
// Toast.makeText(getContext(), "获取成功", Toast.LENGTH_SHORT).show();
|
||||
if (response.getCode()==200){
|
||||
Double userPrice = response.getBody().getUserPrice();
|
||||
canExchangePrice = response.getBody().getCanExchangePrice();
|
||||
tvTotal.setText(userPrice + "");
|
||||
canExchangePrice = response.getBody().getCanExchangePrice();
|
||||
tvUnit.setText(canExchangePrice + "");
|
||||
tvAlready.setText(response.getBody().getHaveExchangePrice() + "");
|
||||
poiPushMoney.setText(response.getBody().getPoiPushPrice() + "元");
|
||||
@ -145,8 +143,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
}else {
|
||||
Toast.makeText(getActivity(), response.getMessage()+"", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
Log.d("TAG", "onSuccess: " + response.toString() + "tttttttt");
|
||||
Log.d("TAG", "onSuccess: " + response.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -170,7 +167,6 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
intentText.putExtra("tag", 26);
|
||||
startActivity(intentText);
|
||||
break;
|
||||
|
||||
case R.id.button:
|
||||
String price = etAllPrice.getText().toString().trim();
|
||||
if (!price.equals("")){
|
||||
@ -183,7 +179,6 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
Toast.makeText(getActivity(), "提现金额不能为空", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!checkBox.isChecked()) {
|
||||
Toast.makeText(getActivity(), "请勾选银行卡", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
@ -201,8 +196,6 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
Toast.makeText(getActivity(), "请先绑定银行卡", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
case R.id.tv_all:
|
||||
etAllPrice.setText(canExchangePrice + "");
|
||||
@ -214,7 +207,6 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
showLoadingDialog();
|
||||
setLoadingDialogText("提现中...");
|
||||
HttpParams httpParams = new HttpParams();
|
||||
|
||||
httpParams.put("exchangeMoney", etAllPrice.getText().toString());
|
||||
httpParams.put("payType", "1");
|
||||
OkGoBuilder.getInstance()
|
||||
@ -239,7 +231,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
etAllPrice.getText().clear();
|
||||
|
||||
Log.d("TAG", "onSuccess: " + response.toString() + "tttttttt");
|
||||
Log.d("TAG", "onSuccess: " + response.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -57,8 +57,8 @@ public class WithdrawalRecordFragment extends BaseFragment implements View.OnCli
|
||||
rxlWithdraw.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
|
||||
rxlWithdraw.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
|
||||
//取消上拉加载,刷新功能。
|
||||
// taskRecycler.setPullRefreshEnabled(false);
|
||||
// taskRecycler.setLoadingMoreEnabled(false);
|
||||
// taskRecycler.setPullRefreshEnabled(false);
|
||||
// taskRecycler.setLoadingMoreEnabled(false);
|
||||
withdrawalAdapter = new WithdrawalAdapter(getContext());
|
||||
rxlWithdraw.setAdapter(withdrawalAdapter);
|
||||
rxlWithdraw.getDefaultFootView().setNoMoreHint("已全部加载完毕");
|
||||
|
@ -18,15 +18,15 @@ public class Geohash {
|
||||
|
||||
private Geohash(){}
|
||||
|
||||
private static class GeohashInstance{
|
||||
private static class GeorasInstance {
|
||||
private static final Geohash INSTANCE = new Geohash();
|
||||
}
|
||||
|
||||
public static Geohash getInstance(){
|
||||
return GeohashInstance.INSTANCE;
|
||||
return GeorasInstance.INSTANCE;
|
||||
}
|
||||
|
||||
private static int numbits = 6 * 5;
|
||||
private static int nubbins = 6 * 5;
|
||||
/*
|
||||
* final static char[] digits = { '0', '1', '2', '3', '4', '5', '6', '7',
|
||||
* '8', '9', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'm', 'n', 'p',
|
||||
@ -153,8 +153,8 @@ public class Geohash {
|
||||
}
|
||||
|
||||
private BitSet getBits(double lat, double floor, double ceiling) {
|
||||
BitSet buffer = new BitSet(numbits);
|
||||
for (int i = 0; i < numbits; i++) {
|
||||
BitSet buffer = new BitSet(nubbins);
|
||||
for (int i = 0; i < nubbins; i++) {
|
||||
double mid = (floor + ceiling) / 2;
|
||||
if (lat >= mid) {
|
||||
buffer.set(i);
|
||||
|
@ -16,9 +16,7 @@ import com.vividsolutions.jts.io.WKTReader;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -64,7 +62,6 @@ public class GeometryTools {
|
||||
|
||||
/**
|
||||
* 返回点几何
|
||||
*
|
||||
* @param gp
|
||||
* @param formatDouble5
|
||||
* @return Geometry
|
||||
@ -115,7 +112,7 @@ public class GeometryTools {
|
||||
multiPolygon = factory.createMultiPolygon(polygons);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return multiPolygon;
|
||||
@ -138,7 +135,7 @@ public class GeometryTools {
|
||||
multiLineString = factory.createMultiLineString(lineStrings);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return multiLineString;
|
||||
@ -164,7 +161,7 @@ public class GeometryTools {
|
||||
createMultiPoint = factory.createMultiPoint(coords);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return createMultiPoint;
|
||||
@ -387,7 +384,7 @@ public class GeometryTools {
|
||||
}
|
||||
|
||||
public static LatLng getLineStringCenter(String lineString) {
|
||||
List<LatLng> points = getLatLngs(lineString);
|
||||
List<LatLng> points = getLatLags(lineString);
|
||||
return getLineStringCenter(points);
|
||||
}
|
||||
|
||||
@ -538,7 +535,7 @@ public class GeometryTools {
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
public static List<LatLng> getLatLngs(String str) {
|
||||
public static List<LatLng> getLatLags(String str) {
|
||||
if (isEmpty(str))
|
||||
return null;
|
||||
List<LatLng> list = null;
|
||||
@ -621,7 +618,7 @@ public class GeometryTools {
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
public static LineString getLineStrinGeo(List<LatLng> list) {
|
||||
public static LineString getLineStainGeo(List<LatLng> list) {
|
||||
|
||||
if (list != null && list.size() > 1) {
|
||||
int size = list.size();
|
||||
@ -659,7 +656,7 @@ public class GeometryTools {
|
||||
* @return
|
||||
*/
|
||||
public static Polygon getPolygonEnvelope(List<LatLng> list) {
|
||||
LineString lineString = getLineStrinGeo(list);
|
||||
LineString lineString = getLineStainGeo(list);
|
||||
if (lineString != null) {
|
||||
Geometry geometry = lineString.getEnvelope();
|
||||
if (geometry != null && geometry.getGeometryType().equals("Polygon")) {
|
||||
@ -845,7 +842,6 @@ public class GeometryTools {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
@ -862,7 +858,6 @@ public class GeometryTools {
|
||||
|
||||
if (isEmpty(lineString) ||isEmpty(point))
|
||||
return false;
|
||||
|
||||
Geometry lineGeo = createGeometry(lineString);
|
||||
|
||||
Geometry pGeo = createGeometry(point);
|
||||
@ -885,7 +880,6 @@ public class GeometryTools {
|
||||
|
||||
/**
|
||||
* 判断捕捉集合中是否包含传入的点位信息
|
||||
*
|
||||
* @param geoList
|
||||
* @return int;
|
||||
*/
|
||||
|
@ -17,6 +17,7 @@
|
||||
app:cameraVideoSizeMinHeight="1080"
|
||||
app:cameraVideoSizeMaxWidth="1920"
|
||||
app:cameraVideoSizeMinWidth="1080"
|
||||
app:cameraPictureSizeAspectRatio="1920:1080"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:keepScreenOn="true"
|
||||
|
@ -152,7 +152,7 @@
|
||||
style="@style/user_style"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:gravity="center"
|
||||
android:text="点击录像"
|
||||
android:textColor="@color/white"
|
||||
@ -162,8 +162,9 @@
|
||||
style="@style/user_style"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
android:text="点击查看成果"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp" />
|
||||
@ -183,7 +184,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="长按录像可删除"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
/>
|
||||
<ImageView
|
||||
android:id="@+id/iv_road_picture"
|
||||
@ -209,7 +210,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="04.描述"
|
||||
android:textColor="@color/black"
|
||||
@ -237,7 +238,7 @@
|
||||
android:focusableInTouchMode="true"
|
||||
android:gravity="top"
|
||||
android:hint="任务描述"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="30dp"
|
||||
android:textColor="@color/test_color_selector"
|
||||
|
@ -140,37 +140,33 @@
|
||||
android:id="@+id/ll_pictures"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintLeft_toLeftOf="@id/ll_mode"
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_mode">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="03.录像 "
|
||||
android:text="03.录像"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_picture"
|
||||
style="@style/user_style"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:gravity="center"
|
||||
android:text="点击录像"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_pictures"
|
||||
style="@style/user_style"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:gravity="center"
|
||||
android:text="点击拍照"
|
||||
android:textColor="@color/white"
|
||||
@ -178,15 +174,14 @@
|
||||
<TextView
|
||||
android:id="@+id/tv_photo_album"
|
||||
style="@style/user_style"
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:gravity="center"
|
||||
android:text="点击查看成果"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
@ -201,8 +196,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="长按图片或者录像可删除"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginLeft="10dp"/>
|
||||
|
||||
android:layout_marginStart="10dp"/>
|
||||
<ImageView
|
||||
android:id="@+id/iv_poi_video_picture"
|
||||
android:layout_width="wrap_content"
|
||||
@ -239,9 +233,9 @@
|
||||
android:id="@+id/tv_exist"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="18dp"
|
||||
android:layout_marginStart="18dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="是否存在*"
|
||||
@ -252,10 +246,9 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="18dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginStart="18dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_toEndOf="@id/tv_exist"
|
||||
android:layout_toRightOf="@id/tv_exist"
|
||||
android:background="@color/white"
|
||||
android:textColor="#333"
|
||||
android:textSize="15sp" />
|
||||
@ -271,7 +264,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="04.描述"
|
||||
android:textColor="@color/black"
|
||||
@ -299,13 +292,11 @@
|
||||
android:focusableInTouchMode="true"
|
||||
android:gravity="top"
|
||||
android:hint="任务描述"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="30dp"
|
||||
android:textColor="@color/test_color_selector"
|
||||
android:textSize="15sp"
|
||||
|
||||
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
Loading…
x
Reference in New Issue
Block a user