From 6f0acb94b63c60fabd2527d56498366acd4eada2 Mon Sep 17 00:00:00 2001 From: Swapnil Kadlag Date: Sat, 1 Jan 2022 12:25:20 +0530 Subject: [PATCH 1/2] Fixed font baseline alignment using baseline shift instead of padding workaround --- .../wallet/ui/csvimport/flow/ImportFrom.kt | 2 +- .../wallet/ui/edit/core/EditBottomSheet.kt | 8 ++-- .../com/ivy/wallet/ui/home/CustomerJourney.kt | 3 +- .../com/ivy/wallet/ui/home/HomeMoreMenu.kt | 3 +- .../ui/onboarding/components/Suggestions.kt | 4 +- .../ui/onboarding/steps/OnboardingAccounts.kt | 2 +- .../onboarding/steps/OnboardingCategories.kt | 2 +- .../onboarding/steps/OnboardingSplashLogin.kt | 5 +-- .../com/ivy/wallet/ui/paywall/PlansSheet.kt | 3 +- .../ui/planned/list/PlannedPaymentCard.kt | 6 +-- .../ivy/wallet/ui/reports/FilterOverlay.kt | 14 +++---- .../com/ivy/wallet/ui/reports/ReportScreen.kt | 3 +- .../com/ivy/wallet/ui/search/SearchScreen.kt | 5 +-- .../ivy/wallet/ui/settings/SettingsScreen.kt | 2 +- .../com/ivy/wallet/ui/theme/IvyTypography.kt | 38 +++++++++++++------ .../wallet/ui/theme/components/BalanceRow.kt | 3 -- .../ui/theme/components/IvyBorderButton.kt | 6 +-- .../wallet/ui/theme/components/IvyButton.kt | 6 +-- .../wallet/ui/theme/components/IvyCheckbox.kt | 1 - .../ui/theme/components/IvyOutlinedButton.kt | 10 ++--- .../theme/components/OnboardingComponents.kt | 5 +-- .../ui/theme/modal/ChoosePeriodModal.kt | 6 +-- .../theme/modal/edit/ChooseCategoryModal.kt | 5 +-- .../ui/theme/transaction/TransactionCard.kt | 10 ++--- .../transaction/TransactionSectionDivider.kt | 2 - 25 files changed, 65 insertions(+), 89 deletions(-) diff --git a/app/src/main/java/com/ivy/wallet/ui/csvimport/flow/ImportFrom.kt b/app/src/main/java/com/ivy/wallet/ui/csvimport/flow/ImportFrom.kt index 3c3e357876..ef77245205 100644 --- a/app/src/main/java/com/ivy/wallet/ui/csvimport/flow/ImportFrom.kt +++ b/app/src/main/java/com/ivy/wallet/ui/csvimport/flow/ImportFrom.kt @@ -100,7 +100,7 @@ private fun ImportOption( .clickable { onImportFrom(importType) } - .padding(top = 24.dp, bottom = 22.dp), + .padding(vertical = 24.dp), verticalAlignment = Alignment.CenterVertically ) { Spacer(Modifier.width(20.dp)) diff --git a/app/src/main/java/com/ivy/wallet/ui/edit/core/EditBottomSheet.kt b/app/src/main/java/com/ivy/wallet/ui/edit/core/EditBottomSheet.kt index 84fd471748..b4788fec5f 100644 --- a/app/src/main/java/com/ivy/wallet/ui/edit/core/EditBottomSheet.kt +++ b/app/src/main/java/com/ivy/wallet/ui/edit/core/EditBottomSheet.kt @@ -328,8 +328,7 @@ private fun TransferRowMini( color = fromContrastColor, fontWeight = FontWeight.ExtraBold ), - paddingTop = 10.dp, - paddingBottom = 12.dp + padding = 10.dp, ) { onSetExpanded() } @@ -350,8 +349,7 @@ private fun TransferRowMini( color = toContrastColor, fontWeight = FontWeight.ExtraBold ), - paddingTop = 10.dp, - paddingBottom = 12.dp + padding = 10.dp, ) { onSetExpanded() } @@ -567,7 +565,7 @@ private fun AddAccount( Spacer(Modifier.width(4.dp)) Text( - modifier = Modifier.padding(top = 10.dp, bottom = 12.dp), + modifier = Modifier.padding(vertical = 10.dp), text = "Add account", style = Typo.body2.style( color = IvyTheme.colors.pureInverse, diff --git a/app/src/main/java/com/ivy/wallet/ui/home/CustomerJourney.kt b/app/src/main/java/com/ivy/wallet/ui/home/CustomerJourney.kt index b210917114..8346ca3f74 100644 --- a/app/src/main/java/com/ivy/wallet/ui/home/CustomerJourney.kt +++ b/app/src/main/java/com/ivy/wallet/ui/home/CustomerJourney.kt @@ -127,8 +127,7 @@ fun CustomerJourneyCard( color = cardData.backgroundColor, fontWeight = FontWeight.Bold ), - paddingTop = 8.dp, - paddingBottom = 10.dp, + padding = 8.dp, backgroundGradient = Gradient.solid(findContrastTextColor(cardData.backgroundColor)) ) { onCTA() diff --git a/app/src/main/java/com/ivy/wallet/ui/home/HomeMoreMenu.kt b/app/src/main/java/com/ivy/wallet/ui/home/HomeMoreMenu.kt index 7a9b4020b1..9dcf3871c2 100644 --- a/app/src/main/java/com/ivy/wallet/ui/home/HomeMoreMenu.kt +++ b/app/src/main/java/com/ivy/wallet/ui/home/HomeMoreMenu.kt @@ -245,8 +245,7 @@ private fun SearchButton( Text( modifier = Modifier.padding( - top = 12.dp, - bottom = 14.dp + vertical = 12.dp, ), text = "Search transactions", style = Typo.body2.style( diff --git a/app/src/main/java/com/ivy/wallet/ui/onboarding/components/Suggestions.kt b/app/src/main/java/com/ivy/wallet/ui/onboarding/components/Suggestions.kt index fbdb662145..bc85c93c4e 100644 --- a/app/src/main/java/com/ivy/wallet/ui/onboarding/components/Suggestions.kt +++ b/app/src/main/java/com/ivy/wallet/ui/onboarding/components/Suggestions.kt @@ -78,7 +78,7 @@ private fun Suggestion( Spacer(Modifier.width(8.dp)) Text( - modifier = Modifier.padding(top = 14.dp, bottom = 18.dp), + modifier = Modifier.padding(vertical = 16.dp), text = name, style = Typo.body2.style( fontWeight = FontWeight.Bold @@ -113,7 +113,7 @@ private fun AddNewButton( Spacer(Modifier.width(8.dp)) Text( - modifier = Modifier.padding(top = 14.dp, bottom = 18.dp), + modifier = Modifier.padding(vertical = 16.dp), text = "Add new", style = Typo.body2.style( color = IvyTheme.colors.pure, diff --git a/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingAccounts.kt b/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingAccounts.kt index e245dfb29f..89cdcd2c7e 100644 --- a/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingAccounts.kt +++ b/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingAccounts.kt @@ -249,7 +249,7 @@ fun BuyPremiumRow( Text( modifier = Modifier - .padding(top = 10.dp, bottom = 14.dp) + .padding(vertical = 12.dp) .padding(start = 12.dp, end = 32.dp), text = "Buy premium for unlimited number of $itemLabelPlural", style = Typo.body2.style( diff --git a/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingCategories.kt b/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingCategories.kt index d912dad579..ddcc486e47 100644 --- a/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingCategories.kt +++ b/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingCategories.kt @@ -231,7 +231,7 @@ private fun CategoryCard( Text( modifier = Modifier .padding(start = 16.dp, end = 24.dp) - .padding(top = 22.dp, bottom = 26.dp), + .padding(vertical = 24.dp), text = category.name, style = Typo.body2.style( fontWeight = FontWeight.Bold diff --git a/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingSplashLogin.kt b/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingSplashLogin.kt index 8a7839100f..aacae80e30 100644 --- a/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingSplashLogin.kt +++ b/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingSplashLogin.kt @@ -465,10 +465,7 @@ private fun LoginButton( Spacer(Modifier.width(16.dp)) Text( - modifier = Modifier.padding( - top = 18.dp, - bottom = 22.dp - ), + modifier = Modifier.padding(vertical = 20.dp), text = text, style = Typo.body2.style( color = textColor, diff --git a/app/src/main/java/com/ivy/wallet/ui/paywall/PlansSheet.kt b/app/src/main/java/com/ivy/wallet/ui/paywall/PlansSheet.kt index 1257be3fe8..9ff5e449aa 100644 --- a/app/src/main/java/com/ivy/wallet/ui/paywall/PlansSheet.kt +++ b/app/src/main/java/com/ivy/wallet/ui/paywall/PlansSheet.kt @@ -152,8 +152,7 @@ fun BoxWithConstraintsScope.PlansSheet( fontWeight = FontWeight.Bold ), iconStart = R.drawable.ic_custom_crown_s, - paddingTop = 16.dp, - paddingBottom = 16.dp, + padding = 16.dp, iconEdgePadding = 24.dp, ) { selectedPlan?.let { diff --git a/app/src/main/java/com/ivy/wallet/ui/planned/list/PlannedPaymentCard.kt b/app/src/main/java/com/ivy/wallet/ui/planned/list/PlannedPaymentCard.kt index ea10779ad7..673f33a491 100644 --- a/app/src/main/java/com/ivy/wallet/ui/planned/list/PlannedPaymentCard.kt +++ b/app/src/main/java/com/ivy/wallet/ui/planned/list/PlannedPaymentCard.kt @@ -136,8 +136,7 @@ private fun PlannedPaymentHeaderRow( color = findContrastTextColor(category.color.toComposeColor()), fontWeight = FontWeight.ExtraBold ), - paddingTop = 8.dp, - paddingBottom = 10.dp, + padding = 8.dp, iconEdgePadding = 10.dp ) { ivyContext.navigateTo( @@ -161,8 +160,7 @@ private fun PlannedPaymentHeaderRow( color = IvyTheme.colors.pureInverse, fontWeight = FontWeight.ExtraBold ), - paddingTop = 8.dp, - paddingBottom = 10.dp, + padding = 8.dp, iconEdgePadding = 10.dp ) { account?.let { diff --git a/app/src/main/java/com/ivy/wallet/ui/reports/FilterOverlay.kt b/app/src/main/java/com/ivy/wallet/ui/reports/FilterOverlay.kt index 4ea2b9220b..beb4ad019f 100644 --- a/app/src/main/java/com/ivy/wallet/ui/reports/FilterOverlay.kt +++ b/app/src/main/java/com/ivy/wallet/ui/reports/FilterOverlay.kt @@ -234,8 +234,7 @@ fun BoxWithConstraintsScope.FilterOverlay( text = "Apply filter", iconStart = R.drawable.ic_filter_xs, backgroundGradient = GradientGreen, - paddingTop = 10.dp, - paddingBottom = 12.dp + padding = 10.dp, ) { if (localFilter != null) { onSetFilter(localFilter!!) @@ -432,8 +431,7 @@ private fun PeriodFilter( text = filter?.period?.toDisplayLong(LocalIvyContext.current.startDayOfMonth) ?.capitalizeLocal() ?: "Select time range", - paddingTop = 12.dp, - paddingBottom = 14.dp + padding = 12.dp, ) { onShowPeriodChooserModal() } @@ -656,7 +654,7 @@ fun ListItem( Spacer(Modifier.width(4.dp)) Text( - modifier = Modifier.padding(top = 10.dp, bottom = 12.dp), + modifier = Modifier.padding(vertical = 10.dp), text = text, style = Typo.body2.style( color = textColor, @@ -841,8 +839,7 @@ private fun Keyword( iconStart = R.drawable.ic_remove, iconTint = Red, borderColor = borderColor, - paddingTop = 10.dp, - paddingBottom = 12.dp + padding = 10.dp, ) { onClick() } @@ -856,8 +853,7 @@ private fun AddKeywordButton( IvyOutlinedButton( text = text, iconStart = R.drawable.ic_plus, - paddingTop = 10.dp, - paddingBottom = 12.dp + padding = 10.dp, ) { onCLick() } diff --git a/app/src/main/java/com/ivy/wallet/ui/reports/ReportScreen.kt b/app/src/main/java/com/ivy/wallet/ui/reports/ReportScreen.kt index b724021875..4d2ddde555 100644 --- a/app/src/main/java/com/ivy/wallet/ui/reports/ReportScreen.kt +++ b/app/src/main/java/com/ivy/wallet/ui/reports/ReportScreen.kt @@ -346,8 +346,7 @@ private fun Toolbar( iconTint = Green, textColor = Green, solidBackground = true, - paddingTop = 8.dp, - paddingBottom = 10.dp, + padding = 8.dp, iconStart = R.drawable.ic_export_csv ) { onExport() diff --git a/app/src/main/java/com/ivy/wallet/ui/search/SearchScreen.kt b/app/src/main/java/com/ivy/wallet/ui/search/SearchScreen.kt index 4e814ca2e5..f7a10e009e 100644 --- a/app/src/main/java/com/ivy/wallet/ui/search/SearchScreen.kt +++ b/app/src/main/java/com/ivy/wallet/ui/search/SearchScreen.kt @@ -163,10 +163,7 @@ private fun SearchInput( val searchFocus = FocusRequester() IvyBasicTextField( modifier = Modifier - .padding( - top = 12.dp, - bottom = 14.dp - ) + .padding(vertical = 12.dp) .focusRequester(searchFocus), value = searchQueryTextFieldValue, hint = "Search transactions", diff --git a/app/src/main/java/com/ivy/wallet/ui/settings/SettingsScreen.kt b/app/src/main/java/com/ivy/wallet/ui/settings/SettingsScreen.kt index 9130841ffc..87e44f484c 100644 --- a/app/src/main/java/com/ivy/wallet/ui/settings/SettingsScreen.kt +++ b/app/src/main/java/com/ivy/wallet/ui/settings/SettingsScreen.kt @@ -883,7 +883,7 @@ private fun AccountCardButton( Text( modifier = Modifier - .padding(top = 10.dp, bottom = 12.dp), + .padding(vertical = 10.dp), text = text, style = Typo.body2.style( fontWeight = FontWeight.Bold, diff --git a/app/src/main/java/com/ivy/wallet/ui/theme/IvyTypography.kt b/app/src/main/java/com/ivy/wallet/ui/theme/IvyTypography.kt index bccce23ca9..4f59a14775 100644 --- a/app/src/main/java/com/ivy/wallet/ui/theme/IvyTypography.kt +++ b/app/src/main/java/com/ivy/wallet/ui/theme/IvyTypography.kt @@ -6,10 +6,14 @@ import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.Font import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.BaselineShift import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.sp import com.ivy.wallet.R +const val OPEN_SANS_BASELINE_SHIFT = 0.075f +const val RALEWAY_BASELINE_SHIFT = 0.2f + val OpenSans = FontFamily( Font(R.font.opensans_regular, FontWeight.Normal), Font(R.font.opensans_regular, FontWeight.Medium), @@ -33,53 +37,63 @@ val Typo = IvyTypography( h1 = TextStyle( fontFamily = RaleWay, fontWeight = FontWeight.Black, - fontSize = 42.sp + fontSize = 42.sp, + baselineShift = BaselineShift(RALEWAY_BASELINE_SHIFT), ), h2 = TextStyle( fontFamily = RaleWay, fontWeight = FontWeight.Normal, - fontSize = 32.sp + fontSize = 32.sp, + baselineShift = BaselineShift(RALEWAY_BASELINE_SHIFT), ), body1 = TextStyle( fontFamily = RaleWay, fontWeight = FontWeight.ExtraBold, - fontSize = 20.sp + fontSize = 20.sp, + baselineShift = BaselineShift(RALEWAY_BASELINE_SHIFT), ), body2 = TextStyle( fontFamily = RaleWay, fontWeight = FontWeight.Medium, - fontSize = 16.sp + fontSize = 16.sp, + baselineShift = BaselineShift(RALEWAY_BASELINE_SHIFT), ), caption = TextStyle( fontFamily = RaleWay, fontWeight = FontWeight.ExtraBold, - fontSize = 12.sp + fontSize = 12.sp, + baselineShift = BaselineShift(RALEWAY_BASELINE_SHIFT), ), numberH1 = TextStyle( fontFamily = OpenSans, fontWeight = FontWeight.Bold, - fontSize = 42.sp + fontSize = 42.sp, + baselineShift = BaselineShift(OPEN_SANS_BASELINE_SHIFT), ), numberH2 = TextStyle( fontFamily = OpenSans, fontWeight = FontWeight.Normal, - fontSize = 32.sp + fontSize = 32.sp, + baselineShift = BaselineShift(OPEN_SANS_BASELINE_SHIFT), ), numberBody1 = TextStyle( fontFamily = OpenSans, fontWeight = FontWeight.Bold, - fontSize = 20.sp + fontSize = 20.sp, + baselineShift = BaselineShift(OPEN_SANS_BASELINE_SHIFT), ), numberBody2 = TextStyle( fontFamily = OpenSans, fontWeight = FontWeight.Normal, - fontSize = 16.sp + fontSize = 16.sp, + baselineShift = BaselineShift(OPEN_SANS_BASELINE_SHIFT), ), numberCaption = TextStyle( fontFamily = OpenSans, fontWeight = FontWeight.Bold, - fontSize = 12.sp + fontSize = 12.sp, + baselineShift = BaselineShift(OPEN_SANS_BASELINE_SHIFT), ), ) @@ -103,9 +117,9 @@ fun TextStyle.colorAs(color: Color) = this.copy(color = color) fun TextStyle.style( color: Color = IvyTheme.colors.pureInverse, fontWeight: FontWeight = FontWeight.Bold, - textAlign: TextAlign = TextAlign.Start + textAlign: TextAlign = TextAlign.Start, ) = this.copy( color = color, fontWeight = fontWeight, - textAlign = textAlign + textAlign = textAlign, ) \ No newline at end of file diff --git a/app/src/main/java/com/ivy/wallet/ui/theme/components/BalanceRow.kt b/app/src/main/java/com/ivy/wallet/ui/theme/components/BalanceRow.kt index 3249cc3513..41492248b9 100644 --- a/app/src/main/java/com/ivy/wallet/ui/theme/components/BalanceRow.kt +++ b/app/src/main/java/com/ivy/wallet/ui/theme/components/BalanceRow.kt @@ -180,9 +180,6 @@ private fun Currency( textColor: Color, ) { Text( - modifier = Modifier.padding( - bottom = if (currencyFontSize == null || currencyFontSize.value > 30) 4.dp else 2.dp - ), text = currency, style = if (currencyFontSize == null) { Typo.h1.style( diff --git a/app/src/main/java/com/ivy/wallet/ui/theme/components/IvyBorderButton.kt b/app/src/main/java/com/ivy/wallet/ui/theme/components/IvyBorderButton.kt index c08a3d9264..8e751d0b51 100644 --- a/app/src/main/java/com/ivy/wallet/ui/theme/components/IvyBorderButton.kt +++ b/app/src/main/java/com/ivy/wallet/ui/theme/components/IvyBorderButton.kt @@ -39,8 +39,7 @@ fun IvyBorderButton( enabled: Boolean = true, wrapContentMode: Boolean = true, - paddingTop: Dp = 12.dp, - paddingBottom: Dp = 14.dp, //center hack + padding: Dp = 12.dp, onClick: () -> Unit ) { Row( @@ -80,8 +79,7 @@ fun IvyBorderButton( Text( modifier = Modifier.padding( - top = paddingTop, - bottom = paddingBottom + vertical = padding, ), text = text, style = textStyle diff --git a/app/src/main/java/com/ivy/wallet/ui/theme/components/IvyButton.kt b/app/src/main/java/com/ivy/wallet/ui/theme/components/IvyButton.kt index 8ebf5dc682..9dc709e4fc 100644 --- a/app/src/main/java/com/ivy/wallet/ui/theme/components/IvyButton.kt +++ b/app/src/main/java/com/ivy/wallet/ui/theme/components/IvyButton.kt @@ -39,8 +39,7 @@ fun IvyButton( shadowAlpha: Float = 0.15f, wrapContentMode: Boolean = true, hasGlow: Boolean = true, - paddingTop: Dp = 12.dp, - paddingBottom: Dp = 14.dp, //center hack + padding: Dp = 12.dp, iconEdgePadding: Dp = 12.dp, onClick: () -> Unit ) { @@ -92,8 +91,7 @@ fun IvyButton( Text( modifier = Modifier.padding( - top = paddingTop, - bottom = paddingBottom + vertical = padding, ), text = text, style = textStyle diff --git a/app/src/main/java/com/ivy/wallet/ui/theme/components/IvyCheckbox.kt b/app/src/main/java/com/ivy/wallet/ui/theme/components/IvyCheckbox.kt index 77e7c2fb34..03ed994da5 100644 --- a/app/src/main/java/com/ivy/wallet/ui/theme/components/IvyCheckbox.kt +++ b/app/src/main/java/com/ivy/wallet/ui/theme/components/IvyCheckbox.kt @@ -66,7 +66,6 @@ fun IvyCheckboxWithText( Spacer(modifier = Modifier.width(4.dp)) Text( - modifier = Modifier.padding(bottom = 2.dp), text = text, style = Typo.body2.style( color = IvyTheme.colors.pureInverse, diff --git a/app/src/main/java/com/ivy/wallet/ui/theme/components/IvyOutlinedButton.kt b/app/src/main/java/com/ivy/wallet/ui/theme/components/IvyOutlinedButton.kt index 87e7f51c9d..868a4a44a7 100644 --- a/app/src/main/java/com/ivy/wallet/ui/theme/components/IvyOutlinedButton.kt +++ b/app/src/main/java/com/ivy/wallet/ui/theme/components/IvyOutlinedButton.kt @@ -28,8 +28,7 @@ fun IvyOutlinedButton( iconTint: Color = IvyTheme.colors.pureInverse, borderColor: Color = IvyTheme.colors.medium, textColor: Color = IvyTheme.colors.pureInverse, - paddingTop: Dp = 10.dp, - paddingBottom: Dp = 14.dp, + padding: Dp = 12.dp, onClick: () -> Unit, ) { Row( @@ -58,7 +57,7 @@ fun IvyOutlinedButton( } Text( - modifier = Modifier.padding(top = paddingTop, bottom = paddingBottom), + modifier = Modifier.padding(vertical = padding), text = text, style = Typo.body2.style( fontWeight = FontWeight.Bold, @@ -79,8 +78,7 @@ fun IvyOutlinedButtonFillMaxWidth( iconTint: Color = IvyTheme.colors.pureInverse, borderColor: Color = IvyTheme.colors.medium, textColor: Color = IvyTheme.colors.pureInverse, - paddingTop: Dp = 14.dp, - paddingBottom: Dp = 18.dp, + padding: Dp = 16.dp, onClick: () -> Unit, ) { Row( @@ -108,7 +106,7 @@ fun IvyOutlinedButtonFillMaxWidth( Spacer(Modifier.weight(1f)) Text( - modifier = Modifier.padding(top = paddingTop, bottom = paddingBottom), + modifier = Modifier.padding(vertical = padding), text = text, style = Typo.body2.style( fontWeight = FontWeight.Bold, diff --git a/app/src/main/java/com/ivy/wallet/ui/theme/components/OnboardingComponents.kt b/app/src/main/java/com/ivy/wallet/ui/theme/components/OnboardingComponents.kt index 75bcf0b3b8..dc754b4a91 100644 --- a/app/src/main/java/com/ivy/wallet/ui/theme/components/OnboardingComponents.kt +++ b/app/src/main/java/com/ivy/wallet/ui/theme/components/OnboardingComponents.kt @@ -67,10 +67,7 @@ fun OnboardingButton( } Text( - modifier = Modifier.padding( - top = 14.dp, - bottom = 18.dp //center hack - ), + modifier = Modifier.padding(vertical = 16.dp), text = text, style = Typo.body2.style( color = textColor, diff --git a/app/src/main/java/com/ivy/wallet/ui/theme/modal/ChoosePeriodModal.kt b/app/src/main/java/com/ivy/wallet/ui/theme/modal/ChoosePeriodModal.kt index 6161217ea9..4a75b275f4 100644 --- a/app/src/main/java/com/ivy/wallet/ui/theme/modal/ChoosePeriodModal.kt +++ b/app/src/main/java/com/ivy/wallet/ui/theme/modal/ChoosePeriodModal.kt @@ -204,8 +204,7 @@ private fun MonthButton( } .padding(horizontal = 24.dp) .padding( - top = 10.dp, - bottom = 14.dp + vertical = 12.dp, ), text = text, style = Typo.body2.style( @@ -310,8 +309,7 @@ private fun IntervalFromToDate( Text( modifier = Modifier .padding( - top = 14.dp, - bottom = 18.dp + vertical = 16.dp, ), text = if (border == IntervalBorder.FROM) "From" else "To", style = Typo.body2.style( diff --git a/app/src/main/java/com/ivy/wallet/ui/theme/modal/edit/ChooseCategoryModal.kt b/app/src/main/java/com/ivy/wallet/ui/theme/modal/edit/ChooseCategoryModal.kt index 3e9f618376..6a42c1bca2 100644 --- a/app/src/main/java/com/ivy/wallet/ui/theme/modal/edit/ChooseCategoryModal.kt +++ b/app/src/main/java/com/ivy/wallet/ui/theme/modal/edit/ChooseCategoryModal.kt @@ -200,7 +200,7 @@ private fun CategoryButton( Text( modifier = Modifier - .padding(top = 10.dp, bottom = 14.dp) + .padding(vertical = 12.dp) .padding( start = if (selected) 12.dp else 12.dp, end = if (selected) 20.dp else 24.dp @@ -246,8 +246,7 @@ fun AddNewButton( fontWeight = FontWeight.Bold ), iconTint = IvyTheme.colors.pureInverse, - paddingTop = 10.dp, - paddingBottom = 12.dp, + padding = 10.dp, onClick = onClick ) } diff --git a/app/src/main/java/com/ivy/wallet/ui/theme/transaction/TransactionCard.kt b/app/src/main/java/com/ivy/wallet/ui/theme/transaction/TransactionCard.kt index fab653dff6..d5e72cc5a0 100644 --- a/app/src/main/java/com/ivy/wallet/ui/theme/transaction/TransactionCard.kt +++ b/app/src/main/java/com/ivy/wallet/ui/theme/transaction/TransactionCard.kt @@ -181,8 +181,7 @@ private fun TransactionHeaderRow( color = findContrastTextColor(category.color.toComposeColor()), fontWeight = FontWeight.ExtraBold ), - paddingTop = 8.dp, - paddingBottom = 10.dp, + padding = 8.dp, iconEdgePadding = 10.dp ) { ivyContext.navigateTo( @@ -211,8 +210,7 @@ private fun TransactionHeaderRow( color = IvyTheme.colors.pureInverse, fontWeight = FontWeight.ExtraBold ), - paddingTop = 8.dp, - paddingBottom = 10.dp, + padding = 8.dp, iconEdgePadding = 10.dp ) { account?.let { @@ -251,7 +249,7 @@ private fun TransferHeader( Text( modifier = Modifier - .padding(top = 8.dp, bottom = 10.dp), + .padding(vertical = 8.dp), text = account?.name ?: "null", style = Typo.caption.style( fontWeight = FontWeight.ExtraBold, @@ -275,7 +273,7 @@ private fun TransferHeader( Text( modifier = Modifier - .padding(top = 8.dp, bottom = 10.dp), + .padding(vertical = 8.dp), text = toAccount?.name ?: "null", style = Typo.caption.style( fontWeight = FontWeight.ExtraBold, diff --git a/app/src/main/java/com/ivy/wallet/ui/theme/transaction/TransactionSectionDivider.kt b/app/src/main/java/com/ivy/wallet/ui/theme/transaction/TransactionSectionDivider.kt index 7243fa9e7f..375ea39eac 100644 --- a/app/src/main/java/com/ivy/wallet/ui/theme/transaction/TransactionSectionDivider.kt +++ b/app/src/main/java/com/ivy/wallet/ui/theme/transaction/TransactionSectionDivider.kt @@ -104,7 +104,6 @@ private fun SectionDividerIncomeExpenseRow( ) ) Text( - modifier = Modifier.padding(bottom = 2.dp), text = " expenses", style = Typo.caption.style( fontWeight = FontWeight.Normal, @@ -131,7 +130,6 @@ private fun SectionDividerIncomeExpenseRow( ) ) Text( - modifier = Modifier.padding(bottom = 2.dp), text = " income", style = Typo.caption.style( fontWeight = FontWeight.Normal, From af72b08f2d88004d51beff55420aac3eca278333 Mon Sep 17 00:00:00 2001 From: Swapnil Kadlag Date: Sat, 1 Jan 2022 13:37:56 +0530 Subject: [PATCH 2/2] Replaced top/bottom padding with vertical padding for Account button in EditBottomSheet. --- .../main/java/com/ivy/wallet/ui/edit/core/EditBottomSheet.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/ivy/wallet/ui/edit/core/EditBottomSheet.kt b/app/src/main/java/com/ivy/wallet/ui/edit/core/EditBottomSheet.kt index b4788fec5f..14b3c878ff 100644 --- a/app/src/main/java/com/ivy/wallet/ui/edit/core/EditBottomSheet.kt +++ b/app/src/main/java/com/ivy/wallet/ui/edit/core/EditBottomSheet.kt @@ -530,7 +530,7 @@ private fun Account( Spacer(Modifier.width(4.dp)) Text( - modifier = Modifier.padding(top = 10.dp, bottom = 12.dp), + modifier = Modifier.padding(vertical = 10.dp), text = account.name, style = Typo.body2.style( color = textColor,