This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ServiceOperationHelper(val merchant: Merchant) { | |
fun getServiceOperation(): ServiceOperation { | |
return try { | |
when { | |
isClosedWithinServiceTime() -> ClosedWithinServiceTime | |
isClosedIndefinitely() -> ClosedIndefinitely | |
isPreClosingHour() -> PreClosingHour | |
isPreOpening() -> PreOpening | |
isAfterClosing() -> AfterClosing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ServiceOperationHelper(val merchant: Merchant) { | |
fun getServiceOperation(): ServiceOperation { | |
return try { | |
when { | |
isClosedWithinServiceTime() -> ClosedWithinServiceTime | |
isClosedIndefinitely() -> ClosedIndefinitely | |
isPreClosingHour() -> PreClosingHour | |
isPreOpening() -> PreOpening | |
isAfterClosing() -> AfterClosing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed class ServiceOperationDetails( | |
val title: String = "", | |
val message: String = "", | |
val ribbonMessage: ServiceOperationStatusRibbon = Hidden, | |
val schedule: Schedule | |
) { | |
data class Schedule( | |
val walkInSchedule: ServiceOperationSchedule.PhysicalStore, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style name="Nueca.Design.Theme.AlertDialog.Light.80" parent="NuecaAppTheme.AlertDialog"> | |
<item name="android:windowMinWidthMajor">80%</item> | |
<item name="android:windowMinWidthMinor">80%</item> | |
<item name="windowFixedWidthMajor">80%</item> | |
<item name="windowFixedWidthMinor">80%</item> | |
<item name="cornerFamily">rounded</item> | |
<item name="dialogCornerRadius">8dp</item> | |
<item name="textAppearanceButton">@style/NuecaAppTheme.AlertDialog.Buttons</item> | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun isJSONValid(test: String): Boolean { | |
return try { | |
Gson().getAdapter(JsonElement::class.java).fromJson(test) | |
true | |
} catch (exception: Exception) { | |
false | |
} | |
} |