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

Android: KlarnaCheckoutView and WRAP_CONTENT layout params #178

Open
erik-kallen opened this issue Feb 1, 2023 · 0 comments
Open

Android: KlarnaCheckoutView and WRAP_CONTENT layout params #178

erik-kallen opened this issue Feb 1, 2023 · 0 comments

Comments

@erik-kallen
Copy link

Describe the bug
For my life, I just can't make the KlarnaCheckoutView size dynamically to its content.

I have a React Native application, that I am trying to add the KlarnaCheckoutView to. The problem is that I want the containing view to automatically resize to the current size of the KlarnaCheckoutView.

What I am doing is

public class KlarnaCheckoutViewWrapper extends FrameLayout {
    public KlarnaCheckoutViewWrapper(ThemedReactContext context) {
        super(context);
        setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
        mKlarnaCheckout = new KlarnaCheckoutView(context.getCurrentActivity());
        mKlarnaCheckout.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
        addView(mKlarnaCheckout);
    }
}

but whatever I do, the KlarnaCheckoutView always has 0 height.

Expected behavior
I would expect the KlarnaCheckoutView to report a height greater than zero

Device and version:

  • Device: Android Emulator
  • OS version: Seems to happen in all versions
  • Klarna In-App SDK version 2.5.0

Merchant Name
Rather not say

Impact Level
Blocker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant