ㅤButtonㅤ
This extension gives you options to adjust corner radius, choose gradient colors, add asset images to place next to text as icons, and set outlines.
SetButton
- buttons: The list of buttons to customize.
- cornerRadius: The radius of the button's corners (in pixels).
- colors: A list of colors in hexadecimal format for the gradient (for example,
YailList.makeList(new String[]{"#FF0000", "#00FF00"})
). - elevation: The elevation of the button (in pixels).
- imageName: The name of the image found in the assets.
- imagePosition: The position of the image (1: top, 2: right, 3: bottom, 4: left).
- imageWidth: Image width (in pixels; use -1 for original size).
- imageHeight: Image height (in pixels; use -1 for original size).
- borderColor: Outline color in hexadecimal format (for example,
"#000000"
). - borderWidth: Outline thickness (in pixels).
SetShadow
- buttons: The list of buttons to add the shadow to.
- radius: The radius of the shadow (in pixels).
- dx: The X-axis offset of the shadow (in pixels).
- dy: The Y-axis offset of the shadow (in pixels).
- color: The color of the shadow in hexadecimal format (e.g. "#000000").
Note: This shadow is for the button text.
For the shadow that goes under the button, I'm still working on it.
Update:
Function inputs have been completely changed, they now accept lists of buttons and each parameter also accepts lists to individually configure each button, if you have a list of buttons with more than 1 button and in the parameters only the first button is configured, the other buttons will take those settings.
Color inputs now accept native App Inventor colors and colors in hexadecimal.
Examples:
At the request of @HarshVardhanSolanki , instead of accepting values from a single button, a list of buttons was implemented.
And at the request of @Kevinkun , AI2 color inputs are now also accepted.
Update • Oct 22, 2024.
The method has been updated to be able to obtain and display the images in the button while in companion.
The imagePosition input has been changed from int to String
Now instead of using: 1, 2, 3 and 4
, you can use: "top", "right", "bottom" and "left"
.
ㅤA small update:ㅤ
Nov 02, 2024.
Added a default shadow behind the button.
Extension:
joejsanz.joedevbutton.aix (13.6 KB)
Thanks