From b1a3d25609fd455ec1bf4f6c9468849a08ab2ac4 Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Fri, 8 Sep 2023 15:07:18 -0400 Subject: [PATCH 1/3] Offline area map selector mask and outline --- .../offline_area_viewport_outline.xml | 22 +++++++++ .../layout/offline_base_map_selector_frag.xml | 47 +++++++++++++++++++ ground/src/main/res/values/colors.xml | 1 + 3 files changed, 70 insertions(+) create mode 100644 ground/src/main/res/drawable/offline_area_viewport_outline.xml diff --git a/ground/src/main/res/drawable/offline_area_viewport_outline.xml b/ground/src/main/res/drawable/offline_area_viewport_outline.xml new file mode 100644 index 0000000000..b523238e64 --- /dev/null +++ b/ground/src/main/res/drawable/offline_area_viewport_outline.xml @@ -0,0 +1,22 @@ + + + + + + + + diff --git a/ground/src/main/res/layout/offline_base_map_selector_frag.xml b/ground/src/main/res/layout/offline_base_map_selector_frag.xml index ea6f2f61eb..80a100129a 100644 --- a/ground/src/main/res/layout/offline_base_map_selector_frag.xml +++ b/ground/src/main/res/layout/offline_base_map_selector_frag.xml @@ -74,6 +74,53 @@ app:layout_constraintEnd_toEndOf="parent" app:useCompatPadding="true" /> + + + + + + + + + + + diff --git a/ground/src/main/res/values/colors.xml b/ground/src/main/res/values/colors.xml index 43db6c4cec..a00e4036ee 100644 --- a/ground/src/main/res/values/colors.xml +++ b/ground/src/main/res/values/colors.xml @@ -20,6 +20,7 @@ #ff9131 #6DDD81 #55ffffff + #000000 #006E2C From 234cb850abc23adcca7f4f98b5cddc33f9d8a154 Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Fri, 8 Sep 2023 17:48:13 -0400 Subject: [PATCH 2/3] Update Cancel and Download layout --- .../selector/OfflineAreaSelectorFragment.kt | 1 - .../selector/OfflineAreaSelectorViewModel.kt | 4 + .../layout/offline_base_map_selector_frag.xml | 85 ++++++++++++------- ground/src/main/res/values/dimens.xml | 4 +- ground/src/main/res/values/strings.xml | 2 + ground/src/main/res/values/styles.xml | 15 +++- 6 files changed, 75 insertions(+), 36 deletions(-) diff --git a/ground/src/main/java/com/google/android/ground/ui/offlinebasemap/selector/OfflineAreaSelectorFragment.kt b/ground/src/main/java/com/google/android/ground/ui/offlinebasemap/selector/OfflineAreaSelectorFragment.kt index 6cc5c97d4d..5c24d64f18 100644 --- a/ground/src/main/java/com/google/android/ground/ui/offlinebasemap/selector/OfflineAreaSelectorFragment.kt +++ b/ground/src/main/java/com/google/android/ground/ui/offlinebasemap/selector/OfflineAreaSelectorFragment.kt @@ -56,7 +56,6 @@ class OfflineAreaSelectorFragment : Hilt_OfflineAreaSelectorFragment() { val binding = OfflineBaseMapSelectorFragBinding.inflate(inflater, container, false) binding.viewModel = viewModel binding.lifecycleOwner = this - getAbstractActivity().setActionBar(binding.offlineAreaSelectorToolbar, true) return binding.root } diff --git a/ground/src/main/java/com/google/android/ground/ui/offlinebasemap/selector/OfflineAreaSelectorViewModel.kt b/ground/src/main/java/com/google/android/ground/ui/offlinebasemap/selector/OfflineAreaSelectorViewModel.kt index 8fce8812ae..f81a5d6d6f 100644 --- a/ground/src/main/java/com/google/android/ground/ui/offlinebasemap/selector/OfflineAreaSelectorViewModel.kt +++ b/ground/src/main/java/com/google/android/ground/ui/offlinebasemap/selector/OfflineAreaSelectorViewModel.kt @@ -96,6 +96,10 @@ internal constructor( } } + fun onCancelClick() { + navigator.navigateUp() + } + fun onMapReady(map: Map) { map.mapType = MapType.TERRAIN tileSources.forEach { map.addTileOverlay(it) } diff --git a/ground/src/main/res/layout/offline_base_map_selector_frag.xml b/ground/src/main/res/layout/offline_base_map_selector_frag.xml index 80a100129a..2d207489a3 100644 --- a/ground/src/main/res/layout/offline_base_map_selector_frag.xml +++ b/ground/src/main/res/layout/offline_base_map_selector_frag.xml @@ -34,46 +34,34 @@ android:layout_height="match_parent" android:fitsSystemWindows="true"> + + + + + - - - - + app:layout_constraintTop_toBottomOf="@id/offline_area_selector_toolbar" /> + app:layout_constraintBottom_toTopOf="@id/button_buttons" /> + + + + + + + diff --git a/ground/src/main/res/values/dimens.xml b/ground/src/main/res/values/dimens.xml index f6d1e119e5..958ede8fcd 100644 --- a/ground/src/main/res/values/dimens.xml +++ b/ground/src/main/res/values/dimens.xml @@ -50,8 +50,8 @@ 8dp 128dp 14dp - 24dp - 48dp + 100dp + 40dp 14sp 20dp 10dp diff --git a/ground/src/main/res/values/strings.xml b/ground/src/main/res/values/strings.xml index f5db64555e..4689f98ad1 100644 --- a/ground/src/main/res/values/strings.xml +++ b/ground/src/main/res/values/strings.xml @@ -163,4 +163,6 @@ Contact your system administrator to request access Close app Warning: If you sign out, all unsaved data will be lost + Cancel + Download this area? diff --git a/ground/src/main/res/values/styles.xml b/ground/src/main/res/values/styles.xml index 50ef4f4ab8..5e7b2c367e 100644 --- a/ground/src/main/res/values/styles.xml +++ b/ground/src/main/res/values/styles.xml @@ -71,6 +71,11 @@ ?attr/colorOnSurface + + + + From 1fd58f95b7641904f04e2bb379c6e20d1587ea71 Mon Sep 17 00:00:00 2001 From: Gino Miceli Date: Fri, 8 Sep 2023 18:15:22 -0400 Subject: [PATCH 3/3] Remove unused resource --- .../res/drawable-anydpi/ic_area_download.xml | 29 ------------------- 1 file changed, 29 deletions(-) delete mode 100644 ground/src/main/res/drawable-anydpi/ic_area_download.xml diff --git a/ground/src/main/res/drawable-anydpi/ic_area_download.xml b/ground/src/main/res/drawable-anydpi/ic_area_download.xml deleted file mode 100644 index 30c3f41959..0000000000 --- a/ground/src/main/res/drawable-anydpi/ic_area_download.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - -