# Fastboard API (/en/api-reference/api-ref/uikit-sdk)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

This page provides the API reference for the Fastboard SDK.


      
## Reference

## FastboardView class

### getFastboard

```java
public Fastboard getFastboard()
```

Get the `Fastboard` object.

The Fastboard SDK does not support initializing a `Fastboard` instance directly. To get the `Fastboard` object, you need to add the `FastboardView` object to the app's layout, and then call the `getFastboard` method.

**Note**

Call this method to obtain the `Fastboard` object before calling other APIs.

**Returns**

The `Fastboard` object is returned when the method call is successful.

## Fastboard class

The Fastboard class provides methods for creating `FastRoom` objects.

### createFastRoom

```java
public FastRoom createFastRoom(FastRoomOptions roomOptions)
```

Create a `FastRoom` object.

**Note**

Call this method after obtaining the `Fastboard` object.

**Parameters**

* `roomOptions`: Configuration options for the whiteboard room. See [FastRoomOptions](#roomoptions) for details.

**Returns**

A `FastRoom` object is returned when the method call is successful.

### preloadWhiteboardView

```java
public static void preloadWhiteboardView() {
    WhiteboardViewManager.get().preload();
}
```

Preload the whiteboard view.

This method only takes effect when `autoPreload` in [`FastboardConfig`](#fastboardconfig) is set to `false`. Successfully calling this method will consume memory to perform one whiteboard view preload, improving the speed of joining rooms next time.

### destroy

```java
public void destroy()
```

Destroy the room and release resources.

### setConfig

```java
public static void setConfig(FastboardConfig config)
```

Modifies the auxiliary configuration of the `Fastboard` object.

**Parameters**

* `config`: The auxiliary configuration of the `Fastboard` object. See [FastboardConfig](#fastboardconfig).

<a id="roomoptions" />

### FastRoomOptions

Whiteboard room configuration options.

```java
public class FastRoomOptions {
     private final String appId;
     private final String uuid;
     private final String token;
     private final String uid;
     private final boolean writable;

     private final FastRegion fastRegion;

     private Float containerSizeRatio;

     private FastUserPayload userPayload;

     public FastRoomOptions(String appId, String uuid, String token, String uid, FastRegion fastRegion) {
         this(appId, uuid, token, uid, fastRegion, true);
     }

     public FastRoomOptions(String appId, String uuid, String token, String uid, FastRegion fastRegion, boolean writable) {
         this.appId = appId;
         this.uuid = uuid;
         this.token = token;
         this.uid = uid;
         this.fastRegion = fastRegion;
         this.writable = writable;
     }
}
```

The `FastRoomOptions` class contains the following properties:

* `appId`: String. App Identifier for the interactive whiteboard project. For details, see [Get security credentials for your whiteboard project](/en/realtime-media/whiteboard/build/set-up-and-build-your-first-app/enable-whiteboard#get-security-credentials-for-your-whiteboard-project).

* `uuid`: String. The UUID of the room, which is the unique identifier of the room. For details, see [Create a room (POST)](/en/api-reference/api-ref/whiteboard/room-management#create-a-room-post) for the value of the `uuid` parameter in the response package body after the request is successful.

* `token`: String. Room Token of the room, used for user authentication when joining the room. It can be obtained in the following ways:

  * Call the [Generate a room token (POST)](/en/realtime-media/whiteboard/build/authenticate-users/generate-token-rest#generate-a-room-token-post) RESTful API.
  * Build a token generator at your app server. See [Generate a token at app server](/en/realtime-media/whiteboard/build/authenticate-users/generate-token-app-server).

* `uid`: String. The unique identifier of a user in string format. The maximum length is 1,024 bytes. Ensure that the `uid` of each user in the same room is unique.

* `writable`: boolean. Whether the user joins the whiteboard room in interactive mode:

  * `true`: Join the whiteboard room in interactive mode, that is, with read and write permissions.
  * `false`: Join the whiteboard room in subscription mode, that is, with read-only permission.

* `fastRegion`: The data center, which must be the same as the data center you chose when [creating the whiteboard room](/en/api-reference/api-ref/whiteboard/room-management#create-a-room-post). See [FastRegion](#fastregion).

* `containerSizeRatio`: Float. In the local display window, the aspect ratio of the content is `0.56` by default, which is `9:16`.

* `userPayload`: User information displayed by the user's cursor, including the user's nickname and avatar. See [`FastUserPayload`](#fastuserpayload) for details.

<a id="fastregion" />

### FastRegion

Data center, containing the following enumeration values:

* `CN_HZ`: Hangzhou, China, the service area covers East Asia, Southeast Asia, and other areas not covered by the data center.

* `US_SV`: Silicon Valley, USA, the service area covers North America and South America.

* `SG`: Singapore, the service area covers Singapore, East Asia, and Southeast Asia.

* `IN_MUM`: Mumbai, India, the service area covers India.

* `EU`: London, UK, the service area covers Europe.

### FastUserPayload

```java
public class FastUserPayload {
     private final String nickName;
     private final String avatar;

     public FastUserPayload(String nickName) {
         this(nickName, null);
     }

     public FastUserPayload(String nickName, String avatar) {
         this.nickName = nickName;
         this.avatar = avatar;
     }
}
```

`FastUserPayload` object, used to store the user information displayed on the cursor, contains the following member variables:

* `nickName`: String. The user's nickname displayed on the user's cursor.

* `avatar`: String. (Optional) The user avatar displayed on the user cursor, the URL address corresponding to the avatar should be passed in.

### FastboardConfig

```java
public class FastboardConfig {
    private final boolean enablePreload;
    private final int preloadCount;
    private final boolean autoPreload;
}
```

The auxiliary configuration class of the `Fastboard` object, including the following attributes:

* `enablePreload`: Boolean. Whether to enable whiteboard preloading:

  * `true`: Enable whiteboard preloading.
  * `false`: (Default) Disable whiteboard preloading.

* `preloadCount`: Integer. The number of WebViews to preload, defaults to `0`. The actual effect of this attribute is limited by the memory capacity. You need to adjust the settings appropriately according to the actual situation.

* `autoPreload`: Boolean. This property only takes effect when `enablePreload` is `true`. Whether to enable automatic preloading:

  * `true`: (Default) Enable automatic preloading. After enabling, whiteboard views will be automatically preloaded to improve loading speed, but will occupy additional memory.
  * `false`: Disable automatic preloading. After disabling, you can call [`preloadWhiteboardView`](#preloadwhiteboardview) to manually perform preloading.

## FastRoom class

The `FastRoom` class provides methods for managing interactive whiteboard real-time rooms.

### join \[1/2]

```java
public void join()
```

Join a whiteboard room.

**Note**

This method needs to be called after the `FastRoom` object is successfully created.

### join \[2/2]

```java
public void join(@Nullable OnRoomReadyCallback onRoomReadyCallback)
```

Join a whiteboard room.

**Note**

This method needs to be called after the `FastRoom` object is successfully created.

**Parameters**

* `onRoomReadyCallback`: [OnRoomReadyCallback](#roomready) interface instance. Passing in `null` means not to register the interface.

<a id="roomready" />

### OnRoomReadyCallback

The `OnRoomReadyCallback` interface is used to send room event notifications to the app and includes the following member methods:

```java
void onRoomReady(FastRoom fastRoom);
```

Room ready callback.

**Parameters**

* `fastRoom`: `FastRoom` object.

### isReady

```java
public boolean isReady()
```

Get whether the room is ready.

After calling the `join` method, you need to call this method to get whether the room is ready. After the room is ready, other methods in the `FastRoom` class can be called to operate the whiteboard.

**Returns**

Is the room ready?

* `true`: ready.
* `false`: Not ready yet.

### isWritable

```java
public boolean isWritable()
```

Get whether the local user's current interactive whiteboard real-time room is in interactive mode.

**Returns**

Get whether the local user is in interactive mode:

* `true`: interactive mode, that is, with read and write permissions.
* `false`: Subscription mode, that is, with read-only permissions.

### redo

```java
public void redo()
```

Redo, that is, roll back the undo operation.

### setWritable \[1/2]

```java
public void setWritable(boolean writable)
```

Set whether the user is in interactive mode in the room.

**Note**

This method needs to be called after the room is ready.

**Parameters**

* `writable`: whether the user is in interactive mode in the room:

  * `true`: interactive mode, that is, with read and write permissions.
  * `false`: Subscription mode, that is, with read-only permissions.

### setWritable \[2/2]

```java
public void setWritable(boolean writable, FastResult<Boolean> result)
```

Set whether the user is in interactive mode in the room.

**Note**

This method needs to be called after the room is ready.

**Parameters**

* `writable`: whether the user is in interactive mode in the room:

  * `true`: interactive mode, that is, with read and write permissions.
  * `false`: Subscription mode, that is, with read-only permissions.

* `result`: The result of the `setWritable` method call. See [FastResult](#result) for details. Passing in the `FastResult` instance, the SDK will trigger the callback implemented in the `FastResult` interface and report whether the `setWritable` method call is successful; passing in `null` means not to listen to the callback.

### registerApp

Registers a third-party window application to the whiteboard room.

```java
public void registerApp(FastRegisterAppParams params, FastResult<Boolean> result)
```

This method allows you to register external applications that can run as independent windows within the whiteboard.

Registration supports two methods:

1. **Local script registration**: Uses local JavaScript code (recommended for its high reliability)
2. **Remote package registration**: Uses a remote URL (may fail due to network issues)

<CalloutContainer type="warning">
  <CalloutTitle>
    Caution
  </CalloutTitle>

  <CalloutDescription>
    * You must complete the registration before joining the room to ensure the application loads correctly.
    * Ensure that all clients use the same version of the application to avoid runtime issues.
    * Register the application before joining the room.
    * Registered applications can be added to the room using `getRoom().addApp()`.
  </CalloutDescription>
</CalloutContainer>

**Parameters**

* `params`: Registration parameters, including app configurations. See [FastRegisterAppParams](#fastregisterappparams) for details.
* `result`: The result of the `registerApp` method call. See [FastResult](#result) for details. If you pass a `FastResult` instance, the SDK triggers the callback implemented in the `FastResult` interface to report whether the `registerApp` method call was successful. Passing `null` means the callback is not listened to.

### FastRegisterAppParams

A configuration class for registering third-party window app parameters.

```java
public class FastRegisterAppParams {
    private String javascriptString;
    private String kind;
    private String url;
    private Map<String, Object> appOptions;
    private String variable;

    public FastRegisterAppParams(String javascriptString, String kind, String variable, Map<String, Object> appOptions) {
        this.javascriptString = javascriptString;
        this.kind = kind;
        this.appOptions = appOptions;
        this.variable = variable;
    }

    public FastRegisterAppParams(String url, String kind, Map<String, Object> appOptions) {
        this.url = url;
        this.kind = kind;
        this.appOptions = appOptions;
    }

    public String getJavascriptString() {
        return javascriptString;
    }

    public String getKind() {
        return kind;
    }

    public String getUrl() {
        return url;
    }

    public Map<String, Object> getAppOptions() {
        return appOptions;
    }

    public String getVariable() {
        return variable;
    }
}
```

The `FastRegisterAppParams` class provides two registration methods:

1. **Local script registration**: Registers using a local JavaScript string (recommended for its high reliability)

   * Use the `FastRegisterAppParams(String javascriptString, String kind, String variable, Map<String, Object> appOptions)` constructor

2. **Remote package registration**: Registers using a published package's URL (may fail due to network issues)

   * Use the `FastRegisterAppParams(String url, String kind, Map<String, Object> appOptions)` constructor

The `FastRegisterAppParams` class includes the following properties:

* `javascriptString`: String. Local JavaScript script code for local script registration.
* `kind`: String. The name of the registered app, representing the type name of the app.
* `url`: String. The URL address of the remote registration package for remote package registration.
* `appOptions`: Map\<String, Object>. Parameters passed during the initialization of the app instance. This configuration is not synchronized to other clients and is considered a local setting, often used to toggle debug mode.
* `variable`: String. The variable name mounted on the window, appearing as `window.variable` after mounting.

### undo

```java
public void undo()
```

Undo the previous operation.

### setStrokeColor

```java
public void setStrokeColor(@ColorInt int color)
```

Set the line color.

**Parameters**

* `color`: Integer. Line color, RGB format, for example `0x0000FF` means blue

### setAppliance

```java
public void setAppliance(FastAppliance fastAppliance)
```

Set the currently used whiteboard tool.

**Parameters**

* `fastAppliance`: Whiteboard tool. See [FastAppliance](#appliance) for details.

<a id="appliance" />

### FastAppliance

Whiteboard tool, containing the following enumeration values:

* `CLICKER(Appliance.CLICKER)`: Click tool. Currently mainly used for clicking content on HTML5 files.

* `SELECTOR(Appliance.SELECTOR)`: Select tool.

* `HAND(Appliance.HAND)`: Grab tool, used to move the view.

* `PENCIL(Appliance.PENCIL)`: Pencil.

* `RECTANGLE(Appliance.RECTANGLE)`: Rectangle tool.

* `ELLIPSE(Appliance.ELLIPSE)`: Ellipse tool.

* `TEXT(Appliance.TEXT)`: text tool.

* `ERASER(Appliance.ERASER)`: Eraser tool.

* `PENCIL_ERASER(Appliance.PENCIL_ERASER)`: Pencil eraser tool, used to erase local pencil strokes.

* `LASER_POINTER(Appliance.LASER_POINTER)`: Laser pointer.

* `ARROW(Appliance.ARROW)`: Arrow.

* `STRAIGHT(Appliance.STRAIGHT)`: Straight line.

* `PENTAGRAM(Appliance.SHAPE, ShapeType.Pentagram)`: Pentagram.

* `RHOMBUS(Appliance.SHAPE, ShapeType.Rhombus)`: rhombus.

* `TRIANGLE(Appliance.SHAPE, ShapeType.Triangle)`: triangle.

* `BUBBLE(Appliance.SHAPE, ShapeType.SpeechBalloon)`: Speech bubble.

* `OTHER_CLEAR()`: Clear the whiteboard content.

### setStrokeWidth

```java
public void setStrokeWidth(int width)
```

Set the width of the line.

**Parameters**

* `width`: Integer. Line width (px).

### cleanScene

```java
public void cleanScene()
```

Clear the whiteboard content.

### setWritable

```java
public void setWritable(boolean writable)
```

Set whether the user is in interactive mode in the room.

**Parameters**

* `writable`: boolean. Whether the user is in interactive mode:

  * `true`: interactive mode, that is, with read and write permissions.
  * `false`: Subscription mode, that is, with read-only permissions.

### insertImage

```java
public void insertImage(String url, int width, int height)
```

Insert picture.

This method can insert and display the specified network image onto the current whiteboard page.

**Parameters**

* `url`: String. The URL address of the image. Please ensure that the app client can access the URL, otherwise the image will not be displayed properly.
* `width`: Integer. The width of the image (px).
* `height`: Integer. The height of the image (px).

### insertVideo

```java
public void insertVideo(String url, String title)
```

Insert and play audio and video in the whiteboard sub-window.

**Parameters**

* `url`: URL address of audio and video files. Please ensure that the app client can access the URL, otherwise the audio and video files cannot be loaded normally.
* `title`: window title.

### insertStaticDoc

```java
public void insertStaticDoc(DocPage[] pages, String title, FastResult<String> result)
```

Inserts a static document into a whiteboard subwindow.

**Parameters**

* `pages`: DocPage array. The page settings for the inserted document. See [DocPage](#docpage).
* `title`: String. The title of the subwindow.
* `result`: An object that implements the `FastResult` interface, used to handle the result of the method call. The SDK will use this object to report the result of the operation. If you do not need to listen to the callback, please pass in `null`.

### DocPage

```java
public class DocPage {
    private String src;
    private String preview;
    private Double width;
    private Double height;
}
```

A class for configuring the page settings for inserting documents. Includes the following attributes

* `src`: String. The address of the image or dynamic PPT page.

  * Image: URL address, which can be generated by yourself or by the document conversion function. You can get the address from the image field returned by the query conversion task progress. Make sure the App client can access the URL, otherwise the image cannot be loaded normally.
  * Dynamic PPT page: URI address generated by the document conversion function.

* `preview`: String. (Optional) URL address of the image or dynamic PPT preview image. The URL address of the dynamic PPT preview image can be obtained from the preview field returned by the query document conversion progress. After passing in, the preview image will be displayed on the left side of the App. Make sure the App client can access the URL, otherwise the preview image cannot be loaded normally.

* `width`: Integer. The width of the inserted document in the whiteboard (px).

* `height`: Integer. The height of the inserted document in the whiteboard (px).

### insertPptx

```java
public void insertPptx(String taskUuid, String prefixUrl, String title, FastResult<String> result)
```

Insert a dynamic document in a whiteboard sub-window.

This method can insert dynamic HTML web pages converted by the document conversion function.

**Parameters**

* `taskUUID`: String. The Task UUID of the document conversion task, which is the value of the `uuid` field in the response body when the initiate document conversion task request is successful.
* `prefixUrl`: String. The prefix path of the converted result file address, which is the value of the `prefix` field in the response body when the query document conversion progress request is successful.
* `title`: String. The title of the sub-window.
* `result`: An object that implements the `FastResult` interface, used to handle the result of the method call. The SDK will use this object to report the result of the operation. If you do not need to listen to the callback, please pass in `null`.

### insertDocs

```java
public void insertDocs(FastInsertDocParams params, FastResult<String> result)
```

**Note**

This method is deprecated since v1.6.0. Use [insertStaticDoc](#insertstaticdoc) or [insertPptx](#insertpptx) instead.

Insert and display documents in the whiteboard subwindow.

After successfully initiating the [document conversion task](/en/api-reference/api-ref/whiteboard/file-conversion), you can call this method and pass in the relevant parameters of the converted document. The SDK will automatically create a sub-window, insert and display the converted document in pages.

**Parameters**

* `params`: Insert the parameter settings of the document. See [FastInsertDocParams](#docparams) for details.
* `result`: `insertDocs` method call result. See [FastResult](#result) for details. Passing in the `FastResult` instance, the SDK will trigger the callback implemented in the `FastResult` interface and report whether the `insertDocs` method call is successful; passing in `null` means not to listen to the callback.

<a id="docparams" />

### FastInsertDocParams

Document parameter settings.

```java
public class FastInsertDocParams {
     private String taskUUID;
     private String taskToken;
     private FastRegion region;
     private ConverterType converterType;
     private String fileType;
     private Boolean dynamicDoc;
     private String title;
}
```

The `FastInsertDocParams` class contains the following properties:

* `taskUUID`: String. Task UUID of the document conversion task, that is, [Initiate document conversion task API](/en/api-reference/api-ref/whiteboard/file-conversion). When the request is successful, the uuid parameter in the response package body value.

* `taskToken`: String. The Task Token of the document conversion task must be consistent with the Task Token passed in when [Initiate document conversion task](/en/api-reference/api-ref/whiteboard/file-conversion).

* `converterType`: enumeration. The version of the document conversion service, the values are as follows:

  * `Projector`: new version. For details, see [New version of document conversion service](/en/realtime-media/whiteboard/build/display-files-and-manage-scenes/file-conversion-overview).
  * `WhiteboardConverter`: legacy (default). For details, see [Old version of the document conversion service](/en/realtime-media/whiteboard/reference/file-conversion-overview-deprecated).

* `fileType`: String. Document type:

  * `pdf`: static document.
  * `pptx`: dynamic document.

* `dynamicDoc`: boolean. Whether the document conversion task type is a dynamic conversion task.

* `title`: String. Window title.

### setFastStyle

```java
public void setFastStyle(FastStyle style)
```

Style the whiteboard user interface.

**Parameters**

* `style`: The style of the whiteboard user interface. See [FastStyle](#faststyle) for details.

<a id="faststyle" />

### FastStyle

Whiteboard user interface style.

```java
public class FastStyle {
     private int mainColor;
     private boolean darkMode;

     public FastStyle() {
     }

     public int getMainColor() {
         return mainColor;
     }

     public void setMainColor(@ColorInt int color) {
         this.mainColor = color;
     }

     public boolean isDarkMode() {
         return darkMode;
     }

     public void setDarkMode(boolean darkMode) {
         this.darkMode = darkMode;
     }

     public FastStyle copy() {
         FastStyle style = new FastStyle();
         style.mainColor = mainColor;
         style.darkMode = darkMode;
         return style;
     }
}
```

The `FastStyle` class contains the following member methods:

**getMainColor**

Gets the theme color of the whiteboard user interface.

**Returns**

The theme color for the whiteboard user interface.

**setMainColor**

Set the theme color of the whiteboard user interface.

This method can set the color of some button borders and prompt text when the whiteboard is loaded.

**Parameters**

* `color`: The theme color of the whiteboard user interface, RGB format, for example `0x0000FF` means blue.

**isDarkMode**

Gets whether the whiteboard user interface is in dark mode.

**Returns**

* `true`: Whiteboard user interface is in dark mode.
* `false`: The whiteboard user interface is in light mode.

**setDarkMode**

Set the whiteboard user interface to dark mode.

**Parameters**

* `darkMode`: whether to use dark mode:

  * `true`: dark mode.
  * `false`: light mode.

### setResource

```java
public void setResource(FastResource fastResource)
```

Set resources related to whiteboard color.

**Parameters**

* `fastResource`: Whiteboard color-related resources. See [FastResource](#fastresource) for details.

<a id="fastresource" />

### FastResource

Resources related to whiteboard colors.

```java
public class FastResource {
     @ColorInt
     public int getBackgroundColor(boolean darkMode) {
         return color(darkMode
                 ? R.color.fast_dark_mode_bg
                 : R.color.fast_light_mode_bg
         );
     }

     @ColorInt
     public int getBoardBackgroundColor(boolean darkMode) {
         return getBackgroundColor(darkMode);
     }
}
```

Contains the following member methods, all of which can be overridden to customize colors:

**getBackgroundColor**

Get the background color of the whiteboard control.

**Parameters**

* `darkMode`: boolean. Whether the background color of the whiteboard control is dark mode:

  * `true`: dark mode.
  * `false`: light mode.

**Returns**

Hexadecimal color value.

**getBoardBackgroundColor**

Get the whiteboard background color.

**Note**

If you do not override this method, `getBackgroundColor` will be called by default.

**Parameters**

* `darkMode`: boolean. Whether the whiteboard background color is dark mode:

  * `true`: dark mode.
  * `false`: light mode.

**Returns**

Hexadecimal color value.

## FastUiSettings class

The `FastUiSettings` class provides methods for setting up the whiteboard user interface.

### showRoomController

```java
public void showRoomController(ControllerId... ids)
```

Demonstrates controls on a whiteboard user interface.

**Parameters**

* `ids`: The identifier of the control. See [ControllerId](#controllerId) for details.

### hideRoomController

```java
public void hideRoomController(ControllerId... ids)
```

Hides controls on the whiteboard user interface.

**Parameters**

* `ids`: The identifier of the control. See [ControllerId](#controllerId) for details.

<a id="controllerId" />

### ControllerId

Controls on the whiteboard user interface, including the following enumeration values:

* `RedoUndo`: redo and undo buttons.
* `ToolBox`: Toolbar.
* `PageIndicator`: Page indicator.

### setToolsExpandAppliances

```java
public static void setToolsExpandAppliances(List<List<FastAppliance>> toolsExpandAppliances)
```

Sets the tool set included in the toolbar in expanded mode.

If the default toolbar provided by Fastboard SDK cannot meet your needs, you can call this method to customize the tools contained in the toolbar and set the toolbar to expand mode. You can pass in a secondary tool list in this method. The elements in the primary list will be expanded and displayed on the toolbar, and the elements in the secondary list will be collapsed.

After successfully calling the `setToolsExpandAppliances` method, if you need to switch the toolbar to collapsed mode, you can call [setToolboxExpand](#settoolboxexpand).

**Note**

This method needs to be called before joining the whiteboard room.

**Parameters**

* `toolsExpandAppliances`: Tools included in the toolbar in expanded mode. See [FastAppliance](#appliance) for details.

**Example**

```java
ArrayList<List<FastAppliance>> config = new ArrayList<>();
config.add(Arrays.asList(
         FastAppliance.CLICKER,
         FastAppliance.PENCIL,
         FastAppliance.TEXT,
         FastAppliance.SELECTOR,
         FastAppliance.ERASER
));
config.add(Arrays.asList(FastAppliance.SELECTOR));
config.add(Arrays.asList(FastAppliance.PENCIL));
config.add(Arrays.asList(FastAppliance.TEXT));
config.add(Arrays.asList(FastAppliance.ERASER));
config.add(Arrays.asList(
         FastAppliance.STRAIGHT,
         FastAppliance.ARROW,
         FastAppliance.RECTANGLE,
         FastAppliance.ELLIPSE,
         FastAppliance.PENTAGRAM,
         FastAppliance.RHOMBUS,
         FastAppliance.BUBBLE,
         FastAppliance.TRIANGLE
));
config.add(Arrays.asList(FastAppliance.OTHER_CLEAR));

FastUiSettings.setToolsExpandAppliances(config);
```

### setToolsCollapseAppliances

```java
public static void setToolsCollapseAppliances(List<FastAppliance> toolsCollapseAppliances)
```

Sets the tool set included in the toolbar in collapsed mode.

If the default toolbar provided by Fastboard SDK cannot meet your needs, you can call this method to customize the tools included in the toolbar and set the toolbar to fold mode. You can pass in a first-level tool list in this method, and the elements in the list will be collapsed on the toolbar by default.

After successfully calling the `setToolsCollapseAppliances` method, if you need to switch the toolbar to expanded mode, you can call [setToolboxExpand](#settoolboxexpand).

**Note**

This method needs to be called before joining the whiteboard room.

**Parameters**

* `toolsCollapseAppliances`: Tools included in the whiteboard toolbar. See [FastAppliance](#appliance) for details.

**Example**

```java
ArrayList<FastAppliance> collapseAppliances = new ArrayList<>();
collapseAppliances.add(FastAppliance.PENCIL);
collapseAppliances.add(FastAppliance.ERASER);
collapseAppliances.add(FastAppliance.ARROW);
collapseAppliances.add(FastAppliance.SELECTOR);
collapseAppliances.add(FastAppliance.TEXT);
collapseAppliances.add(FastAppliance.OTHER_CLEAR);

FastUiSettings.setToolsCollapseAppliances(collapseAppliances);
```

### setToolsColors

```java
public static void setToolsColors(List<Integer> toolsColors)
```

Set the color used by the whiteboard tool.

This method sets the color of graphics, lines, or text drawn using the whiteboard tool.

**Note**

This method needs to be called before joining the whiteboard room.

**Parameters**

* `toolsColors`: Color of whiteboard tools, RGB format, for example `0x0000FF` means blue.

### setStrokeRange

```java
public void setStrokeRange(int min, int max)
```

Sets the range for the line width slider in the toolbox.

This method configures the minimum and maximum values of the line width slider in the toolbox extension panel. Users can adjust the line width within this range when using drawing tools like pencils, rectangles, circles, etc. The default range is \[1, 24].

<CalloutContainer type="warning">
  <CalloutTitle>
    Caution
  </CalloutTitle>

  <CalloutDescription>
    * The line width slider will be restricted to the specified range.
    * If the current line width exceeds the new range, it will be constrained within the new range.
    * This setting affects all drawing tools that support line width adjustments.
  </CalloutDescription>
</CalloutContainer>

**Parameters**

* `min`: int. The minimum value for the line width (inclusive).
* `max`: int. The maximum value for the line width (inclusive).

### setToolboxEdgeMargin

```java
public void setToolboxEdgeMargin(int margin)
```

Set the margins between the whiteboard toolbar and the sides.

The definition of the margin is determined by the toolbar position set in `setToolboxGravity`:

* The toolbar is located on the left side of the whiteboard: the margin refers to the distance between the left side of the toolbar and the left side of the whiteboard.
* The toolbar is located on the right side of the whiteboard: the margin refers to the distance between the right side of the toolbar and the right side of the whiteboard.

**Parameters**

* `margin`: Integer. The distance between the toolbar and the side of the whiteboard, in `px`.

### setToolboxGravity

```java
public void setToolboxGravity(int gravity)
```

Set the position of the toolbar on the whiteboard.

**Parameters**

* `gravity`: The position of the toolbar on the whiteboard:

  * `Gravity.LEFT`: left.
  * `Gravity.RIGHT`: Right.

<a id="settoolboxexpand" />

### setToolboxExpand

```java
public void setToolboxExpand(boolean expand)
```

Set whether to expand the toolbar.

The default display state of the toolbar is related to the device. It is expanded by default on tablets and collapsed by default on mobile phones. You can call this method to modify the display state of the toolbar.

**Parameters**

* `expand`: Whether to expand the toolbar:

  * `true`: expand.
  * `false`: fold.

## FastLogger Class

The `FastLogger` class provides a flexible whiteboard runtime log recording tool that can easily record four different levels of log information: `debug`, `info`, `warn`, and `error`. The `FastLogger` class uses a `Logger` interface and provides a default implementation `DefaultLogger` to use the system's `Log` class.

### setLogger

```java
public static void setLogger(Logger logger)
```

Set custom logger.

**Parameters**

* `logger`: The logger instance. If you need to customize the logger, you need to pass in an implementation class of the `Logger` interface, see [`Logger`](#logger); passing in `null` will result in using the system default logger.

### Logger

Logger specification, including recording methods for all log levels.

### debug

```java
static void debug(String msg)
```

Records a debug log.

**Parameters**

* `msg`: String. Log message.

### info

```java
static void info(String msg)
```

Records an info log.

**Parameters**

* `msg`: String. Log message.

### warn

```java
static void warn(String msg)
```

Records a warn log.

**Parameters**

* `msg`: String. Log message.

### error

```java
static void error(String msg)
```

Records an error.

**Parameters**

* `msg`: String. Log message.

<a id="result" />

## FastResult

The result of the method call.

```java
public interface FastResult<T> {
   void onSuccess(T value);
   void onError(Exception exception);
}
```

The `FastResult` interface reports the results of method calls and includes the following callback methods:

* `onSuccess`: callback when the method call is successful.
* `onError`: callback when an error occurs.

    
  
      
  
      
  


## Platform-specific versions
- [Android](/en/api-reference/api-ref/uikit-sdk/android.md)
- [iOS](/en/api-reference/api-ref/uikit-sdk/ios.md)
- [Web](/en/api-reference/api-ref/uikit-sdk/web.md)
