android-components / mozilla.components.concept.engine.manifest / Size

Size

data class Size (source)

Represents dimensions for an image. Corresponds to values of the “sizes” HTML attribute.

Constructors

Name Summary
<init> Size(width: Int, height: Int)
Represents dimensions for an image. Corresponds to values of the “sizes” HTML attribute.

Properties

Name Summary
height val height: Int
Height of the image.
maxLength val maxLength: Int
Gets the longest length between width and height.
minLength val minLength: Int
Gets the shortest length between width and height.
width val width: Int
Width of the image.

Functions

Name Summary
toString fun toString(): String

Companion Object Properties

Name Summary
ANY val ANY: Size
Represents the “any” size.

Companion Object Functions

Name Summary
parse fun parse(raw: String): Size?
Parses a value from an HTML sizes attribute (512x512, 16x16, etc). Returns null if the value was invalid.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.