public class MainViewModel extends AndroidViewModel implements LifecycleObserver
AndroidViewModel
and implements LifecycleObserver
.Constructor and Description |
---|
MainViewModel(Application application)
Constructor for the MainViewModel
|
Modifier and Type | Method and Description |
---|---|
LiveData<List<AutoReplyWithUserType>> |
getAutoReplies()
A query to get access to all the AutoReplies of a certain userType.
|
LiveData<List<Message>> |
getMessages()
Gets a LiveData list of messages
|
LiveData<Throwable> |
getThrowable()
Gets a LiveData of type, Throwable for us.
|
void |
refreshMessages()
refreshes the incoming messages, or throws a throwable.
|
void |
sendMessage(String phoneNumber,
String text)
This is a method to send a text message out, it utilizes the same method in the
smsRepository.
|
getApplication
public MainViewModel(@NonNull Application application)
application
- takes in an application objectpublic LiveData<List<AutoReplyWithUserType>> getAutoReplies()
public void refreshMessages()
public LiveData<List<Message>> getMessages()
public LiveData<Throwable> getThrowable()
public void sendMessage(String phoneNumber, String text)
phoneNumber
- , a String that contains the phone number the text will be sent to.text
- , a String that containts the body of the text that is being sent.