mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: cleanup
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
import { Image as ImageDefinition, Stretch } from ".";
|
||||
import { View, Property, InheritedCssProperty, Length, Style, Color, isIOS, booleanConverter, CSSType, traceEnabled, traceWrite, traceCategories } from "../core/view";
|
||||
import { View, CSSType } from "../core/view";
|
||||
import { booleanConverter } from "../core/view-base";
|
||||
import { ImageAsset } from "../../image-asset";
|
||||
import { ImageSource } from "../../image-source";
|
||||
import { isDataURI, isFontIconURI, isFileOrResourcePath, RESOURCE_PREFIX } from "../../utils/utils";
|
||||
export * from "../core/view";
|
||||
export { ImageSource, ImageAsset, isDataURI, isFontIconURI, isFileOrResourcePath, RESOURCE_PREFIX };
|
||||
import { Color } from "../../color";
|
||||
import { isIOS } from "../../platform";
|
||||
import { Style } from "../styling/style";
|
||||
import { Length } from "../styling/style-properties";
|
||||
import { Property, InheritedCssProperty, } from "../core/properties";
|
||||
import { Trace } from "../../trace";
|
||||
|
||||
@CSSType("Image")
|
||||
export abstract class ImageBase extends View implements ImageDefinition {
|
||||
@@ -89,11 +94,11 @@ export abstract class ImageBase extends View implements ImageDefinition {
|
||||
}, err => {
|
||||
// catch: Response content may not be converted to an Image
|
||||
this.isLoading = false;
|
||||
if (traceEnabled()) {
|
||||
if (Trace.isEnabled()) {
|
||||
if (typeof err === "object" && err.message) {
|
||||
err = err.message;
|
||||
}
|
||||
traceWrite(err, traceCategories.Debug);
|
||||
Trace.write(err, Trace.categories.Debug);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
11
nativescript-core/ui/image/image.d.ts
vendored
11
nativescript-core/ui/image/image.d.ts
vendored
@@ -1,10 +1,9 @@
|
||||
/**
|
||||
* Contains the Image class, which represents an image widget.
|
||||
* @module "ui/image"
|
||||
*/ /** */
|
||||
|
||||
import { View, Property, InheritedCssProperty, Color, Style, Length } from "../core/view";
|
||||
import { View } from "../core/view";
|
||||
import { Style } from "../styling/style"
|
||||
import { ImageSource } from "../../image-source";
|
||||
import { Color } from "../../color";
|
||||
import { Property, InheritedCssProperty } from "../core/properties";
|
||||
import { Length } from '../styling/style-properties';
|
||||
|
||||
/**
|
||||
* Represents a class that provides functionality for loading and streching image(s).
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import {
|
||||
ImageSource, ImageBase, stretchProperty, imageSourceProperty, tintColorProperty, srcProperty, layout, Color,
|
||||
traceEnabled, traceWrite, traceCategories
|
||||
ImageBase, stretchProperty, imageSourceProperty, tintColorProperty, srcProperty
|
||||
} from "./image-common";
|
||||
import { ImageSource } from "../../image-source";
|
||||
import { Color } from "../../color";
|
||||
import { Trace } from "../../trace";
|
||||
import { layout } from "../../utils/utils";
|
||||
|
||||
export * from "./image-common";
|
||||
|
||||
@@ -76,10 +79,10 @@ export class Image extends ImageBase {
|
||||
measureWidth = finiteWidth ? Math.min(resultW, width) : resultW;
|
||||
measureHeight = finiteHeight ? Math.min(resultH, height) : resultH;
|
||||
|
||||
if (traceEnabled()) {
|
||||
traceWrite("Image stretch: " + this.stretch +
|
||||
if (Trace.isEnabled()) {
|
||||
Trace.write("Image stretch: " + this.stretch +
|
||||
", nativeWidth: " + nativeWidth +
|
||||
", nativeHeight: " + nativeHeight, traceCategories.Layout);
|
||||
", nativeHeight: " + nativeHeight, Trace.categories.Layout);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user