public class AndroidHarnessFragment extends android.app.Fragment implements TouchListener, android.content.DialogInterface.OnClickListener, android.view.View.OnLayoutChangeListener, SystemListener
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
appClass
The application class to start
|
protected java.lang.String |
audioRendererType
Sets the type of Audio Renderer to be used.
|
protected int |
eglAlphaBits
Sets the desired number of Alpha bits for the surfaceview.
|
protected int |
eglBitsPerPixel
Sets the desired RGB size for the surfaceview.
|
protected int |
eglDepthBits
The number of depth bits specifies the precision of the depth buffer.
|
protected int |
eglSamples
Sets the number of samples to use for multisampling.
Leave 0 (default) to disable multisampling. Set to 2 or 4 to enable multisampling. |
protected int |
eglStencilBits
Set the number of stencil bits.
|
protected java.lang.String |
exitDialogMessage
Message of the exit dialog, default is "Use your home key to bring this
app into the background or exit to terminate it."
|
protected java.lang.String |
exitDialogTitle
Title of the exit dialog, default is "Do you want to exit?"
|
protected boolean |
finishOnAppStop
if true finish this activity when the jme app is stopped
|
protected android.widget.FrameLayout |
frameLayout |
protected int |
frameRate
Set the desired frame rate.
|
protected boolean |
handleExitHook
set to false if you don't want the harness to handle the exit hook
|
protected boolean |
joystickEventsEnabled
If true Android Sensors are used as simulated Joysticks.
|
protected boolean |
keyEventsEnabled
If true KeyEvents are generated from TouchEvents
|
protected int |
maxResolutionDimension
Set the maximum resolution for the surfaceview in either the
width or height screen direction depending on the screen size.
|
protected boolean |
mouseEventsEnabled
If true MouseEvents are generated from TouchEvents
|
protected boolean |
mouseEventsInvertX
Flip X axis
|
protected boolean |
mouseEventsInvertY
Flip Y axis
|
protected android.widget.ImageView |
splashImageView |
protected int |
splashPicID
Splash Screen picture Resource ID.
|
protected android.opengl.GLSurfaceView |
view |
Constructor and Description |
---|
AndroidHarnessFragment() |
Modifier and Type | Method and Description |
---|---|
void |
createLayout() |
void |
destroy()
Callback to indicate that the context has been destroyed (either
by the user or requested by the application itself).
|
void |
gainFocus()
Called when the application gained focus.
|
Application |
getJmeApplication() |
void |
handleError(java.lang.String errorMsg,
java.lang.Throwable t)
Called when an error has occurred.
|
void |
initialize()
Callback to indicate the application to initialize.
|
protected void |
initializeLogHandler()
Removes the standard Android log handler due to an issue with not logging
entries lower than INFO level and adds a handler that produces
JME formatted log messages.
|
void |
loseFocus()
Called when the application lost focus.
|
void |
onActivityCreated(android.os.Bundle savedInstanceState) |
void |
onAttach(android.app.Activity activity) |
void |
onClick(android.content.DialogInterface dialog,
int whichButton)
Called by the android alert dialog, terminate the activity and OpenGL
rendering
|
void |
onCreate(android.os.Bundle savedInstanceState)
This Fragment uses setRetainInstance(true) so the onCreate method will only
be called once.
|
android.view.View |
onCreateView(android.view.LayoutInflater inflater,
android.view.ViewGroup container,
android.os.Bundle savedInstanceState)
Called by the system to create the View hierarchy associated with this
Fragment.
|
void |
onDestroy()
Called by the system when the application is being destroyed.
|
void |
onDestroyView()
Called by the Android system each time the Activity is destroyed or recreated.
|
void |
onDetach() |
void |
onLayoutChange(android.view.View v,
int left,
int top,
int right,
int bottom,
int oldLeft,
int oldTop,
int oldRight,
int oldBottom) |
void |
onPause()
When the Fragment pauses (i.e.
|
void |
onResume()
When the Fragment resumes (i.e.
|
void |
onStart() |
void |
onStop() |
void |
onTouch(java.lang.String name,
TouchEvent evt,
float tpf)
Gets called by the InputManager on all touch/drag/scale events
|
void |
removeSplashScreen() |
void |
requestClose(boolean esc)
Called when the user requests to close the application.
|
void |
rescale(float x,
float y)
Called to notify the application that the scale has changed.
|
void |
reshape(int width,
int height)
Called to notify the application that the resolution has changed.
|
void |
update()
Callback to update the application state, and render the scene
to the back buffer.
|
dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLoaderManager, getParentFragment, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, hashCode, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isRemoving, isResumed, isStateSaved, isVisible, onActivityResult, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroyOptionsMenu, onGetLayoutInflater, onHiddenChanged, onInflate, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPictureInPictureModeChanged, onPictureInPictureModeChanged, onPrepareOptionsMenu, onRequestPermissionsResult, onSaveInstanceState, onTrimMemory, onViewCreated, onViewStateRestored, postponeEnterTransition, registerForContextMenu, requestPermissions, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu
protected java.lang.String appClass
protected int eglBitsPerPixel
protected int eglAlphaBits
protected int eglDepthBits
protected int eglSamples
protected int eglStencilBits
protected int frameRate
protected int maxResolutionDimension
protected java.lang.String audioRendererType
Android MediaPlayer / SoundPool can be used on all
supported Android platform versions (2.2+)
OpenAL Soft uses an OpenSL backend and is only supported on Android
versions 2.3+.
Only use ANDROID_ static strings found in AppSettings
protected boolean joystickEventsEnabled
protected boolean keyEventsEnabled
protected boolean mouseEventsEnabled
protected boolean mouseEventsInvertX
protected boolean mouseEventsInvertY
protected boolean finishOnAppStop
protected boolean handleExitHook
protected java.lang.String exitDialogTitle
protected java.lang.String exitDialogMessage
protected int splashPicID
protected android.widget.FrameLayout frameLayout
protected android.opengl.GLSurfaceView view
protected android.widget.ImageView splashImageView
public Application getJmeApplication()
public void onAttach(android.app.Activity activity)
onAttach
in class android.app.Fragment
public void onCreate(android.os.Bundle savedInstanceState)
onCreate
in class android.app.Fragment
savedInstanceState
- the saved instance statepublic android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)
onCreateView
in class android.app.Fragment
inflater
- ignoredcontainer
- ignoredsavedInstanceState
- ignoredpublic void onActivityCreated(android.os.Bundle savedInstanceState)
onActivityCreated
in class android.app.Fragment
public void onStart()
onStart
in class android.app.Fragment
public void onResume()
onResume
in class android.app.Fragment
public void onPause()
onPause
in class android.app.Fragment
public void onStop()
onStop
in class android.app.Fragment
public void onDestroyView()
onDestroyView
in class android.app.Fragment
public void onDestroy()
onDestroy
in class android.app.Fragment
public void onDetach()
onDetach
in class android.app.Fragment
public void handleError(java.lang.String errorMsg, java.lang.Throwable t)
handleError
in interface SystemListener
errorMsg
- The error message, if any, or null.t
- Throwable object, or null.public void onClick(android.content.DialogInterface dialog, int whichButton)
onClick
in interface android.content.DialogInterface.OnClickListener
dialog
- ignoredwhichButton
- the button indexpublic void onTouch(java.lang.String name, TouchEvent evt, float tpf)
onTouch
in interface TouchListener
name
- the name of the eventevt
- the touch eventtpf
- how much time has passed since the last framepublic void createLayout()
public void removeSplashScreen()
protected void initializeLogHandler()
public void initialize()
SystemListener
initialize
in interface SystemListener
public void reshape(int width, int height)
SystemListener
reshape
in interface SystemListener
width
- the new width of the display (in pixels, ≥0)height
- the new height of the display (in pixels, ≥0)public void rescale(float x, float y)
SystemListener
rescale
in interface SystemListener
x
- the new horizontal scale of the displayy
- the new vertical scale of the displaypublic void update()
SystemListener
update
in interface SystemListener
public void requestClose(boolean esc)
SystemListener
requestClose
in interface SystemListener
esc
- If true, the user pressed ESC to close the application.public void destroy()
SystemListener
destroy
in interface SystemListener
public void gainFocus()
SystemListener
gainFocus
in interface SystemListener
public void loseFocus()
SystemListener
loseFocus
in interface SystemListener
public void onLayoutChange(android.view.View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom)
onLayoutChange
in interface android.view.View.OnLayoutChangeListener