Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

fix: NavigationBarItem action property #70

Merged
merged 1 commit into from
Mar 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -51,23 +51,23 @@ data class SafeArea(
*
* @param text defines the description for the item
* @param image defines the local image for the item
* @param action defines an action to be called when the item is clicked on
* @param onPress defines an action list to be called when the item is clicked on
* @param accessibility defines the accessibility details for the item
*
*/

data class NavigationBarItem(
val text: String,
val image: Bind<String>?,
val action: Action,
val onPress: List<Action>,
val accessibility: Accessibility? = null
) {
constructor(
text: String,
image: String? = null,
action: Action,
onPress: List<Action>,
accessibility: Accessibility? = null,
) : this(text, constantNullable(image), action, accessibility)
) : this(text, constantNullable(image), onPress, accessibility)
}

/**
Original file line number Diff line number Diff line change
@@ -42,10 +42,12 @@ object AccessibilityScreenBuilder : ScreenBuilder {
NavigationBarItem(
text = "",
image = "informationImage",
action = Alert(
title = "Accessibility Screen",
message = "This method applies accessibility in a widget",
labelOk = "OK"
onPress = listOf(
Alert(
title = "Accessibility Screen",
message = "This method applies accessibility in a widget",
labelOk = "OK"
)
)
)
)
Original file line number Diff line number Diff line change
@@ -46,10 +46,12 @@ object ActionScreenBuilder : ScreenBuilder {
NavigationBarItem(
text = "",
image = "informationImage",
action = Alert(
title = "Action",
message = "This class handles transition actions between screens in the application. ",
labelOk = "OK"
onPress = listOf(
Alert(
title = "Action",
message = "This class handles transition actions between screens in the application. ",
labelOk = "OK"
)
)
)
)
Original file line number Diff line number Diff line change
@@ -83,11 +83,13 @@ object ButtonScreenBuilder : ScreenBuilder {
NavigationBarItem(
text = "",
image = "informationImage",
action = Alert(
title = "Button",
message = "This is a widget that will define a button natively using the server " +
"driven information received through Beagle.",
labelOk = "OK"
onPress = listOf(
Alert(
title = "Button",
message = "This is a widget that will define a button natively using the server " +
"driven information received through Beagle.",
labelOk = "OK"
)
)
)
)
Original file line number Diff line number Diff line change
@@ -32,10 +32,12 @@ object ComposeScreenBuilder : ScreenBuilder {
NavigationBarItem(
text = "",
image = "informationImage",
action = Alert(
title = "Compose Component",
message = "Creates components to call in different places.",
labelOk = "OK"
onPress = listOf(
Alert(
title = "Compose Component",
message = "Creates components to call in different places.",
labelOk = "OK"
)
)
)
)
Original file line number Diff line number Diff line change
@@ -68,11 +68,13 @@ object ImageLocalScreenBuilder : ScreenBuilder {
NavigationBarItem(
text = "",
image = expressionOf("@{context.informationImage}"),
action = Alert(
title = "Image",
message = "This widget will define a image view natively using the server driven " +
"information received through Beagle.",
labelOk = "OK"
onPress = listOf(
Alert(
title = "Image",
message = "This widget will define a image view natively using the server driven " +
"information received through Beagle.",
labelOk = "OK"
)
)
)
)
Original file line number Diff line number Diff line change
@@ -46,10 +46,12 @@ class ImageRemoteScreenBuilder(private val imagePath: String) : ScreenBuilder {
NavigationBarItem(
text = "",
image = "informationImage",
action = Alert(
title = "Image Remote",
message = "It is a widget that implements an image with a URL.",
labelOk = "OK"
onPress = listOf(
Alert(
title = "Image Remote",
message = "It is a widget that implements an image with a URL.",
labelOk = "OK"
)
)
)
)
Original file line number Diff line number Diff line change
@@ -37,10 +37,12 @@ object LazyComponentScreenBuilder : ScreenBuilder {
NavigationBarItem(
text = "",
image = "informationImage",
action = Alert(
title = "Lazy Component",
message = "A widget that implements loading.",
labelOk = "OK"
onPress = listOf(
Alert(
title = "Lazy Component",
message = "A widget that implements loading.",
labelOk = "OK"
)
)
)
)
Original file line number Diff line number Diff line change
@@ -45,11 +45,13 @@ object ListViewScreenBuilder : ScreenBuilder {
NavigationBarItem(
text = "",
image = "informationImage",
action = Alert(
title = "ListView",
message = "Is a Layout component that will define a list of views natively. " +
"These views could be any Server Driven Component.",
labelOk = "OK"
onPress = listOf(
Alert(
title = "ListView",
message = "Is a Layout component that will define a list of views natively. " +
"These views could be any Server Driven Component.",
labelOk = "OK"
)
)
)
)
Original file line number Diff line number Diff line change
@@ -32,10 +32,12 @@ class MyScreenBuilder(private val title: String) : ScreenBuilder {
NavigationBarItem(
text = "",
image = "informationImage",
action = Alert(
title = "Screen",
message = "This component description and attribute details",
labelOk = "OK"
onPress = listOf(
Alert(
title = "Screen",
message = "This component description and attribute details",
labelOk = "OK"
)
)
)
)
Original file line number Diff line number Diff line change
@@ -50,10 +50,12 @@ object NavigationBarViewScreenBuilder : ScreenBuilder {
text = "Ajuda",
accessibility = Accessibility(accessibilityLabel = "Content Description"),
image = "informationImage",
action = Alert(
title = "NavigationBar",
message = "This component that allows to place titles and button action.",
labelOk = "OK"
onPress = listOf(
Alert(
title = "NavigationBar",
message = "This component that allows to place titles and button action.",
labelOk = "OK"
)
)
)
)
Original file line number Diff line number Diff line change
@@ -44,11 +44,13 @@ object PageViewScreenBuilder : ScreenBuilder {
NavigationBarItem(
text = "",
image = "informationImage",
action = Alert(
title = "PageView",
message = "This component is a specialized container " +
"to hold pages (views) that may be swiped.",
labelOk = "OK"
onPress = listOf(
Alert(
title = "PageView",
message = "This component is a specialized container " +
"to hold pages (views) that may be swiped.",
labelOk = "OK"
)
)
)
)
Original file line number Diff line number Diff line change
@@ -35,12 +35,12 @@ object SampleViewScreenBuilder : ScreenBuilder {
NavigationBarItem(
text = "First",
image = "delete",
action = Navigate.PopToView(PATH_SAMPLE_VIEW_ENDPOINT)
onPress = listOf(Navigate.PopToView(PATH_SAMPLE_VIEW_ENDPOINT))
),
NavigationBarItem(
text = "Second",
image = "question",
action = Navigate.PopView()
onPress = listOf(Navigate.PopView())
)
)
),
Original file line number Diff line number Diff line change
@@ -39,11 +39,13 @@ object ScrollViewScreenBuilder : ScreenBuilder {
NavigationBarItem(
text = "",
image = "informationImage",
action = Alert(
title = "ScrollView",
message = "This component is a specialized container that will display its " +
"components in a Scroll like view.",
labelOk = "OK"
onPress = listOf(
Alert(
title = "ScrollView",
message = "This component is a specialized container that will display its " +
"components in a Scroll like view.",
labelOk = "OK"
)
)
)
)
Original file line number Diff line number Diff line change
@@ -40,10 +40,12 @@ object SimpleFormScreenBuilder : ScreenBuilder {
NavigationBarItem(
text = "",
image = "informationImage",
action = Alert(
title = "SimpleForm",
message = "A SubmitForm action will define a submit handler in a form.",
labelOk = "OK"
onPress = listOf(
Alert(
title = "SimpleForm",
message = "A SubmitForm action will define a submit handler in a form.",
labelOk = "OK"
)
)
)
)
Original file line number Diff line number Diff line change
@@ -63,11 +63,13 @@ object TabBarScreenBuilder : ScreenBuilder {
NavigationBarItem(
text = "",
image = "informationImage",
action = Alert(
title = "TabBar",
message = " Is a component that will make the navigation between views. It may happen by " +
"sliding through screens or by clicking at the tabs shown. ",
labelOk = "OK"
onPress = listOf(
Alert(
title = "TabBar",
message = " Is a component that will make the navigation between views. It may happen by " +
"sliding through screens or by clicking at the tabs shown. ",
labelOk = "OK"
)
)
)
)
Original file line number Diff line number Diff line change
@@ -44,11 +44,13 @@ object TextInputBuilder : ScreenBuilder {
NavigationBarItem(
text = "",
image = "informationImage",
action = Alert(
title = "Text Input",
message = "This widget will define a Text Input view natively using the server driven " +
"information received through Beagle.",
labelOk = "OK"
onPress = listOf(
Alert(
title = "Text Input",
message = "This widget will define a Text Input view natively using the server driven " +
"information received through Beagle.",
labelOk = "OK"
)
)
)
)
Original file line number Diff line number Diff line change
@@ -39,11 +39,13 @@ object TextScreenBuilder : ScreenBuilder {
NavigationBarItem(
text = "",
image = "informationImage",
action = Alert(
title = "Text",
message = "This widget will define a text view natively using the server driven " +
"information received through Beagle.",
labelOk = "OK"
onPress = listOf(
Alert(
title = "Text",
message = "This widget will define a text view natively using the server driven " +
"information received through Beagle.",
labelOk = "OK"
)
)
)
)
Original file line number Diff line number Diff line change
@@ -55,10 +55,12 @@ object TouchableScreenBuilder : ScreenBuilder {
NavigationBarItem(
text = "",
image = "informationImage",
action = Alert(
title = "Touchable",
message = "Applies click action on widgets that have no action.",
labelOk = "OK"
onPress = listOf(
Alert(
title = "Touchable",
message = "Applies click action on widgets that have no action.",
labelOk = "OK"
)
)
)
)
Original file line number Diff line number Diff line change
@@ -34,11 +34,13 @@ object WebViewScreenBuilder : ScreenBuilder {
NavigationBarItem(
text = "",
image = "informationImage",
action = Alert(
title = "Web View",
message = "The Web View component is responsible for defining a web view natively " +
"using server driven information",
labelOk = "OK"
onPress = listOf(
Alert(
title = "Web View",
message = "The Web View component is responsible for defining a web view natively " +
"using server driven information",
labelOk = "OK"
)
)
)
)
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ class SampleNavigationBarService {
navigationBarItems = listOf(
NavigationBarItem(
text = "Entrar",
action = Navigate.PushView(Route.Remote(SCREEN_ACTION_CLICK_ENDPOINT))
onPress = listOf(Navigate.PushView(Route.Remote(SCREEN_ACTION_CLICK_ENDPOINT)))
)
)
)
@@ -59,7 +59,7 @@ class SampleNavigationBarService {
NavigationBarItem(
text = "",
image = LOGO_BEAGLE,
action = Navigate.PushView(Route.Remote(SCREEN_ACTION_CLICK_ENDPOINT))
onPress = listOf(Navigate.PushView(Route.Remote(SCREEN_ACTION_CLICK_ENDPOINT)))
)
)
)
Loading