-
- All Implemented Interfaces:
-
com.badlogic.gdx.Application,com.badlogic.gdx.backends.android.AndroidApplicationBase
public class AndroidLiveWallpaper implements AndroidApplicationBase
An implementation of the Application interface to be used with an AndroidLiveWallpaperService. Not directly constructable, instead the AndroidLiveWallpaperService will create this class internally.
-
-
Field Summary
Fields Modifier and Type Field Description protected AndroidLiveWallpaperServiceserviceprotected AndroidInputinputprotected final Array<Runnable>runnablesprotected final Array<Runnable>executedRunnablesprotected final SnapshotArray<LifecycleListener>lifecycleListenersprotected intlogLevelprotected ApplicationLoggerapplicationLogger
-
Constructor Summary
Constructors Constructor Description AndroidLiveWallpaper(AndroidLiveWallpaperService service)
-
Method Summary
Modifier and Type Method Description AndroidLiveWallpaperServicegetService()AndroidInputgetInput()Returns the AndroidInput object associated with this AndroidApplicationBase Array<Runnable>getRunnables()A set of usable runnables Array<Runnable>getExecutedRunnables()The currently executed runnables SnapshotArray<LifecycleListener>getLifecycleListeners()Returns the LifecycleListener array associated with this AndroidApplicationBase intgetLogLevel()voidsetLogLevel(int logLevel)ApplicationLoggergetApplicationLogger()voidsetApplicationLogger(ApplicationLogger applicationLogger)voidinitialize(ApplicationListener listener, AndroidApplicationConfiguration config)voidonPause()voidonResume()voidonDestroy()WindowManagergetWindowManager()Returns the WindowManager associated with the application ApplicationListenergetApplicationListener()voidpostRunnable(Runnable runnable)Application.ApplicationTypegetType()intgetVersion()longgetJavaHeap()longgetNativeHeap()PreferencesgetPreferences(String name)voiddebug(String tag, String message)voiddebug(String tag, String message, Throwable exception)voidlog(String tag, String message)voidlog(String tag, String message, Throwable exception)voiderror(String tag, String message)voiderror(String tag, String message, Throwable exception)voidexit()voidaddLifecycleListener(LifecycleListener listener)voidremoveLifecycleListener(LifecycleListener listener)ContextgetContext()The application or activity context voidstartActivity(Intent intent)Method signifies an intent to start an activity, may be the default method of the Activity class WindowgetApplicationWindow()Returns the Window associated with the application HandlergetHandler()Returns the Handler object created by the application AndroidAudiocreateAudio(Context context, AndroidApplicationConfiguration config)Returns the AndroidAudio to be used by the application AndroidInputcreateInput(Application activity, Context context, Object view, AndroidApplicationConfiguration config)Returns the AndroidInput to be used by the application voidrunOnUiThread(Runnable runnable)Method signifies an intent of the caller to execute some action on the UI Thread. voiduseImmersiveMode(boolean b)Activates Android 4.4 KitKat's 'Immersive Mode' feature. voidnotifyColorsChanged(Color primaryColor, Color secondaryColor, Color tertiaryColor)Notify the wallpaper engine that the significant colors of the wallpaper have changed. -
Methods inherited from class com.badlogic.gdx.Application
addLifecycleListener, debug, error, exit, getApplicationListener, getApplicationLogger, getAudio, getClipboard, getFiles, getGraphics, getInput, getJavaHeap, getLogLevel, getNativeHeap, getNet, getPreferences, getType, getVersion, log, postRunnable, removeLifecycleListener, setApplicationLogger, setLogLevel -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
AndroidLiveWallpaper
AndroidLiveWallpaper(AndroidLiveWallpaperService service)
-
-
Method Detail
-
getService
AndroidLiveWallpaperService getService()
-
getInput
AndroidInput getInput()
Returns the AndroidInput object associated with this AndroidApplicationBase
-
getRunnables
Array<Runnable> getRunnables()
A set of usable runnables
-
getExecutedRunnables
Array<Runnable> getExecutedRunnables()
The currently executed runnables
-
getLifecycleListeners
SnapshotArray<LifecycleListener> getLifecycleListeners()
Returns the LifecycleListener array associated with this AndroidApplicationBase
-
getLogLevel
int getLogLevel()
-
setLogLevel
void setLogLevel(int logLevel)
-
getApplicationLogger
ApplicationLogger getApplicationLogger()
-
setApplicationLogger
void setApplicationLogger(ApplicationLogger applicationLogger)
-
initialize
void initialize(ApplicationListener listener, AndroidApplicationConfiguration config)
-
onPause
void onPause()
-
onResume
void onResume()
-
onDestroy
void onDestroy()
-
getWindowManager
WindowManager getWindowManager()
Returns the WindowManager associated with the application
-
getApplicationListener
ApplicationListener getApplicationListener()
-
postRunnable
void postRunnable(Runnable runnable)
-
getType
Application.ApplicationType getType()
-
getVersion
int getVersion()
-
getJavaHeap
long getJavaHeap()
-
getNativeHeap
long getNativeHeap()
-
getPreferences
Preferences getPreferences(String name)
-
exit
void exit()
-
addLifecycleListener
void addLifecycleListener(LifecycleListener listener)
-
removeLifecycleListener
void removeLifecycleListener(LifecycleListener listener)
-
getContext
Context getContext()
The application or activity context
-
startActivity
void startActivity(Intent intent)
Method signifies an intent to start an activity, may be the default method of the Activity class
- Parameters:
intent- The Intent for starting an activity
-
getApplicationWindow
Window getApplicationWindow()
Returns the Window associated with the application
-
getHandler
Handler getHandler()
Returns the Handler object created by the application
-
createAudio
AndroidAudio createAudio(Context context, AndroidApplicationConfiguration config)
Returns the AndroidAudio to be used by the application
-
createInput
AndroidInput createInput(Application activity, Context context, Object view, AndroidApplicationConfiguration config)
Returns the AndroidInput to be used by the application
-
runOnUiThread
void runOnUiThread(Runnable runnable)
Method signifies an intent of the caller to execute some action on the UI Thread.
- Parameters:
runnable- The runnable to be executed
-
useImmersiveMode
void useImmersiveMode(boolean b)
Activates Android 4.4 KitKat's 'Immersive Mode' feature.
- Parameters:
b- Whether or not to use immersive mode
-
notifyColorsChanged
void notifyColorsChanged(Color primaryColor, Color secondaryColor, Color tertiaryColor)
Notify the wallpaper engine that the significant colors of the wallpaper have changed. This method may be called beforeinitializing the live wallpaper.
- Parameters:
primaryColor- The most visually significant color.secondaryColor- The second most visually significant color.tertiaryColor- The third most visually significant color.
-
-
-
-