public class

CompassCalibrationFragment

extends DialogFragment
implements SensorEventListener
java.lang.Object
   ↳ android.app.Fragment
     ↳ android.app.DialogFragment
       ↳ com.steerpath.sdk.maps.defaults.CompassCalibrationFragment

Class Overview

DialogFragment that contains instructions for compass calibration. Example usage:

FragmentManager fragmentManager = getFragmentManager();
CompassCalibrationFragment fragment = CompassCalibrationFragment.newInstance(R.layout.fragment_compass_calibration);
fragment.setOnDismissListener(new DialogInterface.OnDismissListener() {
public void onDismiss(DialogInterface dialogInterface) {
// do something
}
});

fragment.show(fragmentManager, "compass-calibration-fragment");

Added in 3.0.0-rc38

Summary

[Expand]
Inherited Constants
From class android.app.DialogFragment
From interface android.content.ComponentCallbacks2
Public Constructors
CompassCalibrationFragment()
Public Methods
static boolean isCompassCalibrationNeeded(Context context)
Naive method to check if compass needs calibration.
static CompassCalibrationFragment newInstance(int layoutResId)
Creates new DialogFragment.
void onAccuracyChanged(Sensor sensor, int i)
void onCreate(Bundle savedInstanceState)
View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
void onDismiss(DialogInterface dialog)
void onSensorChanged(SensorEvent sensorEvent)
void onStart()
void setOnDismissListener(DialogInterface.OnDismissListener listener)
Sets OnDismissListener to notify when DialogFragment has been dismissed.
[Expand]
Inherited Methods
From class android.app.DialogFragment
From class android.app.Fragment
From class java.lang.Object
From interface android.content.ComponentCallbacks
From interface android.content.ComponentCallbacks2
From interface android.content.DialogInterface.OnCancelListener
From interface android.content.DialogInterface.OnDismissListener
From interface android.hardware.SensorEventListener
From interface android.view.View.OnCreateContextMenuListener

Public Constructors

public CompassCalibrationFragment ()

Public Methods

public static boolean isCompassCalibrationNeeded (Context context)

Naive method to check if compass needs calibration. Calibrate once in hour.
Deprecated. Use CompassUtils instead.

public static CompassCalibrationFragment newInstance (int layoutResId)

Creates new DialogFragment.

Requirements for the layout:
- must contain View with id: @+id/compass_calibration_done
- must contain TextView with id: @+id/compass_calibration_accuracy

Default layout is R.layout.fragment_compass_calibration

public void onAccuracyChanged (Sensor sensor, int i)

public void onCreate (Bundle savedInstanceState)

public View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)

public void onDismiss (DialogInterface dialog)

public void onSensorChanged (SensorEvent sensorEvent)

public void onStart ()

public void setOnDismissListener (DialogInterface.OnDismissListener listener)

Sets OnDismissListener to notify when DialogFragment has been dismissed.