Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-14573

Parity: Platforms all have different behavior if borderColor is set to null

    Details

      Description

      problem

      When setting borderColor of a proxy to null, out supported platforms all have different behaviors:

      ios

      The borderColor is given the default solid color, which is black

      mobileweb

      The borderColor is made transparent

      android

      A force close happens and this error log is generated

      W/dalvikvm(  765): threadid=1: thread exiting with uncaught exception (group=0x40015560)
      E/TiApplication(  765): (main) [22789,22790] Sending event: exception on thread: main msg:java.lang.NullPointerException; Titanium 3.1.1,2013/06/15 16:10,f7592c1
      E/TiApplication(  765): java.lang.NullPointerException
      E/TiApplication(  765): 	at org.appcelerator.titanium.view.TiUIView.handleBorderProperty(TiUIView.java:1023)
      E/TiApplication(  765): 	at org.appcelerator.titanium.view.TiUIView.propertyChanged(TiUIView.java:619)
      E/TiApplication(  765): 	at ti.modules.titanium.ui.widget.TiUILabel.propertyChanged(TiUILabel.java:168)
      E/TiApplication(  765): 	at org.appcelerator.kroll.KrollPropertyChange.fireEvent(KrollPropertyChange.java:21)
      E/TiApplication(  765): 	at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1011)
      E/TiApplication(  765): 	at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:316)
      E/TiApplication(  765): 	at android.os.Handler.dispatchMessage(Handler.java:95)
      E/TiApplication(  765): 	at android.os.Looper.loop(Looper.java:130)
      E/TiApplication(  765): 	at android.app.ActivityThread.main(ActivityThread.java:3683)
      E/TiApplication(  765): 	at java.lang.reflect.Method.invokeNative(Native Method)
      E/TiApplication(  765): 	at java.lang.reflect.Method.invoke(Method.java:507)
      E/TiApplication(  765): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
      E/TiApplication(  765): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
      E/TiApplication(  765): 	at dalvik.system.NativeStart.main(Native Method)
      E/AndroidRuntime(  765): FATAL EXCEPTION: main
      E/AndroidRuntime(  765): java.lang.NullPointerException
      E/AndroidRuntime(  765): 	at org.appcelerator.titanium.view.TiUIView.handleBorderProperty(TiUIView.java:1023)
      E/AndroidRuntime(  765): 	at org.appcelerator.titanium.view.TiUIView.propertyChanged(TiUIView.java:619)
      E/AndroidRuntime(  765): 	at ti.modules.titanium.ui.widget.TiUILabel.propertyChanged(TiUILabel.java:168)
      E/AndroidRuntime(  765): 	at org.appcelerator.kroll.KrollPropertyChange.fireEvent(KrollPropertyChange.java:21)
      E/AndroidRuntime(  765): 	at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1011)
      E/AndroidRuntime(  765): 	at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:316)
      E/AndroidRuntime(  765): 	at android.os.Handler.dispatchMessage(Handler.java:95)
      E/AndroidRuntime(  765): 	at android.os.Looper.loop(Looper.java:130)
      E/AndroidRuntime(  765): 	at android.app.ActivityThread.main(ActivityThread.java:3683)
      E/AndroidRuntime(  765): 	at java.lang.reflect.Method.invokeNative(Native Method)
      E/AndroidRuntime(  765): 	at java.lang.reflect.Method.invoke(Method.java:507)
      E/AndroidRuntime(  765): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
      E/AndroidRuntime(  765): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
      E/AndroidRuntime(  765): 	at dalvik.system.NativeStart.main(Native Method)
      

      expected

      Whether the borderColor is turned to solid black or transparent, it needs to be uniform across platforms. Also, there should be no errors when setting borderColor to null.

      test case

      var win = Ti.UI.createWindow({
      	backgroundColor: '#fff',
      	modal: false,
      	exitOnClose: true
      });
      var label = Ti.UI.createLabel({
      	text: 'just a test label',
      	borderColor: '#0f0',
       
      	// note: borderWidth is required to cause the android exception
      	borderWidth: 2
      });
      label.addEventListener('click', function(e) {
      	label.borderColor = null;
      });
       
      win.add(label);
      win.open();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bijuexalture Biju pm
                Reporter:
                tlukasavage Tony Lukasavage
                Reviewer:
                Vishal Duggal (Inactive)
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-17009
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code