Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27369] Android: Border Radius once set on a view cannot be reset( i.e. set to 0)

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2020-08-17T23:27:37.000+0000
Affected Version/sRelease 8.1.0, Release 8.2.0, Release 8.1.1
Fix Version/sRelease 9.1.0
ComponentsAndroid
LabelsAndroid, borderRadius, bug, engSchedule, sdk-8.0.2.GA
Reporterpritish.george
AssigneeGary Mathews
Created2019-07-19T08:29:14.000+0000
Updated2020-08-17T23:27:43.000+0000

Description

var win = Ti.UI.createWindow({
    backgroundColor: 'black',
});

var vw_main = Ti.UI.createView({
    left: 0,
    top: 0,
    width: '100%',
    height: '100%',
    layout: 'vertical',
});
win.add(vw_main);


var vw_rect1 = Ti.UI.createView({
    top: 20,
    width: 200,
    height: 300,
    borderRadius: 20,
    backgroundColor: 'red',
});
vw_main.add(vw_rect1);

var checkBox = Ti.UI.createSwitch({
    top: 10,
    value: true,
    style: Titanium.UI.Android.SWITCH_STYLE_CHECKBOX,
    title: 'Border Radius is enabled',
});
vw_main.add(checkBox);

checkBox.addEventListener('change', function (e) {
    if (e.value) {
        vw_rect1.borderRadius = 20;
        checkBox.title = "Border Radius is enabled";
    }
    else {
        vw_rect1.borderRadius = 0;
        //vw_rect1.borderRadius = 0.1; //Current Workaround
        checkBox.title = "Border Radius is not enabled";
    }
});

win.open();
Currently as a workaround I am setting the borderRadius to 0.1 instead of 0.

Comments

  1. Rakhi Mitro 2019-08-08

    Hello, Thanks for reaching out to us. It would be great if you can describe more about the issue you are experiencing and share complete console logs/screenshot which displays the issue.
  2. pritish.george 2019-08-12

    If I set the borderRadius of a view to 10 and then later set the borderRadius of the same view to 0, the borderRadius doesn’t change to 0 and remains at 10. I have shared the code in the description and tested it on SDK 8.0.2.GA in a classic app on an android device. I could share a screenshot but it would basically be a view with a borderRadius of 10. I don’t think that will help out. Also there is nothing in the logs This is a bug I’ve seen on 8.0.2.GA and not the previous SDK. Also currently as a workaround I am setting the borderRadius to 0.1 instead of 0. That seems to get it working.
  3. Rakhi Mitro 2019-08-13

    [~pritish.george], Thanks for letting us know. Hope this issue is sorted out. Can we close this now?
  4. pritish.george 2019-08-13

    The bug still exists and not sure about the stability of the workaround
  5. Sharif AbuDarda 2019-08-30

    Hello, I can verify the issue in the latest SDK 8.1.0.GA and 8.1.1.GA. in android. The borderRadius doesn’t change to 0 and remains at 10 upon change. But it does come to 0.1 if that was used instead of 0. Moving to engineering. Thanks.
  6. Gary Mathews 2020-08-17

    Fixed by TIMOB-27946

JSON Source