CompassFragment

public class CompassFragment extends Fragment implements View.OnTouchListener

Fields

ACTION_COMPASS_UPDATES

public static final String ACTION_COMPASS_UPDATES

DEGREE_CHAR

public static final char DEGREE_CHAR

mAzimuth

protected float mAzimuth

mBasePlate

protected ImageView mBasePlate

mBubbleView

protected BubbleSurfaceView mBubbleView

mCompass

protected CompassImage mCompass

mCurrentLocation

protected Location mCurrentLocation

mDeclination

protected float mDeclination

mDownX

protected float mDownX

mIsVibrationOn

protected boolean mIsVibrationOn

mParent

protected FrameLayout mParent

mSensorManager

protected SensorManager mSensorManager

mTvAzimuth

protected TextView mTvAzimuth

mVibrator

protected Vibrator mVibrator

sensorListener

protected SensorEventListener sensorListener

Methods

formatNumber

public static String formatNumber(Object value, int max, int min)

getAzimuth

protected float getAzimuth(float az)

getDeclination

public static float getDeclination(Location location, long timestamp)

getDeviceRotation

public int getDeviceRotation()

getDirectionCode

public static String getDirectionCode(float azimuth, Resources res)

onCreate

public void onCreate(Bundle savedInstanceState)

onCreateView

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

onDestroy

public void onDestroy()

onPause

public void onPause()

onResume

public void onResume()

onTouch

public boolean onTouch(View v, MotionEvent event)

rotateCompass

protected void rotateCompass(float angle)

setClickable

public void setClickable(boolean clickable)

setInterface

protected void setInterface()

setStyle

public void setStyle(boolean isNeedleOnly)

updateCompass

public void updateCompass(float azimuth)