From 0b6bde4b46cc01c33b2220bc6c468966bf305b1a Mon Sep 17 00:00:00 2001 From: shah Date: Mon, 2 Oct 2023 17:35:59 +0530 Subject: [PATCH] ALS-1675 search no data found, geofence and tracking sheet catch and minute display fixes --- .../ui/main/explore/ExploreFragment.kt | 1 + .../ui/main/geofence/GeofenceUtils.kt | 10 ++++++++++ .../ui/main/tracking/TrackingUtils.kt | 1 + .../com/aws/amazonlocation/utils/Units.kt | 20 +++++++++++++------ .../bottom_sheet_direction_search.xml | 1 + .../bottom_sheet_direction_search.xml | 1 + .../layout/bottom_sheet_direction_search.xml | 1 + .../com/aws/amazonlocation/mock/Constants.kt | 2 +- 8 files changed, 30 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/aws/amazonlocation/ui/main/explore/ExploreFragment.kt b/app/src/main/java/com/aws/amazonlocation/ui/main/explore/ExploreFragment.kt index 05a09134..13a6050d 100644 --- a/app/src/main/java/com/aws/amazonlocation/ui/main/explore/ExploreFragment.kt +++ b/app/src/main/java/com/aws/amazonlocation/ui/main/explore/ExploreFragment.kt @@ -2074,6 +2074,7 @@ class ExploreFragment : } } else { hideViews(rvSearchPlacesDirection, nsDirectionSearchPlaces) + layoutNoDataFound.root.show() layoutNoDataFound.groupNoSearchFound.show() } } diff --git a/app/src/main/java/com/aws/amazonlocation/ui/main/geofence/GeofenceUtils.kt b/app/src/main/java/com/aws/amazonlocation/ui/main/geofence/GeofenceUtils.kt index 6e6a3fa0..44a3273c 100644 --- a/app/src/main/java/com/aws/amazonlocation/ui/main/geofence/GeofenceUtils.kt +++ b/app/src/main/java/com/aws/amazonlocation/ui/main/geofence/GeofenceUtils.kt @@ -99,6 +99,7 @@ class GeofenceUtils { } fun collapseGeofenceList() { + mBottomSheetGeofenceListBehavior?.isDraggable = true mBottomSheetGeofenceListBehavior?.state = BottomSheetBehavior.STATE_COLLAPSED } @@ -152,6 +153,7 @@ class GeofenceUtils { mBindingAddGeofence?.apply { mBottomSheetAddGeofenceBehavior = BottomSheetBehavior.from(root) mBottomSheetAddGeofenceBehavior?.isFitToContents = false + mBottomSheetAddGeofenceBehavior?.isDraggable = true mBottomSheetAddGeofenceBehavior?.state = BottomSheetBehavior.STATE_HIDDEN setGeofenceSearchSuggestionAdapter() setGeofenceSearchPlaceAdapter() @@ -343,6 +345,7 @@ class GeofenceUtils { mBindingGeofenceList?.apply { mBottomSheetGeofenceListBehavior = BottomSheetBehavior.from(root) mBottomSheetGeofenceListBehavior?.isHideable = true + mBottomSheetGeofenceListBehavior?.isDraggable = true mBottomSheetGeofenceListBehavior?.state = BottomSheetBehavior.STATE_HIDDEN mBottomSheetGeofenceListBehavior?.isFitToContents = false if (isTablet) { @@ -536,6 +539,7 @@ class GeofenceUtils { ) } mBindingAddGeofence?.btnDeleteGeofence?.show() + mBottomSheetAddGeofenceBehavior?.isDraggable = true mBottomSheetAddGeofenceBehavior?.state = BottomSheetBehavior.STATE_COLLAPSED checkRtl() @@ -622,6 +626,7 @@ class GeofenceUtils { enableAddGeofenceButton(false) mIsBtnEnable = false mBottomSheetGeofenceListBehavior?.isHideable = false + mBottomSheetGeofenceListBehavior?.isDraggable = true mBottomSheetGeofenceListBehavior?.halfExpandedRatio = 0.55f mBottomSheetGeofenceListBehavior?.state = BottomSheetBehavior.STATE_HALF_EXPANDED } @@ -639,6 +644,7 @@ class GeofenceUtils { } private fun hideGeofenceListBottomSheet() { + mBottomSheetGeofenceListBehavior?.isDraggable = false mBottomSheetGeofenceListBehavior?.isHideable = true mBottomSheetGeofenceListBehavior?.state = BottomSheetBehavior.STATE_HIDDEN } @@ -656,6 +662,7 @@ class GeofenceUtils { mBindingAddGeofence?.groupRadius?.show() mBindingAddGeofence?.edtAddGeofenceSearch?.clearFocus() mBottomSheetAddGeofenceBehavior?.isHideable = false + mBottomSheetAddGeofenceBehavior?.isDraggable = true mBottomSheetAddGeofenceBehavior?.state = BottomSheetBehavior.STATE_COLLAPSED mGeofenceHelper?.mDefaultLatLng?.let { mGeofenceInterface?.openAddGeofenceBottomSheet(it) } checkRtl() @@ -679,14 +686,17 @@ class GeofenceUtils { } fun expandAddGeofenceBottomSheet() { + mBottomSheetAddGeofenceBehavior?.isDraggable = true mBottomSheetAddGeofenceBehavior?.state = BottomSheetBehavior.STATE_EXPANDED } fun collapseAddGeofenceBottomSheet() { + mBottomSheetAddGeofenceBehavior?.isDraggable = true mBottomSheetAddGeofenceBehavior?.state = BottomSheetBehavior.STATE_COLLAPSED } private fun hideAddGeofenceBottomSheet() { + mBottomSheetAddGeofenceBehavior?.isDraggable = false mBottomSheetAddGeofenceBehavior?.isHideable = true mBottomSheetAddGeofenceBehavior?.state = BottomSheetBehavior.STATE_HIDDEN } diff --git a/app/src/main/java/com/aws/amazonlocation/ui/main/tracking/TrackingUtils.kt b/app/src/main/java/com/aws/amazonlocation/ui/main/tracking/TrackingUtils.kt index 0cf358eb..59dc7ba8 100644 --- a/app/src/main/java/com/aws/amazonlocation/ui/main/tracking/TrackingUtils.kt +++ b/app/src/main/java/com/aws/amazonlocation/ui/main/tracking/TrackingUtils.kt @@ -526,6 +526,7 @@ class TrackingUtils( it?.isHideable = true it?.state = BottomSheetBehavior.STATE_HIDDEN it?.isFitToContents = false + it?.isDraggable = false mMapHelper?.clearMarker() mMapHelper?.removeLine() sourceIdsToRemove.let { list -> diff --git a/app/src/main/java/com/aws/amazonlocation/utils/Units.kt b/app/src/main/java/com/aws/amazonlocation/utils/Units.kt index 1101aa3d..3f655767 100644 --- a/app/src/main/java/com/aws/amazonlocation/utils/Units.kt +++ b/app/src/main/java/com/aws/amazonlocation/utils/Units.kt @@ -96,12 +96,20 @@ object Units { } if (mHours != 0L) { - mTime = buildString { - append(mHours) - append(" ") - append(context.getString(R.string.label_hr)) - append(" ") - append(mTime) + mTime = if (mMinute != 0L) { + buildString { + append(mHours) + append(" ") + append(context.getString(R.string.label_hr)) + append(" ") + append(mTime) + } + } else { + buildString { + append(mHours) + append(" ") + append(context.getString(R.string.label_hr)) + } } } return mTime diff --git a/app/src/main/res/layout-sw600dp/bottom_sheet_direction_search.xml b/app/src/main/res/layout-sw600dp/bottom_sheet_direction_search.xml index 9ce33c73..5524952b 100644 --- a/app/src/main/res/layout-sw600dp/bottom_sheet_direction_search.xml +++ b/app/src/main/res/layout-sw600dp/bottom_sheet_direction_search.xml @@ -1543,6 +1543,7 @@ layout="@layout/layout_no_data_found" android:layout_width="match_parent" android:layout_height="@dimen/dp_0" + android:visibility="gone" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/card_map_option" /> diff --git a/app/src/main/res/layout-sw720dp/bottom_sheet_direction_search.xml b/app/src/main/res/layout-sw720dp/bottom_sheet_direction_search.xml index 9ce33c73..5524952b 100644 --- a/app/src/main/res/layout-sw720dp/bottom_sheet_direction_search.xml +++ b/app/src/main/res/layout-sw720dp/bottom_sheet_direction_search.xml @@ -1543,6 +1543,7 @@ layout="@layout/layout_no_data_found" android:layout_width="match_parent" android:layout_height="@dimen/dp_0" + android:visibility="gone" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/card_map_option" /> diff --git a/app/src/main/res/layout/bottom_sheet_direction_search.xml b/app/src/main/res/layout/bottom_sheet_direction_search.xml index da7862c6..9827d80b 100644 --- a/app/src/main/res/layout/bottom_sheet_direction_search.xml +++ b/app/src/main/res/layout/bottom_sheet_direction_search.xml @@ -1542,6 +1542,7 @@ layout="@layout/layout_no_data_found" android:layout_width="match_parent" android:layout_height="@dimen/dp_0" + android:visibility="gone" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/card_map_option" /> diff --git a/app/src/test/java/com/aws/amazonlocation/mock/Constants.kt b/app/src/test/java/com/aws/amazonlocation/mock/Constants.kt index 0389df68..5f79b61a 100644 --- a/app/src/test/java/com/aws/amazonlocation/mock/Constants.kt +++ b/app/src/test/java/com/aws/amazonlocation/mock/Constants.kt @@ -206,7 +206,7 @@ const val UNIT_TIME_SEC_3 = 3600.0 const val UNIT_TIME_1_OUTPUT = "50 sec" const val UNIT_TIME_2_OUTPUT = "2 min" -const val UNIT_TIME_3_OUTPUT = "1 hr 0 min" +const val UNIT_TIME_3_OUTPUT = "1 hr" const val UNIT_DEF_AWS_CONF_INPUT_POOL_ID = "us-east-1_48VeDo2Uw" const val UNIT_DEF_AWS_CONF_INPUT_REGION = "us-east-1"