Start annotation
First, get the InMeetingAnnotationController instance from ZoomSDK.
InMeetingAnnotationController mAnnotationController = ZoomSDK.getInstance().getInMeetingService().getInMeetingAnnotationController();
Then, call startAnnotation method to start annotation.
private void startAnnotation()
{
mAnnotationController.startAnnotation();
mLineWidth = 2;
setRandomColor();
mAnnotationController.setToolType(AnnotationToolType.ANNO_TOOL_TYPE_PEN);
updateSelection(mPen);
mArrow.setVisibility(mAnnotationController.isPresenter() ? GONE : VISIBLE);
mSpotlight.setVisibility(mAnnotationController.isPresenter() ? VISIBLE : GONE);
}
Stop annotation
Stop annotation service is similar to start annotation, call
stopAnnotation method in mAnnotationController to stop the service.
public void stopAnnotation() {
if(mAnnotationController == null) return;
mAnnotationController.stopAnnotation();
mAnnotationController.setToolType(AnnotationToolType.ANNO_TOOL_TYPE_PEN);
updateSelection(mPen);
if(null != mColorTableView && mColorTableView.isShowing())
mColorTableView.dismiss();
if(null != mSaveTableView && mSaveTableView.isShowing())
mSaveTableView.dismiss();
}
Colors
Override the onColorChanged and the onColorPicked methods to add behavior to the above actions.
@Override
public void onColorChanged(View view, int newColor) {
}
@Override
public void onColorPicked(View view, int newColor) {
if(mAnnotationController != null)
mAnnotationController.setToolColor(newColor);
mColorImage.setColor(newColor);
}
To have random color, implement a setRandomColor method.
private void setRandomColor()
{
Random rand = new Random();
int index = rand.nextInt(9);
int color = ColorTable.COLOR_RED;
if(null != mColorTable){
color = mColorTable.getColorByIndex(index);
}
if(mAnnotationController != null)
mAnnotationController.setToolColor(color);
mColorImage.setColor(color);
}