-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert ThreeDSecureV2ButtonCustomization, ThreeDSecureV2ButtonType, …
…ThreeDSecureV2LabelCustomization, ThreeDSecureV2TextBoxCustomization, ThreeDSecureV2ToolbarCustomization, and ThreeDSecureV2UiCustomization to Kotlin (#1132)
- Loading branch information
Showing
16 changed files
with
237 additions
and
851 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
148 changes: 0 additions & 148 deletions
148
...c/main/java/com/braintreepayments/api/threedsecure/ThreeDSecureV2ButtonCustomization.java
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
...src/main/java/com/braintreepayments/api/threedsecure/ThreeDSecureV2ButtonCustomization.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.braintreepayments.api.threedsecure | ||
|
||
import android.os.Parcelable | ||
import com.cardinalcommerce.shared.userinterfaces.ButtonCustomization | ||
import kotlinx.parcelize.Parcelize | ||
|
||
/** | ||
* Button customization options for 3D Secure 2 flows. | ||
* | ||
* @property textFontName Font type for the UI element. | ||
* @property textColor Color code in Hex format. For example, the color code can be “#999999”. | ||
* @property textFontSize Font size for the UI element. | ||
* @property backgroundColor @param backgroundColor Color code in Hex format. For example, the color | ||
* code can be “#999999”. | ||
* @property cornerRadius Radius (integer value) for the button corners. | ||
*/ | ||
@Parcelize | ||
data class ThreeDSecureV2ButtonCustomization( | ||
var textFontName: String? = null, | ||
var textColor: String? = null, | ||
var textFontSize: Int = 0, | ||
var backgroundColor: String? = null, | ||
var cornerRadius: Int = 0 | ||
) : Parcelable { | ||
|
||
val cardinalButtonCustomization: ButtonCustomization | ||
get() { | ||
return ButtonCustomization().also { | ||
textFontName?.let { textFontName -> it.textFontName = textFontName } | ||
textColor?.let { textColor -> it.textColor = textColor } | ||
if (textFontSize != 0) it.textFontSize = textFontSize | ||
backgroundColor?.let { backgroundColor -> it.backgroundColor = backgroundColor } | ||
if (cornerRadius != 0) it.cornerRadius = cornerRadius | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...eDSecure/src/main/java/com/braintreepayments/api/threedsecure/ThreeDSecureV2ButtonType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.braintreepayments.api.threedsecure | ||
|
||
/** | ||
* Button types that can be customized in 3D Secure 2 flows. | ||
*/ | ||
enum class ThreeDSecureV2ButtonType { | ||
BUTTON_TYPE_VERIFY, | ||
BUTTON_TYPE_CONTINUE, | ||
BUTTON_TYPE_NEXT, | ||
BUTTON_TYPE_CANCEL, | ||
BUTTON_TYPE_RESEND | ||
} |
Oops, something went wrong.