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

Android: Camera overlay does not support portrait mode and default view is in Landscape only.

    Details

      Description

      Description

      In Android, camera custom overlay display mode is in Landscape only. Need the ability to use an overlay in either portrait or landscape mode.

      Testcase

      1. Please use the below code to reproduce the same

      var win = Titanium.UI.createWindow();
       
      var scanner = Titanium.UI.createView({
      	width:200,
      	height:200,
      	borderColor:'red',
      	borderWidth:5,
      	borderRadius:15,
      });
       
      var button = Titanium.UI.createButton({
      	 title:'take foto'
      	
      });
       
       
      var overlay = Titanium.UI.createView();
      overlay.add(scanner);
      overlay.add(button);
       
       
      button.addEventListener('click',function()
      {
      	scanner.borderColor = 'blue';
      	Ti.Media.takePicture();
      	messageView.animate({visible:true});
      	setTimeout(function()
      	{
      		scanner.borderColor = 'red';
      		messageView.animate({visible:false});
      	},500);
      });
       
       
      Titanium.Media.showCamera({
       
      	success:function(event)
      	{
      		Ti.API.debug("picture was taken");
      	},
      	cancel:function()
      	{
      	},
      	error:function(error)
      	{
      		Ti.API.debug("Error "+error);
      	},
      	overlay:overlay,
      	showControls:true,	
      	mediaTypes:Ti.Media.MEDIA_TYPE_PHOTO,
      	autohide:true
      }); 
       
      win.open();
      

      2. Install and run the application and you will see that overlay is displayed on landscape mode.

      Note:Related to https://jira.appcelerator.org/browse/TIDOC-480

        Attachments

          Activity

            People

            • Assignee:
              pwang Ping Wang
              Reporter:
              rsharma Rupesh Sharma
              Reviewer:
              Allen Yeung
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration