Class AndroidHarnessFragment
java.lang.Object
androidx.fragment.app.Fragment
com.jme3.app.AndroidHarnessFragment
- All Implemented Interfaces:
com.jme3.system.SystemListener
public abstract class AndroidHarnessFragment
extends androidx.fragment.app.Fragment
implements com.jme3.system.SystemListener
AndroidX Fragment that hosts a jME application on Android 11+.
The fragment is intentionally small: subclasses create the application and
optionally customize settings; this class owns the Android view lifecycle and
forwards render callbacks to LegacyApplication.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.jme3.app.LegacyApplicationprotected booleanprotected android.opengl.GLSurfaceView -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract com.jme3.app.LegacyApplicationCreates the jME application hosted by this fragment.voiddestroy()voidcom.jme3.app.ApplicationvoidhandleError(String errorMsg, Throwable throwable) voidprotected voidvoidvoidonAttach(android.content.Context context) voidonCreate(android.os.Bundle savedInstanceState) android.view.ViewonCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState) voidvoidvoidonPause()voidonResume()voidrequestClose(boolean esc) voidrescale(float x, float y) Deprecated.voidreshape(int width, int height) voidreshape(int logicalWidth, int logicalHeight, int framebufferWidth, int framebufferHeight) voidsetFinishOnAppStop(boolean finishOnAppStop) voidupdate()Methods inherited from class androidx.fragment.app.Fragment
getResources, onActivityCreated, onDetach, onStart, onStop, requireActivity, requireContext
-
Field Details
-
view
protected android.opengl.GLSurfaceView view -
app
protected com.jme3.app.LegacyApplication app -
finishOnAppStop
protected boolean finishOnAppStop
-
-
Constructor Details
-
AndroidHarnessFragment
public AndroidHarnessFragment()
-
-
Method Details
-
onAttach
public void onAttach(android.content.Context context) - Overrides:
onAttachin classandroidx.fragment.app.Fragment
-
getJmeApplication
public com.jme3.app.Application getJmeApplication() -
setFinishOnAppStop
public void setFinishOnAppStop(boolean finishOnAppStop) -
onCreate
public void onCreate(android.os.Bundle savedInstanceState) - Overrides:
onCreatein classandroidx.fragment.app.Fragment
-
createApplication
-
onCreateView
public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState) - Overrides:
onCreateViewin classandroidx.fragment.app.Fragment
-
onResume
public void onResume()- Overrides:
onResumein classandroidx.fragment.app.Fragment
-
onPause
public void onPause()- Overrides:
onPausein classandroidx.fragment.app.Fragment
-
onDestroyView
public void onDestroyView()- Overrides:
onDestroyViewin classandroidx.fragment.app.Fragment
-
onDestroy
public void onDestroy()- Overrides:
onDestroyin classandroidx.fragment.app.Fragment
-
handleError
-
initializeLogHandler
protected void initializeLogHandler() -
initialize
public void initialize()- Specified by:
initializein interfacecom.jme3.system.SystemListener
-
reshape
public void reshape(int width, int height) - Specified by:
reshapein interfacecom.jme3.system.SystemListener
-
reshape
public void reshape(int logicalWidth, int logicalHeight, int framebufferWidth, int framebufferHeight) - Specified by:
reshapein interfacecom.jme3.system.SystemListener
-
rescale
Deprecated.- Specified by:
rescalein interfacecom.jme3.system.SystemListener
-
update
public void update()- Specified by:
updatein interfacecom.jme3.system.SystemListener
-
requestClose
public void requestClose(boolean esc) - Specified by:
requestClosein interfacecom.jme3.system.SystemListener
-
destroy
public void destroy()- Specified by:
destroyin interfacecom.jme3.system.SystemListener
-
gainFocus
public void gainFocus()- Specified by:
gainFocusin interfacecom.jme3.system.SystemListener
-
loseFocus
public void loseFocus()- Specified by:
loseFocusin interfacecom.jme3.system.SystemListener
-