Some widget not showing in app
539 3 2022-3-12
Uploading and Loding Picture ...(0/1)
o(^-^)o
djiuser_YDso2sK4VXB6
lvl.2

Belgium
Offline

I'm trying to use some of the available widgets but some of them are not showing while the others do.
For example if I put in may RelativeLayout

        <dji.ux.widget.RadarWidget
            android:layout_width="340dp"
            android:layout_height="160dp"
            android:layout_centerHorizontal="true"
            android:layout_alignParentBottom="true"/>

it works like a charm but both BatteryWidget and RemainingFlightTimeWidget are not showing:

    <dji.ux.widget.RemainingFlightTimeWidget
        android:id="@+id/mission_flight_time"
        android:layout_width="match_parent"
        android:layout_height="100dp"
        android:layout_marginTop="6dp"
        android:layout_marginLeft="6dp"
        android:layout_marginRight="30dp"
        android:layout_toLeftOf="@id/mission_battery_widget"/>

    <dji.ux.widget.BatteryWidget
        android:id="@+id/mission_battery_widget"
        android:layout_width="96dp"
        android:layout_height="22dp"
        android:layout_margin="6dp"
        android:layout_alignParentRight="true"
        custom:excludeView="singleVoltage"/>

I use version 4.16 (but same issue on 4.14.1)

    implementation 'com.dji:dji-uxsdk:4.16'`
    compileOnly 'com.dji:dji-sdk-provided:4.16'`

and my colors needed are all defined. Is it a bug or would you have any ideas?


2022-3-12
Use props
Mats Bohlinsson
Second Officer
Flight distance : 1838077 ft
  • >>>
Sweden
Offline

I use:
       <dji.ux.widget.BatteryWidget
            android:layout_width="96dp"
            android:layout_height="22dp"
            custom:excludeView="singleVoltage"/>

In a LinearLayout.
Works.

Have you checked the example project? Does it show up there?
2022-3-12
Use props
djiuser_YDso2sK4VXB6
lvl.2

Germany
Offline

I finally found the solution. The widget has to be in a LinearLayout for the status widget and for the remaining time it has to have a height of 28dp (idk why)
2022-3-14
Use props
NickFury1
lvl.1

Ukraine
Offline

That's awesome, thanks a lot for information
2023-10-25
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules