Skip to content

Commit

Permalink
Make bottom padding on manage screen consistent. (#10254)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaynewstrom-stripe authored Feb 21, 2025
1 parent 69caba2 commit 4e152d5
Show file tree
Hide file tree
Showing 15 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package com.stripe.android.paymentelement.embedded.manage

import androidx.compose.foundation.layout.Column
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.stripe.android.core.strings.ResolvableString
import com.stripe.android.paymentsheet.navigation.NavigationHandler
import com.stripe.android.paymentsheet.ui.PaymentSheetTopBarState
import com.stripe.android.paymentsheet.ui.UpdatePaymentMethodInteractor
import com.stripe.android.paymentsheet.ui.UpdatePaymentMethodUI
import com.stripe.android.paymentsheet.utils.PaymentSheetContentPadding
import com.stripe.android.paymentsheet.verticalmode.ManageScreenInteractor
import com.stripe.android.paymentsheet.verticalmode.ManageScreenUI
import com.stripe.android.uicore.utils.mapAsStateFlow
Expand Down Expand Up @@ -83,7 +86,10 @@ internal class ManageNavigator private constructor(

@Composable
override fun Content() {
ManageScreenUI(interactor = interactor)
Column {
ManageScreenUI(interactor = interactor)
PaymentSheetContentPadding(subtractingExtraPadding = 12.dp)
}
}

override fun close() {
Expand All @@ -102,7 +108,10 @@ internal class ManageNavigator private constructor(

@Composable
override fun Content() {
UpdatePaymentMethodUI(interactor = interactor, modifier = Modifier)
Column {
UpdatePaymentMethodUI(interactor = interactor, modifier = Modifier)
PaymentSheetContentPadding(subtractingExtraPadding = 16.dp)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private fun DetailsCannotBeChangedText(
color = MaterialTheme.stripeColors.subtitle,
fontWeight = FontWeight.Normal,
modifier = Modifier
.padding(top = 10.dp)
.padding(top = 8.dp)
.testTag(UPDATE_PM_DETAILS_SUBTITLE_TEST_TAG)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.stripe.android.paymentsheet.R

@Composable
internal fun PaymentSheetContentPadding() {
internal fun PaymentSheetContentPadding(subtractingExtraPadding: Dp = 0.dp) {
val bottomPadding = dimensionResource(R.dimen.stripe_paymentsheet_button_container_spacing_bottom)
Spacer(modifier = Modifier.requiredHeight(bottomPadding))
Spacer(modifier = Modifier.requiredHeight(bottomPadding - subtractingExtraPadding))
}

@Composable
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4e152d5

Please sign in to comment.