-
Notifications
You must be signed in to change notification settings - Fork 55
AMSL Altitude Widget
Siddharth Utgikar edited this page Dec 22, 2020
·
2 revisions
The AMSL Altitude Widget is a TEXT type of Base Telemetry Widget. It shows the current above-mean-sea-level(AMSL) altitude, which is the altitude of the aircraft against the average sea level.
State | Image |
---|---|
Disconnected | |
Metric Unit System | |
Imperial Unit System |
<dji.ux.beta.core.widget.altitude.AMSLAltitudeWidget
android:layout_width="wrap_content"
android:layout_height="150dp" />
The UI elements can be customized to match the style of the user's application. The widget supports all the Text Customizations provided in the Base Telemetry Widget.
<dji.ux.beta.core.widget.altitude.AMSLAltitudeWidget
android:layout_width="wrap_content"
android:layout_height="150dp"
android:background="@color/white"
app:uxsdk_label_text_color="@color/black"
app:uxsdk_value_text_color="@color/blue"
app:uxsdk_unit_text_color="@color/blue"/>
State | Image |
---|---|
Disconnected | |
Metric Unit System | |
Imperial Unit System |
val amslAltitudeWidget = AMSLAltitudeWidget(context)
amslAltitudeWidget.setBackgroundColor(resources.getColor(R.color.white))
amslAltitudeWidget.labelTextColor = resources.getColor(R.color.black)
amslAltitudeWidget.valueTextColor = resources.getColor(R.color.blue)
amslAltitudeWidget.unitTextColor = resources.getColor(R.color.blue)
AMSLAltitudeWidget amslAltitudeWidget = new AMSLAltitudeWidget(this);
amslAltitudeWidget.setBackgroundColor(getResources().getColor(R.color.white));
amslAltitudeWidget.setLabelTextColor(getResources().getColor(R.color.black));
amslAltitudeWidget.setValueTextColor(getResources().getColor(R.color.blue));
amslAltitudeWidget.setUnitTextColor(getResources().getColor(R.color.blue));
The widget provides hooks for the users to add functionality based on the state changes in the widget. The AMSLAltitudeWidget 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 AltitudeStateUpdated(val altitudeState: AltitudeState) : ModelState()
- Event when altitude of the drone 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