From a760328422c121156815419dcac9a3201c2231ae Mon Sep 17 00:00:00 2001 From: atanasovg Date: Fri, 22 Jan 2016 18:29:59 +0200 Subject: [PATCH] Applied several fixes over the initial commit. --- file-system/file-system-access.android.ts | 5 +++++ file-system/file-system-access.d.ts | 5 +++++ file-system/file-system-access.ios.ts | 4 ++++ file-system/file-system.ts | 5 ++--- ui/styling/background.android.ts | 2 ++ 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/file-system/file-system-access.android.ts b/file-system/file-system-access.android.ts index d8ed46756..7e995631c 100644 --- a/file-system/file-system-access.android.ts +++ b/file-system/file-system-access.android.ts @@ -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(); diff --git a/file-system/file-system-access.d.ts b/file-system/file-system-access.d.ts index aa0ddfec4..f1989cb04 100644 --- a/file-system/file-system-access.d.ts +++ b/file-system/file-system-access.d.ts @@ -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. diff --git a/file-system/file-system-access.ios.ts b/file-system/file-system-access.ios.ts index 4e8bfd049..d60320dea 100644 --- a/file-system/file-system-access.ios.ts +++ b/file-system/file-system-access.ios.ts @@ -214,6 +214,10 @@ export class FileSystemAccess { } } + public getLogicalRootPath(): string { + return NSBundle.mainBundle().bundlePath; + } + public getDocumentsFolderPath(): string { return this.getKnownPath(this.documentDir); } diff --git a/file-system/file-system.ts b/file-system/file-system.ts index e5378b588..c431e7bbd 100644 --- a/file-system/file-system.ts +++ b/file-system/file-system.ts @@ -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; } diff --git a/ui/styling/background.android.ts b/ui/styling/background.android.ts index 6bf4fea36..e200f9bb3 100644 --- a/ui/styling/background.android.ts +++ b/ui/styling/background.android.ts @@ -173,6 +173,8 @@ export module ad { return; } + ensureBorderDrawable(); + var style: typeof styleModule = require("./style"); var backgroundValue = v.style._getValue(style.backgroundInternalProperty);