AttitudeView

Additional

Language
Java
Version
N/A
Created
Jan 25, 2017
Updated
Jan 26, 2017 (Retired)
Owner
Andres Rengifo (andresR8)
Contributor
Andres Rengifo (andresR8)
1
Activity
Badge
Generate
Download
Source code

Android - AttitudeView

Android attitude view for drones, airplanes, rovs and mobile robots.

Demo


How install it

How to use it

  1. In XML File:

  2. In the root ViewGroup property of your layout, specify: xmlns:custom="http://schemas.android.com/apk/res-auto";

  3. Within the ViewGroup, add the following code: <package.AttitudeView android:id="@+id/attitudeView" android:layout_width="300dp" android:layout_height="300dp" />

  4. To change the color of the numbers: custom:textC="@android:color/black"

  5. To change the color of the ticks in the pitch indicator use:custom:lineC="@android:color/black""

  6. To change the background color of the roll indicator use: custom:markerC="#fff741"

  7. In Code:

AttitudeView  av= (AttitudeView) findViewById(R.id.attitudeView);
// Specify the property like layout params
av.setPitch(20); // Update the Pitch value in degrees.
float pitch=av.getPitch(); // Update get the actual pitch value degrees.
av.setRoll(10); // Update the Roll value in degrees.
float roll=av.getRoll(); // Update get the actual roll value degrees.

For further details, checkout the AttitudeView.java class.