diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f95b08753..97cca1c27 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,9 +54,8 @@ To create or modify components on this repository, follow the next steps: 3. Place the new component under `library` module, under `com.telefonica.mistica` package. The component should have a proper definition by the design team. When implementing the component, follow these guidelines: - The component should be implemented to be reusable. Make it **generic** enough so that other teams can also use it. - If it is designed to be part of a layout definition (It's not a floating element), it should be implemented as a **Custom View**. - - It must allow **configuration with layout attributes**. - - It must provide **databinding support** for these attributes. - - It must also provide relevant **public methods to configure the view programatically**. + - It must allow **configuration through XML layout attributes**. + - It must expose **public APIs (setters / methods)** to configure the view programmatically. - In case it is a floating element, provide **necessary classes/builders to configure it** before display. - Make sure the component **resizes correctly**, so it adapts correctly to any screen size (including rotation). - If possible, take into account **accessibility** (TalkBack, Font size modification). @@ -79,3 +78,8 @@ Y -> New components or features Z -> Minor modifications or fixes You can find more information here https://semver.org/ + +> [!NOTE] +> Mística components are implemented as standard Android Views and do not depend on Android DataBinding. +> Applications may still use DataBinding at app level if needed, but the library does not provide or require +> DataBinding-specific APIs. diff --git a/library/src/main/java/com/telefonica/mistica/feedback/error/LoadErrorFeedbackView.kt b/library/src/main/java/com/telefonica/mistica/feedback/error/LoadErrorFeedbackView.kt index fb4699e33..b6aa0dcd0 100644 --- a/library/src/main/java/com/telefonica/mistica/feedback/error/LoadErrorFeedbackView.kt +++ b/library/src/main/java/com/telefonica/mistica/feedback/error/LoadErrorFeedbackView.kt @@ -93,6 +93,14 @@ class LoadErrorFeedbackView @JvmOverloads constructor( } fun setButtonClickListener(listener: ((View) -> Unit)?) { - setButtonOnClick(OnClickListener { listener?.invoke(it) }) + setButtonOnClick { v -> listener?.invoke(v) } } + + fun setLoadErrorFeedbackTitle(text: CharSequence?) = setTitle(text) + fun setLoadErrorFeedbackDescription(text: CharSequence?) = setDescription(text ?: "") + fun setLoadErrorFeedbackButtonText(text: CharSequence?) = setButtonText(text ?: "") + fun setLoadErrorFeedbackButtonText(@StringRes textId: Int) = setButtonText(textId) + fun setLoadErrorFeedbackIsLoading(loading: Boolean) = setIsLoading(loading) + fun setLoadErrorFeedbackIsButtonVisible(visible: Boolean) = setIsButtonVisible(visible) + fun setLoadErrorFeedbackButtonOnClick(listener: OnClickListener?) = setButtonOnClick(listener) } \ No newline at end of file diff --git a/library/src/main/res/values/attrs_components.xml b/library/src/main/res/values/attrs_components.xml index 2733a8575..38402880c 100755 --- a/library/src/main/res/values/attrs_components.xml +++ b/library/src/main/res/values/attrs_components.xml @@ -181,14 +181,14 @@ - + - + @@ -329,6 +329,7 @@ +