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

Embedded Appearance API #9706

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions paymentsheet-example/detekt-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<ID>EmptyFunctionBlock:DrawablePainter.kt$EmptyPainter${}</ID>
<ID>FunctionNaming:Receipt.kt$@Preview @Composable fun Receipt_Editable()</ID>
<ID>FunctionNaming:Receipt.kt$@Preview @Composable fun Receipt_NotEditable()</ID>
<ID>LongMethod:AppearanceBottomSheetDialogFragment.kt$@Composable private fun Colors( currentAppearance: PaymentSheet.Appearance, updateAppearance: (PaymentSheet.Appearance) -> Unit, )</ID>
<ID>LongMethod:AppearanceBottomSheetDialogFragment.kt$@Composable private fun PrimaryButton( currentAppearance: PaymentSheet.Appearance, updateAppearance: (PaymentSheet.Appearance) -> Unit, )</ID>
<ID>LongMethod:AppearanceBottomSheetDialogFragment.kt$@OptIn(ExperimentalEmbeddedPaymentElementApi::class) @Composable private fun Colors( currentAppearance: PaymentSheet.Appearance, updateAppearance: (PaymentSheet.Appearance) -> Unit, )</ID>
<ID>LongMethod:AppearanceBottomSheetDialogFragment.kt$@OptIn(ExperimentalEmbeddedPaymentElementApi::class) @Composable private fun PrimaryButton( currentAppearance: PaymentSheet.Appearance, updateAppearance: (PaymentSheet.Appearance) -> Unit, )</ID>
<ID>LongMethod:Receipt.kt$@Composable fun Receipt( isLoading: Boolean, cartState: CartState, isEditable: Boolean = false, onQuantityChanged: (CartProduct.Id, Int) -> Unit = { _, _ -> }, bottomContent: @Composable () -> Unit, )</ID>
<ID>MagicNumber:AppearanceBottomSheetDialogFragment.kt$16</ID>
<ID>MagicNumber:CartProduct.kt$100</ID>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import androidx.compose.ui.unit.sp
import com.godaddy.android.colorpicker.ClassicColorPicker
import com.godaddy.android.colorpicker.HsvColor
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentsheet.PaymentSheet
import com.stripe.android.paymentsheet.example.R

Expand Down Expand Up @@ -182,6 +183,7 @@ private fun CustomizationCard(
}
}

@OptIn(ExperimentalEmbeddedPaymentElementApi::class)
Copy link
Collaborator Author

@tjclawson-stripe tjclawson-stripe Nov 25, 2024

Choose a reason for hiding this comment

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

Required because the method calls copy on Appearance

@Composable
private fun Colors(
currentAppearance: PaymentSheet.Appearance,
Expand Down Expand Up @@ -364,6 +366,7 @@ private fun Colors(
)
}

@OptIn(ExperimentalEmbeddedPaymentElementApi::class)
@Composable
private fun Shapes(
currentAppearance: PaymentSheet.Appearance,
Expand All @@ -390,6 +393,7 @@ private fun Shapes(
}
}

@OptIn(ExperimentalEmbeddedPaymentElementApi::class)
@Composable
private fun Typography(
currentAppearance: PaymentSheet.Appearance,
Expand All @@ -416,6 +420,7 @@ private fun Typography(
}
}

