AppWerft / Ti.FloatingWidget

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ti.FloatingWidget

This Axway Tiranium module realize the Android version of Floating Widget.

Permission

If you want to draw a Floating Widget in your application then your application mus have the SYSTEM_ALERT_WINDOW permission. Now you already know it that after Android Marshmallow we need to ask permissions at run time.

Usage

const FW = require('ti.floatingwidget');
var fwview;
const content = Ti.UI.createView({
		width : 100,
		height : 100,
		backgroundColor : 'orange'
});
content.add(Ti.UI.createLabel({
	text : "Title",
	top:0,
	height:20,
	width:Ti.UI.FILL,
	backgroundColor:'yellow'
}));

if (FW.canDrawOverlays())
	fwView = FW.createWidget(content);
else FW.requestPermission();

// ...
fwView.destroy();

Alternativally you can listen to "result":

FW.addEventListener("result",onResultFn);

About

License:Other


Languages

Language:Java 87.4%Language:JavaScript 12.6%