Passing the size in dpi as common in react-native, on android the wrapper sets the container size correctly, but the native button sets the dpi size prop as pixel as LayoutParams.
This way the container size is fine, but the icon in very small.
In RNShinebutton.java
public void setSize(FrameLayout shineButtonFrame, int size) {
float density = shineButtonFrame.getContext().getResources().getDisplayMetrics().density;
int dpSize = Math.round(size * density);
ShineButton shineButton = (ShineButton) shineButtonFrame.getChildAt(0);
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(dpSize, dpSize);
shineButton.setLayoutParams(layoutParams);
}
I multiplied the size for the density in order to get the pixel size intended.
Is it correct?
Passing the size in dpi as common in react-native, on android the wrapper sets the container size correctly, but the native button sets the dpi size prop as pixel as LayoutParams.
This way the container size is fine, but the icon in very small.
In RNShinebutton.java
public void setSize(FrameLayout shineButtonFrame, int size) {float density = shineButtonFrame.getContext().getResources().getDisplayMetrics().density;int dpSize = Math.round(size * density);ShineButton shineButton = (ShineButton) shineButtonFrame.getChildAt(0);FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(dpSize, dpSize);shineButton.setLayoutParams(layoutParams);}I multiplied the size for the density in order to get the pixel size intended.
Is it correct?