@OptIn(ExperimentalEmbeddedPaymentElementApi::class)
@Composable
private fun PrimaryButton(
currentAppearance: PaymentSheet.Appearance,
Expand Down
75 changes: 49 additions & 26 deletions paymentsheet/api/paymentsheet.api
Original file line number Diff line number Diff line change
Expand Up @@ -606,32 +606,6 @@ public final class com/stripe/android/paymentsheet/PaymentSheet$Address$Creator
public synthetic fun newArray (I)[Ljava/lang/Object;
}

public final class com/stripe/android/paymentsheet/PaymentSheet$Appearance : android/os/Parcelable {
Copy link
Collaborator

Choose a reason for hiding this comment

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

How come this got removed?

public static final field $stable I
public static final field CREATOR Landroid/os/Parcelable$Creator;
public fun <init> ()V
public fun <init> (Lcom/stripe/android/paymentsheet/PaymentSheet$Colors;Lcom/stripe/android/paymentsheet/PaymentSheet$Colors;Lcom/stripe/android/paymentsheet/PaymentSheet$Shapes;Lcom/stripe/android/paymentsheet/PaymentSheet$Typography;Lcom/stripe/android/paymentsheet/PaymentSheet$PrimaryButton;)V
public synthetic fun <init> (Lcom/stripe/android/paymentsheet/PaymentSheet$Colors;Lcom/stripe/android/paymentsheet/PaymentSheet$Colors;Lcom/stripe/android/paymentsheet/PaymentSheet$Shapes;Lcom/stripe/android/paymentsheet/PaymentSheet$Typography;Lcom/stripe/android/paymentsheet/PaymentSheet$PrimaryButton;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Lcom/stripe/android/paymentsheet/PaymentSheet$Colors;
public final fun component2 ()Lcom/stripe/android/paymentsheet/PaymentSheet$Colors;
public final fun component3 ()Lcom/stripe/android/paymentsheet/PaymentSheet$Shapes;
public final fun component4 ()Lcom/stripe/android/paymentsheet/PaymentSheet$Typography;
public final fun component5 ()Lcom/stripe/android/paymentsheet/PaymentSheet$PrimaryButton;
public final fun copy (Lcom/stripe/android/paymentsheet/PaymentSheet$Colors;Lcom/stripe/android/paymentsheet/PaymentSheet$Colors;Lcom/stripe/android/paymentsheet/PaymentSheet$Shapes;Lcom/stripe/android/paymentsheet/PaymentSheet$Typography;Lcom/stripe/android/paymentsheet/PaymentSheet$PrimaryButton;)Lcom/stripe/android/paymentsheet/PaymentSheet$Appearance;
public static synthetic fun copy$default (Lcom/stripe/android/paymentsheet/PaymentSheet$Appearance;Lcom/stripe/android/paymentsheet/PaymentSheet$Colors;Lcom/stripe/android/paymentsheet/PaymentSheet$Colors;Lcom/stripe/android/paymentsheet/PaymentSheet$Shapes;Lcom/stripe/android/paymentsheet/PaymentSheet$Typography;Lcom/stripe/android/paymentsheet/PaymentSheet$PrimaryButton;ILjava/lang/Object;)Lcom/stripe/android/paymentsheet/PaymentSheet$Appearance;
public final fun describeContents ()I
public fun equals (Ljava/lang/Object;)Z
public final fun getColors (Z)Lcom/stripe/android/paymentsheet/PaymentSheet$Colors;
public final fun getColorsDark ()Lcom/stripe/android/paymentsheet/PaymentSheet$Colors;
public final fun getColorsLight ()Lcom/stripe/android/paymentsheet/PaymentSheet$Colors;
public final fun getPrimaryButton ()Lcom/stripe/android/paymentsheet/PaymentSheet$PrimaryButton;
public final fun getShapes ()Lcom/stripe/android/paymentsheet/PaymentSheet$Shapes;
public final fun getTypography ()Lcom/stripe/android/paymentsheet/PaymentSheet$Typography;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
public final fun writeToParcel (Landroid/os/Parcel;I)V
}

public final class com/stripe/android/paymentsheet/PaymentSheet$Appearance$Builder {
public static final field $stable I
public fun <init> ()V
Expand All @@ -651,6 +625,55 @@ public final class com/stripe/android/paymentsheet/PaymentSheet$Appearance$Creat
public synthetic fun newArray (I)[Ljava/lang/Object;
}

public final class com/stripe/android/paymentsheet/PaymentSheet$Appearance$Embedded$Creator : android/os/Parcelable$Creator {
public fun <init> ()V
public final fun createFromParcel (Landroid/os/Parcel;)Lcom/stripe/android/paymentsheet/PaymentSheet$Appearance$Embedded;
public synthetic fun createFromParcel (Landroid/os/Parcel;)Ljava/lang/Object;
public final fun newArray (I)[Lcom/stripe/android/paymentsheet/PaymentSheet$Appearance$Embedded;
public synthetic fun newArray (I)[Ljava/lang/Object;
}

public final class com/stripe/android/paymentsheet/PaymentSheet$Appearance$Embedded$RowStyle$FlatWithCheckmark$Creator : android/os/Parcelable$Creator {
public fun <init> ()V
public final fun createFromParcel (Landroid/os/Parcel;)Lcom/stripe/android/paymentsheet/PaymentSheet$Appearance$Embedded$RowStyle$FlatWithCheckmark;
public synthetic fun createFromParcel (Landroid/os/Parcel;)Ljava/lang/Object;
public final fun newArray (I)[Lcom/stripe/android/paymentsheet/PaymentSheet$Appearance$Embedded$RowStyle$FlatWithCheckmark;
public synthetic fun newArray (I)[Ljava/lang/Object;
}

public final class com/stripe/android/paymentsheet/PaymentSheet$Appearance$Embedded$RowStyle$FlatWithRadio : com/stripe/android/paymentsheet/PaymentSheet$Appearance$Embedded$RowStyle {
public static final field $stable I
public static final field CREATOR Landroid/os/Parcelable$Creator;
public fun <init> (FIFZZIIF)V
public synthetic fun <init> (Landroid/content/Context;IJIZZJJILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun describeContents ()I
public final fun getAdditionalInsetsDp ()F
public final fun getBottomSeparatorEnabled ()Z
public final fun getSelectedColor ()I
public final fun getSeparatorColor ()I
public final fun getSeparatorInsetsDp ()F
public final fun getSeparatorThicknessDp ()F
public final fun getTopSeparatorEnabled ()Z
public final fun getUnselectedColor ()I
public final fun writeToParcel (Landroid/os/Parcel;I)V
}

public final class com/stripe/android/paymentsheet/PaymentSheet$Appearance$Embedded$RowStyle$FlatWithRadio$Creator : android/os/Parcelable$Creator {
public fun <init> ()V
public final fun createFromParcel (Landroid/os/Parcel;)Lcom/stripe/android/paymentsheet/PaymentSheet$Appearance$Embedded$RowStyle$FlatWithRadio;
public synthetic fun createFromParcel (Landroid/os/Parcel;)Ljava/lang/Object;
public final fun newArray (I)[Lcom/stripe/android/paymentsheet/PaymentSheet$Appearance$Embedded$RowStyle$FlatWithRadio;
public synthetic fun newArray (I)[Ljava/lang/Object;
}

public final class com/stripe/android/paymentsheet/PaymentSheet$Appearance$Embedded$RowStyle$FloatingButton$Creator : android/os/Parcelable$Creator {
public fun <init> ()V
public final fun createFromParcel (Landroid/os/Parcel;)Lcom/stripe/android/paymentsheet/PaymentSheet$Appearance$Embedded$RowStyle$FloatingButton;
public synthetic fun createFromParcel (Landroid/os/Parcel;)Ljava/lang/Object;
public final fun newArray (I)[Lcom/stripe/android/paymentsheet/PaymentSheet$Appearance$Embedded$RowStyle$FloatingButton;
public synthetic fun newArray (I)[Ljava/lang/Object;
}

public final class com/stripe/android/paymentsheet/PaymentSheet$BillingDetails : android/os/Parcelable {
public static final field $stable I
public static final field CREATOR Landroid/os/Parcelable$Creator;
Expand Down
Loading
Loading