com.dopanic.panicarkit.lib
Class PARFragment

java.lang.Object
  extended by Fragment
      extended by com.dopanic.panicarkit.lib.PARFragment
All Implemented Interfaces:
PSKEventListener

public class PARFragment
extends Fragment
implements PSKEventListener


Field Summary
protected  PARView _arView
          AR container layout
protected  PARCameraView _cameraView
          Camera view
protected static PARFragment activeFragment
           
protected  AlertDialog airplaneModeDialog
           
protected  boolean hasAirplaneModeDialog
           
protected  boolean isInAirplaneMode
           
protected  int viewLayoutId
          Required layout resource id for AR content
 
Constructor Summary
PARFragment()
           
 
Method Summary
protected  void checkForAirplaneMode()
           
 PARProgressBar createProgressBar()
           
protected  void drawLabels()
           
static PARFragment getActiveFragment()
           
 PARView getARView()
           
 PARCameraView getCameraView()
          Returns CameraView
 int getCurrentARViewVisbility()
           
 TextView getDebugTextView()
           
 float[] getPerspectiveCameraMatrix()
          Get perspective camera matrix
 PARProgressBar getProgressBar()
           
 PARRadarView getRadarView()
           
 int getScreenMargin()
          Get screen margin
 Point getScreenSize()
          Get screen size (x,y)
static boolean isAirplaneModeOn(Context context)
          Gets the state of Airplane Mode.
 void onAirplaneModeDetected(boolean airplaneMode)
           
 void onARNotSupportedRaised()
           
 void onCreate(Bundle savedInstance)
           
 View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
          Android onCreateView
 void onDeviceOrientationChanged(PSKDeviceOrientation newOrientation)
          callback when device orientation changes
 void onLocationChangedEvent(Location location)
          callback when location is updated
 void onPause()
           
 void onResume()
           
protected  void onUpdateDebugLabel()
           
 void setARViewShouldBeVisible(boolean arViewShouldBeVisible)
           
 void setCameraView(PARCameraView cameraView)
          Sets the cameraView
 boolean shouldARViewBeVisible()
           
 void updateRadarOnOrientationChange(PSKDeviceOrientation newOrientation)
          called when device orientation changes override to disable or change radar behaviour
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

activeFragment

protected static PARFragment activeFragment

_cameraView

protected PARCameraView _cameraView
Camera view


_arView

protected PARView _arView
AR container layout


viewLayoutId

protected int viewLayoutId
Required layout resource id for AR content


isInAirplaneMode

protected boolean isInAirplaneMode

hasAirplaneModeDialog

protected boolean hasAirplaneModeDialog

airplaneModeDialog

protected AlertDialog airplaneModeDialog
Constructor Detail

PARFragment

public PARFragment()
Method Detail

getActiveFragment

public static PARFragment getActiveFragment()

onCreate

public void onCreate(Bundle savedInstance)

onCreateView

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

Parameters:
inflater - Layout inflater
container - Container
savedInstanceState - Saved instance
Returns:
View created

onResume

public void onResume()

onARNotSupportedRaised

public void onARNotSupportedRaised()

onPause

public void onPause()

createProgressBar

public PARProgressBar createProgressBar()

isAirplaneModeOn

public static boolean isAirplaneModeOn(Context context)
Gets the state of Airplane Mode.

Parameters:
context -
Returns:
true if enabled.

onUpdateDebugLabel

protected void onUpdateDebugLabel()

checkForAirplaneMode

protected void checkForAirplaneMode()

onAirplaneModeDetected

public void onAirplaneModeDetected(boolean airplaneMode)

drawLabels

protected void drawLabels()

getCameraView

public PARCameraView getCameraView()
Returns CameraView

Returns:
PARCameraView

setCameraView

public void setCameraView(PARCameraView cameraView)
Sets the cameraView

Parameters:
cameraView - Camera view

getPerspectiveCameraMatrix

public float[] getPerspectiveCameraMatrix()
Get perspective camera matrix

Returns:
Camera perspective matrix

getScreenMargin

public int getScreenMargin()
Get screen margin

Returns:
Screen margin

getScreenSize

public Point getScreenSize()
Get screen size (x,y)

Returns:
Screen size

getRadarView

public PARRadarView getRadarView()
Returns:
the radar view (if any)

getARView

public PARView getARView()
Returns:
the view all POIs are rendered in

onLocationChangedEvent

public void onLocationChangedEvent(Location location)
callback when location is updated

Specified by:
onLocationChangedEvent in interface PSKEventListener

onDeviceOrientationChanged

public void onDeviceOrientationChanged(PSKDeviceOrientation newOrientation)
callback when device orientation changes

Specified by:
onDeviceOrientationChanged in interface PSKEventListener
Parameters:
newOrientation -

updateRadarOnOrientationChange

public void updateRadarOnOrientationChange(PSKDeviceOrientation newOrientation)
called when device orientation changes override to disable or change radar behaviour


getDebugTextView

public TextView getDebugTextView()

shouldARViewBeVisible

public boolean shouldARViewBeVisible()

setARViewShouldBeVisible

public void setARViewShouldBeVisible(boolean arViewShouldBeVisible)

getCurrentARViewVisbility

public int getCurrentARViewVisbility()

getProgressBar

public PARProgressBar getProgressBar()



Copyright © 2014 doPanic GmbH. All rights reserved.