From 3f9e8626a1c9e158eb25910e78729d95b719a5a9 Mon Sep 17 00:00:00 2001 From: Pablo Garcia Date: Fri, 28 Jul 2023 15:06:43 +0200 Subject: [PATCH 1/2] ANDROID-13593 Unify ids button --- UPGRADING.md | 16 + .../components/BadgesCatalogFragment.kt | 4 +- .../components/ButtonsCatalogFragment.kt | 14 +- .../components/CalloutsCatalogFragment.kt | 4 +- .../ui/classic/components/DataCardFragment.kt | 2 +- .../EmptyStateCardCatalogFragment.kt | 2 +- .../EmptyStateScreenCatalogFragment.kt | 2 +- .../components/HeadersCatalogFragment.kt | 4 +- .../HighlightedCardsCatalogFragment.kt | 4 +- .../components/InputsCatalogFragment.kt | 4 +- .../classic/components/MediaCardsFragment.kt | 2 +- .../components/PopOverCatalogFragment.kt | 4 +- .../ScrollContentIndicatorCatalogFragment.kt | 4 +- .../components/SnackBarCatalogFragment.kt | 4 +- .../components/SteppersCatalogFragment.kt | 2 +- .../res/layout/data_card_fragment_catalog.xml | 4 +- .../empty_state_card_fragment_catalog.xml | 2 +- .../empty_state_screen_fragment_catalog.xml | 2 +- .../res/layout/headers_fragment_catalog.xml | 4 +- .../highlighted_cards_fragment_catalog.xml | 4 +- .../layout/media_card_fragment_catalog.xml | 4 +- .../main/res/layout/screen_badges_catalog.xml | 14 +- .../res/layout/screen_buttons_catalog.xml | 825 ++++++++++-------- .../res/layout/screen_callouts_catalog.xml | 4 +- .../layout/screen_fragment_sheet_catalog.xml | 2 +- .../main/res/layout/screen_inputs_catalog.xml | 14 +- .../res/layout/screen_popovers_catalog.xml | 6 +- ...creen_scroll_content_indicator_catalog.xml | 4 +- .../res/layout/screen_snackbar_catalog.xml | 4 +- .../res/layout/screen_steppers_catalog.xml | 12 +- .../main/res/layout/screen_tabs_catalog.xml | 4 +- .../com/telefonica/mistica/button/Button.kt | 96 +- .../mistica/button/ProgressButton.kt | 335 ------- .../com/telefonica/mistica/button/README.md | 47 +- .../com/telefonica/mistica/card/CardView.kt | 1 + .../mistica/compose/button/Button.kt | 23 +- .../emptystate/card/EmptyStateCardView.kt | 11 +- .../emptystate/screen/EmptyStateScreenView.kt | 11 +- .../feedback/error/LoadErrorFeedbackView.kt | 10 +- .../screen/view/FeedbackScreenView.kt | 21 +- .../telefonica/mistica/header/HeaderView.kt | 2 +- .../highlightedcard/HighlightedCardView.kt | 4 +- .../com/telefonica/mistica/util/ViewUtils.kt | 12 +- library/src/main/res/layout/callout_view.xml | 8 +- .../src/main/res/layout/card_actions_view.xml | 48 +- .../main/res/layout/empty_state_card_view.xml | 9 +- .../res/layout/empty_state_screen_view.xml | 7 +- library/src/main/res/layout/header_view.xml | 40 +- .../main/res/layout/highlighted_card_view.xml | 26 +- .../main/res/layout/load_error_feedback.xml | 10 +- .../res/layout/screen_feedback_buttons.xml | 41 +- .../screen_feedback_buttons_inverse.xml | 18 +- .../src/main/res/values/attrs_components.xml | 20 +- library/src/main/res/values/attrs_ids.xml | 8 + 54 files changed, 839 insertions(+), 950 deletions(-) delete mode 100644 library/src/main/java/com/telefonica/mistica/button/ProgressButton.kt create mode 100644 library/src/main/res/values/attrs_ids.xml diff --git a/UPGRADING.md b/UPGRADING.md index c5c323170..5b51deff6 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -63,3 +63,19 @@ Other colors have been removed because UX team has decided to remove them from t ### Changes in FeedbackScreenView - `TYPE_CUSTOM` has been removed. Use `TYPE_INFO` instead, it allows custom icon or animation. - `shouldAnimateOnAttachedToWindow` is now private. Use method `setShouldAnimateOnAttached()` or xml attribute `app:shouldAnimateOnAttached` instead. + +## Upgrade to version 9.3.0 +9.3.0 version change the xml button implementation. + +Please replace set functions by property access syntax + +- `button.setText("some text")` -> `button.text = "some text"` +- `button.setLoadingText("some text")` -> `button.loadingText = "some text"` +- `button.setIsLoading(true)` -> `button.isLoading = true` +- `button.setIsLoading(false)` -> `button.isLoading = false` +- `button.showLoading` -> `button.isLoading = true` +- `button.hideLoading` -> `button.isLoading = false` + +Please replace android xml attributes by Mistica attributes +- `android:text="some text"` -> `app:text="some text"` +- `android:enabled="false"` -> `app:enabled="false"` diff --git a/catalog/src/main/java/com/telefonica/mistica/catalog/ui/classic/components/BadgesCatalogFragment.kt b/catalog/src/main/java/com/telefonica/mistica/catalog/ui/classic/components/BadgesCatalogFragment.kt index 253128f74..40b6170af 100644 --- a/catalog/src/main/java/com/telefonica/mistica/catalog/ui/classic/components/BadgesCatalogFragment.kt +++ b/catalog/src/main/java/com/telefonica/mistica/catalog/ui/classic/components/BadgesCatalogFragment.kt @@ -4,11 +4,11 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import android.widget.Button import android.widget.FrameLayout import android.widget.ImageView import androidx.fragment.app.Fragment import com.telefonica.mistica.badge.Badge +import com.telefonica.mistica.button.Button import com.telefonica.mistica.catalog.R import kotlin.random.Random @@ -57,4 +57,4 @@ class BadgesCatalogFragment : Fragment() { } } } -} \ No newline at end of file +} diff --git a/catalog/src/main/java/com/telefonica/mistica/catalog/ui/classic/components/ButtonsCatalogFragment.kt b/catalog/src/main/java/com/telefonica/mistica/catalog/ui/classic/components/ButtonsCatalogFragment.kt index 10ad11ea3..33c5306b5 100644 --- a/catalog/src/main/java/com/telefonica/mistica/catalog/ui/classic/components/ButtonsCatalogFragment.kt +++ b/catalog/src/main/java/com/telefonica/mistica/catalog/ui/classic/components/ButtonsCatalogFragment.kt @@ -5,7 +5,7 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.fragment.app.Fragment -import com.telefonica.mistica.button.ProgressButton +import com.telefonica.mistica.button.Button import com.telefonica.mistica.catalog.R class ButtonsCatalogFragment : Fragment() { @@ -13,7 +13,7 @@ class ButtonsCatalogFragment : Fragment() { override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, - savedInstanceState: Bundle? + savedInstanceState: Bundle?, ): View? { super.onCreateView(inflater, container, savedInstanceState) return layoutInflater.inflate(R.layout.screen_buttons_catalog, container, false) @@ -35,12 +35,12 @@ class ButtonsCatalogFragment : Fragment() { R.id.secondary_small_inverse_progress, R.id.link_inverse_progress ) - .map { view.findViewById(it) } + .map { view.findViewById