public class SharedBuffer
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SharedBuffer.LocationState
An enum for the possible location (GPS) states.
|
static class |
SharedBuffer.MarkerState
A binary enum to reflect visibility of markers.
|
static class |
SharedBuffer.PositionState
An enum to indicate where the
user_location_ stands relatively to places. |
Modifier and Type | Field and Description |
---|---|
private AudioPlayer.AppState |
audio_state_
The current
AudioPlayer.AppState audio state. |
private AudioPlayer.AudioType |
audio_type_
The current
AudioPlayer.AudioType audio type. |
private DataManager |
data_manager_
A
DataManager instance. |
private EventDispatcher |
event_dispatcher_
An
EventDispatcher engine instance. |
private static SharedBuffer |
instance_
This singleton.
|
private SharedBuffer.LocationState |
location_state_
The current
SharedBuffer.LocationState . |
private com.mapbox.mapboxsdk.maps.MapboxMap |
map_
Pointer to the displayed
MapboxMap . |
private SharedBuffer.PositionState |
position_state_
The current
SharedBuffer.PositionState . |
private short |
screen_height_ |
private short |
screen_width_
Size of the screen (in pixels).
|
private com.mapbox.mapboxsdk.geometry.LatLng |
user_location_
Last user location.
|
Modifier | Constructor and Description |
---|---|
private |
SharedBuffer(DataManager data_manager,
android.util.DisplayMetrics metrics)
Private Constructor.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
audio_busy()
Indicates that the
AudioPlayer.AppState is either AudioPlayer.AppState#PREPARING
or AudioPlayer.AppState#PLAYING . |
static AudioPlayer.AppState |
audio_state() |
static AudioPlayer.AudioType |
audio_type() |
static EventDispatcher |
dispatcher() |
static void |
init_instance(DataManager data_manager,
android.util.DisplayMetrics metrics)
Constructs and returns the
instance_ singleton. |
private static SharedBuffer |
instance()
Returns the singleton
instance_ . |
static SharedBuffer.LocationState |
location_state() |
static com.mapbox.mapboxsdk.geometry.LatLng |
location() |
static DataManager |
manager() |
static com.mapbox.mapboxsdk.maps.MapboxMap |
map() |
static SharedBuffer.PositionState |
position_state() |
static short |
screen_height() |
static short |
screen_width() |
static void |
set_audio_state(AudioPlayer.AppState audio_state) |
static void |
set_audio_type(AudioPlayer.AudioType audio_type) |
static void |
set_location_state(SharedBuffer.LocationState location_state) |
static void |
set_location(com.mapbox.mapboxsdk.geometry.LatLng location) |
static void |
set_map(com.mapbox.mapboxsdk.maps.MapboxMap map) |
static void |
set_position_state(SharedBuffer.PositionState position_state) |
static boolean |
user_tracking()
Shortcut to find out if the application is currently tracked user.
|
private static SharedBuffer instance_
private final DataManager data_manager_
DataManager
instance.private final EventDispatcher event_dispatcher_
EventDispatcher
engine instance.private final com.mapbox.mapboxsdk.geometry.LatLng user_location_
private final short screen_width_
private final short screen_height_
@NonNull private SharedBuffer.LocationState location_state_
SharedBuffer.LocationState
.@NonNull private SharedBuffer.PositionState position_state_
SharedBuffer.PositionState
.@NonNull private AudioPlayer.AppState audio_state_
AudioPlayer.AppState
audio state.@NonNull private AudioPlayer.AudioType audio_type_
AudioPlayer.AudioType
audio type.private com.mapbox.mapboxsdk.maps.MapboxMap map_
MapboxMap
.private SharedBuffer(DataManager data_manager, android.util.DisplayMetrics metrics)
init_instance(DataManager, DisplayMetrics)
when instance_
is null
.data_manager
- Final DataManager
instancemetrics
- Final DisplayMetrics
instancepublic static void init_instance(@NonNull DataManager data_manager, @NonNull android.util.DisplayMetrics metrics)
instance_
singleton.data_manager
- Final DataManager
instancemetrics
- Final DisplayMetrics
instancepublic static short screen_height()
@NonNull private static SharedBuffer instance()
instance_
.
This method remains private since the instance is mostly used to access its members.SharedBuffer
singleton.java.lang.RuntimeException
- if the instance_
hasn't been initialized.public static short screen_width()
@NonNull public static DataManager manager()
@NonNull public static EventDispatcher dispatcher()
@NonNull public static com.mapbox.mapboxsdk.maps.MapboxMap map()
public static void set_map(com.mapbox.mapboxsdk.maps.MapboxMap map)
@NonNull public static com.mapbox.mapboxsdk.geometry.LatLng location()
public static void set_location(com.mapbox.mapboxsdk.geometry.LatLng location)
@NonNull public static SharedBuffer.PositionState position_state()
public static void set_position_state(@NonNull SharedBuffer.PositionState position_state)
@NonNull public static SharedBuffer.LocationState location_state()
public static void set_location_state(@NonNull SharedBuffer.LocationState location_state)
public static void set_audio_state(@NonNull AudioPlayer.AppState audio_state)
@NonNull public static AudioPlayer.AudioType audio_type()
public static void set_audio_type(@NonNull AudioPlayer.AudioType audio_type)
public static boolean audio_busy()
AudioPlayer.AppState
is either AudioPlayer.AppState#PREPARING
or AudioPlayer.AppState#PLAYING
.true
or false
@NonNull public static AudioPlayer.AppState audio_state()
public static boolean user_tracking()
true
is GPS is active, false
otherwise.