Skip to content

Commit

Permalink
ALS-1675 search no data found, geofence and tracking sheet catch and …
Browse files Browse the repository at this point in the history
…minute display fixes
  • Loading branch information
shah272728 committed Oct 2, 2023
1 parent 07023e5 commit 0b6bde4
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2074,6 +2074,7 @@ class ExploreFragment :
}
} else {
hideViews(rvSearchPlacesDirection, nsDirectionSearchPlaces)
layoutNoDataFound.root.show()
layoutNoDataFound.groupNoSearchFound.show()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class GeofenceUtils {
}

fun collapseGeofenceList() {
mBottomSheetGeofenceListBehavior?.isDraggable = true
mBottomSheetGeofenceListBehavior?.state = BottomSheetBehavior.STATE_COLLAPSED
}

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -536,6 +539,7 @@ class GeofenceUtils {
)
}
mBindingAddGeofence?.btnDeleteGeofence?.show()
mBottomSheetAddGeofenceBehavior?.isDraggable = true
mBottomSheetAddGeofenceBehavior?.state = BottomSheetBehavior.STATE_COLLAPSED

checkRtl()
Expand Down Expand Up @@ -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
}
Expand All @@ -639,6 +644,7 @@ class GeofenceUtils {
}

private fun hideGeofenceListBottomSheet() {
mBottomSheetGeofenceListBehavior?.isDraggable = false
mBottomSheetGeofenceListBehavior?.isHideable = true
mBottomSheetGeofenceListBehavior?.state = BottomSheetBehavior.STATE_HIDDEN
}
Expand All @@ -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()
Expand All @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down
20 changes: 14 additions & 6 deletions app/src/main/java/com/aws/amazonlocation/utils/Units.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/bottom_sheet_direction_search.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
2 changes: 1 addition & 1 deletion app/src/test/java/com/aws/amazonlocation/mock/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 0b6bde4

Please sign in to comment.