### SVG Usage Example Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SVG.html Demonstrates how to load an SVG from assets, register a custom resolver, and render it to a Bitmap canvas. Clears the background to white before rendering. ```java SVG.registerExternalFileResolver(myResolver); SVG svg = SVG.getFromAsset(getContext().getAssets(), svgPath); Bitmap newBM = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); Canvas bmcanvas = new Canvas(newBM); bmcanvas.drawRGB(255, 255, 255); // Clear background to white svg.renderToCanvas(bmcanvas); ``` -------------------------------- ### SVG ViewBox Example Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/PreserveAspectRatio.html An example of an SVG element with a viewBox attribute, which is necessary for scaling to occur when using PreserveAspectRatio. ```html ``` -------------------------------- ### Enum Utility Methods Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/PreserveAspectRatio.Alignment.html Provides static methods for working with the PreserveAspectRatio.Alignment enum, including retrieving constants by name and getting all constants. ```APIDOC ## Enum Utility Methods ### `static PreserveAspectRatio.Alignment valueOf(String name)` **Description:** Returns the enum constant of this type with the specified name. ### `static PreserveAspectRatio.Alignment[] values()` **Description:** Returns an array containing the constants of this enum type, in the order they are declared. ``` -------------------------------- ### Library Version Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html Method to get the version of the AndroidSVG library. ```APIDOC ## Library Version ### Description Retrieves the version number of the AndroidSVG library. ### Method - **`getVersion()`**: Static method that returns the version number of this library. ``` -------------------------------- ### Create and Configure RenderOptions Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/RenderOptions.html Demonstrates how to create a RenderOptions object and set its viewport and CSS rules for rendering an SVG. This is useful for controlling the rendering area and applying custom styles. ```java RenderOptions renderOptions = RenderOptions.create(); renderOptions.viewPort(100f, 100f, 400f, 300f) // Set the area of the Canvas to render the SVG into .css("rect { fill: red; }"); // Add some CSS that makes all rectangles red svg.renderToCanvas(canvas, renderOptions); ``` -------------------------------- ### RenderOptions Constructor Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/RenderOptions.html Creates a new RenderOptions instance. You can use either the constructor or the static create() method. ```APIDOC ## RenderOptions() ### Description Creates a new `RenderOptions` instance. ### Method Constructor ### Parameters None ``` ```APIDOC ## RenderOptions(RenderOptions other) ### Description Creates a copy of the given `RenderOptions` object. ### Method Constructor ### Parameters * **other** (RenderOptions) - The object to copy. ``` ```APIDOC ## create() ### Description Create a new `RenderOptions` instance. This is just an alternative to `new RenderOptions()`. ### Method static ### Returns new instance of this class. ``` -------------------------------- ### Constructors Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SVGImageView.html These constructors can be used to create an instance of SVGImageView. ```APIDOC ## Constructors ### SVGImageView(Context context) Creates a new SVGImageView with the given context. ### SVGImageView(Context context, AttributeSet attrs) Creates a new SVGImageView with the given context and attributes. ### SVGImageView(Context context, AttributeSet attrs, int defStyle) Creates a new SVGImageView with the given context, attributes, and default style. ``` -------------------------------- ### Getting PreserveAspectRatio.Alignment by name Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/PreserveAspectRatio.Alignment.html Shows how to retrieve a specific PreserveAspectRatio.Alignment constant by its string name using the valueOf() method. This method is case-sensitive and requires an exact match. ```Java PreserveAspectRatio.Alignment c = PreserveAspectRatio.Alignment.valueOf("xMidYMin"); ``` -------------------------------- ### RenderOptions Class Methods Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html Methods for configuring rendering options. ```APIDOC ## RenderOptions Class Methods ### Description Methods for configuring rendering options for an SVG. ### Methods - **`hasCss()`**: Returns `true` if CSS styles have been set for rendering, `false` otherwise. ``` -------------------------------- ### RenderOptions Constructor Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/RenderOptions.html Constructs a new RenderOptions object. ```APIDOC ## RenderOptions() ### Description Public constructor for creating a new RenderOptions instance. ### Method public RenderOptions() ### Endpoint N/A (Constructor Call) ### Parameters None ### Response #### Success Response - **RenderOptions**: A new RenderOptions object. ``` -------------------------------- ### PreserveAspectRatio.FULLSCREEN_START Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html Static variable representing the FULLSCREEN_START alignment for PreserveAspectRatio. It keeps the document's aspect ratio, scaling it to fill the entire viewport. ```APIDOC ## PreserveAspectRatio.FULLSCREEN_START ### Description Static variable representing the FULLSCREEN_START alignment for PreserveAspectRatio. It keeps the document's aspect ratio, scaling it to fill the entire viewport. ### Type Static variable ``` -------------------------------- ### RenderOptions Class Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/RenderOptions.html Provides a fluent builder class that creates a render configuration object for the SVG.renderToCanvas() and SVG.renderToPicture() methods. ```APIDOC ## Class RenderOptions A fluent builder class that creates a render configuration object for the [`SVG.renderToCanvas(Canvas,RenderOptions)`](../../../com/caverock/androidsvg/SVG.html#renderToCanvas-android.graphics.Canvas-com.caverock.androidsvg.RenderOptions-) and [`SVG.renderToPicture(int,int,RenderOptions)`](../../../com/caverock/androidsvg/SVG.html#renderToPicture-int-int-com.caverock.androidsvg.RenderOptions-) methods. ### Example usage `RenderOption renderOptions = RenderOptions.create(); renderOptions.viewPort(100f, 100f, 400f, 300f) // Set the area of the Canvas to render the SVG into .css("rect { fill: red; }") // Add some CSS that makes all rectangles red svg.renderToCanvas(canvas, renderOptions);` Since: 1.3 ### Constructor Summary Constructors Constructor and Description `[RenderOptions](../../../com/caverock/androidsvg/RenderOptions.html#RenderOptions--)()` Create a new `RenderOptions` instance. `[RenderOptions](../../../com/caverock/androidsvg/RenderOptions.html#RenderOptions-com.caverock.androidsvg.RenderOptions-)([RenderOptions](../../../com/caverock/androidsvg/RenderOptions.html "class in com.caverock.androidsvg") other) Creates a copy of the given `RenderOptions` object. ### Method Summary All Methods [Static Methods](javascript:show(1);) [Instance Methods](javascript:show(2);) [Concrete Methods](javascript:show(8);)  Modifier and Type Method and Description `static [RenderOptions](../../../com/caverock/androidsvg/RenderOptions.html "class in com.caverock.androidsvg")` `[create](../../../com/caverock/androidsvg/RenderOptions.html#create--)()` Create a new `RenderOptions` instance. `[RenderOptions](../../../com/caverock/androidsvg/RenderOptions.html "class in com.caverock.androidsvg")` `[css](../../../com/caverock/androidsvg/RenderOptions.html#css-java.lang.String-)([String](http://d.android.com/reference/java/lang/String.html?is-external=true "class or interface in java.lang") css) Specifies some additional CSS rules that will be applied during render in addition to any specified in the file itself. `boolean` `[hasCss](../../../com/caverock/androidsvg/RenderOptions.html#hasCss--)()` Returns true if this RenderOptions instance has had CSS set with `css()`. `boolean` `[hasPreserveAspectRatio](../../../com/caverock/androidsvg/RenderOptions.html#hasPreserveAspectRatio--)()` Returns true if this RenderOptions instance has had PreserveAspectRatio set with `preserveAspectRatio()`. ``` -------------------------------- ### CSS Configuration Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/RenderOptions.html Methods for setting and checking custom CSS rules for rendering. ```APIDOC ## css(String css) ### Description Specifies some additional CSS rules that will be applied during render in addition to any specified in the file itself. ### Method Instance method ### Parameters * **css** (String) - CSS rules to apply ### Returns this same `RenderOptions` instance. ``` ```APIDOC ## hasCss() ### Description Returns true if this RenderOptions instance has had CSS set with `css()`. ### Method Instance method ### Returns true if this RenderOptions instance has had CSS set. ``` -------------------------------- ### SVGImageView Constructors Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SVGImageView.html These constructors are used to create instances of the SVGImageView. They allow initialization with a Context, and optionally with AttributeSet and default style attributes. ```APIDOC ## SVGImageView Constructors ### Description Initializes a new instance of the `SVGImageView` class. ### Constructors - `SVGImageView(Context context)` - Creates an `SVGImageView` with the given context. - `SVGImageView(Context context, AttributeSet attrs)` - Creates an `SVGImageView` with the given context and attribute set. - `SVGImageView(Context context, AttributeSet attrs, int defStyle)` - Creates an `SVGImageView` with the given context, attribute set, and default style. ``` -------------------------------- ### View Configuration Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/RenderOptions.html Methods for specifying a particular view or viewport for rendering. ```APIDOC ## view(String viewId) ### Description Specifies the `id` of a `` element in the SVG. A `` element is a way to specify a predetermined view of the document, that differs from the default view. Note: setting this option will override any `viewBox()` or `preserveAspectRatio()` settings. ### Method Instance method ### Parameters * **viewId** (String) - The id attribute of the view that should be used for rendering. ### Returns this same `RenderOptions` instance. ``` ```APIDOC ## hasView() ### Description Returns true if this RenderOptions instance has had a view set with `view()`. ### Method Instance method ### Returns true if this RenderOptions instance has had a view set. ``` ```APIDOC ## viewBox(float minX, float minY, float width, float height) ### Description Sets the viewBox for the SVG. This defines the coordinate system and aspect ratio of the SVG canvas. Overrides any `preserveAspectRatio` settings. ### Method Instance method ### Parameters * **minX** (float) - The minimum x-coordinate of the viewBox. * **minY** (float) - The minimum y-coordinate of the viewBox. * **width** (float) - The width of the viewBox. * **height** (float) - The height of the viewBox. ### Returns this same `RenderOptions` instance. ``` -------------------------------- ### RenderOptions Constructors Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html Provides constructors for creating and copying RenderOptions objects, which configure SVG rendering. ```APIDOC ## RenderOptions Constructors ### Description These constructors allow for the creation of `RenderOptions` objects, which are used to configure the rendering process for SVG content. ### Constructors #### RenderOptions() Creates a new `RenderOptions` instance with default settings. #### RenderOptions(RenderOptions other) Creates a copy of the given `RenderOptions` object. ``` -------------------------------- ### Enum Constants Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/PreserveAspectRatio.Scale.html Details of the 'meet' and 'slice' enum constants, explaining their scaling behavior. ```APIDOC ## Enum Constant Detail ### meet `public static final PreserveAspectRatio.Scale meet` The document is scaled so that it is as large as possible without overflowing the viewport. There may be blank areas on one or more sides of the document. ### slice `public static final PreserveAspectRatio.Scale slice` The document is scaled so that entirely fills the viewport. That means that some of the document may fall outside the viewport and will not be rendered. ``` -------------------------------- ### PreserveAspectRatio FULLSCREEN_START Constant Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/PreserveAspectRatio.html Represents a PreserveAspectRatio setting that scales the document to fill the entire viewport while maintaining its aspect ratio. ```java static PreserveAspectRatio FULLSCREEN_START ``` -------------------------------- ### Aspect Ratio Configuration Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/RenderOptions.html Methods for configuring how the aspect ratio is handled during rendering. ```APIDOC ## preserveAspectRatio(PreserveAspectRatio preserveAspectRatio) ### Description Specifies how the renderer should handle aspect ratio when rendering the SVG. If not specified, the default will be `PreserveAspectRatio.LETTERBOX`. This is equivalent to the SVG default of `xMidYMid meet`. ### Method Instance method ### Parameters * **preserveAspectRatio** (PreserveAspectRatio) - The new aspect ratio value. ### Returns this same `RenderOptions` instance. ``` ```APIDOC ## hasPreserveAspectRatio() ### Description Returns true if this RenderOptions instance has had a preserveAspectRatio value set with `preserveAspectRatio()`. ### Method Instance method ### Returns true if this RenderOptions instance has had a preserveAspectRatio value set. ``` -------------------------------- ### SVG Rendering and View Configuration Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html Methods related to rendering options, DPI settings, and view properties. ```APIDOC ## SVG Rendering and View Configuration ### Description This section covers methods for configuring rendering behavior and accessing properties of the SVG view. ### Methods - **`getRenderDPI()`**: Retrieves the current DPI (dots per inch) setting used for rendering. - **`getRenderingMethod()`**: Gets the rendering method used by the `SVGView`. - **`getMaxHeight()`**: Returns the maximum height constraint for the `SVGView`. - **`getMaxWidth()`**: Returns the maximum width constraint for the `SVGView`. ``` -------------------------------- ### RenderOptions.css(String) Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html Specifies additional CSS rules to be applied during rendering. ```APIDOC ## RenderOptions.css(String cssRules) ### Description Specifies some additional CSS rules that will be applied during render in addition to any specified in the file itself. ### Parameters #### Query Parameters - **cssRules** (String) - Description: Additional CSS rules to apply. ``` -------------------------------- ### SimpleAssetResolver Class Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/allclasses-frame.html A simple implementation of an asset resolver for external SVG files. ```APIDOC ## Class SimpleAssetResolver ### Description A simple implementation of an asset resolver that can be used to locate and load external files referenced by an SVG. ### Usage Use this class when your SVG references external resources like images or other SVGs that need to be resolved. ``` -------------------------------- ### RenderOptions Class Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/allclasses-frame.html Provides options for rendering SVG content. ```APIDOC ## Class RenderOptions ### Description Provides options for rendering SVG content, allowing customization of the rendering process. ### Usage Instantiate this class to pass specific rendering configurations when rendering an SVG. ``` -------------------------------- ### SimpleAssetResolver Constructor Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SimpleAssetResolver.html Constructs a new SimpleAssetResolver instance. It requires an Android AssetManager to access files from the assets folder. ```APIDOC ## SimpleAssetResolver(AssetManager assetManager) ### Description Constructs a new SimpleAssetResolver instance. It requires an Android AssetManager to access files from the assets folder. ### Constructor `SimpleAssetResolver(AssetManager assetManager)` ``` -------------------------------- ### AssetResolver Methods Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html Methods for checking format support in asset resolvers. ```APIDOC ## isFormatSupported(String) ### Description Returns true when passed the MIME types for SVG, JPEG, PNG or any of the other bitmap image formats supported by Android's BitmapFactory class. ### Method N/A (Instance method) ### Endpoint N/A ## isFormatSupported(String) ### Description Called by renderer to determine whether a particular format is supported. ### Method N/A (Instance method) ### Endpoint N/A ``` -------------------------------- ### Library Information Methods Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SVG.html Methods to retrieve information about the androidsvg library itself. ```APIDOC ## getVersion ### Description Returns the version number of this library. ### Method static String ### Endpoint SVG.getVersion() ``` -------------------------------- ### RenderOptions.viewBox(float, float, float, float) Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html A method in the RenderOptions class that specifies alternative values to use for the root element's viewBox attribute. ```APIDOC ## RenderOptions.viewBox(float minX, float minY, float width, float height) ### Description Specifies alternative values to use for the root element `viewBox`. ### Method RenderOptions ### Parameters #### Path Parameters - **minX** (float) - The minimum x-coordinate of the viewBox. - **minY** (float) - The minimum y-coordinate of the viewBox. - **width** (float) - The width of the viewBox. - **height** (float) - The height of the viewBox. ``` -------------------------------- ### RenderOptions Methods Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html These methods in the RenderOptions class check if specific rendering properties have been set. ```APIDOC ## hasPreserveAspectRatio() ### Description Returns true if this RenderOptions instance has had a preserveAspectRatio value set with `preserveAspectRatio()`. ### Method N/A (Instance method) ### Endpoint N/A ## hasTarget() ### Description Returns true if this RenderOptions instance has had a target set with `target()`. ### Method N/A (Instance method) ### Endpoint N/A ## hasView() ### Description Returns true if this RenderOptions instance has had a view set with `view()`. ### Method N/A (Instance method) ### Endpoint N/A ## hasViewBox() ### Description Returns true if this RenderOptions instance has had a viewBox set with `viewBox()`. ### Method N/A (Instance method) ### Endpoint N/A ## hasViewPort() ### Description Returns true if this RenderOptions instance has had a viewPort set with `viewPort()`. ### Method N/A (Instance method) ### Endpoint N/A ## preserveAspectRatio(PreserveAspectRatio) ### Description Specifies how the renderer should handle aspect ratio when rendering the SVG. ### Method N/A (Instance method) ### Endpoint N/A ``` -------------------------------- ### Enum Methods Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/PreserveAspectRatio.Scale.html Documentation for the static methods 'values' and 'valueOf' available on the PreserveAspectRatio.Scale enum. ```APIDOC ## Method Detail ### values `public static PreserveAspectRatio.Scale[] values()` Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows: ```java for (PreserveAspectRatio.Scale c : PreserveAspectRatio.Scale.values()) System.out.println(c); ``` **Returns:** An array containing the constants of this enum type, in the order they are declared. ### valueOf `public static PreserveAspectRatio.Scale valueOf(String name)` Returns the enum constant of this type with the specified name. The string must match _exactly_ an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) **Parameters:** * `name` (String) - The name of the enum constant to be returned. **Returns:** The enum constant with the specified name. **Throws:** * `IllegalArgumentException` - If this enum type has no constant with the specified name. ``` -------------------------------- ### renderToPicture (renderOptions) Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SVG.html Renders the SVG document to a Picture object using the provided RenderOptions. The returned Picture can be drawn onto a Canvas. ```APIDOC ## renderToPicture ### Description Renders this SVG document to a Picture object. ### Method public Picture renderToPicture(RenderOptions renderOptions) ### Parameters #### Path Parameters - **renderOptions** (RenderOptions) - Required - options that describe how to render this SVG on the Canvas. ### Returns #### Success Response - **Picture** - a Picture object suitable for later rendering using `Canvas.drawPicture(Picture)` ### Since 1.3 ``` -------------------------------- ### viewBox Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/RenderOptions.html Specifies alternative values to use for the root element's viewBox attribute. ```APIDOC ## viewBox ### Description Specifies alternative values to use for the root element `viewBox`. ### Method `RenderOptions` viewBox(float minX, float minY, float width, float height) ### Endpoint N/A (Method Call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response - **RenderOptions**: The updated RenderOptions instance for chaining. ``` -------------------------------- ### renderToPicture Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SVG.html Renders the SVG document to a Picture object. An attempt is made to determine a suitable initial viewport; otherwise, a default of 512x512 is used. The returned Picture can be drawn onto a Canvas. ```APIDOC ## renderToPicture ### Description Renders this SVG document to a Picture object. An attempt will be made to determine a suitable initial viewport from the contents of the SVG file. If an appropriate viewport can't be determined, a default viewport of 512x512 will be used. ### Method public Picture renderToPicture() ### Returns #### Success Response - **Picture** - a Picture object suitable for later rendering using `Canvas.drawPicture()` ``` -------------------------------- ### RenderOptions.viewPort(float, float, float, float) Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html A method in the RenderOptions class that describes the viewport into which the SVG should be rendered. ```APIDOC ## RenderOptions.viewPort(float x, float y, float width, float height) ### Description Describes the viewport into which the SVG should be rendered. ### Method RenderOptions ### Parameters #### Path Parameters - **x** (float) - The x-coordinate of the viewport. - **y** (float) - The y-coordinate of the viewport. - **width** (float) - The width of the viewport. - **height** (float) - The height of the viewport. ``` -------------------------------- ### renderToPicture (width, height, renderOptions) Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SVG.html Renders the SVG document to a Picture object with specified dimensions and RenderOptions. The Picture is suitable for later rendering using `Canvas.drawPicture()`. ```APIDOC ## renderToPicture ### Description Renders this SVG document to a Picture object. ### Method public Picture renderToPicture(int widthInPixels, int heightInPixels, RenderOptions renderOptions) ### Parameters #### Path Parameters - **widthInPixels** (int) - Required - the width of the `Picture` - **heightInPixels** (int) - Required - the height of the `Picture` - **renderOptions** (RenderOptions) - Required - options that describe how to render this SVG on the Canvas. ### Returns #### Success Response - **Picture** - a Picture object suitable for later rendering using `Canvas.drawPicture(Picture)` ### Since 1.3 ``` -------------------------------- ### SVGView Methods Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html Methods related to the SVGView class for drawing and measuring. ```APIDOC ## onDraw(Canvas) ### Description Called to draw the SVG. ### Method Instance method ### Endpoint N/A ## onMeasure(int, int) ### Description Called to measure the SVG view. ### Method Instance method ### Endpoint N/A ``` -------------------------------- ### resolveImage Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html Attempts to find and return a decoded Bitmap for a specified image file in the 'assets' folder. ```APIDOC ## resolveImage(String) ### Description Attempts to find the specified image file in the `assets` folder and return a decoded Bitmap. ### Method [Method signature not explicitly defined, inferred as public Bitmap resolveImage(String)] ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response - **Bitmap**: The decoded Bitmap image. #### Response Example None ``` -------------------------------- ### isFormatSupported Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SVGExternalFileResolver.html Checks if a specific image format is supported by the implementation. Used for conditional processing in elements. ```APIDOC ## isFormatSupported ### Description Called by the renderer to determine whether a particular image format is supported. This method is particularly used in `` elements when processing `requiredFormats` conditionals. ### Method `public boolean isFormatSupported(String mimeType)` ### Parameters #### Path Parameters - **mimeType** (String) - A MIME type (such as "image/jpeg"). ### Response #### Success Response - **boolean** - `true` if the `resolveImage()` implementation supports this file format, `false` otherwise. ``` -------------------------------- ### getDocumentAspectRatio Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SVG.html Calculates and returns the aspect ratio of the document. ```APIDOC ## getDocumentAspectRatio ### Description Returns the aspect ratio of the document as a width/height fraction. If the width or height of the document are listed with a physical unit such as "cm", then the current `renderDPI` setting will be used to convert that value to pixels. ### Method public float getDocumentAspectRatio() ### Returns - **float** - the aspect ratio of the document as a width/height fraction. ``` -------------------------------- ### setCSS Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SVGImageView.html Method to directly set the CSS to be applied during rendering. ```APIDOC ## setCSS ### public void setCSS(String css) Directly set the CSS. Parameters: - `css` (String): Extra CSS to apply when rendering. Since: 1.3 ``` -------------------------------- ### viewBox Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/RenderOptions.html Specifies alternative values to use for the root element `viewBox`. Any existing `viewBox` attribute value will be ignored. Note: will be overridden if a `view(String)` is set. ```APIDOC ## viewBox ### Description Specifies alternative values to use for the root element `viewBox`. Any existing `viewBox` attribute value will be ignored. Note: will be overridden if a `view(String)` is set. ### Parameters #### Path Parameters - **minX** (float) - The left X coordinate of the viewBox - **minY** (float) - The top Y coordinate of the viewBox - **width** (float) - The width of the viewBox - **height** (float) - The height of the viewBox ### Returns - this same `RenderOptions` instance ``` -------------------------------- ### Iterating through PreserveAspectRatio.Alignment constants Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/PreserveAspectRatio.Alignment.html Demonstrates how to iterate over all defined PreserveAspectRatio.Alignment constants using the values() method. This is useful for processing all possible alignment options. ```Java for (PreserveAspectRatio.Alignment c : PreserveAspectRatio.Alignment.values())   System.out.println(c); ``` -------------------------------- ### getFromResource (Resources) Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SVG.html Loads and parses an SVG resource using an Android Resources object. This overload provides flexibility when you already have access to the Resources object. ```APIDOC ## getFromResource (Resources) ### Description Read and parse an SVG from the given resource location. ### Method `public static SVG getFromResource(Resources resources, int resourceId)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **resources** (Resources) - Required - the Android Resources object. * **resourceId** (int) - Required - the resource identifier of the SVG document. ### Returns An SVG instance on which you can call one of the render methods. ### Throws * `SVGParseException` - if there is an error parsing the document. ``` -------------------------------- ### renderToPicture Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SVG.html Renders the SVG document to an Android Picture object. ```APIDOC ## renderToPicture ### Description Renders this SVG document to a Picture object. ### Method `Picture` ``` ```APIDOC ## renderToPicture ### Description Renders this SVG document to a Picture object with specified dimensions. ### Method `Picture` ### Parameters #### Path Parameters - **widthInPixels** (`int`) - Required - The desired width of the Picture in pixels. - **heightInPixels** (`int`) - Required - The desired height of the Picture in pixels. ``` ```APIDOC ## renderToPicture ### Description Renders this SVG document to a Picture object with specified dimensions and custom render options. ### Method `Picture` ### Parameters #### Path Parameters - **widthInPixels** (`int`) - Required - The desired width of the Picture in pixels. - **heightInPixels** (`int`) - Required - The desired height of the Picture in pixels. - **renderOptions** (`RenderOptions`) - Required - The options to configure the rendering process. ``` ```APIDOC ## renderToPicture ### Description Renders this SVG document to a Picture object with custom render options. ### Method `Picture` ### Parameters #### Path Parameters - **renderOptions** (`RenderOptions`) - Required - The options to configure the rendering process. ``` -------------------------------- ### getViewList Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SVG.html Retrieves a list of IDs for all `` elements present in the SVG document. These IDs can be used with `renderViewToX()` methods. ```APIDOC ## getViewList ### Description Returns a list of ids for all `` elements in this SVG document. The returned view ids could be used when calling and of the `renderViewToX()` methods. ### Method public Set getViewList() ### Returns - **Set** - The list of id strings. ### Response Example (No explicit example provided in source) ``` -------------------------------- ### getScale Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/PreserveAspectRatio.html Returns the scale value of this PreserveAspectRatio instance. ```APIDOC ## getScale ### Description Returns the scale value of this PreserveAspectRatio instance. ### Method `PreserveAspectRatio.Scale getScale()` ``` -------------------------------- ### PreserveAspectRatio.FULLSCREEN Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html Static variable representing the FULLSCREEN alignment for PreserveAspectRatio. It keeps the document's aspect ratio, scaling it to fill the entire viewport. ```APIDOC ## PreserveAspectRatio.FULLSCREEN ### Description Static variable representing the FULLSCREEN alignment for PreserveAspectRatio. It keeps the document's aspect ratio, scaling it to fill the entire viewport. ### Type Static variable ``` -------------------------------- ### viewPort Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/RenderOptions.html Describes the viewport into which the SVG should be rendered. ```APIDOC ## viewPort ### Description Describes the viewport into which the SVG should be rendered. ### Method `RenderOptions` viewPort(float minX, float minY, float width, float height) ### Endpoint N/A (Method Call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response - **RenderOptions**: The updated RenderOptions instance for chaining. ``` -------------------------------- ### SVG.getDocumentAspectRatio() Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html Returns the aspect ratio of the SVG document. ```APIDOC ## SVG.getDocumentAspectRatio() ### Description Returns the aspect ratio of the document as a width/height fraction. ### Method static ### Returns `float` - The aspect ratio of the document. ``` -------------------------------- ### setImageAsset Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SVGImageView.html Loads an SVG image from a file located in the application's assets folder. The filename should be the path relative to the assets directory. ```APIDOC ## setImageAsset ### Description Loads an SVG image from the given asset filename. ### Method `void setImageAsset(String filename)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **filename** (String) - Required - The name of the SVG file in the assets folder. ``` -------------------------------- ### renderToPicture Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html Renders the SVG document to a Picture object, with options for specifying dimensions or render options. ```APIDOC ## renderToPicture ### Description Renders this SVG document to a `Picture` object. Overloads allow for specifying dimensions or applying custom render options. ### Methods #### renderToPicture() #### renderToPicture(int width, int height) - **Parameters** - **width** (`int`) - The desired width of the Picture. - **height** (`int`) - The desired height of the Picture. #### renderToPicture(RenderOptions options) - **Parameters** - **options** (`RenderOptions`) - The render options to apply during rendering. #### renderToPicture(int width, int height, RenderOptions options) - **Parameters** - **width** (`int`) - The desired width of the Picture. - **height** (`int`) - The desired height of the Picture. - **options** (`RenderOptions`) - The render options to apply during rendering. ``` -------------------------------- ### renderToPicture (width, height) Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SVG.html Renders the SVG document to a Picture object with specified dimensions. The Picture is suitable for later rendering using `Canvas.drawPicture()`. ```APIDOC ## renderToPicture ### Description Renders this SVG document to a Picture object. ### Method public Picture renderToPicture(int widthInPixels, int heightInPixels) ### Parameters #### Path Parameters - **widthInPixels** (int) - Required - the width of the initial viewport - **heightInPixels** (int) - Required - the height of the initial viewport ### Returns #### Success Response - **Picture** - a Picture object suitable for later rendering using `Canvas.drawPicture(Picture)` ``` -------------------------------- ### getFromResource (Context) Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SVG.html Loads and parses an SVG resource from the Android application's resources using a Context. This is the standard way to include SVGs as app resources. ```APIDOC ## getFromResource (Context) ### Description Read and parse an SVG from the given resource location. ### Method `public static SVG getFromResource(Context context, int resourceId)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **context** (Context) - Required - the Android context of the resource. * **resourceId** (int) - Required - the resource identifier of the SVG document. ### Returns An SVG instance on which you can call one of the render methods. ### Throws * `SVGParseException` - if there is an error parsing the document. ``` -------------------------------- ### viewPort Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/RenderOptions.html Describes the viewport into which the SVG should be rendered. If this is not specified, then the whole of the canvas will be used as the viewport. If rendering to a `Picture` then a default viewport width and height will be used. ```APIDOC ## viewPort ### Description Describes the viewport into which the SVG should be rendered. If this is not specified, then the whole of the canvas will be used as the viewport. If rendering to a `Picture` then a default viewport width and height will be used. ### Parameters #### Path Parameters - **minX** (float) - The left X coordinate of the viewport - **minY** (float) - The top Y coordinate of the viewport - **width** (float) - The width of the viewport - **height** (float) - The height of the viewport ### Returns - this same `RenderOptions` instance ``` -------------------------------- ### Enum Constants: meet and slice Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/PreserveAspectRatio.Scale.html Defines how an SVG document is scaled within its viewport. 'meet' scales to fit without overflowing, potentially leaving blank space. 'slice' scales to fill the viewport, potentially clipping content. ```java public static final PreserveAspectRatio.Scale meet The document is scaled so that it is as large as possible without overflowing the viewport. There may be blank areas on one or more sides of the document. ``` ```java public static final PreserveAspectRatio.Scale slice The document is scaled so that entirely fills the viewport. That means that some of the document may fall outside the viewport and will not be rendered. ``` -------------------------------- ### PreserveAspectRatio.Scale Enum Methods Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/PreserveAspectRatio.Scale.html Static methods for the PreserveAspectRatio.Scale enum. ```APIDOC ## Methods ### `static PreserveAspectRatio.Scale valueOf(String name)` Returns the enum constant of this type with the specified name. ### `static PreserveAspectRatio.Scale[] values()` Returns an array containing the constants of this enum type, in the order they are declared. ``` -------------------------------- ### SVGView.setRenderingMethod(SVGView.RenderingMethod) Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html Sets the rendering method for the SVGView. ```APIDOC ## SVGView.setRenderingMethod(SVGView.RenderingMethod) ### Description Sets the rendering method for the `SVGView`. ### Method Not specified (assumed to be a method call on an SVGView object) ### Parameters * **method** (SVGView.RenderingMethod) - The rendering method to use. ``` -------------------------------- ### SVG.getDocumentDescription() Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html Returns the content of the `` element in the SVG document. ```APIDOC ## SVG.getDocumentDescription() ### Description Returns the contents of the `` element in the SVG document. ### Method static ### Returns `String` - The description of the SVG document. ``` -------------------------------- ### SVGView.setImageAsset(String) Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html Loads an SVG image from a given asset filename into an SVGView. ```APIDOC ## SVGView.setImageAsset(String) ### Description Loads an SVG image from the given asset filename into an `SVGView`. ### Method Not specified (assumed to be a method call on an SVGView object) ### Parameters * **assetFileName** (String) - The name of the SVG asset file. ``` -------------------------------- ### PreserveAspectRatio FULLSCREEN Constant Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/PreserveAspectRatio.html Represents a PreserveAspectRatio setting that scales the document to fill the entire viewport while maintaining its aspect ratio. ```java static PreserveAspectRatio FULLSCREEN ``` -------------------------------- ### renderViewToPicture Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html Renders a specific view within the SVG document to a Picture object. ```APIDOC ## renderViewToPicture ### Description Renders a specified view within the SVG document to a `Picture` object. This method is useful for rendering specific sections of an SVG defined as views. ### Method #### renderViewToPicture(String viewID, int width, int height) - **Parameters** - **viewID** (`String`) - The ID of the view to render. - **width** (`int`) - The desired width of the Picture. - **height** (`int`) - The desired height of the Picture. ``` -------------------------------- ### renderToCanvas with RenderOptions Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SVG.html Renders the SVG document to a Canvas object with advanced rendering options. ```APIDOC ## renderToCanvas ### Description Renders this SVG document to a Canvas object. ### Method public void renderToCanvas(Canvas canvas, RenderOptions renderOptions) ### Parameters #### Path Parameters - **canvas** (Canvas) - Required - The canvas to which the document should be rendered. - **renderOptions** (RenderOptions) - Required - Options that describe how to render this SVG on the Canvas. ### Since 1.3 ``` -------------------------------- ### renderViewToPicture Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SVG.html Renders a specific view within the SVG document to a Picture object. The rendering is performed at a specified width and height in pixels. ```APIDOC ## renderViewToPicture(String viewId, int widthInPixels, int heightInPixels) ### Description Renders this SVG document to a `Picture` using the specified view defined in the document. ### Method `renderViewToPicture` ### Parameters #### Path Parameters - **viewId** (String) - Required - The ID of the view to render. - **widthInPixels** (int) - Required - The desired width of the Picture in pixels. - **heightInPixels** (int) - Required - The desired height of the Picture in pixels. ### Returns A `Picture` object representing the rendered view. ``` -------------------------------- ### isFormatSupported Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SimpleAssetResolver.html Checks if the resolver supports the given MIME type. It supports SVG, JPEG, PNG, and other bitmap image formats compatible with Android's BitmapFactory. ```APIDOC ## isFormatSupported(String mimeType) ### Description Returns true when passed the MIME types for SVG, JPEG, PNG or any of the other bitmap image formats supported by Android's BitmapFactory class. ### Method `boolean isFormatSupported(String mimeType)` ### Parameters #### Query Parameters - **mimeType** (String) - The MIME type to check for support. ``` -------------------------------- ### hasViewBox Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/RenderOptions.html Checks if custom viewBox values have been provided. ```APIDOC ## hasViewBox ### Description Returns true if this RenderOptions instance has had a viewBox set with `viewBox()`. ### Method boolean ### Endpoint N/A (Method Call) ### Parameters None ### Response #### Success Response - **boolean**: true if viewBox is set, false otherwise. ``` -------------------------------- ### isFormatSupported Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SimpleAssetResolver.html Checks if the resolver supports a given MIME type. It returns true for SVG, JPEG, PNG, and other bitmap formats supported by Android's BitmapFactory. ```APIDOC ## isFormatSupported ### Description Returns true when passed the MIME types for SVG, JPEG, PNG or any of the other bitmap image formats supported by Android's BitmapFactory class. ### Method public boolean isFormatSupported(String mimeType) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response - **true** (boolean) - if the MIME type is supported. - **false** (boolean) - if the MIME type is not supported. ### Error Handling None explicitly documented. ``` -------------------------------- ### getRenderDPI Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SVG.html Retrieves the current render DPI setting. This value is used in the conversion of physical units to pixel values during rendering. ```APIDOC ## getRenderDPI ### Description Gets the current render DPI setting. ### Method public float getRenderDPI() ### Returns #### Success Response - **float** - the DPI value ``` -------------------------------- ### resolveCSSStyleSheet Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SimpleAssetResolver.html Attempts to find and return the string contents of a specified CSS stylesheet file located in the "assets" folder. ```APIDOC ## resolveCSSStyleSheet ### Description Attempt to find the specified stylesheet file in the "assets" folder and return its string contents. ### Method public String resolveCSSStyleSheet(String url) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response - **String** (String) - The string contents of the CSS stylesheet if found. #### Failure Response - **null** - if the stylesheet could not be found. ### Since 1.3 ### Error Handling None explicitly documented. ``` -------------------------------- ### SVGImageView.setImageAsset(String) Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html Loads an SVG image from a given asset filename into an SVGImageView. ```APIDOC ## SVGImageView.setImageAsset(String) ### Description Loads an SVG image from the given asset filename into an `SVGImageView`. ### Method Not specified (assumed to be a method call on an SVGImageView object) ### Parameters * **assetFileName** (String) - The name of the SVG asset file. ``` -------------------------------- ### hasViewBox Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/RenderOptions.html Returns true if this RenderOptions instance has had a viewBox set with `viewBox()`. ```APIDOC ## hasViewBox ### Description Returns true if this RenderOptions instance has had a viewBox set with `viewBox()`. ### Returns - true if this RenderOptions instance has had a viewBox set ``` -------------------------------- ### SVGView Class Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/allclasses-frame.html A base class for Android Views that render SVG content. ```APIDOC ## Class SVGView ### Description A base Android `View` class designed for rendering SVG content. It provides the foundation for displaying SVGs within the Android UI. ### Usage This class serves as a base for other SVG-displaying views, such as `SVGImageView`. ``` -------------------------------- ### resolveFont Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SimpleAssetResolver.html Attempts to find and load a specified font from the 'assets' folder, returning a Typeface object. It searches for .ttf and .otf files and respects font family, weight, and style. This method overrides the default implementation in SVGExternalFileResolver. ```APIDOC ## resolveFont ### Description Attempt to find the specified font in the "assets" folder and return a Typeface object. For the font name "Foo", first the file "Foo.ttf" will be tried and if that fails, "Foo.otf". ### Method `resolveFont(String fontFamily, int fontWeight, String fontStyle)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **fontFamily** (String) - Font family as specified in a font-family style attribute. * **fontWeight** (int) - Font weight as specified in a font-weight style attribute. * **fontStyle** (String) - Font style as specified in a font-style style attribute. ### Response #### Success Response * **Typeface** - An Android Typeface instance representing the loaded font. #### Response Example ``` // Returns a Typeface object or null if not found Typeface font = simpleAssetResolver.resolveFont("Roboto", 400, "normal"); ``` ### Overrides `[resolveFont](../../../com/caverock/androidsvg/SVGExternalFileResolver.html#resolveFont-java.lang.String-int-java.lang.String-)` in class `[SVGExternalFileResolver](../../../com/caverock/androidsvg/SVGExternalFileResolver.html "class in com.caverock.androidsvg")` ``` -------------------------------- ### SVGView.setMaxWidth(int) Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html Sets an optional maximum width for the SVGView. ```APIDOC ## SVGView.setMaxWidth(int) ### Description An optional argument to supply a maximum width for this view. ### Method Not specified (assumed to be a method call on an SVGView object) ### Parameters * **maxWidth** (int) - The maximum width for the view. ``` -------------------------------- ### PreserveAspectRatio.equals(Object) Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html Compares this PreserveAspectRatio instance with another object for equality. ```APIDOC ## PreserveAspectRatio.equals(Object obj) ### Description Compares this PreserveAspectRatio instance with another object for equality. ### Method instance ### Parameters #### Path Parameters - **obj** (Object) - Required - The object to compare with. ### Returns `boolean` - True if the objects are equal, false otherwise. ``` -------------------------------- ### SVG.getFromAsset Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SVG.html Reads and parses an SVG from the assets folder of an Android application. This method is suitable for SVGs stored in the `assets` directory. ```APIDOC ## SVG.getFromAsset ### Description Read and parse an SVG from the assets folder. ### Method `public static SVG getFromAsset(AssetManager assetManager, String filename)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response - **SVG** (SVG) - An SVG instance on which you can call one of the render methods. #### Response Example None ### Throws - **SVGParseException** - if there is an error parsing the document. - **IOException** - if there is some IO error while reading the file. ``` -------------------------------- ### SVG Class Methods Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SVG.html This section details the public methods available on the SVG class for interacting with SVG documents. ```APIDOC ## SVG Class Documentation This class is the main entry point for the AndroidSVG library. It provides static methods for loading and parsing SVG documents, and instance methods for rendering them. ### Static Methods * **`static void deregisterExternalFileResolver()`** * Description: De-registers the current `SVGExternalFileResolver` instance. ### Instance Methods * **`float getDocumentAspectRatio()`** * Description: Returns the aspect ratio of the document as a width/height fraction. * **`String getDocumentDescription()`** * Description: Returns the contents of the `` element in the SVG document. * **`float getDocumentHeight()`** * Description: Returns the height of the document as specified in the SVG file. * **`PreserveAspectRatio getDocumentPreserveAspectRatio()`** * Description: Returns the `PreserveAspectRatio` object associated with the SVG document. ``` -------------------------------- ### getDocumentDescription Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/SVG.html Retrieves the content of the `` element from the SVG document. ```APIDOC ## getDocumentDescription ### Description Returns the contents of the `` element in the SVG document. ### Method public String getDocumentDescription() ### Returns - **String** - Desc contents if available, otherwise an empty string. ### Throws - **IllegalArgumentException** - if there is no current SVG document loaded. ### Response Example (No explicit example provided in source) ``` -------------------------------- ### PreserveAspectRatio END Constant Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/com/caverock/androidsvg/PreserveAspectRatio.html Represents a PreserveAspectRatio setting that scales the document to fit neatly inside the viewport while maintaining its aspect ratio. ```java static PreserveAspectRatio END ``` -------------------------------- ### setCSS Source: https://github.com/bigbadaboom/androidsvg/blob/master/doc/index-all.html Directly sets the CSS for an SVG View or SVG ImageView. ```APIDOC ## setCSS(String) ### Description Directly set the CSS. ### Method [Method signature not explicitly defined, inferred as public void setCSS(String)] ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response None #### Response Example None ```