-
Notifications
You must be signed in to change notification settings - Fork 54
Camera Config White Balance Widget
(Updated widget in develop branch)
Camera Config White Balance Widget is created using Base Camera Config Widget and shows the camera's current white balance value. The widget shows the preset name in the label and the exact temperature value in the value.
<dji.ux.beta.visualcamera.widget.cameraconfig.wb.CameraConfigWBWidget
android:id="@+id/widget_camera_config_wb"
android:layout_width="wrap_content"
android:layout_height="50dp" />
The widget can be customized by the user to serve their purpose and theme. It supports all the customizations that its parent Base Camera Config Widget does. The customizations can be done using attributes in XML or programmatically using the APIs.
<dji.ux.beta.visualcamera.widget.cameraconfig.wb.CameraConfigWBWidget
android:id="@+id/widget_camera_config_wb"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:background="@color/white"
app:uxsdk_label_text_color="@color/blue"
app:uxsdk_value_normal_color="@color/red" />
List of the customizable XML attributes
-
uxsdk_cameraIndex
- The camera index to which the widget should react. -
uxsdk_lensType
- The type of lens to which the widget should react.
val cameraConfigWBWidget = findViewById<CameraConfigWBWidget>(R.id.widget_camera_config_wb)
cameraConfigWBWidget.setBackgroundColor(getResources().getColor(R.color.white))
cameraConfigWBWidget.labelTextColor = getResources().getColor(R.color.blue)
cameraConfigWBWidget.normalValueColor = getResources().getColor(R.color.red)
CameraConfigWBWidget cameraConfigWBWidget = findViewById(R.id.widget_camera_config_wb);
cameraConfigWBWidget.setBackgroundColor(getResources().getColor(R.color.white));
cameraConfigWBWidget.setLabelTextColor(getResources().getColor(R.color.blue));
cameraConfigWBWidget.setNormalValueColor(getResources().getColor(R.color.red));
List of the customization APIs
-
var cameraIndex: CameraIndex
- The camera index for which the widget should react. -
var lensType: LensType
- The type of the lens the widget is reacting to.
The widget provides hooks for users to add functionality based on state changes in the widget. The Camera Config WB widget provides the following hooks
-
ModelState
- Provides hooks for events received by the widget from the widget model.-
data class ProductConnected(val isConnected: Boolean) : ModelState()
- Event when product is connected or disconnected. -
data class WhiteBalanceStateUpdated(val whiteBalanceState: CameraConfigWBState) : ModelState()
- Event when camera white balance state is updated.
-
The user can subscribe to this using public override fun getWidgetStateUpdate(): Flowable<ModelState>
.
DJI UX SDK Version 5 Beta 5
UX SDK 5.0 Overview
Core Module
Camera Core Module
Visual Cameras Module
- Camera Config