From 80e72f7be8986703f1173e96bab44c29ab5d5efb Mon Sep 17 00:00:00 2001 From: Ngou Long Kam <25244131+ngoulongkam@users.noreply.github.com> Date: Fri, 17 Mar 2023 10:48:54 +0000 Subject: [PATCH] HMA-5074 HMA-5073: Added InsetView and InsetTextView in Compose (#111) * HMA-5074: Added InsetView in Compose * fix padding on sample * spotless * address comments * Fix padding order * address feedback * address comment --- .../compose/molecule/inset/InsetTextView.kt | 42 +++++++ .../compose/molecule/inset/InsetView.kt | 52 ++++++++ .../molecule/titleBodyView/TitleBodyView.kt | 18 --- .../components/compose/ui/theme/Dimens.kt | 1 + .../{AtomItem.kt => ComponentMenuItem.kt} | 2 +- .../data/repository/RepositoryImp.kt | 21 +++- .../domain/repository/Repository.kt | 5 +- .../extension/ModifierExtension.kt | 41 +++++++ .../fragment/atoms/AtomsFragment.kt | 6 +- .../molecules/InsetTextViewFragment.kt | 49 ++++++++ .../fragment/molecules/InsetViewFragment.kt | 51 ++++++++ .../fragment/molecules/MoleculesFragment.kt | 39 ++++++ .../presentation/screens/ButtonScreen.kt | 14 +-- .../screens/InsetTextViewScreen.kt | 58 +++++++++ .../presentation/screens/InsetViewScreen.kt | 115 ++++++++++++++++++ .../presentation/screens/TextScreen.kt | 14 +-- .../sampletemplate/ComposableTemplate.kt | 53 ++++++++ .../presentation/viewModel/AtomsViewModel.kt | 6 +- .../viewModel/MoleculesViewModel.kt | 43 +++++++ .../main/res/drawable-night/checked_tile.png | Bin 0 -> 1220 bytes .../src/main/res/drawable/checked_tile.png | Bin 0 -> 3250 bytes .../res/layout/fragment_compose_example.xml | 28 +++++ .../main/res/layout/fragment_molecules.xml | 15 +-- .../src/main/res/menu/bottom_bar_menu.xml | 2 +- .../src/main/res/navigation/nav_graph.xml | 7 +- .../res/navigation/nav_graph_molecules.xml | 50 ++++++++ 26 files changed, 671 insertions(+), 61 deletions(-) create mode 100644 components-compose/src/main/java/uk/gov/hmrc/components/compose/molecule/inset/InsetTextView.kt create mode 100644 components-compose/src/main/java/uk/gov/hmrc/components/compose/molecule/inset/InsetView.kt delete mode 100644 components-compose/src/main/java/uk/gov/hmrc/components/compose/molecule/titleBodyView/TitleBodyView.kt rename sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/data/model/{AtomItem.kt => ComponentMenuItem.kt} (89%) create mode 100644 sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/extension/ModifierExtension.kt create mode 100644 sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/fragment/molecules/InsetTextViewFragment.kt create mode 100644 sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/fragment/molecules/InsetViewFragment.kt create mode 100644 sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/screens/InsetTextViewScreen.kt create mode 100644 sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/screens/InsetViewScreen.kt create mode 100644 sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/screens/sampletemplate/ComposableTemplate.kt create mode 100644 sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/viewModel/MoleculesViewModel.kt create mode 100644 sample-compose-fragments/src/main/res/drawable-night/checked_tile.png create mode 100644 sample-compose-fragments/src/main/res/drawable/checked_tile.png create mode 100644 sample-compose-fragments/src/main/res/layout/fragment_compose_example.xml create mode 100644 sample-compose-fragments/src/main/res/navigation/nav_graph_molecules.xml diff --git a/components-compose/src/main/java/uk/gov/hmrc/components/compose/molecule/inset/InsetTextView.kt b/components-compose/src/main/java/uk/gov/hmrc/components/compose/molecule/inset/InsetTextView.kt new file mode 100644 index 00000000..c696840e --- /dev/null +++ b/components-compose/src/main/java/uk/gov/hmrc/components/compose/molecule/inset/InsetTextView.kt @@ -0,0 +1,42 @@ +/* + * Copyright 2023 HM Revenue & Customs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package uk.gov.hmrc.components.compose.molecule.inset + +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.text.style.TextAlign +import uk.gov.hmrc.components.compose.ui.theme.HmrcTheme.typography +import uk.gov.hmrc.components.compose.ui.theme.hmrc_spacing_8 + +@Composable +fun InsetTextView( + text: String, + modifier: Modifier = Modifier +) { + InsetView( + modifier = modifier, + childView = { + Text( + modifier = Modifier.padding(vertical = hmrc_spacing_8), + text = text, + style = typography.body, + textAlign = TextAlign.Start, + ) + } + ) +} diff --git a/components-compose/src/main/java/uk/gov/hmrc/components/compose/molecule/inset/InsetView.kt b/components-compose/src/main/java/uk/gov/hmrc/components/compose/molecule/inset/InsetView.kt new file mode 100644 index 00000000..97f8269a --- /dev/null +++ b/components-compose/src/main/java/uk/gov/hmrc/components/compose/molecule/inset/InsetView.kt @@ -0,0 +1,52 @@ +/* + * Copyright 2023 HM Revenue & Customs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package uk.gov.hmrc.components.compose.molecule.inset + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.IntrinsicSize +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width +import androidx.compose.material3.Divider +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.RectangleShape +import uk.gov.hmrc.components.compose.ui.theme.HmrcTheme.colors +import uk.gov.hmrc.components.compose.ui.theme.hmrc_spacing_16 +import uk.gov.hmrc.components.compose.ui.theme.hmrc_spacing_4 + +@Composable +fun InsetView( + modifier: Modifier = Modifier, + childView: @Composable () -> Unit, +) { + Column { + Row(modifier = modifier.height(IntrinsicSize.Min)) { + Divider( + color = colors.hmrcGrey2, + modifier = Modifier + .fillMaxHeight() + .clip(RectangleShape) + .padding(end = hmrc_spacing_16) + .width(hmrc_spacing_4) + ) + childView() + } + } +} diff --git a/components-compose/src/main/java/uk/gov/hmrc/components/compose/molecule/titleBodyView/TitleBodyView.kt b/components-compose/src/main/java/uk/gov/hmrc/components/compose/molecule/titleBodyView/TitleBodyView.kt deleted file mode 100644 index c7d28dbf..00000000 --- a/components-compose/src/main/java/uk/gov/hmrc/components/compose/molecule/titleBodyView/TitleBodyView.kt +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2021 HM Revenue & Customs - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package uk.gov.hmrc.components.compose.molecule.titleBodyView - -class TitleBodyView diff --git a/components-compose/src/main/java/uk/gov/hmrc/components/compose/ui/theme/Dimens.kt b/components-compose/src/main/java/uk/gov/hmrc/components/compose/ui/theme/Dimens.kt index d3eeb99c..40041a21 100644 --- a/components-compose/src/main/java/uk/gov/hmrc/components/compose/ui/theme/Dimens.kt +++ b/components-compose/src/main/java/uk/gov/hmrc/components/compose/ui/theme/Dimens.kt @@ -17,6 +17,7 @@ package uk.gov.hmrc.components.compose.ui.theme import androidx.compose.ui.unit.dp +val hmrc_spacing_4 = 4.dp val hmrc_spacing_8 = 8.dp val hmrc_spacing_16 = 16.dp val hmrc_icon_size_24 = 24.dp diff --git a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/data/model/AtomItem.kt b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/data/model/ComponentMenuItem.kt similarity index 89% rename from sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/data/model/AtomItem.kt rename to sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/data/model/ComponentMenuItem.kt index 075a1f5b..9c9cd3e0 100644 --- a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/data/model/AtomItem.kt +++ b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/data/model/ComponentMenuItem.kt @@ -18,4 +18,4 @@ package uk.gov.hmrc.sample_compose_fragments.data.model import androidx.annotation.StringRes import uk.gov.hmrc.sample_compose_fragments.presentation.screens.ComponentItem -class AtomItem(val id: Int, @StringRes override val titleRes: Int): ComponentItem \ No newline at end of file +class ComponentMenuItem(val id: Int, @StringRes override val titleRes: Int): ComponentItem \ No newline at end of file diff --git a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/data/repository/RepositoryImp.kt b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/data/repository/RepositoryImp.kt index 991c4730..daf31d67 100644 --- a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/data/repository/RepositoryImp.kt +++ b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/data/repository/RepositoryImp.kt @@ -16,7 +16,7 @@ package uk.gov.hmrc.sample_compose_fragments.data.repository import uk.gov.hmrc.sample_compose_components.R -import uk.gov.hmrc.sample_compose_fragments.data.model.AtomItem +import uk.gov.hmrc.sample_compose_fragments.data.model.ComponentMenuItem import uk.gov.hmrc.sample_compose_fragments.data.model.ColorItem import uk.gov.hmrc.sample_compose_fragments.domain.repository.Repository import javax.inject.Inject @@ -25,8 +25,21 @@ class RepositoryImpl @Inject constructor() : Repository { override suspend fun getColorList() = ColorItem.values().asList() override suspend fun getAtomList() = arrayListOf( - AtomItem(1, R.string.atoms_text), - AtomItem(2, R.string.atoms_buttons), - AtomItem(3, R.string.atoms_divider) + ComponentMenuItem(ATOM_TEXT, R.string.atoms_text), + ComponentMenuItem(ATOM_BUTTON, R.string.atoms_buttons), + ComponentMenuItem(ATOM_DIVIDER, R.string.atoms_divider) ) + override suspend fun getMoleculesList() = arrayListOf( + ComponentMenuItem(MOLECULE_INSET_VIEW, R.string.molecules_inset), + ComponentMenuItem(MOLECULE_INSET_TEXT_VIEW, R.string.molecules_inset_text) + ) + + companion object { + const val ATOM_TEXT = 1 + const val ATOM_BUTTON = 2 + const val ATOM_DIVIDER = 3 + + const val MOLECULE_INSET_VIEW = 1 + const val MOLECULE_INSET_TEXT_VIEW = 2 + } } \ No newline at end of file diff --git a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/domain/repository/Repository.kt b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/domain/repository/Repository.kt index 9d77de89..c80dd52b 100644 --- a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/domain/repository/Repository.kt +++ b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/domain/repository/Repository.kt @@ -16,9 +16,10 @@ package uk.gov.hmrc.sample_compose_fragments.domain.repository import uk.gov.hmrc.sample_compose_fragments.data.model.ColorItem -import uk.gov.hmrc.sample_compose_fragments.data.model.AtomItem +import uk.gov.hmrc.sample_compose_fragments.data.model.ComponentMenuItem interface Repository { suspend fun getColorList(): List - suspend fun getAtomList(): List + suspend fun getAtomList(): List + suspend fun getMoleculesList(): List } \ No newline at end of file diff --git a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/extension/ModifierExtension.kt b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/extension/ModifierExtension.kt new file mode 100644 index 00000000..268f8915 --- /dev/null +++ b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/extension/ModifierExtension.kt @@ -0,0 +1,41 @@ +/* + * Copyright 2023 HM Revenue & Customs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package uk.gov.hmrc.sample_compose_fragments.presentation.extension + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.wrapContentHeight +import androidx.compose.runtime.remember +import androidx.compose.ui.Modifier +import androidx.compose.ui.composed +import androidx.compose.ui.graphics.ImageBitmap +import androidx.compose.ui.graphics.ImageShader +import androidx.compose.ui.graphics.ShaderBrush +import androidx.compose.ui.graphics.TileMode +import androidx.compose.ui.res.imageResource +import uk.gov.hmrc.sample_compose_components.R + +internal fun Modifier.addPlaceholderModifier(): Modifier = composed { + val image = ImageBitmap.imageResource(id = R.drawable.checked_tile) + val repeatImage = remember(image) { + ShaderBrush(ImageShader(image, TileMode.Repeated, TileMode.Repeated)) + } + this.then( + wrapContentHeight() + .fillMaxWidth() + .background(repeatImage) + ) +} diff --git a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/fragment/atoms/AtomsFragment.kt b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/fragment/atoms/AtomsFragment.kt index 84c7a83b..e6523ef4 100644 --- a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/fragment/atoms/AtomsFragment.kt +++ b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/fragment/atoms/AtomsFragment.kt @@ -31,6 +31,8 @@ import uk.gov.hmrc.components.compose.ui.theme.HmrcTheme import uk.gov.hmrc.components.compose.ui.theme.HmrcTheme.colors import uk.gov.hmrc.sample_compose_components.R import uk.gov.hmrc.sample_compose_components.databinding.FragmentAtomsBinding +import uk.gov.hmrc.sample_compose_fragments.data.repository.RepositoryImpl.Companion.ATOM_BUTTON +import uk.gov.hmrc.sample_compose_fragments.data.repository.RepositoryImpl.Companion.ATOM_TEXT import uk.gov.hmrc.sample_compose_fragments.presentation.screens.ComponentListScreen import uk.gov.hmrc.sample_compose_fragments.presentation.viewModel.AtomsViewModel @@ -52,8 +54,8 @@ class AtomsFragment : Fragment(R.layout.fragment_atoms) { ) { ComponentListScreen(items = listItems, navigateTo = { when (it.id) { - 1 -> findNavController().navigate(R.id.action_atomsFragment_to_textFragment) - 2 -> findNavController().navigate(R.id.action_atomsFragment_to_buttonFragment) + ATOM_TEXT -> findNavController().navigate(R.id.action_atomsFragment_to_textFragment) + ATOM_BUTTON -> findNavController().navigate(R.id.action_atomsFragment_to_buttonFragment) } }) } diff --git a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/fragment/molecules/InsetTextViewFragment.kt b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/fragment/molecules/InsetTextViewFragment.kt new file mode 100644 index 00000000..755f9635 --- /dev/null +++ b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/fragment/molecules/InsetTextViewFragment.kt @@ -0,0 +1,49 @@ +/* + * Copyright 2023 HM Revenue & Customs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package uk.gov.hmrc.sample_compose_fragments.presentation.fragment.molecules + +import android.os.Bundle +import android.view.View +import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.material3.Surface +import androidx.compose.ui.Modifier +import androidx.fragment.app.Fragment +import uk.gov.hmrc.components.compose.ui.theme.HmrcTheme +import uk.gov.hmrc.components.compose.ui.theme.HmrcTheme.colors +import uk.gov.hmrc.sample_compose_components.R +import uk.gov.hmrc.sample_compose_components.databinding.FragmentComposeExampleBinding +import uk.gov.hmrc.sample_compose_fragments.presentation.screens.InsetTextViewScreen + +class InsetTextViewFragment : Fragment(R.layout.fragment_compose_example) { + + private lateinit var binding: FragmentComposeExampleBinding + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + binding = FragmentComposeExampleBinding.bind(view) + binding.composeView.setContent { + HmrcTheme() { + Surface( + modifier = Modifier.fillMaxHeight().fillMaxWidth(), + color = colors.hmrcPageBackground + ) { + InsetTextViewScreen() + } + } + } + } +} diff --git a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/fragment/molecules/InsetViewFragment.kt b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/fragment/molecules/InsetViewFragment.kt new file mode 100644 index 00000000..84153f1b --- /dev/null +++ b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/fragment/molecules/InsetViewFragment.kt @@ -0,0 +1,51 @@ +/* + * Copyright 2023 HM Revenue & Customs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package uk.gov.hmrc.sample_compose_fragments.presentation.fragment.molecules + +import android.os.Bundle +import android.view.View +import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.material3.Surface +import androidx.compose.ui.Modifier +import androidx.fragment.app.Fragment +import dagger.hilt.android.AndroidEntryPoint +import uk.gov.hmrc.components.compose.ui.theme.HmrcTheme +import uk.gov.hmrc.components.compose.ui.theme.HmrcTheme.colors +import uk.gov.hmrc.sample_compose_components.R +import uk.gov.hmrc.sample_compose_components.databinding.FragmentComposeExampleBinding +import uk.gov.hmrc.sample_compose_fragments.presentation.screens.InsetViewScreen + +@AndroidEntryPoint +class InsetViewFragment : Fragment(R.layout.fragment_compose_example) { + + private lateinit var binding: FragmentComposeExampleBinding + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + binding = FragmentComposeExampleBinding.bind(view) + binding.composeView.setContent { + HmrcTheme() { + Surface( + modifier = Modifier.fillMaxHeight().fillMaxWidth(), + color = colors.hmrcPageBackground + ) { + InsetViewScreen() + } + } + } + } +} diff --git a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/fragment/molecules/MoleculesFragment.kt b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/fragment/molecules/MoleculesFragment.kt index 58387803..bf2b610e 100644 --- a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/fragment/molecules/MoleculesFragment.kt +++ b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/fragment/molecules/MoleculesFragment.kt @@ -17,16 +17,55 @@ package uk.gov.hmrc.sample_compose_fragments.presentation.fragment.molecules import android.os.Bundle import android.view.View +import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.material3.Surface +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.ui.Modifier import androidx.fragment.app.Fragment +import androidx.fragment.app.activityViewModels +import androidx.navigation.fragment.findNavController +import dagger.hilt.android.AndroidEntryPoint +import uk.gov.hmrc.components.compose.ui.theme.HmrcTheme +import uk.gov.hmrc.components.compose.ui.theme.HmrcTheme.colors import uk.gov.hmrc.sample_compose_components.R import uk.gov.hmrc.sample_compose_components.databinding.FragmentMoleculesBinding +import uk.gov.hmrc.sample_compose_fragments.data.repository.RepositoryImpl.Companion.MOLECULE_INSET_TEXT_VIEW +import uk.gov.hmrc.sample_compose_fragments.data.repository.RepositoryImpl.Companion.MOLECULE_INSET_VIEW +import uk.gov.hmrc.sample_compose_fragments.presentation.screens.ComponentListScreen +import uk.gov.hmrc.sample_compose_fragments.presentation.viewModel.MoleculesViewModel +@AndroidEntryPoint class MoleculesFragment : Fragment(R.layout.fragment_molecules) { private lateinit var binding: FragmentMoleculesBinding + private val viewModel: MoleculesViewModel by activityViewModels() override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) binding = FragmentMoleculesBinding.bind(view) + + binding.composeViewMolecules.setContent { + val listItems by viewModel.moleculesItems.collectAsState() + HmrcTheme { + Surface( + modifier = Modifier.fillMaxHeight().fillMaxWidth(), + color = colors.hmrcPageBackground + ) { + ComponentListScreen(items = listItems, navigateTo = { + when (it.id) { + MOLECULE_INSET_VIEW -> { + findNavController().navigate(R.id.action_moleculesFragment_to_insetViewFragment) + } + MOLECULE_INSET_TEXT_VIEW -> { + findNavController().navigate(R.id.action_moleculesFragment_to_insetTextViewFragment) + } + } + }) + } + } + } + viewModel.getMoleculesData() } } \ No newline at end of file diff --git a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/screens/ButtonScreen.kt b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/screens/ButtonScreen.kt index 86c27786..cf29e72d 100644 --- a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/screens/ButtonScreen.kt +++ b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/screens/ButtonScreen.kt @@ -15,13 +15,8 @@ */ package uk.gov.hmrc.sample_compose_fragments.presentation.screens -import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.rememberScrollState -import androidx.compose.foundation.verticalScroll import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource @@ -30,19 +25,20 @@ import uk.gov.hmrc.components.compose.atom.button.PrimaryButton import uk.gov.hmrc.components.compose.atom.button.SecondaryButton import uk.gov.hmrc.components.compose.ui.theme.hmrc_spacing_16 import uk.gov.hmrc.sample_compose_components.R +import uk.gov.hmrc.sample_compose_fragments.presentation.screens.sampletemplate.ScreenScrollViewColumn @Composable fun ButtonScreen() { - Column( - modifier = Modifier.fillMaxWidth().padding(hmrc_spacing_16).verticalScroll(rememberScrollState()) - ) { + ScreenScrollViewColumn { PrimaryButton(text = stringResource(id = R.string.button_primary_example)) {} Spacer(modifier = Modifier.height(hmrc_spacing_16)) PrimaryButton(text = stringResource(id = R.string.button_primary_example_disabled), enabled = false) {} Spacer(modifier = Modifier.height(hmrc_spacing_16)) SecondaryButton(text = stringResource(id = R.string.button_secondary_example), onClick = {}) Spacer(modifier = Modifier.height(hmrc_spacing_16)) - IconButton(text = stringResource(id = R.string.button_icon_example), iconResId = R.drawable.ic_info, onClick = {}) + IconButton(text = stringResource(id = R.string.button_icon_example), + iconResId = R.drawable.ic_info, + onClick = {}) } } \ No newline at end of file diff --git a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/screens/InsetTextViewScreen.kt b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/screens/InsetTextViewScreen.kt new file mode 100644 index 00000000..c3569776 --- /dev/null +++ b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/screens/InsetTextViewScreen.kt @@ -0,0 +1,58 @@ +/* + * Copyright 2023 HM Revenue & Customs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package uk.gov.hmrc.sample_compose_fragments.presentation.screens + +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.Card +import androidx.compose.material3.CardDefaults +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import uk.gov.hmrc.components.compose.molecule.inset.InsetTextView +import uk.gov.hmrc.components.compose.ui.theme.HmrcTheme +import uk.gov.hmrc.components.compose.ui.theme.hmrc_spacing_16 +import uk.gov.hmrc.sample_compose_components.R +import uk.gov.hmrc.sample_compose_fragments.presentation.extension.addPlaceholderModifier +import uk.gov.hmrc.sample_compose_fragments.presentation.screens.sampletemplate.PlaceholderHeading +import uk.gov.hmrc.sample_compose_fragments.presentation.screens.sampletemplate.ExamplesHeading +import uk.gov.hmrc.sample_compose_fragments.presentation.screens.sampletemplate.ScreenScrollViewColumn + +@Composable +fun InsetTextViewScreen() { + ScreenScrollViewColumn { + PlaceholderHeading() + + InsetTextView( + text = stringResource(id = R.string.inset_text_placeholder_text), + modifier = Modifier + .padding(bottom = hmrc_spacing_16) + .addPlaceholderModifier()) + + ExamplesHeading() + + Card( + modifier = Modifier.fillMaxWidth(), + shape = RoundedCornerShape(0), + colors = CardDefaults.cardColors(containerColor = HmrcTheme.colors.hmrcWhiteBackground)) { + InsetTextView( + text = stringResource(id = R.string.inset_text_example_text), + modifier = Modifier.padding(hmrc_spacing_16) + ) + } + } +} diff --git a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/screens/InsetViewScreen.kt b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/screens/InsetViewScreen.kt new file mode 100644 index 00000000..fc527307 --- /dev/null +++ b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/screens/InsetViewScreen.kt @@ -0,0 +1,115 @@ +/* + * Copyright 2023 HM Revenue & Customs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package uk.gov.hmrc.sample_compose_fragments.presentation.screens + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.verticalScroll +import androidx.compose.material3.Card +import androidx.compose.material3.CardDefaults +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.style.TextAlign +import uk.gov.hmrc.components.compose.atom.heading.Heading5 +import uk.gov.hmrc.components.compose.molecule.inset.InsetView +import uk.gov.hmrc.components.compose.ui.theme.HmrcTheme.colors +import uk.gov.hmrc.components.compose.ui.theme.HmrcTheme.typography +import uk.gov.hmrc.components.compose.ui.theme.hmrc_spacing_16 +import uk.gov.hmrc.components.compose.ui.theme.hmrc_spacing_4 +import uk.gov.hmrc.components.compose.ui.theme.hmrc_spacing_8 +import uk.gov.hmrc.sample_compose_components.R +import uk.gov.hmrc.sample_compose_fragments.presentation.extension.addPlaceholderModifier +import uk.gov.hmrc.sample_compose_fragments.presentation.screens.sampletemplate.ExamplesHeading +import uk.gov.hmrc.sample_compose_fragments.presentation.screens.sampletemplate.PlaceholderHeading +import uk.gov.hmrc.sample_compose_fragments.presentation.screens.sampletemplate.ScreenScrollViewColumn + +@Composable +fun InsetViewScreen() { + ScreenScrollViewColumn { + PlaceholderHeading() + + InsetView(modifier = Modifier + .padding(bottom = hmrc_spacing_16) + .addPlaceholderModifier(), + childView = { + Text( + text = stringResource(R.string.inset_placeholder_text), + style = typography.body, + textAlign = TextAlign.Start + ) + } + ) + + ExamplesHeading() + + Card( + modifier = Modifier.fillMaxWidth(), + shape = RoundedCornerShape(0), + colors = CardDefaults.cardColors(containerColor = colors.hmrcWhiteBackground)) { + InsetView(modifier = Modifier.padding(hmrc_spacing_16), + childView = { + Column() { + Row { + Text( + text = stringResource(R.string.inset_example_text_line_1_description), + modifier = Modifier.padding(end = hmrc_spacing_4), + style = typography.body, + textAlign = TextAlign.Start + ) + Text( + text = stringResource(id = R.string.inset_example_text_line_1_value), + style = typography.h6, + textAlign = TextAlign.Start + ) + } + Row(modifier = Modifier.padding(top = hmrc_spacing_8)) { + Text( + text = stringResource(R.string.inset_example_text_line_2_description), + modifier = Modifier.padding(end = hmrc_spacing_4), + style = typography.body, + textAlign = TextAlign.Start + ) + Text( + text = stringResource(id = R.string.inset_example_text_line_2_value), + style = typography.h6, + textAlign = TextAlign.Start + ) + } + Row(modifier = Modifier.padding(top = hmrc_spacing_8)) { + Text( + text = stringResource(R.string.inset_example_text_line_3_description), + modifier = Modifier.padding(end = hmrc_spacing_4), + style = typography.body, + textAlign = TextAlign.Start + ) + Text( + text = stringResource(id = R.string.inset_example_text_line_3_value), + style = typography.h6, + textAlign = TextAlign.Start + ) + } + } + } + ) + } + } +} diff --git a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/screens/TextScreen.kt b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/screens/TextScreen.kt index 2ba60d2c..33abb699 100644 --- a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/screens/TextScreen.kt +++ b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/screens/TextScreen.kt @@ -31,18 +31,16 @@ import uk.gov.hmrc.components.compose.atom.heading.Heading5 import uk.gov.hmrc.components.compose.ui.theme.HmrcTheme.typography import uk.gov.hmrc.components.compose.ui.theme.hmrc_spacing_16 import uk.gov.hmrc.sample_compose_components.R +import uk.gov.hmrc.sample_compose_fragments.presentation.screens.sampletemplate.ScreenScrollViewColumn @Composable fun TextScreen() { - Column( - modifier = Modifier - .fillMaxWidth() - .padding(start = hmrc_spacing_16, end = hmrc_spacing_16) - .verticalScroll(rememberScrollState()) - ) { + ScreenScrollViewColumn { Heading3(text = stringResource(id = R.string.text_heading3)) Text( - text = stringResource(id = R.string.text_h3), style = typography.h3, modifier = Modifier.padding(top = hmrc_spacing_16) + text = stringResource(id = R.string.text_h3), + style = typography.h3, + modifier = Modifier.padding(top = hmrc_spacing_16) ) Heading4(text = stringResource(id = R.string.text_heading4), modifier = Modifier.padding(top = hmrc_spacing_16)) Text( @@ -74,7 +72,7 @@ fun TextScreen() { modifier = Modifier.padding(top = hmrc_spacing_16) ) BulletedTextView(text = stringResource(id = R.string.text_bullet_2), - modifier = Modifier.padding(vertical = hmrc_spacing_16) + modifier = Modifier.padding(top = hmrc_spacing_16) ) } } diff --git a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/screens/sampletemplate/ComposableTemplate.kt b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/screens/sampletemplate/ComposableTemplate.kt new file mode 100644 index 00000000..64691d5d --- /dev/null +++ b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/screens/sampletemplate/ComposableTemplate.kt @@ -0,0 +1,53 @@ +/* + * Copyright 2023 HM Revenue & Customs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package uk.gov.hmrc.sample_compose_fragments.presentation.screens.sampletemplate + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.ColumnScope +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import uk.gov.hmrc.components.compose.atom.heading.Heading5 +import uk.gov.hmrc.components.compose.ui.theme.hmrc_spacing_16 +import uk.gov.hmrc.sample_compose_components.R + +@Composable +fun ScreenScrollViewColumn(content: @Composable ColumnScope.() -> Unit) { + Column( + modifier = Modifier + .fillMaxWidth() + .verticalScroll(rememberScrollState()) + .padding(hmrc_spacing_16) + ) { + content.invoke(this) + } +} + +@Composable +fun PlaceholderHeading() { + Heading5(text = stringResource(id = R.string.heading_placeholder_plural), + modifier = Modifier.padding(bottom = hmrc_spacing_16)) +} + +@Composable +fun ExamplesHeading() { + Heading5(text = stringResource(id = R.string.heading_example_plural), + modifier = Modifier.padding(bottom = hmrc_spacing_16)) +} diff --git a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/viewModel/AtomsViewModel.kt b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/viewModel/AtomsViewModel.kt index cb61ec74..219818ae 100644 --- a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/viewModel/AtomsViewModel.kt +++ b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/viewModel/AtomsViewModel.kt @@ -23,15 +23,15 @@ import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.launch import kotlinx.coroutines.withContext -import uk.gov.hmrc.sample_compose_fragments.data.model.AtomItem +import uk.gov.hmrc.sample_compose_fragments.data.model.ComponentMenuItem import uk.gov.hmrc.sample_compose_fragments.domain.repository.Repository import javax.inject.Inject @HiltViewModel class AtomsViewModel @Inject constructor(private val repository: Repository) : ViewModel() { - private val _atomsItems = MutableStateFlow(listOf()) - val atomsItems: StateFlow> get() = _atomsItems + private val _atomsItems = MutableStateFlow(listOf()) + val atomsItems: StateFlow> get() = _atomsItems fun getAtomsData() { viewModelScope.launch { diff --git a/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/viewModel/MoleculesViewModel.kt b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/viewModel/MoleculesViewModel.kt new file mode 100644 index 00000000..7bc1639a --- /dev/null +++ b/sample-compose-fragments/src/main/java/uk/gov/hmrc/sample_compose_fragments/presentation/viewModel/MoleculesViewModel.kt @@ -0,0 +1,43 @@ +/* + * Copyright 2023 HM Revenue & Customs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package uk.gov.hmrc.sample_compose_fragments.presentation.viewModel + +import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope +import dagger.hilt.android.lifecycle.HiltViewModel +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext +import uk.gov.hmrc.sample_compose_fragments.data.model.ComponentMenuItem +import uk.gov.hmrc.sample_compose_fragments.domain.repository.Repository +import javax.inject.Inject + +@HiltViewModel +class MoleculesViewModel @Inject constructor(private val repository: Repository) : ViewModel() { + + private val _moleculesItems = MutableStateFlow(listOf()) + val moleculesItems: StateFlow> get() = _moleculesItems + + fun getMoleculesData() { + viewModelScope.launch { + withContext(Dispatchers.Default) { + _moleculesItems.value = repository.getMoleculesList() + } + } + } +} \ No newline at end of file diff --git a/sample-compose-fragments/src/main/res/drawable-night/checked_tile.png b/sample-compose-fragments/src/main/res/drawable-night/checked_tile.png new file mode 100644 index 0000000000000000000000000000000000000000..d99f3360950f3e4b139756240a7b08e7b0405fac GIT binary patch literal 1220 zcmZ{kPiWIn9LIl~Q@W0_`3D@HLI-1r&7XFeYe*xtUEN?EwYJd8gl1{B1)IE>q%_^d zF+8X!;%$>1^djOx@F0qpxq~Nfo;>*fAfl%s3W_pc(r%4)E2Me({=T2z@Auxz%azR3 zseu289{>Uq#I*s^ElA0j~7jVo`cTS0k>BB0rspbxq?+lPjV7cNwJJ(WYSi3 z>;~X%4i8n?5(!(aXeMXJg06$ZV@IZfglngtZSBNhct7bkz^}RQZ^++(JcjO zgp*gCK~*aj3_69jf6YEseY=omHfM$BN7#tG$0HC$cLh+sZDO6KP=X zVl;Z>@rrV3R90r|NzsypFde2tG!tTma}3K3(;OS&sWwk*hAy2jWYI!K4xx&Ws?-&2 zj!0vLh)c-Oh!K({n<>1;opQ*{4w%spgF9ezbd-xQ9L+X5aPfx6LpzJX6|=I5DphAM zgyUhJ`cG^J5=hkz*)$yhr+58ct=-?spVt&i*ecN`w^M~yyw#Rh^Z?H8a2dsxD}|(@ z%37l}nx}RQw1Wv$LB<(flw@IqWg~b>F6NQj3Aa>nw^E)!6XYr9CHK7ajT7an_(%zU zyh&TfQ}B1^KP}-Ct4<{2xzYVn`B`9jW#v)z`-K+~`oqnEA@=@CsqfCw{wE-H-0jLe zChW<{uGi0(P6W=aE&P19cG34OQ#^KW+Iow}8}ozj=~OCpyWV%;O=;i9mp?W)H<@bZ lnD5oKeDAcLi||92C4l@!?>hAVx$b-`CdQ_c4^Ebr{sQ5Qb$0*& literal 0 HcmV?d00001 diff --git a/sample-compose-fragments/src/main/res/drawable/checked_tile.png b/sample-compose-fragments/src/main/res/drawable/checked_tile.png new file mode 100644 index 0000000000000000000000000000000000000000..99ff5b9cdbf79547f6ae34dfa553f5dcc5ddd30d GIT binary patch literal 3250 zcmeHKU5Fc16uv91wrLkF6|{xwkfJCunV%$^nPD=xO;!^zHQlDVt!R65=T0)1%uHt{ zo9w>0YF}C_A}SQw2f;!?M6@Vdi^|$Q*oT5jTLfPOr6LvuA1wa#!8?;oGRY>gReTT( zOlES<`Og12b91=3^TF}R)(8M#JfF)>ll!gSweCjp{lejG(|vk!FOV8utgir_O_BhPZm4K)-6{z4a(CC%Vxt(N28vh?x*dit7|<=hSLd)1ju+ChKsSx zFc@y>BVZn9Buqu!sH}!v^J7vGgKM~s4c8$!Zm2nu+d`oW?Q^pQE#F+dJ{0M=Q?n%W zPAZ2Yozk3znQ82p4IAO9S>nm|VKEaY{#wy6kX1EZ)2W&xpj~!5WqvEPDJeKfK|l|ta2-gP7LxbMB^C7+uFYh1QUu4tBw3jm$`}M@ z%$jNMwjjdFL^2sqc3>g$Ai_7bca*6RBLq~Dq?vXdx{6+h70g&hMP_=$kfh%y5(%}U z8?cr&QN!!2d{!Zhn5wH%nHS3w6BC#g5&};rQhb>f#5hN@IL>21(^8@cWoD$B6{d2! zrMugnYs_5$eI=on~Lv7rzp0?lzWmn^ZO6z3#1xi3)U z3yj9=hT}p5;ZCykRVTacW(Ypo21I^KBO5~(tAS%3>L5&Jywz9J|5H^!RcKVOsxU!t z0bww@UT6FZg%f#=G=i9-IhfSQl&F}72q78?0#}Z6WgORpz`^S&oC9b7FWcyOOQfVE z`w!+#gDeu%6e*h+PtXaD%(4hIj>bHjN(f~w#ZHh7ef{(H_siCv!Twbktk;#RQ*Q6w z{K`$Ty2w_*dqdMv9eN|QPiLx$$fD}Lg(We;CR1gtO!H!b + + + + + + \ No newline at end of file diff --git a/sample-compose-fragments/src/main/res/layout/fragment_molecules.xml b/sample-compose-fragments/src/main/res/layout/fragment_molecules.xml index 488f520f..3396947a 100644 --- a/sample-compose-fragments/src/main/res/layout/fragment_molecules.xml +++ b/sample-compose-fragments/src/main/res/layout/fragment_molecules.xml @@ -14,16 +14,17 @@ See the License for the specific language governing permissions and limitations under the License. --> - + android:orientation="vertical" + android:name="uk.gov.hmrc.sample_compose_fragments.presentation.fragment.molecules.MoleculesFragment"> - - + android:layout_height="wrap_content" /> \ No newline at end of file diff --git a/sample-compose-fragments/src/main/res/menu/bottom_bar_menu.xml b/sample-compose-fragments/src/main/res/menu/bottom_bar_menu.xml index 593df4e3..380babab 100644 --- a/sample-compose-fragments/src/main/res/menu/bottom_bar_menu.xml +++ b/sample-compose-fragments/src/main/res/menu/bottom_bar_menu.xml @@ -21,7 +21,7 @@ android:title="@string/title_organisms" /> - - + + + + + + + + + + + + + + + + \ No newline at end of file