From 8ae0b3e29827c1ddfdcb0b13da03ceee7203eee7 Mon Sep 17 00:00:00 2001 From: Andrii Horishnii Date: Fri, 25 Oct 2024 22:20:40 +0300 Subject: [PATCH] Apply default attributes from XML theme Apply default attributes from GliaTheme to the Entry Widget view in the XML layer. MOB-3601 --- .../java/com/glia/widgets/entrywidget/EntryWidgetFragment.kt | 4 +++- .../widgets/view/unifiedui/theme/defaulttheme/EntryWidget.kt | 2 +- widgetssdk/src/main/res/drawable/bg_entry_widget_divider.xml | 2 +- widgetssdk/src/main/res/drawable/ic_drag_handle.xml | 4 +--- widgetssdk/src/main/res/layout/entry_widget_fragment.xml | 5 +++-- ...idget_EntryWidgetBottomSheetTest_contactsDefaultTheme.png | 4 ++-- ...t_EntryWidgetBottomSheetTest_contactsWithUnifiedTheme.png | 4 ++-- ...tomSheetTest_contactsWithUnifiedThemeWithGlobalColors.png | 4 ++-- ...mSheetTest_contactsWithUnifiedThemeWithoutEntryWidget.png | 4 ++-- ...rywidget_EntryWidgetBottomSheetTest_emptyDefaultTheme.png | 4 ++-- ...dget_EntryWidgetBottomSheetTest_emptyWithUnifiedTheme.png | 4 ++-- ...BottomSheetTest_emptyWithUnifiedThemeWithGlobalColors.png | 4 ++-- ...ttomSheetTest_emptyWithUnifiedThemeWithoutEntryWidget.png | 4 ++-- ...rywidget_EntryWidgetBottomSheetTest_errorDefaultTheme.png | 4 ++-- ...dget_EntryWidgetBottomSheetTest_errorWithUnifiedTheme.png | 4 ++-- ...BottomSheetTest_errorWithUnifiedThemeWithGlobalColors.png | 4 ++-- ...ttomSheetTest_errorWithUnifiedThemeWithoutEntryWidget.png | 4 ++-- ...widget_EntryWidgetBottomSheetTest_loadingDefaultTheme.png | 4 ++-- ...et_EntryWidgetBottomSheetTest_loadingWithUnifiedTheme.png | 4 ++-- ...ttomSheetTest_loadingWithUnifiedThemeWithGlobalColors.png | 4 ++-- ...omSheetTest_loadingWithUnifiedThemeWithoutEntryWidget.png | 4 ++-- ...getBottomSheetTest_sdkNotInitializedItemsDefaultTheme.png | 4 ++-- ...ottomSheetTest_sdkNotInitializedItemsWithUnifiedTheme.png | 4 ++-- ...dkNotInitializedItemsWithUnifiedThemeWithGlobalColors.png | 4 ++-- ...NotInitializedItemsWithUnifiedThemeWithoutEntryWidget.png | 4 ++-- ...dget_EntryWidgetEmbeddedViewTest_contactsDefaultTheme.png | 2 +- ..._EntryWidgetEmbeddedViewTest_contactsWithUnifiedTheme.png | 4 ++-- ...ddedViewTest_contactsWithUnifiedThemeWithGlobalColors.png | 4 ++-- ...edViewTest_contactsWithUnifiedThemeWithoutEntryWidget.png | 2 +- ...idget_EntryWidgetEmbeddedViewTest_loadingDefaultTheme.png | 4 ++-- ...t_EntryWidgetEmbeddedViewTest_loadingWithUnifiedTheme.png | 4 ++-- ...eddedViewTest_loadingWithUnifiedThemeWithGlobalColors.png | 4 ++-- ...dedViewTest_loadingWithUnifiedThemeWithoutEntryWidget.png | 4 ++-- 33 files changed, 63 insertions(+), 62 deletions(-) diff --git a/widgetssdk/src/main/java/com/glia/widgets/entrywidget/EntryWidgetFragment.kt b/widgetssdk/src/main/java/com/glia/widgets/entrywidget/EntryWidgetFragment.kt index 6097ad057..003199bc2 100644 --- a/widgetssdk/src/main/java/com/glia/widgets/entrywidget/EntryWidgetFragment.kt +++ b/widgetssdk/src/main/java/com/glia/widgets/entrywidget/EntryWidgetFragment.kt @@ -14,6 +14,7 @@ import com.glia.widgets.R import com.glia.widgets.databinding.EntryWidgetFragmentBinding import com.glia.widgets.di.Dependencies import com.glia.widgets.entrywidget.adapter.EntryWidgetAdapter +import com.glia.widgets.helper.wrapWithMaterialThemeOverlay import com.glia.widgets.view.unifiedui.applyLayerTheme import com.glia.widgets.view.unifiedui.theme.entrywidget.EntryWidgetTheme import com.google.android.material.bottomsheet.BottomSheetBehavior @@ -35,7 +36,8 @@ internal class EntryWidgetFragment : BottomSheetDialogFragment() { inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View { - val binding = EntryWidgetFragmentBinding.inflate(inflater, container, false) + val layoutInflater = LayoutInflater.from(requireContext().wrapWithMaterialThemeOverlay()) + val binding = EntryWidgetFragmentBinding.inflate(layoutInflater, container, false) val entryWidgetsTheme = Dependencies.gliaThemeManager.theme?.entryWidgetTheme setupView(requireContext(), binding, entryWidgetsTheme) diff --git a/widgetssdk/src/main/java/com/glia/widgets/view/unifiedui/theme/defaulttheme/EntryWidget.kt b/widgetssdk/src/main/java/com/glia/widgets/view/unifiedui/theme/defaulttheme/EntryWidget.kt index ec40f4dda..0f0f5e1f6 100644 --- a/widgetssdk/src/main/java/com/glia/widgets/view/unifiedui/theme/defaulttheme/EntryWidget.kt +++ b/widgetssdk/src/main/java/com/glia/widgets/view/unifiedui/theme/defaulttheme/EntryWidget.kt @@ -27,7 +27,7 @@ internal fun DefaultMediaTypeItemsTheme(pallet: ColorPallet?): MediaTypeItemsThe pallet?.run { MediaTypeItemsTheme( mediaTypeItem = DefaultMediaItemTypeTheme(this), - dividerColor = baseNormalColorTheme + dividerColor = baseShadeColorTheme ) } diff --git a/widgetssdk/src/main/res/drawable/bg_entry_widget_divider.xml b/widgetssdk/src/main/res/drawable/bg_entry_widget_divider.xml index 1e1c391b7..0d17fd84d 100644 --- a/widgetssdk/src/main/res/drawable/bg_entry_widget_divider.xml +++ b/widgetssdk/src/main/res/drawable/bg_entry_widget_divider.xml @@ -7,7 +7,7 @@ - + diff --git a/widgetssdk/src/main/res/drawable/ic_drag_handle.xml b/widgetssdk/src/main/res/drawable/ic_drag_handle.xml index 0513800d7..c0b572ec5 100644 --- a/widgetssdk/src/main/res/drawable/ic_drag_handle.xml +++ b/widgetssdk/src/main/res/drawable/ic_drag_handle.xml @@ -5,7 +5,5 @@ android:viewportHeight="4"> + android:fillColor="?attr/gliaBaseShadeColor" /> diff --git a/widgetssdk/src/main/res/layout/entry_widget_fragment.xml b/widgetssdk/src/main/res/layout/entry_widget_fragment.xml index 34721a98f..1d440e177 100644 --- a/widgetssdk/src/main/res/layout/entry_widget_fragment.xml +++ b/widgetssdk/src/main/res/layout/entry_widget_fragment.xml @@ -5,7 +5,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:background="@drawable/bg_bottom_sheet"> + android:background="@drawable/bg_bottom_sheet" + android:backgroundTint="?attr/gliaBaseLightColor"> + app:layout_constraintBottom_toTopOf="@id/container" />