backgroundImage property now use Fetcher & Cache as Image component (#4030)

* backgroundImage property now use Fetcher & Cache as Image component
Fix GridLayout tests on iPhone Plus - actualLength wasn’t rounded
ImageCache is closed when activity is stopped

* Fix reset of background drawable.

* additional check for drawable

* imageCache init cache on activity Started
This commit is contained in:
Hristo Hristov
2017-04-21 16:50:12 +03:00
committed by GitHub
parent 483df829c9
commit 9e3222781a
18 changed files with 403 additions and 396 deletions

View File

@@ -35,7 +35,7 @@ import * as platformTests from "./platform/platform-tests";
allTests["PLATFORM"] = platformTests;
import * as fsTests from "./file-system/file-system-tests";
allTests["FILE SYSTEM"] = fsTests;
allTests["FILE-SYSTEM"] = fsTests;
import * as httpTests from "./http/http-tests";
allTests["HTTP"] = httpTests;
@@ -47,13 +47,13 @@ import * as fetchTests from "./fetch/fetch-tests";
allTests["FETCH"] = fetchTests;
import * as appSettingsTests from "./application-settings/application-settings-tests";
allTests["APPLICATION SETTINGS"] = appSettingsTests;
allTests["APPLICATION-SETTINGS"] = appSettingsTests;
import * as applicationTests from "./application/application-tests";
allTests["APPLICATION"] = applicationTests;
import * as imageSourceTests from "./image-source/image-source-tests";
allTests["IMAGE SOURCE"] = imageSourceTests;
allTests["IMAGE-SOURCE"] = imageSourceTests;
import * as observableArrayTests from "./data/observable-array-tests";
allTests["OBSERVABLE-ARRAY"] = observableArrayTests;

View File

@@ -17,12 +17,12 @@ import * as ViewModule from "tns-core-modules/ui/core/view";
import * as helper from "../helper";
import * as ObservableModule from "tns-core-modules/data/observable";
import * as color from "tns-core-modules/color";
import * as backgroundModule from "tns-core-modules/ui/styling/background";
import { android as androidApp } from "tns-core-modules/application";
const imagePath = "~/logo.png";
if (isAndroid) {
const imageModule = require("ui/image");
imageModule.currentMode = imageModule.CacheMode.memory; // use memory cache only.
(<any>backgroundModule).initImageCache(androidApp.startActivity, (<any>backgroundModule).CacheMode.memory); // use memory cache only.
}
export const test_Image_Members = function () {