Skip to content

Commit 743702a

Browse files
committed
Use AppearanceAPIAdditionsPreview::class
1 parent fb329a5 commit 743702a

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/playground/activity/AppearanceBottomSheetDialogFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ import androidx.fragment.app.setFragmentResult
6767
import com.godaddy.android.colorpicker.ClassicColorPicker
6868
import com.godaddy.android.colorpicker.HsvColor
6969
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
70-
import com.stripe.android.paymentelement.ExtendedAppearancePreview
70+
import com.stripe.android.paymentelement.AppearanceAPIAdditionsPreview
7171
import com.stripe.android.paymentsheet.PaymentSheet
7272
import com.stripe.android.paymentsheet.example.R
7373
import com.stripe.android.paymentsheet.example.playground.activity.AppearanceBottomSheetDialogFragment.Companion.EMBEDDED_KEY
@@ -502,7 +502,7 @@ private fun Insets(
502502
}
503503
}
504504

505-
@OptIn(ExtendedAppearancePreview::class)
505+
@OptIn(AppearanceAPIAdditionsPreview::class)
506506
@Composable
507507
private fun Typography(
508508
currentAppearance: PaymentSheet.Appearance,

paymentsheet/detekt-baseline.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<ID>LongMethod:PaymentDetails.kt$@Preview(showBackground = true) @Composable private fun PaymentDetailsListItemPreview()</ID>
4545
<ID>LongMethod:PaymentElementLoader.kt$DefaultPaymentElementLoader$private suspend fun createLinkConfiguration( configuration: CommonConfiguration, customer: CustomerInfo?, elementsSession: ElementsSession, initializationMode: PaymentElementLoader.InitializationMode ): LinkConfiguration?</ID>
4646
<ID>LongMethod:PaymentMethodVerticalLayoutInteractor.kt$DefaultPaymentMethodVerticalLayoutInteractor.Companion$fun create( viewModel: BaseSheetViewModel, paymentMethodMetadata: PaymentMethodMetadata, customerStateHolder: CustomerStateHolder, bankFormInteractor: BankFormInteractor, ): PaymentMethodVerticalLayoutInteractor</ID>
47-
<ID>LongMethod:PaymentSheetConfigurationKtx.kt$@OptIn(ExtendedAppearancePreview::class) internal fun PaymentSheet.Appearance.parseAppearance()</ID>
47+
<ID>LongMethod:PaymentSheetConfigurationKtx.kt$@OptIn(AppearanceAPIAdditionsPreview::class) internal fun PaymentSheet.Appearance.parseAppearance()</ID>
4848
<ID>LongMethod:PaymentSheetScreen.kt$@Composable private fun PaymentSheetContent( viewModel: BaseSheetViewModel, headerText: ResolvableString?, walletsState: WalletsState?, walletsProcessingState: WalletsProcessingState?, error: ResolvableString?, currentScreen: PaymentSheetScreen, mandateText: MandateText?, modifier: Modifier )</ID>
4949
<ID>LongMethod:PaymentSheetViewModelTest.kt$PaymentSheetViewModelTest$@Test fun `Can complete payment after switching to another LPM from card selection with inline Link signup state`()</ID>
5050
<ID>LongMethod:PlaceholderHelperTest.kt$PlaceholderHelperTest$@Test fun `Test correct placeholder is removed for placeholder spec`()</ID>

paymentsheet/src/main/java/com/stripe/android/paymentsheet/PaymentSheet.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,7 +1597,7 @@ class PaymentSheet internal constructor(
15971597
}
15981598

15991599
@Parcelize
1600-
data class Typography @ExtendedAppearancePreview constructor(
1600+
data class Typography @AppearanceAPIAdditionsPreview constructor(
16011601
/**
16021602
* The scale factor for all fonts in PaymentSheet, the default value is 1.0.
16031603
* When this value increases fonts will increase in size and decrease when this value is lowered.
@@ -1616,7 +1616,7 @@ class PaymentSheet internal constructor(
16161616
*/
16171617
val custom: Custom,
16181618
) : Parcelable {
1619-
@OptIn(ExtendedAppearancePreview::class)
1619+
@OptIn(AppearanceAPIAdditionsPreview::class)
16201620
constructor(
16211621
/**
16221622
* The scale factor for all fonts in PaymentSheet, the default value is 1.0.
@@ -1634,7 +1634,7 @@ class PaymentSheet internal constructor(
16341634
custom = Custom(),
16351635
)
16361636

1637-
@ExtendedAppearancePreview
1637+
@AppearanceAPIAdditionsPreview
16381638
@Parcelize
16391639
data class Custom(
16401640
/**
@@ -1645,7 +1645,7 @@ class PaymentSheet internal constructor(
16451645
val h1: Font? = null,
16461646
) : Parcelable
16471647

1648-
@ExtendedAppearancePreview
1648+
@AppearanceAPIAdditionsPreview
16491649
@Parcelize
16501650
data class Font(
16511651
/**

paymentsheet/src/main/java/com/stripe/android/paymentsheet/PaymentSheetConfigurationKtx.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ import androidx.compose.ui.text.font.FontFamily
99
import androidx.compose.ui.text.font.FontWeight
1010
import androidx.compose.ui.unit.TextUnit
1111
import androidx.compose.ui.unit.sp
12-
import com.stripe.android.paymentelement.ExtendedAppearancePreview
12+
import com.stripe.android.paymentelement.AppearanceAPIAdditionsPreview
1313
import com.stripe.android.uicore.PrimaryButtonColors
1414
import com.stripe.android.uicore.PrimaryButtonShape
1515
import com.stripe.android.uicore.PrimaryButtonTypography
1616
import com.stripe.android.uicore.StripeTheme
1717
import com.stripe.android.uicore.StripeThemeDefaults
1818

19-
@OptIn(ExtendedAppearancePreview::class)
19+
@OptIn(AppearanceAPIAdditionsPreview::class)
2020
internal fun PaymentSheet.Appearance.parseAppearance() {
2121
StripeTheme.colorsLightMutable = StripeThemeDefaults.colorsLight.copy(
2222
component = Color(colorsLight.component),
@@ -98,7 +98,7 @@ internal fun PaymentSheet.Appearance.parseAppearance() {
9898
)
9999
}
100100

101-
@OptIn(ExtendedAppearancePreview::class)
101+
@OptIn(AppearanceAPIAdditionsPreview::class)
102102
private fun PaymentSheet.Typography.Font.toTextStyle(): TextStyle {
103103
return TextStyle(
104104
fontSize = fontSizeSp?.sp ?: TextUnit.Unspecified,

paymentsheet/src/test/java/com/stripe/android/utils/screenshots/PaymentSheetAppearance.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.stripe.android.utils.screenshots
22

33
import android.graphics.Color
4-
import com.stripe.android.paymentelement.ExtendedAppearancePreview
4+
import com.stripe.android.paymentelement.AppearanceAPIAdditionsPreview
55
import com.stripe.android.paymentsheet.PaymentSheet
66
import com.stripe.android.paymentsheet.R
77
import com.stripe.android.paymentsheet.parseAppearance
@@ -29,7 +29,7 @@ enum class PaymentSheetAppearance(val appearance: PaymentSheet.Appearance) : Pap
2929
),
3030
),
3131

32-
@OptIn(ExtendedAppearancePreview::class)
32+
@OptIn(AppearanceAPIAdditionsPreview::class)
3333
CrazyAppearance(
3434
appearance = PaymentSheet.Appearance(
3535
colorsLight = PaymentSheet.Colors(

0 commit comments

Comments
 (0)