mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Applied several fixes over the initial commit.
This commit is contained in:
@@ -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();
|
||||
|
||||
5
file-system/file-system-access.d.ts
vendored
5
file-system/file-system-access.d.ts
vendored
@@ -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.
|
||||
|
||||
@@ -214,6 +214,10 @@ export class FileSystemAccess {
|
||||
}
|
||||
}
|
||||
|
||||
public getLogicalRootPath(): string {
|
||||
return NSBundle.mainBundle().bundlePath;
|
||||
}
|
||||
|
||||
public getDocumentsFolderPath(): string {
|
||||
return this.getKnownPath(this.documentDir);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -173,6 +173,8 @@ export module ad {
|
||||
return;
|
||||
}
|
||||
|
||||
ensureBorderDrawable();
|
||||
|
||||
var style: typeof styleModule = require("./style");
|
||||
|
||||
var backgroundValue = v.style._getValue(style.backgroundInternalProperty);
|
||||
|
||||
Reference in New Issue
Block a user