How to use the alloy.isTablet function in alloy

To help you get started, we’ve selected a few alloy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appcelerator / alloy / test / apps / testing / ALOY-1103 / _generated / windows / alloy / controllers / index.js View on Github external
{
            __processArg(arguments[0], "$model");
        }
        {
            __processArg(arguments[0], "__itemTemplate");
        }
    }
    var $ = this;
    var exports = {};
    $.__views.index = Ti.UI.createWindow({
        backgroundColor: "white",
        layout: "vertical",
        id: "index"
    });
    $.__views.index && $.addTopLevelView($.__views.index);
    if (Alloy.isTablet) {
        $.__views.__alloyId2 = Ti.UI.createView({
            id: "__alloyId2"
        });
        $.__views.__alloyId3 = Ti.UI.createLabel({
            font: {
                fontSize: "20dp",
                color: "black"
            },
            text: "HeaderView Tablet",
            id: "__alloyId3"
        });
        $.__views.__alloyId2.add($.__views.__alloyId3);
    }
    if (!Alloy.isTablet) {
        $.__views.__alloyId5 = Ti.UI.createView({
            id: "__alloyId5"
github appcelerator / alloy / test / apps / testing / ALOY-1103 / _generated / windows / alloy / controllers / index.js View on Github external
if (Alloy.isTablet) {
        $.__views.__alloyId7 = Ti.UI.createView({
            id: "__alloyId7"
        });
        $.__views.index.add($.__views.__alloyId7);
        $.__views.__alloyId8 = Ti.UI.createLabel({
            font: {
                fontSize: "20dp",
                color: "black"
            },
            text: "View Tablet",
            id: "__alloyId8"
        });
        $.__views.__alloyId7.add($.__views.__alloyId8);
    }
    if (!Alloy.isTablet) {
        $.__views.__alloyId9 = Ti.UI.createView({
            id: "__alloyId9"
        });
        $.__views.index.add($.__views.__alloyId9);
        $.__views.__alloyId10 = Ti.UI.createLabel({
            font: {
                fontSize: "20dp",
                color: "black"
            },
            text: "View Handheld",
            id: "__alloyId10"
        });
        $.__views.__alloyId9.add($.__views.__alloyId10);
    }
    exports.destroy = function() {};
    _.extend($, $.__views);
github appcelerator / alloy / test / apps / advanced / form_factor / _generated / android / alloy / controllers / index.js View on Github external
backgroundColor: "blue"
        });
        Alloy.isTablet && _.extend(o, {
            backgroundColor: "red"
        });
        _.extend(o, {
            id: "container",
            height: "50",
            width: "200",
            bottom: "10",
            backgroundColor: "#cdcdcd"
        });
        return o;
    }());
    $.__views.index.add($.__views.container);
    if (true && Alloy.isTablet) {
        $.__views.platformLabel = Ti.UI.createLabel({
            width: Ti.UI.SIZE,
            height: Ti.UI.SIZE,
            color: "#fff",
            text: "android tablet",
            id: "platformLabel"
        });
        $.__views.container.add($.__views.platformLabel);
    }
    if (true && !Alloy.isTablet) {
        $.__views.platformLabel = Ti.UI.createLabel({
            width: Ti.UI.SIZE,
            height: Ti.UI.SIZE,
            color: "#fff",
            text: "android handheld",
            id: "platformLabel"
github appcelerator / alloy / test / apps / testing / ALOY-1103 / _generated / ios / alloy / controllers / index.js View on Github external
$.__views.__alloyId0 = Ti.UI.createTableView(function() {
        var o = {};
        Alloy.isTablet && Alloy.deepExtend(true, o, {
            headerView: $.__views.__alloyId2
        });
        Alloy.isHandheld && Alloy.deepExtend(true, o, {
            headerView: $.__views.__alloyId5
        });
        Alloy.deepExtend(true, o, {
            height: "80%",
            id: "__alloyId0"
        });
        return o;
    }());
    $.__views.index.add($.__views.__alloyId0);
    if (Alloy.isTablet) {
        $.__views.__alloyId7 = Ti.UI.createView({
            id: "__alloyId7"
        });
        $.__views.index.add($.__views.__alloyId7);
        $.__views.__alloyId8 = Ti.UI.createLabel({
            font: {
                fontSize: "20dp",
                color: "black"
            },
            text: "View Tablet",
            id: "__alloyId8"
        });
        $.__views.__alloyId7.add($.__views.__alloyId8);
    }
    if (!Alloy.isTablet) {
        $.__views.__alloyId9 = Ti.UI.createView({
github appcelerator / alloy / test / apps / advanced / form_factor / _generated / mobileweb / alloy / controllers / index.js View on Github external
backgroundColor: "blue"
        });
        Alloy.isTablet && _.extend(o, {
            backgroundColor: "red"
        });
        _.extend(o, {
            id: "container",
            height: "50",
            width: "200",
            bottom: "10",
            backgroundColor: "#cdcdcd"
        });
        return o;
    }());
    $.__views.index.add($.__views.container);
    if (true && Alloy.isTablet) {
        $.__views.platformLabel = Ti.UI.createLabel({
            width: Ti.UI.SIZE,
            height: Ti.UI.SIZE,
            color: "#fff",
            text: "mobileweb tablet",
            id: "platformLabel"
        });
        $.__views.container.add($.__views.platformLabel);
    }
    if (true && !Alloy.isTablet) {
        $.__views.platformLabel = Ti.UI.createLabel({
            width: Ti.UI.SIZE,
            height: Ti.UI.SIZE,
            color: "#fff",
            text: "mobileweb handheld",
            id: "platformLabel"
github appcelerator / alloy / test / apps / advanced / master_detail / _generated / ios / alloy / controllers / index.js View on Github external
$.master.on("detail", function(e) {
        var controller = true && Alloy.isTablet ? $.detail : Alloy.createController("detail");
        var win = controller.getView();
        controller.setBoxerStats(e.row.fighterName);
        true && Alloy.isHandheld && Alloy.Globals.navgroup.openWindow(win);
    });
    $.index.open();
github appcelerator / alloy / test / apps / testing / ALOY-687 / _generated / ios / alloy / controllers / index.js View on Github external
$.__views.label = Ti.UI.createLabel(function() {
        var o = {};
        Alloy.deepExtend(true, o, {
            height: Ti.UI.SIZE,
            width: "90%",
            font: {
                fontSize: "24dp",
                fontWeight: "normal"
            },
            textAlign: "center",
            color: "#0f0"
        });
        Alloy.isHandheld && Alloy.deepExtend(true, o, {
            color: "#0ff"
        });
        Alloy.isTablet && Alloy.deepExtend(true, o, {
            color: "#963"
        });
        Alloy.deepExtend(true, o, {
            text: 'Check the console output and make sure that only styles relevant to the current build platform are listed in the printed array. Note also that the "platform" key has been removed entirely from the "queries" object in conditional styles.',
            id: "label"
        });
        return o;
    }());
    $.__views.index.add($.__views.label);
github appcelerator / alloy / test / apps / advanced / form_factor / _generated / ios / alloy / controllers / index.js View on Github external
$.__views.main = Ti.UI.createView(function() {
            var o = {};
            Alloy.isHandheld && _.extend(o, {
                backgroundColor: "blue"
            });
            Alloy.isTablet && _.extend(o, {
                backgroundColor: "red"
            });
            _.extend(o, {
                id: "main"
            });
            return o;
        }());
        $.__views.index.add($.__views.main);
github appcelerator / alloy / samples / apps / advanced / form_factor / _generated / blackberry / alloy / controllers / index.js View on Github external
function Controller() {
    require("alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments));
    this.__controllerPath = "index";
    if (arguments[0]) {
        __processArg(arguments[0], "__parentSymbol");
        __processArg(arguments[0], "$model");
        __processArg(arguments[0], "__itemTemplate");
    }
    var $ = this;
    var exports = {};
    $.__views.index = Ti.UI.createWindow({
        backgroundColor: "#fff",
        id: "index"
    });
    $.__views.index && $.addTopLevelView($.__views.index);
    if (!Alloy.isTablet) {
        $.__views.main = Ti.UI.createView(function() {
            var o = {};
            _.extend(o, {});
            Alloy.isHandheld && _.extend(o, {
                backgroundColor: "blue"
            });
            _.extend(o, {});
            Alloy.isTablet && _.extend(o, {
                backgroundColor: "red"
            });
            _.extend(o, {
                id: "main"
            });
            return o;
        }());
        $.__views.index.add($.__views.main);
github CBMVC / CBMVC-Library-For-Titanium-Alloy / app / lib / core.js View on Github external
MainContent: null,
	_mainContent: null,
	_innerContent: null,
	_currentController: null,
	_previousController: null,
	_staticControllers: [],
	_backAnimation: null,
	_contentWidth: Ti.Platform.displayCaps.platformWidth,
	_mainContentwidth: Ti.Platform.displayCaps.platformHeight,

	/**
	 * Device information
	 */
	Device: {
		isHandheld: Alloy.isHandheld,
		isTablet: Alloy.isTablet,
		type: Alloy.isHandheld ? "handheld" : "tablet",
		os: null,
		name: null,
		version: Titanium.Platform.version,
		versionMajor: null,
		versionMinor: null,
		width: Ti.Platform.displayCaps.platformWidth > Ti.Platform.displayCaps.platformHeight ? Ti.Platform.displayCaps.platformHeight : Ti.Platform.displayCaps.platformWidth,
		height: Ti.Platform.displayCaps.platformWidth > Ti.Platform.displayCaps.platformHeight ? Ti.Platform.displayCaps.platformWidth : Ti.Platform.displayCaps.platformHeight,
		dpi: Ti.Platform.displayCaps.dpi,
		orientation: Ti.Gesture.orientation == Ti.UI.LANDSCAPE_LEFT || Ti.Gesture.orientation == Ti.UI.LANDSCAPE_RIGHT ? "LANDSCAPE" : "PORTRAIT",
		statusBarOrientation: null,
		isNexus7: (OS_ANDROID && (Ti.Platform.displayCaps.platformWidth == 1280 || (Ti.Platform.displayCaps.platformWidth == 800 && Ti.Platform.displayCaps.platformHeight > 1200)))
	},
	/**
	 * Init the core app setting
	 * @param {object} mainContent view