Skip to main content

Configure Brush

VideoEditor SDK supports several configuration options for the BrushToolPanel allowing flexible adaptation to different needs and use cases.

Set available tools#

By default, all available brush tools are enabled. For this example only a couple are enabled.

Default brush tool color#

The default color of the brush stroke is white. If you can anticipate that your use case requires a different default color you can do so using the setDefaultBrushColor() method.

Set available colors#

The default color palette provides multiple colors. Here, we only provide a small selection of colors as might be sensible for an annotation use case.

Default brush size#

Similarly, the size of the brush is set at 5% relative to the smaller side of the video by default. In our example, we change it to 8%.

class VideoBrushConfiguration(private val activity: AppCompatActivity) : Example(activity) {
override fun invoke() {
// In this example, we do not need access to the Uri(s) after the editor is closed
// so we pass false in the constructor
val settingsList = VideoEditorSettingsList(false)
// Set the source as the Uri of the video to be loaded
.configure<LoadSettings> {
it.source = activity.resourceUri(R.raw.skater)
settingsList.configure<UiConfigBrush> {
// By default all available brush tools are enabled.
// For this example only a couple are enabled.
BrushColorOption(BrushToolPanel.OPTION_COLOR, Color.TRANSPARENT),
// By default the default color for the brush stroke is white
// For this example the default color is set to black
// By default the editor provides a variety of different colors to customize the color of the brush stroke
// For this example only a small selection of colors is enabled
ColorItem(, ColorAsset(-0x1)),
ColorItem(, ColorAsset(-0x1000000)),
ColorItem(, ColorAsset(-0x18afb0))
settingsList.configure<BrushSettings> {
// By default the default brush size is set to 5% of the smaller side of the video
// For this example, we change it to 8%
it.brushSize = 0.08f
// Start the video editor using VideoEditorBuilder
// The result will be obtained in onActivityResult() corresponding to EDITOR_REQUEST_CODE
.startActivityForResult(activity, EDITOR_REQUEST_CODE)
// Release the SettingsList once done
override fun onActivityResult(requestCode: Int, resultCode: Int, intent: Intent?) {
intent ?: return
if (requestCode == EDITOR_REQUEST_CODE) {
// Wrap the intent into an EditorSDKResult
val result = EditorSDKResult(intent)
when (result.resultStatus) {
EditorSDKResult.Status.CANCELED -> showMessage("Editor cancelled")
EditorSDKResult.Status.EXPORT_DONE -> showMessage("Result saved at ${result.resultUri}")
else -> {