file-name-resolver module

This commit is contained in:
vakrilov
2015-03-17 17:20:15 +02:00
parent 9e15302db3
commit 0b2c4cc523
14 changed files with 299 additions and 13 deletions

View File

@@ -0,0 +1,29 @@
import label = require("ui/label");
import pages = require("ui/page");
import fs = require("file-system");
import fileResolverModule = require("file-system/file-name-resolver");
export function createPage() {
var page = new pages.Page();
var lbl = new label.Label();
var moduleName = "app/tests/pages/files/test";
var resolver = new fileResolverModule.FileNameResolver({
width: 400,
height: 600,
os: "android",
deviceType: "phone"
});
// Current app full path.
var currentAppPath = fs.knownFolders.currentApp().path;
var moduleNamePath = fs.path.join(currentAppPath, moduleName);
var fileName = resolver.resolveFileName(moduleNamePath, "xml");
lbl.text = fileName;
lbl.textWrap = true;;
page.content = lbl;
return page;
}

View File

@@ -0,0 +1 @@
other.xml

View File

@@ -0,0 +1 @@
test.android.phone.xml

View File

@@ -0,0 +1 @@
test.android.xml

View File

@@ -0,0 +1 @@
test.minWH300.xml

View File

@@ -0,0 +1 @@
test.monWH450.xml

View File

@@ -0,0 +1 @@
test.xml