DJI Mobile SDK Documentation

      class ShapeDescriptor

      class ShapeDescriptor 
      Package:dji.open.pilot.base.ui.model
      Description:

      Background shape descriptor that encapsulates background styles such as corner radius, stroke, and fill color.

      Supported since MSDK 5.20.1

      Class Members:
      method getCornerRadius
      float getCornerRadius() 
      Package:dji.open.pilot.base.ui.model
      Description:

      Gets the uniform corner radius of the four corners (dp).

      Supported since MSDK 5.20.1

      Return:
      floatThe uniform corner radius of the four corners (dp).
      method getCornerRadii
      float[] getCornerRadii() 
      Package:dji.open.pilot.base.ui.model
      Description:

      Gets the array of individual corner radii of the four corners (dp), which may be null.

      Supported since MSDK 5.20.1

      Return:
      float[]The array of individual corner radii of the four corners (dp), may be null.
      method getStrokeWidth
      int getStrokeWidth() 
      Package:dji.open.pilot.base.ui.model
      Description:

      Gets the stroke width (dp).

      Supported since MSDK 5.20.1

      Return:
      intThe stroke width (dp).
      method getStrokeColor
      int getStrokeColor() 
      Package:dji.open.pilot.base.ui.model
      Description:

      Gets the stroke color (ARGB).

      Supported since MSDK 5.20.1

      Return:
      intThe stroke color (ARGB).
      method getFillColor
      int getFillColor() 
      Package:dji.open.pilot.base.ui.model
      Description:

      Gets the fill color (ARGB).

      Supported since MSDK 5.20.1

      Return:
      intThe fill color (ARGB).
      method
      method getShape
      int getShape() 
      Package:dji.open.pilot.base.ui.model
      Description:

      Gets the shape type - SHAPE_RECTANGLE or SHAPE_OVAL.

      Supported since MSDK 5.20.1

      Return:
      intThe shape type - SHAPE_RECTANGLE or SHAPE_OVAL.
      method
      method toJson
      String toJson() 
      Package:dji.open.pilot.base.ui.model
      Description:

      Serializes the current object into a JSON string.

      Supported since MSDK 5.20.1

      Return:
      StringA JSON string, or an empty string on failure.
      method
      method fromJson
      static ShapeDescriptor fromJson(String json) 
      Package:dji.open.pilot.base.ui.model
      Description:

      Restores a ShapeDescriptor from a JSON string. Called by the server when processing RemoteViewProperty.BACKGROUND_SHAPE.

      Supported since MSDK 5.20.1

      Input Parameters:
      String jsonThe string generated by toJson().
      Return:
      static ShapeDescriptorThe restored ShapeDescriptor, or null if parsing fails.
      class
      class Builder ↗
      static class Builder
      描述

      ShapeDescriptor builder.

      MSDK 5.20.1开始支持