diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/ChargingStationFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/ChargingStationFragment.java index 71dd8da..57958ba 100644 --- a/app/src/main/java/com/navinfo/outdoor/fragment/ChargingStationFragment.java +++ b/app/src/main/java/com/navinfo/outdoor/fragment/ChargingStationFragment.java @@ -91,6 +91,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. private RelativeLayout rlPanorama, rlName, rlInternalPhotos, rlElse, rlScutcheon, rlNull; private ImageView ivPanorama, ivName, ivInternal, ivElse, ivScutcheon; private TextView tvExamine; + private TextView tvPanorama; + private TextView tvName; + private TextView tvInternal; + private TextView tvElse; + private TextView tvScutcheon; private EditText editNameContent, editSiteContent; private ArrayList poiBeans; private Button btnSaveLocal; @@ -246,7 +251,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. rlElse.setOnClickListener(this::onClick); rlScutcheon = findViewById(R.id.rl_scutcheon); rlScutcheon.setOnClickListener(this::onClick); - + tvPanorama = findViewById(R.id.tv_panorama); + tvElse = findViewById(R.id.tv_else); + tvInternal = findViewById(R.id.tv_internal); + tvName = findViewById(R.id.tv_name); + tvScutcheon = findViewById(R.id.tv_scutcheon); /* recyclerPhone = findViewById(R.id.recycler_phone); recyclerPhone.setLayoutManager(new LinearLayoutManager(getContext())); recyclerPhone.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL)); @@ -538,19 +547,19 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. String[] split = photo.split("/"); if (split[split.length - 1].startsWith("a")) { Glide.with(getActivity()).load(photo).into(ivPanorama); - ivPanorama.setTag(photo); + tvPanorama.setTag(photo); } else if (split[split.length - 1].startsWith("b")) { Glide.with(getActivity()).load(photo).into(ivName); - ivName.setTag(photo); + tvName.setTag(photo); } else if (split[split.length - 1].startsWith("c")) { Glide.with(getActivity()).load(photo).into(ivInternal); - ivInternal.setTag(photo); + tvInternal.setTag(photo); } else if (split[split.length - 1].startsWith("d")) { Glide.with(getActivity()).load(photo).into(ivElse); - ivElse.setTag(photo); + tvElse.setTag(photo); } else if (split[split.length - 1].startsWith("e")) { Glide.with(getActivity()).load(photo).into(ivScutcheon); - ivScutcheon.setTag(photo); + tvScutcheon.setTag(photo); } } } @@ -714,14 +723,14 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. return; } chargingStationList = new ArrayList<>(); - String tagPanorama = (String) ivPanorama.getTag(); + String tagPanorama = (String) tvPanorama.getTag(); if (tagPanorama == null) { Toast.makeText(getContext(), "请拍照", Toast.LENGTH_SHORT).show(); return; } else { chargingStationList.add(new File(tagPanorama)); } - String tagName = (String) ivName.getTag(); + String tagName = (String) tvName.getTag(); if (tagName == null) { Toast.makeText(getContext(), "请拍照", Toast.LENGTH_SHORT).show(); return; @@ -729,7 +738,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. chargingStationList.add(new File(tagName)); } if (existence == 0) { - String tagInternal = (String) ivInternal.getTag(); + String tagInternal = (String) tvInternal.getTag(); if (tagInternal == null) { Toast.makeText(getContext(), "请拍照", Toast.LENGTH_SHORT).show(); return; @@ -743,7 +752,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. } else { chargingStationList.add(new File(tagElse)); } - String tagScutcheon = (String) ivScutcheon.getTag(); + String tagScutcheon = (String) tvScutcheon.getTag(); if (tagScutcheon == null) { Toast.makeText(getContext(), "请拍照", Toast.LENGTH_SHORT).show(); return; @@ -1114,7 +1123,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. Bundle extras = data.getExtras();//从Intent中获取附加值 Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像 String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a", Geohash.getInstance().encode(latLng.latitude, latLng.longitude)); - ivPanorama.setTag(takePhotoPath); + tvPanorama.setTag(takePhotoPath); ivPanorama.setImageBitmap(bitmap);//显示图像 /* int height = bitmap.getHeight(); int width = bitmap.getWidth(); @@ -1135,7 +1144,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. Bundle extras = data.getExtras();//从Intent中获取附加值 Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像 String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "b", Geohash.getInstance().encode(latLng.latitude, latLng.longitude)); - ivName.setTag(takePhotoPath); + tvName.setTag(takePhotoPath); ivName.setImageBitmap(bitmap);//显示图像 /*int height = bitmap.getHeight(); int width = bitmap.getWidth(); @@ -1156,7 +1165,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. Bundle extras = data.getExtras();//从Intent中获取附加值 Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像 String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c", Geohash.getInstance().encode(latLng.latitude, latLng.longitude)); - ivInternal.setTag(takePhotoPath); + tvInternal.setTag(takePhotoPath); ivInternal.setImageBitmap(bitmap);//显示图像 /*int height = bitmap.getHeight(); int width = bitmap.getWidth(); @@ -1177,7 +1186,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. Bundle extras = data.getExtras();//从Intent中获取附加值 Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像 String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "d", Geohash.getInstance().encode(latLng.latitude, latLng.longitude)); - ivElse.setTag(takePhotoPath); + tvElse.setTag(takePhotoPath); ivElse.setImageBitmap(bitmap);//显示图像 /* int height = bitmap.getHeight(); int width = bitmap.getWidth(); @@ -1198,7 +1207,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. Bundle extras = data.getExtras();//从Intent中获取附加值 Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像 String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "e", Geohash.getInstance().encode(latLng.latitude, latLng.longitude)); - ivScutcheon.setTag(takePhotoPath); + tvScutcheon.setTag(takePhotoPath); ivScutcheon.setImageBitmap(bitmap);//显示图像 /* int height = bitmap.getHeight(); int width = bitmap.getWidth(); @@ -1324,23 +1333,23 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. String list = contactView.getList(); poiEntity.setTelPhone(list); } - String tagPanorama = (String) ivPanorama.getTag(); + String tagPanorama = (String) tvPanorama.getTag(); if (tagPanorama != null && !tagPanorama.equals("")) { infoPhoto.add(new Info(tagPanorama)); } - String tagName = (String) ivName.getTag(); + String tagName = (String) tvName.getTag(); if (tagName != null && !tagName.equals("")) { infoPhoto.add(new Info(tagName)); } - String tagInternal = (String) ivInternal.getTag(); + String tagInternal = (String) tvInternal.getTag(); if (tagInternal != null && !tagInternal.equals("")) { infoPhoto.add(new Info(tagInternal)); } - String tagElse = (String) ivElse.getTag(); + String tagElse = (String) tvElse.getTag(); if (tagElse != null && !tagElse.equals("")) { infoPhoto.add(new Info(tagElse)); } - String tagScutcheon = (String) ivScutcheon.getTag(); + String tagScutcheon = (String) tvScutcheon.getTag(); if (tagScutcheon != null && !tagScutcheon.equals("")) { infoPhoto.add(new Info(tagScutcheon)); } @@ -1366,28 +1375,28 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. poiCheckResult.setMsg("请输入 名称"); return poiCheckResult; } - if (ivPanorama.getTag()==null){ + if (tvPanorama.getTag()==null){ poiCheckResult.setCode(1); poiCheckResult.setMsg("请拍照 全景图"); return poiCheckResult; } - if (ivName.getTag()==null){ + if (tvName.getTag()==null){ poiCheckResult.setCode(1); poiCheckResult.setMsg("请拍照 名称照片"); return poiCheckResult; } if (entity.getExistence()==0){ - if (ivInternal.getTag()==null){ + if (tvInternal.getTag()==null){ poiCheckResult.setCode(1); poiCheckResult.setMsg("请拍照 服务说明"); return poiCheckResult; } - if (ivElse.getTag()==null){ + if (tvElse.getTag()==null){ poiCheckResult.setCode(1); poiCheckResult.setMsg("请拍照 充电站指引牌"); return poiCheckResult; } - if (ivScutcheon.getTag()==null){ + if (tvScutcheon.getTag()==null){ poiCheckResult.setCode(1); poiCheckResult.setMsg("请拍照 收费标牌"); return poiCheckResult; diff --git a/app/src/main/res/layout/charging_station_fragment.xml b/app/src/main/res/layout/charging_station_fragment.xml index b8fd960..16b4e08 100644 --- a/app/src/main/res/layout/charging_station_fragment.xml +++ b/app/src/main/res/layout/charging_station_fragment.xml @@ -315,6 +315,7 @@ android:layout_height="20dp" />