aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/Account/AccountViewModel.java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/Account/AccountViewModel.java')
-rw-r--r--app/src/main/java/Account/AccountViewModel.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/src/main/java/Account/AccountViewModel.java b/app/src/main/java/Account/AccountViewModel.java
index ab6e9663..15fe6143 100644
--- a/app/src/main/java/Account/AccountViewModel.java
+++ b/app/src/main/java/Account/AccountViewModel.java
@@ -8,22 +8,30 @@ import androidx.lifecycle.LiveData;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;
+import java.util.List;
+
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
public class AccountViewModel extends AndroidViewModel {
private AccountRepository mAccountRepository;
private LiveData<Account> mAccountLiveData;
+ private LiveData<List<Account>> mAccountsExceptCurrentAccountLiveData;
public AccountViewModel(Application application, RedditDataRoomDatabase redditDataRoomDatabase, String id) {
super(application);
mAccountRepository = new AccountRepository(redditDataRoomDatabase, id);
mAccountLiveData = mAccountRepository.getAccountLiveData();
+ mAccountsExceptCurrentAccountLiveData = mAccountRepository.getAccountsExceptCurrentAccountLiveData();
}
public LiveData<Account> getAccountLiveData() {
return mAccountLiveData;
}
+ public LiveData<List<Account>> getAccountsExceptCurrentAccountLiveData() {
+ return mAccountsExceptCurrentAccountLiveData;
+ }
+
public void insert(Account userData) {
mAccountRepository.insert(userData);
}