-
Notifications
You must be signed in to change notification settings - Fork 54
Camera Config Exposure Value Widget
Siddharth Utgikar edited this page Feb 26, 2021
·
3 revisions
(Updated widget in develop branch)
Camera Config Exposure Value Widget is created using Base Camera Config Widget and shows the camera's current exposure compensation value.
<dji.ux.beta.visualcamera.widget.cameraconfig.ev.CameraConfigEVWidget
android:id="@+id/widget_camera_config_ev"
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.ev.CameraConfigEVWidget
android:id="@+id/widget_camera_config_ev"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:background="@color/white"
app:uxsdk_label_text_color="@color/black"
app:uxsdk_value_normal_color="@color/blue"/>
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 cameraConfigEVWidget = findViewById<CameraConfigWBWidget>(R.id.widget_camera_config_ev)
cameraConfigEVWidget.setBackgroundColor(getResources().getColor(R.color.white))
cameraConfigEVWidget.labelTextColor = getResources().getColor(R.color.black)
cameraConfigEVWidget.normalValueColor = getResources().getColor(R.color.blue)
CameraConfigEVWidget cameraConfigEVWidget = findViewById(R.id.widget_camera_config_ev);
cameraConfigEVWidget.setBackgroundColor(getResources().getColor(R.color.white));
cameraConfigEVWidget.setLabelTextColor(getResources().getColor(R.color.black));
cameraConfigEVWidget.setNormalValueColor(getResources().getColor(R.color.blue));
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 Exposure Value 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 EVStateUpdated(val cameraConfigEVState: CameraConfigEVState) : ModelState()
- Event when camera exposure value 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