-
Notifications
You must be signed in to change notification settings - Fork 54
Location Widget
Siddharth Utgikar edited this page Dec 22, 2020
·
1 revision
The Location Widget is a TEXT_IMAGE_LEFT type of Base Telemetry Widget. It shows the current geo location which constitutes the latitude and longitude as reported by the drone. It updates the coordinates in real time and provides a precision up to 6 decimal places.
State | Image |
---|---|
Disconnected or Location Unavailable | |
Location Available |
<dji.ux.beta.core.widget.location.LocationWidget
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
The UI elements can be customized to match the style of the user's application. The widget supports all the Text Customizations and Icon Customizations provided in the Base Telemetry Widget.
<dji.ux.beta.core.widget.location.LocationWidget
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/white"
app:uxsdk_widget_icon="@drawable/ic_custom_location"
app:uxsdk_value_text_color="@color/blue"/>
State | Image |
---|---|
Disconnected or Location Unavailable | |
Location Available |
val locationWidget: LocationWidget = findViewById(R.id.widget_location)
locationWidget.setBackgroundColor(resources.getColor(R.color.white))
locationWidget.valueTextColor = resources.getColor(R.color.blue)
locationWidget.widgetIcon = resources.getDrawable(R.drawable.ic_custom_location)
LocationWidget locationWidget = findViewById(R.id.widget_location);
locationWidget.setBackgroundColor(getResources().getColor(R.color.white));
locationWidget.setValueTextColor(getResources().getColor(R.color.blue));
locationWidget.setWidgetIcon(getResources().getDrawable(R.drawable.ic_custom_location));
The widget provides hooks for the users to add functionality based on the state changes in the widget. The LocationWidget provides the following hooks
-
ModelState
- Provides hooks in events received by the widget from the widget model.-
data class ProductConnected(val isConnected: Boolean) : ModelState()
- Event when the product is connected or disconnected. -
data class LocationStateUpdated(val locationState: LocationState) : ModelState()
- Event when the aircraft location 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