[TIMOB-24161] Android: Ti.UI.AlertDialog.androidView doesn't work when borderRadius is set
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-11-29T00:07:20.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.1.0 |
Components | Android |
Labels | android |
Reporter | Baharroth |
Assignee | Gary Mathews |
Created | 2016-11-21T15:04:26.000+0000 |
Updated | 2016-11-29T00:07:36.000+0000 |
Description
The AndroidView property doesn't work with a simple view.
Ti.UI.setBackgroundColor('white');
var win = Ti.UI.createWindow({
title : 'Click window to test',
backgroundColor : 'white',
exitOnClose : true,
fullscreen : false
});
win.addEventListener('click', function(e) {
var dialog = Ti.UI.createAlertDialog({
message : 'The file has been deleted',
ok : 'Okay',
title : 'File Deleted',
androidView : Titanium.UI.createView({
borderRadius : 10,
backgroundColor : 'red',
width : 50,
height : 50
})
});
dialog.show();
});
win.open();
Result :
{{[WARN] : TiUIDialog: (main) [2917,2917] Context must have gone away: The specified child already has a parent. You must call removeView() on the child's parent first.
[WARN] : TiUIDialog: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
[WARN] : TiUIDialog: at android.view.ViewGroup.addViewInner(ViewGroup.java:3938)
[WARN] : TiUIDialog: at android.view.ViewGroup.addView(ViewGroup.java:3788)
[WARN] : TiUIDialog: at android.view.ViewGroup.addView(ViewGroup.java:3760)
[WARN] : TiUIDialog: at android.support.v7.app.AlertController.setupCustomContent(AlertController.java:610)
[WARN] : TiUIDialog: at android.support.v7.app.AlertController.setupView(AlertController.java:449)
[WARN] : TiUIDialog: at android.support.v7.app.AlertController.installContent(AlertController.java:214)
[WARN] : TiUIDialog: at android.support.v7.app.AlertDialog.onCreate(AlertDialog.java:240)
[WARN] : TiUIDialog: at android.app.Dialog.dispatchOnCreate(Dialog.java:373)
[WARN] : TiUIDialog: at android.app.Dialog.show(Dialog.java:274)
[WARN] : TiUIDialog: at ti.modules.titanium.ui.widget.TiUIDialog.show(TiUIDialog.java:298)
[WARN] : TiUIDialog: at ti.modules.titanium.ui.AlertDialogProxy$1.run(AlertDialogProxy.java:73)
[WARN] : TiUIDialog: at android.os.Handler.handleCallback(Handler.java:746)
[WARN] : TiUIDialog: at android.os.Handler.dispatchMessage(Handler.java:95)
[WARN] : TiUIDialog: at android.os.Looper.loop(Looper.java:135)
[WARN] : TiUIDialog: at android.app.ActivityThread.main(ActivityThread.java:5343)
[WARN] : TiUIDialog: at java.lang.reflect.Method.invoke(Native Method)
[WARN] : TiUIDialog: at java.lang.reflect.Method.invoke(Method.java:372)
[WARN] : TiUIDialog: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
[WARN] : TiUIDialog: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)}}
Does the Alloy-one work?
Looks like a regression then.
master: https://github.com/appcelerator/titanium_mobile/pull/8633
Sorry Gary for my bad report : usually i simplify the test case and i should have removed the borderRadius, then see it's working. I let the borderRadius because, to avoid mistakes from me, i used the documentation sample which include a borderRadius. TiBaharroth
It's not only for borderRadius, it's all border properties. Your code crash if i add a borderWidth for example.
Verified fixed. Using the code provided in the description and the code provided in the test case of https://github.com/appcelerator/titanium_mobile/pull/8633 was able to see Alert Dialogs when a border radius is set. *Environement*