public class Application
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Application.AppState
States enum.
|
(package private) static class |
Application.AppTrigger
Triggers enum.
|
(package private) class |
Application.GrantEntry
Action taken before the state machine enters
Application.AppState.GRANTING -> grant() . |
(package private) class |
Application.RunEntry
Action taken before the state machine enters
Application.AppState.RUNNING -> schedule_fullscreen_() . |
(package private) class |
Application.StartEntry
Action taken before the state machine enters
Application.AppState.STARTED -> grant_check()
and run() . |
(package private) class |
Application.StopEntry
Action taken before the state machine enters
Application.AppState.STOPPED -> nothing yet. |
Modifier and Type | Field and Description |
---|---|
private android.app.Activity |
activity_
MainActivity backref. |
private android.content.Context |
context_
MainActivity 's Context backref. |
private com.github.oxo42.stateless4j.StateMachine<Application.AppState,Application.AppTrigger> |
fsm_
The state machine.
|
private android.os.Handler |
fullscreen_handler_
Fullscreen thread
Handler . |
private java.lang.Runnable |
fullscreen_runnable_
Fullscreen thread
Runnable . |
private boolean |
location_
Indicates that the application is granted with
ACCESS_FINE_LOCATION permission. |
private boolean |
record_
Indicates that the application is granted with
RECORD_AUDIO permission. |
private android.view.View |
view_
MainActivity 's content view. |
Constructor and Description |
---|
Application(android.content.Context context,
android.app.Activity activity,
android.view.View view)
Constructor
Where we register activity backrefs', configure and start the FSM.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
destroy() trigger. |
private void |
grant_check()
|
private void |
grant()
Grants the application with required permissions.
|
boolean |
granted()
grant_check() with boolean response clone. |
void |
pause()
pause() trigger. |
void |
run()
run() trigger. |
private void |
schedule_fullscreen_()
Sets immersive full screen mode.
|
void |
start()
start() trigger. |
Application.AppState |
state()
Returns the current state of the
fsm_ . |
void |
stop()
stop() trigger. |
private final android.os.Handler fullscreen_handler_
Handler
.private final java.lang.Runnable fullscreen_runnable_
Runnable
.private final android.content.Context context_
MainActivity
's Context
backref.private final android.app.Activity activity_
MainActivity
backref.private final android.view.View view_
MainActivity
's content view.private final com.github.oxo42.stateless4j.StateMachine<Application.AppState,Application.AppTrigger> fsm_
private boolean location_
ACCESS_FINE_LOCATION
permission.private boolean record_
RECORD_AUDIO
permission.public Application(@NonNull android.content.Context context, @NonNull android.app.Activity activity, @NonNull android.view.View view)
context
- Application Context
activity
- Application Activity
view
- Application View
private void schedule_fullscreen_()
private void grant()
public boolean granted()
grant_check()
with boolean response clone.private void grant_check()
public void start()
start()
trigger.public void run()
run()
trigger.public void pause()
pause()
trigger.public void stop()
stop()
trigger.public void destroy()
destroy()
trigger.public Application.AppState state()
fsm_
.Application.AppState
variable.