Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes main content padding on various screens #2906

Merged
merged 11 commits into from
Dec 6, 2023

Conversation

brandyodhiambo
Copy link
Contributor

@brandyodhiambo brandyodhiambo commented Dec 4, 2023

IMPORTANT: Where possible all PRs must be linked to a Github issue

Fixes #2892

Engineer Checklist

  • I have written Unit tests for any new feature(s) and edge cases for bug fixes
  • I have added any strings visible on UI components to the strings.xml file
  • I have updated the CHANGELOG.md file for any notable changes to the codebase
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the project's style guide
  • I have built and run the FHIRCore app to verify my change fixes the issue and/or does not break the app
  • I have checked that this PR does NOT introduce breaking changes that require an update to Content and/or Configs? If it does add a sample here or a link to exactly what changes need to be made to the content.

Code Reviewer Checklist

  • I have verified Unit tests have been written for any new feature(s) and edge cases
  • I have verified any strings visible on UI components are in the strings.xml file
  • I have verifed the CHANGELOG.md file has any notable changes to the codebase
  • I have verified the solution has been implemented in a configurable and generic way for reuseable components
  • I have built and run the FHIRCore app to verify the change fixes the issue and/or does not break the app

Demo

Image without FAB Image With FAB
all_house_hold edited screen

@brandyodhiambo brandyodhiambo linked an issue Dec 4, 2023 that may be closed by this pull request
3 tasks
Copy link

codecov bot commented Dec 4, 2023

Codecov Report

Merging #2906 (2552ac3) into main (ad3a737) will increase coverage by 2.2%.
Report is 114 commits behind head on main.
The diff coverage is 63.7%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main   #2906     +/-   ##
=========================================
+ Coverage     64.5%   66.8%   +2.2%     
- Complexity    1075    1092     +17     
=========================================
  Files          218     222      +4     
  Lines         9635   10162    +527     
  Branches      1897    1879     -18     
=========================================
+ Hits          6218    6790    +572     
+ Misses        2234    2183     -51     
- Partials      1183    1189      +6     
Flag Coverage Δ
engine 70.4% <67.8%> (-2.3%) ⬇️
geowidget 65.5% <33.3%> (+1.1%) ⬆️
quest 64.4% <61.0%> (+5.4%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...ngine/configuration/view/CompoundTextProperties.kt 100.0% <ø> (ø)
...gine/configuration/workflow/ApplicationWorkflow.kt 100.0% <100.0%> (ø)
...r/fhircore/engine/domain/model/RoundingStrategy.kt 100.0% <100.0%> (ø)
...gister/fhircore/engine/rulesengine/RulesFactory.kt 71.8% <100.0%> (+0.6%) ⬆️
...martregister/fhircore/engine/sync/AppSyncWorker.kt 100.0% <ø> (ø)
...r/fhircore/engine/task/FhirResourceExpireWorker.kt 100.0% <100.0%> (ø)
...fhircore/engine/task/FhirTaskStatusUpdateWorker.kt 100.0% <100.0%> (ø)
...g/smartregister/fhircore/engine/ui/theme/Colors.kt 100.0% <100.0%> (ø)
...rcore/engine/util/extension/FhirEngineExtension.kt 80.0% <100.0%> (+2.8%) ⬆️
...fhircore/engine/util/extension/StringExtensions.kt 91.6% <100.0%> (ø)
... and 77 more

... and 29 files with indirect coverage changes

modifier
.fillMaxWidth()
.testTag(SEARCH_FOOTER_TAG)
.padding(bottom = if (!fabActions.isNullOrEmpty() && fabActions.first().visible) 80.dp else 32.dp)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Convert these to constants with intuitive names e.g FOOTER_PADDING_WITH_FAB, FOOTER_PADDING_WITHOUT_FAB

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be a constant variable? for both

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my suggested code in the comments. The idea is to define the padding values in 2 separate constants to be reused in all screens.

LazyColumn(state = lazyListState) {
LazyColumn(
state = lazyListState,
modifier = Modifier.padding(bottom = if (!fabActions.isNullOrEmpty() && fabActions.first().visible) 80.dp else 32.dp)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Convert these to constants with intuitive names e.g FOOTER_PADDING_WITH_FAB, FOOTER_PADDING_WITHOUT_FAB

@ellykits
Copy link
Collaborator

ellykits commented Dec 6, 2023

@brandy-kay Can you link the issue to this PR?

.testTag(SEARCH_FOOTER_TAG)
.padding(
bottom =
if (!fabActions.isNullOrEmpty() && fabActions.first().visible) 80.dp else 32.dp,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!fabActions.isNullOrEmpty() && fabActions.first().visible) 80.dp else 32.dp,
//Declared these constants in AndroidExtensions file
const val PADDING_BOTTOM_WITH_FAB = 80
const val PADDING_BOTTOM_WITHOUT_FAB = 32
if (!fabActions.isNullOrEmpty() && fabActions.first().visible) PADDING_BOTTOM_WITH_FAB.dp else PADDING_BOTTOM_WITHOUT_FAB.dp,

@ellykits
Copy link
Collaborator

ellykits commented Dec 6, 2023

Kindly can you share screenshots to verify this is fixed on the UI?

@brandyodhiambo
Copy link
Contributor Author

@ellykits Sure the PR is WIP once done I will Linking all the necessary UI let me include the changes

@brandyodhiambo brandyodhiambo marked this pull request as ready for review December 6, 2023 12:49
@brandyodhiambo
Copy link
Contributor Author

@Rkareko and @ellykits the pr is now ready for review

@f-odhiambo f-odhiambo merged commit 3cbb77b into main Dec 6, 2023
6 checks passed
@f-odhiambo f-odhiambo deleted the 2892-fix-main-content-padding-on-various-screens branch December 6, 2023 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix main content padding on various screens
4 participants