-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
border-radius on Android 4.4.4 (Samsung Tab) not applied to <Button> #830
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
Comments
This comment was marked as abuse.
This comment was marked as abuse.
That was just an example. Excuse the typo. It doesn't get applied on this On 10:50pm, Sun, Sep 27, 2015 Nathanael Anderson notifications@github.com
|
Just tried locally with our test app and everything worked as expected. |
Maybe because of cache problem? Strange behavior did occur. I experienced button like before flat design. In a lollipop device :) |
It's device specific. The same code works fine in my emulator and when I run the .apk through appetize.io but locally on my Samsung Tab with 4.4.2 no border-radius is applied to the button. I haven't checked other elements. |
I also encountered the same issue - border-radius works on versions >= 4.4, but it does not work on devices (including emulators) running Android 4.2.2. P.S. I tried it with an Image element. |
I can confirm border-radius is not applied to any element on Samsung Tab (4.4.2) when using cssClass. I have not tested setting the styles in JS. |
Hi @tsvetan-ganev, I tested border-radius on emulator running Android 4.2.2 and it seemed to work as expected. Details:
@bradmartin Did you have the chance to try if setting border-radius in JS works on your device? We still have not managed to reproduce this issue on some of our devices ... |
@vchimev Working on that now, to set the border-radius in .js with the button module. Is it this:
or is it:
? |
I just tried using the XML from the test app only the LOGIN button and as you can see no border-radius applied. I'll keep trying to set it in the .js but not sure how to do so yet. I got an error trying to set .text on a new button which I thought was strange.
|
@bradmartin, @vchimev, I will try it when I get home. |
I set it in the .js and still no border-radius. It is very much a device issue. I've ran the same .apk through appetize.io and on my emulator and the border-radius works as expected but when locally on the device nothing.
|
FYI, a related issue we managed to reproduce: #1000. |
Using {N} 1.4 I can work with the border properties some, I think there is a combination of things going on here. To use border-radius on a 'BUTTON' I have to declare the border-width. I was expecting border-radius to work more web like and not needing a border-width declared. Is that a bug or by design for borders in {N}? The other issue is the background-color 'bleeds' out beyond the border when set. This is visibile from the image I posted previously but now that I am able to generate borders I can't find a way to fix the background-color from extending beyond the element when a border-radius is applied. |
@bradmartin
It looks like hardware acceleration may sometimes cause rendering problems and it API-level and device specific. Sometimes 2 devices with same Android Version will behave differently. |
@vakrilov - adding
to the button did add the border radius as I expected. Thanks! I'll try this on a ListView with images and see how the performance is, that's my only concern. I have an infinite scrolling ListView with user pictures loading in so I'll let you know the results of that in terms of performance. Also, is there no other way to remedy this or was this just a simple way to determine the cause? |
Hey @bradmartin - did you experience any performance drawback when changing the layer type? |
@vakrilov - I haven't been able to get a working ListView with 'loadMoreItems' working with this fix. I've used it with several hard coded buttons on some pages and no issue yet but I am curious if the listview with images will cause a big hit as they load in. Just not sure best way to tackle this approach since I don't have a ref to the Image within the ListView. If you want send me an email at bradmartin0905@gmail.com and I'll share the code I have to get a quick working sample for you to try it with. Or if you can just tell me how I'd get the image refs from the ListView to set the layer type as the ListView items are loaded in. |
@vakrilov - Can you help me get the pics from the ListView here so I can test the change on images? I made some changes but for some reason the following code does not get the Image element so I can't set the layer type on the view. The p variable will be undefined, I have the user.Name correctly when debugging so it's working but not getting a ref to the view. Again this is in a ListView so not sure of the internals there.
Here is the xml:
Everything is working but getting the ref to the image view. |
@bradmartin I would recommend another (I hope more simple) approach. Attach to the |
@vakrilov - thanks for the event tip. That was much simpler :) and it works for border-radius. A couple of remarks about this:
Thanks again for your help in uncovering the cause to this and a potential work around. |
@vakrilov - feel free to close this if you want. Your solution for setting the layer works. Don't keep it open for me :) unless you guys are going to try and implement a fix. Thanks again for your help. |
We used clipping to achieve the rounding, but had to move to Canvas.drawRoundRect and the like to enable anti-aliasing. It would be nice if you could give it a try with the upcoming 1.6.0 release to check its status with the new implementation. |
I'll check it out and get some feedback to you. |
Hey @bradmartin, Do you still have problems with this or we can close the issue? |
All good on my end. 👍 On Mon, Feb 15, 2016, 7:15 AM Vladimir Enchev notifications@github.com
|
This still isn't fixed out of the box on Android and requires a hacky fix as above. However, the above does work. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
The following markup does not apply a border-radius to the on Android 4.4.2.
I've ran the same .apk through appetize.io which I believe runs the app through Android 5.0 and the border-radius works correctly.
The text was updated successfully, but these errors were encountered: