Nets-mobile-acceptance / Netaxept-Android-SDK

PiA Netaxept Android SDK is a library that provides the native In-App interaction to perform Netaxept payments directly from an app on Android devices while minimizing PCI DSS requirements for you.
31 stars 15 forks source link

Setting pay button rounded corners #40

Closed Waltari10 closed 2 years ago

Waltari10 commented 3 years ago

In documentation there is this example to set rounded corners:

PiaInterfaceConfiguration.getInstance().setButtonRoundCorner(R.drawable.custom_rounded_button);

I have this as my custom_rounded_button.xml in drawable folder.

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <corners android:radius="1dp" />

</shape>

However just setting it to "1dp" causes the corners to be completely rounded. Actually even just rounds it completely:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
</shape>

What should the custom_rounded_button look like? I would like to adjust the corner radius more gradually.

Miss-PiA commented 3 years ago

Hi @Waltari10

Thank you for raising this up, we will work on the documentation part that needs an update.

Meantime for setting the rounded corner of buttons, you could send an integer value as a radius instead of the shape drawable. SDK internally uses the integer value for creating a dynamic ShapeDrawable and apply it on the button.

Please let us know if you face any difficulties during the integration.

BR

Waltari10 commented 3 years ago

Yup, integer value seems to work fine.

PiaInterfaceConfiguration.getInstance().setButtonRoundCorner(50);

Waltari10 commented 3 years ago

It would still be nice to know the buttons height. We would like the corner radius to always be half of the buttons height, so that it is fully rounded. Similar to iOS buttonCornerRadius 0.5 value. Bit annoying that it works differently on iOS and Android since we want them to look the same, and would like to make a React-Native abstraction.

Miss-PiA commented 3 years ago

Hello @Waltari10

Sorry for the delay in response.

We are looking into this to check how we can make it similar to the iOS counterpart. We will get back to you with an update on this.

Best Regards

Miss-PiA commented 2 years ago

Hello @Waltari10 ,

We will redesign the SDK UI/UX in the v3 which is under development now and the look and feel will be more similar between two platforms. We will inform you once the SDK v3 is available to have a try!