As the current user's own state, teaching aids belong to the MemberState
management in the SDK.
public class Appliance {
// pencil
public final static String PENCIL = "pencil";
// choose
public final static String SELECTOR = "selector";
// rectangle
public final static String RECTANGLE = "rectangle";
// Ellipse
public final static String ELLIPSE = "ellipse";
// Rubber
public final static String ERASER = "eraser";
// text
public final static String TEXT = "text";
// straight
public final static String STRAIGHT = "straight";
// arrow
public final static String ARROW = "arrow";
// Hand tool, after switching, one finger can pan
public final static String HAND = "hand";
// Laser pointer, showing the user's mouse/finger position, but will not draw anything
public final static String LASER_POINTER = "laserPointer";
}
public class MemberState {
// Current tool, modifying it will switch tool. Specific parameters can refer to the constants in the appliance
private String currentApplianceName;
// The color of the line, write RGB in an array. The shape is [255, 128, 255].
private int[] strokeColor;
// The thickness of the line
private Double strokeWidth;
// font size of the text
private Double textSize;
... setter/getter
}
White SDK provides a variety of teaching aids. We can switch the current teaching aids by modifying memberState
. For example, to switch the current teaching aid to the "pencil" tool, the following code can be used.
MemberState memberState = new MemberState();
memberState.setCurrentApplianceName("pencil");
room.setMemberState(memberState);
The name of the teaching aid of the current room can be obtained by the following code.
room.getMemberState().getCurrentApplianceName();
The color of the palette can be modified by the following code.
MemberState memberState = new MemberState();
memberState.setStrokeColor(new int[]{255, 0, 0});
room.setMemberState(memberState);
By writing RGB in an array, the shape is [255, 0, 0] to represent the color of the palette.
You can also get the color of the current palette according to the following code.
room.getMemberState().getStrokeColor();
The color palette can affect the effects of pencil, rectangle, ellipse, and text tools.
2.2.0 New API
You can block teaching aids by the following methods.
// prohibit teaching aid operation
room.disableDeviceInputs(true);
// Restore teaching aid operation
room.disableDeviceInputs(false);