From c47a0bdfb49a8a06b94c7a895ae6bc57e8a754a0 Mon Sep 17 00:00:00 2001 From: JHM69 Date: Fri, 10 May 2024 15:18:53 -0700 Subject: [PATCH 1/4] fixed map --- .../app/src/main/assets/video_loading_bg.svg | 150 ++++-------------- .../ui/activities/nearbysts/MapView.java | 63 ++++---- 2 files changed, 68 insertions(+), 145 deletions(-) diff --git a/android-app/app/src/main/assets/video_loading_bg.svg b/android-app/app/src/main/assets/video_loading_bg.svg index 7a03fd5..47da8e8 100644 --- a/android-app/app/src/main/assets/video_loading_bg.svg +++ b/android-app/app/src/main/assets/video_loading_bg.svg @@ -1,118 +1,34 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loading video... - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android-app/app/src/main/java/com/quantum_guys/dncc_eco_sync/ui/activities/nearbysts/MapView.java b/android-app/app/src/main/java/com/quantum_guys/dncc_eco_sync/ui/activities/nearbysts/MapView.java index be22508..3d2e6b7 100644 --- a/android-app/app/src/main/java/com/quantum_guys/dncc_eco_sync/ui/activities/nearbysts/MapView.java +++ b/android-app/app/src/main/java/com/quantum_guys/dncc_eco_sync/ui/activities/nearbysts/MapView.java @@ -53,7 +53,6 @@ import com.google.android.gms.maps.model.Marker; import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.gms.maps.model.Polyline; -import com.google.android.gms.maps.model.PolylineOptions; import com.karumi.dexter.Dexter; import com.karumi.dexter.MultiplePermissionsReport; import com.karumi.dexter.PermissionToken; @@ -216,13 +215,13 @@ public void onRoutingSuccess(ArrayList route, int sh // map.moveCamera(center); // map.moveCamera(zoom); - Toast.makeText(this, "Route Success", Toast.LENGTH_SHORT).show(); - if (polyLines.size() > 0) { - for (Polyline poly : polyLines) { - poly.remove(); - } - } - polyLines = new ArrayList<>(); +// Toast.makeText(this, "Route Success", Toast.LENGTH_SHORT).show(); +// if (polyLines.size() > 0) { +// for (Polyline poly : polyLines) { +// poly.remove(); +// } +// } +// polyLines = new ArrayList<>(); //add route(s) to the map. @@ -235,23 +234,23 @@ public void onRoutingSuccess(ArrayList route, int sh map.addMarker(options); } - try { - for (int i = 0; i < route.size(); i++) { - //In case of more than 5 alternative routes - PolylineOptions polyOptions = new PolylineOptions(); - //polyOptions.color(getResources().getColor(R.color.addColor)); - polyOptions.width(15 + i * 3); - polyOptions.addAll(route.get(i).getPoints()); - Polyline polyline = map.addPolyline(polyOptions); - polyLines.add(polyline); - } - } catch (Exception f) { - Toast.makeText( - this, - f.getLocalizedMessage(), - Toast.LENGTH_SHORT - ).show(); - } +// try { +// for (int i = 0; i < route.size(); i++) { +// //In case of more than 5 alternative routes +// PolylineOptions polyOptions = new PolylineOptions(); +// //polyOptions.color(getResources().getColor(R.color.addColor)); +// polyOptions.width(15 + i * 3); +// polyOptions.addAll(route.get(i).getPoints()); +// Polyline polyline = map.addPolyline(polyOptions); +// polyLines.add(polyline); +// } +// } catch (Exception f) { +// Toast.makeText( +// this, +// f.getLocalizedMessage(), +// Toast.LENGTH_SHORT +// ).show(); +// } for (int i = 0; i < trip.getVehicleEntries().size(); i++) { VehicleEntry vehicleEntry = trip.getVehicleEntries().get(i); @@ -458,12 +457,20 @@ public void onResponse(Call call, Response response) { // Add Marker for each STS for (NearbySts sts : response1.sts) { + LatLng lt = new LatLng(sts.getLat(), sts.getLon()); stsList.add(new LatLng(sts.getLat(), sts.getLon())); MarkerOptions options = new MarkerOptions(); - options.position(new LatLng(sts.getLat(), sts.getLon()) ); + options.position(lt); + options.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED)); + map.addMarker(options); + } + + + + for (LatLng lt : stsList) { + MarkerOptions options = new MarkerOptions(); + options.position(lt); options.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED)); -// add a text to the marker - options.title(sts.getName()); map.addMarker(options); } From a9c4ab2141ebebe133877032ba369fb66b522606 Mon Sep 17 00:00:00 2001 From: JHM69 Date: Fri, 10 May 2024 15:34:15 -0700 Subject: [PATCH 2/4] fixed issue bug --- .../java/com/quantum_guys/dncc_eco_sync/ui/fragment/Issue.java | 2 +- android-app/app/src/main/res/layout/activity_issue_image.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android-app/app/src/main/java/com/quantum_guys/dncc_eco_sync/ui/fragment/Issue.java b/android-app/app/src/main/java/com/quantum_guys/dncc_eco_sync/ui/fragment/Issue.java index 72632b9..4d3b742 100644 --- a/android-app/app/src/main/java/com/quantum_guys/dncc_eco_sync/ui/fragment/Issue.java +++ b/android-app/app/src/main/java/com/quantum_guys/dncc_eco_sync/ui/fragment/Issue.java @@ -113,7 +113,7 @@ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { } }); - button.setOnClickListener(view12 -> mBottomSheetDialog.show()); + button.setOnClickListener(view12 -> startPickImage()); } private void setupAdapter(String tag) { diff --git a/android-app/app/src/main/res/layout/activity_issue_image.xml b/android-app/app/src/main/res/layout/activity_issue_image.xml index 9f6dd59..62dc529 100644 --- a/android-app/app/src/main/res/layout/activity_issue_image.xml +++ b/android-app/app/src/main/res/layout/activity_issue_image.xml @@ -88,7 +88,7 @@ app:layout_constraintTop_toTopOf="parent"> Date: Sat, 11 May 2024 04:36:34 +0600 Subject: [PATCH 3/4] bug fix --- express-server/src/services/pdf.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/express-server/src/services/pdf.service.ts b/express-server/src/services/pdf.service.ts index 0ba9006..8ea19df 100644 --- a/express-server/src/services/pdf.service.ts +++ b/express-server/src/services/pdf.service.ts @@ -440,5 +440,5 @@ const getHtml = ( `; } - export { getHtml2}; + export { getHtml, getHtml2}; \ No newline at end of file From 88faeecf3125282d0d056b1fe00d5999e9578076 Mon Sep 17 00:00:00 2001 From: JHM69 Date: Fri, 10 May 2024 15:39:19 -0700 Subject: [PATCH 4/4] url changed --- deploy.sh | 1 + react-app/utils/url.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index b1b2e52..e79deed 100644 --- a/deploy.sh +++ b/deploy.sh @@ -1,3 +1,4 @@ +git pull cd express-server docker build -t cs_backend . docker stop cs_backend || true diff --git a/react-app/utils/url.js b/react-app/utils/url.js index abc002d..9d2da75 100644 --- a/react-app/utils/url.js +++ b/react-app/utils/url.js @@ -4,6 +4,6 @@ const url = process.env.API; export const getBaseUrl = () => { // console.log(process.env.API); //return process.env.API || 'http://3.208.28.247:5000'; - return 'http://localhost:5000'; + return 'http://3.208.28.247:5000'; } \ No newline at end of file