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

Android: Camera Overlay - RuntimeException is thrown when creating custom camera overlay with properties

    Details

      Description

      Details: If you create a custom camera overlay with properties, then a RuntimeException is thrown on Android.

      This is not a regression and this bug is not reproducible on iOS.

      Steps to reproduce:
      1. Create the default Titanium classic app with this sample code:

      var window = Ti.UI.createWindow({
      	backgroundColor:'white',
      	layout:'vertical'
      });
       
      var cameraOverlayBtn = Ti.UI.createButton({
      	title:'camera overaly'
      });
       
      cameraOverlayBtn.addEventListener('click', function(e){
      	
      	Ti.API.info('### camera overlay');
      	
      	var customOverlay = Ti.UI.createView({
      		// commenting the property will NOT throw a RuntimeException
      		borderColor:'red'
      	});
      	
      	var takePhotoButton = Ti.UI.createButton({
      		title:'Take Photo',
      		backgroundColor : '#fff',
              backgroundSelectedColor : '#efefef',
              borderColor : '#000',
              borderRadius : 17,
              borderWidth : 1,
              bottom : 65,
              color : '#000',
              height : 34,
              opacity : 0.4,
              width : '100dp'
          });
          
          takePhotoButton.addEventListener('click', function(e) {
              Ti.Media.takePicture();
          });
      	
      	customOverlay.add(takePhotoButton);
      	
      	Titanium.Media.showCamera({
      		success:function(success_event) {
      			Ti.API.info('### camera overlay success');
      		},
      		
      		cancel:function(cancel_event) {
      			Ti.API.info('### camera overlay cancel');
      		},
      		
      		error:function(error_event) {
      			Ti.API.info('### camera overlay error');
      		},
      		
      		overlay:customOverlay,
      		
      		// only used to verify on iOS
      		// showControls: false
      	});
      });
       
      window.add(cameraOverlayBtn);
      window.open();
      

      2. Install the app to an Android device
      3. Press on camera overlay button

      Actual: A RuntimeException is thrown (see logcat.txt attachment).
      Expected: A RuntimeException should not be thrown and the specified overlay properties should appear on top of the camera ui.

        Attachments

          Activity

            People

            • Assignee:
              sunila Sunila
              Reporter:
              wluu Wilson Luu (Inactive)
              Reviewer:
              Hieu Pham
            • Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration