Skip to content

Fix AdyenTheme with public access control and making some more todos on this topic#2465

Draft
robertdalmeida wants to merge 6 commits intodevelopfrom
chore/expose-adyen-theme
Draft

Fix AdyenTheme with public access control and making some more todos on this topic#2465
robertdalmeida wants to merge 6 commits intodevelopfrom
chore/expose-adyen-theme

Conversation

@robertdalmeida
Copy link
Copy Markdown
Contributor

@robertdalmeida robertdalmeida commented Mar 26, 2026

Summary

Discussion MR on the AdyenTheme.

  1. Fix the mistake @robertdalmeida earlier about making package some initializers for AdyenTheme.

Adding todos about ways to improve the theming from an integration point of view.

  1. Improve docs on AdyenColors, looking for feedback to understand what a particular color is being used and for what purpose. If the purpose can be defined then it becomes easier to make any internal mapping.

For example, if i ask what should the color of a secondary button be, what color should i use?

  1. Naming incosistencies between Android and iOS about theme.

Pubilc API usage how it would look for the merchant

        return AdyenTheme(
            colors: AdyenColors(
                background: brandBackground,
                container: brandContainer,
                containerOutline: brandPrimary.withAlphaComponent(0.2),
                primary: brandPrimary,
                textOnPrimary: ExampleColors.staticWhite,
                highlight: brandAccent,
                destructive: brandDestructive,
                success: UIColor(red: 0.2, green: 0.78, blue: 0.35, alpha: 1.0),
                textOnDestructive: ExampleColors.staticWhite,
                disabled: UIColor(red: 0.9, green: 0.9, blue: 0.92, alpha: 1.0),
                textOnDisabled: UIColor(red: 0.6, green: 0.6, blue: 0.65, alpha: 1.0),
                separator: UIColor(red: 0.85, green: 0.85, blue: 0.87, alpha: 1.0),
                text: brandText,
                textSecondary: brandTextSecondary
            )
        )
        .primaryButton(
            backgroundColor: brandPrimary,
            textColor: ExampleColors.staticWhite,
            disabledBackgroundColor: brandPrimary.withAlphaComponent(0.4),
            disabledTextColor: ExampleColors.staticWhite.withAlphaComponent(0.6),
            cornerRadius: 10.0
        )
        .destructiveButton(
            backgroundColor: ExampleColors.clear,
            textColor: brandDestructive,
            cornerRadius: 10.0
        )
        .cornerRadius(10.0)

@robertdalmeida robertdalmeida self-assigned this Mar 26, 2026
@robertdalmeida robertdalmeida added the chore a pull request that has chore changes that shouldn't be in the release notes label Mar 26, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the extensibility of the Adyen UI theming system by making core components, specifically AdyenTheme and AdyenColors, publicly accessible. This change allows merchants to more easily customize the appearance of UI elements through a fluent API, while also introducing internal notes for further refinement of the theming API and documentation.

Highlights

  • Public Access Control: The initializers for AdyenTheme and AdyenColors, along with key chaining methods in AdyenTheme (e.g., colors, cornerRadius, attributes), were changed from package or internal to public to allow external customization by merchants.
  • AdyenColors Refinement: The supportShadow property in AdyenColors was removed as a parameter from the public initializer and is now consistently initialized with the default scheme's value. New TODO comments were added to AdyenColors to guide future documentation and discussion regarding color usage and the supportShadow property.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the access control of several initializers and methods in AdyenColors and AdyenTheme from package or internal to public. It also refactors the AdyenColors initializer by removing supportShadow as a direct parameter and includes TODO comments for future documentation and visibility improvements. A critical issue was identified where the attributes(_:) function in AdyenTheme was made public, but its AdyenAttributes parameter retains package access, which will lead to a compilation error.

Comment thread AdyenUI/AdyenTheme.swift Outdated
/// - Parameter attributes: The UI attributes to apply.
/// - Returns: A new `AdyenTheme` instance.
internal func attributes(_ attributes: AdyenAttributes) -> AdyenTheme {
public func attributes(_ attributes: AdyenAttributes) -> AdyenTheme {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

This function has been changed to public, but its parameter attributes is of type AdyenAttributes, which has package access control. A public function cannot accept a non-public type as a parameter. This will result in a compilation error.

To resolve this, you should either make AdyenAttributes and its properties public (which would require changes in AdyenAttributes.swift), or revert this function's access level to internal.

Suggested change
public func attributes(_ attributes: AdyenAttributes) -> AdyenTheme {
internal func attributes(_ attributes: AdyenAttributes) -> AdyenTheme {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There was no plan to expose it publicly. We want to have full control over what merchants can override and we use a builder pattern for this, adding helper methods such as bodyLabel() and so on.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 26, 2026

ℹ️ No baseline data found for 'develop'.

Framework Size
AdyenComponents.framework 2790 KB
AdyenActions.framework 2392 KB
AdyenDropIn.framework 1359 KB
AdyenDelegatedAuthentication.framework 98 KB
AdyenAuthentication.framework 347 KB
AdyenWeChatPay.framework 262 KB
AdyenUI.framework 3310 KB
AdyenCardScanner.framework 694 KB
AdyenEncryption.framework 504 KB
AdyenSession.framework 750 KB
AdyenTwint.framework 278 KB
AdyenWeChatPayInternal.framework 4135 KB
AdyenCheckout.framework 2070 KB
AdyenCashAppPay.framework 1764 KB
AdyenCard.framework 1749 KB
TwintSDK.framework 97 KB
Adyen3DS2.framework 919 KB
Adyen.framework 5065 KB
total 28583 KB

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 8, 2026

👀 2 public changes detected

Comparing chore/expose-adyen-theme to develop

❇️2 Additions

AdyenUI

❇️ Added

public struct AdyenColors: Swift.Equatable {
  public init(
    background: UIKit.UIColor? = nil,
    container: UIKit.UIColor? = nil,
    containerOutline: UIKit.UIColor? = nil,
    primary: UIKit.UIColor? = nil,
    textOnPrimary: UIKit.UIColor? = nil,
    highlight: UIKit.UIColor? = nil,
    destructive: UIKit.UIColor? = nil,
    success: UIKit.UIColor? = nil,
    textOnDestructive: UIKit.UIColor? = nil,
    disabled: UIKit.UIColor? = nil,
    textOnDisabled: UIKit.UIColor? = nil,
    separator: UIKit.UIColor? = nil,
    text: UIKit.UIColor? = nil,
    textSecondary: UIKit.UIColor? = nil
  )
  public static func ==(
    a: AdyenUI.AdyenColors,
    b: AdyenUI.AdyenColors
  ) -> Swift.Bool
  public static var `default`: AdyenUI.AdyenColors
}

CheckoutTheme

❇️ Added

public init(colors: AdyenUI.AdyenColors = .default)

Analyzed targets: Adyen, AdyenActions, AdyenCard, AdyenCardScanner, AdyenCashAppPay, AdyenCheckout, AdyenComponents, AdyenDelegatedAuthentication, AdyenDropIn, AdyenEncryption, AdyenSession, AdyenSwiftUI, AdyenTwint, AdyenUI, AdyenWeChatPay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore a pull request that has chore changes that shouldn't be in the release notes size:small size:tiny

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants