aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/Account/AccountRepository.java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/Account/AccountRepository.java')
-rw-r--r--app/src/main/java/Account/AccountRepository.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/src/main/java/Account/AccountRepository.java b/app/src/main/java/Account/AccountRepository.java
index c495579d..33927077 100644
--- a/app/src/main/java/Account/AccountRepository.java
+++ b/app/src/main/java/Account/AccountRepository.java
@@ -4,21 +4,29 @@ import android.os.AsyncTask;
import androidx.lifecycle.LiveData;
+import java.util.List;
+
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
public class AccountRepository {
private AccountDao mAccountDao;
private LiveData<Account> mAccountLiveData;
+ private LiveData<List<Account>> mAccountsExceptCurrentAccountLiveData;
AccountRepository(RedditDataRoomDatabase redditDataRoomDatabase, String username) {
mAccountDao = redditDataRoomDatabase.accountDao();
mAccountLiveData = mAccountDao.getAccountLiveData(username);
+ mAccountsExceptCurrentAccountLiveData = mAccountDao.getAccountsExceptCurrentAccountLiveData(username);
}
LiveData<Account> getAccountLiveData() {
return mAccountLiveData;
}
+ public LiveData<List<Account>> getAccountsExceptCurrentAccountLiveData() {
+ return mAccountsExceptCurrentAccountLiveData;
+ }
+
public void insert(Account Account) {
new InsertAsyncTask(mAccountDao).execute(Account);
}