-
Notifications
You must be signed in to change notification settings - Fork 15
Overview List Item Widget
Overview List Item Widget is a DUXBetaListItemLabelOnly type of widget which will display the overall status of the drone. The color of the text changes depending on the severity of the status. Following are examples of the widget states:
Disconnected
Normal
Warning
Error
To add the overview widget to your DUXBetaSmartListModel class, override buildModelLists and include DUXBetaOverviewListItemWidget.duxbeta_className() or [DUXBetaOverviewListItemWidget duxbeta_className] in your modelClassnameList:
@objc open class MySmartListModel : DUXBetaSmartListModel {
@objc open override func buildModelLists() {
super.buildModelLists()
self.modelClassnameList.append(DUXBetaOverviewListItemWidget.duxbeta_className())
}
}
@interface DUXBetaTestSmartListModel : DUXBetaSmartListModel
@end
@implementation DUXBetaTestSmartListModel
- (void)buildModelLists {
[super buildModelLists];
[self.modelClassnameList append:[DUXBetaOverviewListItemWidget duxbeta_className]];
}
@end
The UI elements can be customized to match the style of the user's application. The widget supports all the customizations that its parent, DUXBetaListItemLabelOnly, supports. An example of a customized states for messages to use the system yellow color for warnings instead of the default warning color could look something like this:
To get this effect we would use the following code:
overviewListWidget.warningValueColor = .yellow
overviewListWidget.warningValueColor = [UIColor yellowColor];
List message color customizations
-
UIColor *normalValueColor;
- The color to draw the information area text when active. (inherited) -
UIColor *warningValueColor;
- The color to use when displaing warning status messages. (inherited) -
UIColor *errorValueColor;
- The color to use when displaying error status messages. (inherited)
The widget provides hooks for the users to add functionality based on the state changes in the widget. The OverviewListItemStateWidget provides the following hooks
-
DUXBetaOverviewListItemModelState
- Provides hooks for events received by the widget from the widget model. It inherits from ListItemLabelButtonModelState and adds the following hooks:
-
+ (instancetype)overviewStateUpdated:(DJIWarningStatusItem*)newStatus;
- Status object with message and warning level when an new status is received.
DJI UX SDK Version 5 Beta 4.1