Skip to content

Top Bar Panel Widget

Cristina Suciu edited this page Dec 23, 2020 · 2 revisions

The TopBarWidget is a specialized subclass of Bar Panel Widget configured to work in an horizontal orientation. It is provided to display the standard list of status bar widgets. The top bar panel widget provides an option to organize its child widgets into left side widgets and right side widgets.

The top bar panel widget contains:

Left Side Widgets

Right Side Widgets

The top bar panel is seen as below:

Disconnected State

Connected State

Usage

This is a good example of how you can create a self contained bar panel widget. The widget adds its own widget list in the subclass implementation of viewDidLoad. The next step is to specify the configuration of the widget in defaultConfigurationSetup as follows:

Swift

public override func defaultConfigurationSetup() {
    let config = DUXBetaPanelWidgetConfiguration(type:.bar, variant:.horizontal)
    let _ = configure(config)
}

Objective-C

- (void)defaultConfigurationSetup {
    DUXBetaPanelWidgetConfiguration *configuration = [[DUXBetaPanelWidgetConfiguration alloc] initWithType:DUXBetaPanelTypeBar variant:DUXBetaPanelVariantHorizontal];
    [self configure:configuration];
}

In order to instantiate and use this widget, do the following:

Swift

let topBarWidget = DUXBetaTopBarWidget()
topBarWidget.install(in: self)

Objective-C

DUXBetaTopBarWidget *topBarWidget = [[DUXBetaTopBarWidget alloc] init];
[topBarWidget installInViewController:self];

Customizations

The widget supports all the customizations that its parent Bar Panel Widget supports. Individual elements of the panel can also be customized using the properties exposed by the top bar panel.

APIs

List of the customization APIs
Clone this wiki locally