Applied several fixes over the initial commit.

This commit is contained in:
atanasovg
2016-01-22 18:29:59 +02:00
parent f5eb34466e
commit a760328422
5 changed files with 18 additions and 3 deletions

View File

@@ -187,6 +187,11 @@ export class FileSystemAccess {
return dir.getAbsolutePath();
}
public getLogicalRootPath(): string {
var dir = utils.ad.getApplicationContext().getFilesDir();
return dir.getCanonicalPath();
}
public getTempFolderPath(): string {
var dir = utils.ad.getApplicationContext().getCacheDir();
return dir.getAbsolutePath();

View File

@@ -99,6 +99,11 @@
*/
getTempFolderPath(): string;
/**
* Gets the path to the logical root of the application - that is /path/to/appfiles/app.
*/
getLogicalRootPath(): string;
/**
* Reads a text from a file with a given path.
* @param path The path to the source file.

View File

@@ -214,6 +214,10 @@ export class FileSystemAccess {
}
}
public getLogicalRootPath(): string {
return NSBundle.mainBundle().bundlePath;
}
public getDocumentsFolderPath(): string {
return this.getKnownPath(this.documentDir);
}

View File

@@ -443,10 +443,9 @@ export module knownFolders {
export var currentApp = function (): Folder {
if (!_app) {
var utils: typeof utilsModule = require("utils/utils");
var filesDir = utils.ad.getApplicationContext().getFilesDir().getCanonicalPath();
var logicalRoot = getFileAccess().getLogicalRootPath();
_app = new Folder();
_app[pathProperty] = filesDir + "/app/";
_app[pathProperty] = logicalRoot + "/app";
_app[isKnownProperty] = true;
}

View File

@@ -173,6 +173,8 @@ export module ad {
return;
}
ensureBorderDrawable();
var style: typeof styleModule = require("./style");
var backgroundValue = v.style._getValue(style.backgroundInternalProperty);