Skip to content

Commit

Permalink
Add Deprecated annotation to old primaryButtonColor api (#5061)
Browse files Browse the repository at this point in the history
* Add Deprecated annoation to old primaryButtonColor api

* changelog
  • Loading branch information
skyler-stripe committed May 24, 2022
1 parent 3f9eb26 commit 95c943d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,4 +1,8 @@
# CHANGELOG
## XX.X.X - 2022-XX-XX

### PaymentSheet
* [DEPRECATED][5061](https://github.com/stripe/stripe-android/pull/5061) Add Deprecated annotation to old primaryButtonColor api.

## 20.4.0 - 2022-05-23
This release adds [appearance customization APIs](https://github.com/stripe/stripe-android/blob/master/paymentsheet/src/main/java/com/stripe/android/paymentsheet/PaymentSheet.kt#L186) to payment sheet and enables Affirm and AU BECS direct debit as payment methods within Payment Sheet.
Expand Down
6 changes: 6 additions & 0 deletions MIGRATING.md
@@ -1,5 +1,11 @@
# Migration Guide

## Migrating from versions < 20.X.X
- Changes to `PaymentSheet.Configuration`
* `primaryButtonColor` is now deprecated. Please use the new `Appearance` parameter instead:
* `Appearance.colorsLight/colorsDark.primary`
* `PrimaryButton.colorsLight/colorsDark.backgroundColor`

## Migrating from versions < 20.2.0

- Changes to `CollectBankAccountLauncher`
Expand Down
Expand Up @@ -108,6 +108,13 @@ class PaymentSheet internal constructor(
*
* If set, PaymentSheet displays the button with this color.
*/
@Deprecated(
message = "Use Appearance parameter to customize primary button color",
replaceWith = ReplaceWith(
expression = "Appearance.colorsLight/colorsDark.primary " +
"or PrimaryButton.colorsLight/colorsDark.background"
)
)
val primaryButtonColor: ColorStateList? = null,

/**
Expand Down Expand Up @@ -158,6 +165,13 @@ class PaymentSheet internal constructor(
fun googlePay(googlePay: GooglePayConfiguration?) =
apply { this.googlePay = googlePay }

@Deprecated(
message = "Use Appearance parameter to customize primary button color",
replaceWith = ReplaceWith(
expression = "Appearance.colorsLight/colorsDark.primary " +
"or PrimaryButton.colorsLight/colorsDark.background"
)
)
fun primaryButtonColor(primaryButtonColor: ColorStateList?) =
apply { this.primaryButtonColor = primaryButtonColor }

Expand Down

0 comments on commit 95c943d

Please sign in to comment.