I'm trying to develop and Alloy app (Android ). I want to use the camera so i create a camera controller (camera.js, camera.xml and camera.tss) Titanium SDK: 3.3.0 Platform: Android 4.3 Device: Motorola G
in camera.xml
<Alloy> <Window class="container" navBarHidden="true" fullscreen="false" navBarHidden="true" translucent="true"> </Window> </Alloy>in camera.js
var overlay = Ti.UI.createView({ width:'100%', height:'100%', left:"0" }); var nav = Ti.UI.createView({ top:0, width:Ti.UI.FILL, height: "50dp", backgroundColor: "black", layout: "horizontal" }); var back = Ti.UI.createView({ left:"5dp", top: "25dp", width:"22px", height:"36px", backgroundImage: "/volver.png", touchEnabled:true, zIndex:"999", left: "10dp" }); var logo = Ti.UI.createView({ backgroundImage: "/logonavWhite.png", height: "49px", width: "123px", top: "15dp", left:"45%" }); var captureBtn = Ti.UI.createView({ bottom:0, backgroundImage:"/captureBtn.png", width:"160px", height:"160px", left:"40%" }); nav.add(back); nav.add(logo); overlay.add(nav); overlay.add(captureBtn); captureBtn.addEventListener('click',function(){ App.Navigator.open('newofferDetail'); }); Ti.Media.showCamera({ overlay:overlay, saveToPhotoGallery:true, allowEditing:false, mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO], showControls : false, autohide : false, success:function(event){ var image = event.media; var date = new Date().getTime(); var f = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, "savedOffer"+date+".jpg"); f.write(image); App.Navigator.open('uploadOffer',{image:f.nativePath}); } });When i try to open the camera (from other window using a button) i get the postWindowCreated() message in the console (DEBUG), but i can only see a black and empty screen.
I'm add a theme
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="Theme.Offers" parent="Theme.AppCompat.Light"> <item type="bool" name="android:windowActionBar">false</item> <item type="bool" name="android:windowNoTitle">true</item> <!--<item name="android:windowFullscreen">true</item>--> </style> </resources>And set the theme for camera activity in tiapp.xml
<activity android:name="ti.modules.titanium.media.TiCameraActivity" android:configChanges="keyboardHidden|orientation" android:theme="@style/Theme.Offers" />Any idea why?
I want to show the camera with an overlay (top navbar and button) like this image 