Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13367] Android: View borderRadius not working

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-04-07T19:44:56.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.1.0, 2013 Sprint 07 Core, 2013 Sprint 07
ComponentsAndroid
LabelsborderRadius, module_views, qe-testadded, triage, view
ReporterCarter Lathrop
AssigneeAllen Yeung
Created2013-01-31T08:39:04.000+0000
Updated2013-06-26T21:52:20.000+0000

Description

*Problem* borderRadius not working in android versions 2.4 and below. borderRadius also not working when Force GPU Rendeing is turned on. I have the below code running using in device using Android 2.2 but the border radius is not showing. i also attached the build log file: *Steps to Reproduce* 1. copy and past provided code in app.js 2. if testing on android device with OS > 2.4, go to dev options and turn on "Force GPU Rendering" 3. Run the code 4. notice borderRadius is not enforced. 5. if on android OS version 2.4 or below, the option should not be available but should show the bug regardless *Test Code to Reproduce*
var mainWindow = Ti.UI.createWindow({
	title : 'Lab',
	backgroundColor : 'white',
	fullscreen : false,
	navBarHidden : true,
	exitOnClose : true,
	orientationModes : [Titanium.UI.PORTRAIT]
});
var portletView = Ti.UI.createView({
	width : 200,
	height : 220,
	borderRadius : 20,
	borderWidth : 1,
	backgroundColor : '#b2b2b2',
	zIndex : 1,
	left : 100,
	top : 100
});

mainWindow.add(portletView);
mainWindow.open();

Attachments

FileDateSize
berderRadius_visible.png2013-03-05T20:58:28.000+0000851357
build.log2013-01-31T08:39:04.000+000014487
Screenshot_2013-01-31-10-28-17.png2013-01-31T08:39:04.000+000011878

