Modifier and Type | Field and Description |
---|---|
private androidx.lifecycle.MediatorLiveData<java.util.List<Device>> |
deviceList
Device List
|
private java.lang.String |
ERR_NO_REMOTE_DEVICES
Error message for no remote device
|
private DeviceDB |
mDB
Database
|
private static DeviceRepo |
sInstance |
Modifier | Constructor and Description |
---|---|
private |
DeviceRepo(android.app.Application app) |
Modifier and Type | Method and Description |
---|---|
void |
add(Device device) |
androidx.lifecycle.LiveData<java.util.List<Device>> |
getDevices() |
private void |
initInfoMessage() |
static DeviceRepo |
INST(android.app.Application app) |
void |
noRegisteredDevices()
Detected that the server has no other registered devices
|
void |
onSharedPreferenceChanged(android.content.SharedPreferences sharedPreferences,
java.lang.String key) |
void |
refreshList()
Send ping to query remote devices
|
void |
remove(Device device) |
void |
removeAll() |
getErrorMsg, getInfoMessage, getIsWorking, postErrorMsg, postInfoMessage, postIsWorking, setErrorMsg, setInfoMessage, setIsWorking
private static DeviceRepo sInstance
private final java.lang.String ERR_NO_REMOTE_DEVICES
private final DeviceDB mDB
private final androidx.lifecycle.MediatorLiveData<java.util.List<Device>> deviceList
public static DeviceRepo INST(android.app.Application app)
public void onSharedPreferenceChanged(android.content.SharedPreferences sharedPreferences, java.lang.String key)
onSharedPreferenceChanged
in interface android.content.SharedPreferences.OnSharedPreferenceChangeListener
@NonNull public androidx.lifecycle.LiveData<java.util.List<Device>> getDevices()
public void add(Device device)
public void remove(Device device)
public void removeAll()
public void refreshList()
public void noRegisteredDevices()
private void initInfoMessage()