Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15296] Android: Support for window flags

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2014-04-17T23:57:45.000+0000
Affected Version/sRelease 3.1.1, Release 3.1.2
Fix Version/s2014 Sprint 08, 2014 Sprint 08 SDK, Release 3.3.0
ComponentsAndroid
Labelsmodule_window, qe-closed-3.3.0, qe-testadded, supportTeam
ReporterRupesh Sharma
AssigneeVishal Duggal
Created2013-09-20T11:15:59.000+0000
Updated2014-07-08T21:55:06.000+0000

Description

Description

Currently Titanium doesn't support setting the flags on window. This is possible in native Android SDK when we add flags in the onCreate method of the window object.

Android Native Example

getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);

getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);

getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

getWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
This is basically required to show the message screen over the lock-screen. When a message is send to the app the message window should be shown even if the phone's screen is locked. For reference: http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html

Comments

  1. Jong Eun Lee 2013-12-27

    Yes!! This is basically required!!!! Is there any good new?
  2. Vishal Duggal 2014-04-14

    Pull pending master - https://github.com/appcelerator/titanium_mobile/pull/5602
  3. Vishal Duggal 2014-04-14

    Test Case
       var win = Ti.UI.createWindow({backgroundColor:'white'});
       
       var b1 = Ti.UI.createButton({
       	title:'Fullscreen property',
       	top:50
       });
       
       var b2 = Ti.UI.createButton({
       	title: 'Fullscreen flag',
       	bottom:50
       });
       
       
       var l = Ti.UI.createLabel({
       	text:'No exitOnClose specified. Press back button and app should automatically exit',
       	left:10,
       	right:10,
       	color:'black'
       });
       
       win.add(l);
       win.add(b1);
       
       win.add(b2);
       
       win.open();
       
       b1.addEventListener('click',function(){
       	var nwin = Ti.UI.createWindow({
       		backgroundColor:'white',
       		fullscreen:true
       	});
       	var l1 = Ti.UI.createLabel({
       		text:'I must be fullscreen',
       		color: 'red'
       	});
       	
       	nwin.add(l1);
       	
       	nwin.open();
       });
       
       
       b2.addEventListener('click',function(){
       	var nwin2 = Ti.UI.createWindow({
       		backgroundColor:'white',
       		windowFlags:1024
       	});
       	var l2 = Ti.UI.createLabel({
       		text:'I must be fullscreen',
       		color: 'blue'
       	});
       	
       	nwin2.add(l2);
       	
       	nwin2.open();
       });
       
  4. Priya Agarwal 2014-04-24

    Verified the issue with environment: Appc-Studio:3.3.0.201404211130 sdk:3.3.0.v20140423155715 acs:1.0.14 alloy:1.4.0-dev npm:1.3.2 titanium:3.3.0-dev titanium-code-processor:1.1.1-beta1 xCODE:5.1.1 Device:Iphone5(7.1),Nexus7(v4.4.2) Working fine on android Window fullscreen flag. Hence closing the issue

JSON Source