Comments

  1. Sameeh Harfoush 2013-02-04

    see discussion thread here http://developer.appcelerator.com/question/144371/borderradius-not-working-on-android-versions--400
  2. Carter Lathrop 2013-02-13

    Hello, Just to clarify, which Android OS versions are you experiencing this problem on? In the environment section you posted Android 4.0.4 but in the description you said 2.2. Is the problem happening on both platforms or just one? Can you test to see if this problem is happening on any other OS versions? The more information we can gather, the better. BTW, Just tested the code on a Galaxy SIII and the borderRadius is working as expected. Regards, Carter
  3. Sameeh Harfoush 2013-02-14

    my device uses Android 4.0.4 and i compiled the code against Android API level 12 (3.1).
       <android xmlns:android="http://schemas.android.com/apk/res/android">
           <tool-api-level>12</tool-api-level>
       	<manifest android:versionCode="1" android:versionName="LAB">
       		<uses-sdk android:minSdkVersion="12" android:targetSdkVersion="12"/>
       	</manifest>
       </android>
       
    in the studio application installer i selected "google APIs Android 3.1 [armeabli]"
  4. Carter Lathrop 2013-02-21

    Sameeh, Just curious, why use api lvl 12 when the minSdkVersion for 4.0.3, 4.0.4, and 4.0.5 is 15? http://developer.android.com/about/versions/android-4.0.3.html Regards, Carter
  5. Sameeh Harfoush 2013-02-22

    because i want to develop,compile, and test in an environment that supports Android 3.1 as minimum version not just 4.0.x so the app is available for different platforms
  6. Carter Lathrop 2013-02-25

    Hello Sameeh, Just a few more things before I move to Ti-Mobile. I have tested on my device (Galaxy 4.1.1) and even when editing the tiapp.xml to include the lines you posted in a previous comment, I could not reproduce. Could you do me a favor and change the android tag contents in tiapp.xml to its default value of:
       <android xmlns:android="http://schemas.android.com/apk/res/android"/>
       
    and let me know if the bug still persists. Also can you confirm any other platforms that this is breaking on? Have you tested on another device and seen the same problem? Thank you for your patience as I continue to gather information and test cases on other devices. Carter
  7. Sameeh Harfoush 2013-03-05

    i retested using the above settings with SDK 3.0.2.GA. the problem still occurs in android but works great on iOS. note that in the "Titanium Android Application Installer" i am selecting "Google APIs Android 3.1 armeabi]" and even if i select "Google APIs Android 2.2 armeabi]" i still dont get my rounded corners. do you think there is kind of a caching problem??
  8. Ivan Wee 2013-03-05

    borderRadius is not working in buttons too, i think the problem is with "android:hardwareAccelerated" option, which is enabled by default when using .
  9. Sameeh Harfoush 2013-03-05

    yes same for buttons
  10. Ivan Wee 2013-03-05

    in my tiapp.xml,
     
        <android xmlns:android="http://schemas.android.com/apk/res/android">
            <tool-api-level>15</tool-api-level>
            <manifest>
                <uses-sdk android:minSdkVersion="11"/>
                <!-- <application android:hardwareAccelerated="true"/> -->  Commenting this line
            </manifest>
        </android>
        
    AND with "Developer options -> Force gpu rendering" disabled on the device, makes the borderRadius work. The problem is the huge speed drop.
  11. Sameeh Harfoush 2013-03-05

    yess same here, i just tested it with Force gpu rendering off and it worked. now should we wait for an SDK release to fix this??
  12. Carter Lathrop 2013-03-05

    Tested using provided code in description on Android emulator run configurations: Titanium Android Application Installer: Google APIs Android 3.1 [armeabi] Titanium Android Emulator: Android 3.1 [armeabi] on Ti SDK 3.0.2GA With tiapp.xml android tag:
        <android xmlns:android="http://schemas.android.com/apk/res/android">
            <tool-api-level>12</tool-api-level>
            <manifest android:versionCode="1" android:versionName="LAB">
                <uses-sdk android:minSdkVersion="12" android:targetSdkVersion="12"/>
            </manifest>
        </android>
        
    and could not reproduce bug. I still have rounded corners. See picture attached. Please provide any and all information that may be missing here. Are these the steps you are using to reproduce this bug? If not, please provide a clear and detailed list of steps to reproduce (add to description) so that we may see the problem. Thank you.
  13. Ivan Wee 2013-03-05

    I tested on galaxy tab 2 android 4.1.1 and it works, however in my Xoom 2 Android 4.0.4 its not working, is not showing rounded corners with "force gpu rendering" enabled. Sameeh Harfoush also related the same problem on Xperia P Android 4.0.4 it works fine in the emulator here, so this problem may be related to hardware acceleration in Android 4.0.4.
  14. Kevin Purnelle 2013-03-11

    Hello, I just faced this problem today. Here are my tests: Context: Device: HTC Sensation OS: Android 4.0.3 Titanium SDK: 3.0.2.GA (Implemented with Alloy) Test #1: --------- Android SDK: 2.3.3 Force GPU : enabled Result: borderRadius does not work Test #2: --------- Android SDK: 2.3.3 Force GPU : disabled Result: borderRadius works Test #3: --------- Android SDK: 4.0.3 Force GPU : enabled Result: borderRadius does not work Test #4: --------- Android SDK: 4.0.3 Force GPU : disabled Result: borderRadius works So it seems to be a problem with the GPU rendering and does not seem to depend on Android SDK version.
  15. Sameeh Harfoush 2013-04-03

    any idea if the fix will be available in Release 3.1.0 ?
  16. Kevin Purnelle 2013-04-04

    Just want to clarify a thing, this problem occurs when: 1. the force gpu option of developer tools menu has been turned on. 2. the hardware acceleration was activated in the manifest at application level with: I have not tried at activity level.
  17. Vishal Duggal 2013-04-07

    This might have been fixed by the fix for TIMOB-12500
  18. Allen Yeung 2013-04-07

    Confirmed that this has been fixed in 3.1.0. I tested on Droid Razr MAXX HD with Force GPU rendering on/off.
  19. Dhirendra Jha 2013-06-19

    Tested with: SDK:3.1.2.v20130617140100 Appcelerator Studio: 3.1.1.201306131423 OS: OSX 10.7.5 Device:Google nexus(v 4.0.4) Xcode: 4.6 alloy: 1.1.3-cr acs: 1.0.2 npm: 1.2.14 titanium: 3.1.1-cr titanium-code-processor: 1.0.1-cr5 View borderRadius works fine.

JSON Source