diff options
Diffstat (limited to '')
-rw-r--r-- | app/src/main/java/SubscribedUserDatabase/SubscribedUserRepository.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/app/src/main/java/SubscribedUserDatabase/SubscribedUserRepository.java b/app/src/main/java/SubscribedUserDatabase/SubscribedUserRepository.java index 10549113..eb588958 100644 --- a/app/src/main/java/SubscribedUserDatabase/SubscribedUserRepository.java +++ b/app/src/main/java/SubscribedUserDatabase/SubscribedUserRepository.java @@ -1,19 +1,20 @@ package SubscribedUserDatabase; -import android.app.Application; -import androidx.lifecycle.LiveData; import android.os.AsyncTask; +import androidx.lifecycle.LiveData; + import java.util.List; +import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase; + public class SubscribedUserRepository { private SubscribedUserDao mSubscribedUserDao; private LiveData<List<SubscribedUserData>> mAllSubscribedUsers; - SubscribedUserRepository(Application application) { - SubscribedUserRoomDatabase db = SubscribedUserRoomDatabase.getDatabase(application); - mSubscribedUserDao = db.subscribedUserDao(); - mAllSubscribedUsers = mSubscribedUserDao.getAllSubscribedUsers(); + SubscribedUserRepository(RedditDataRoomDatabase redditDataRoomDatabase, String accountName) { + mSubscribedUserDao = redditDataRoomDatabase.subscribedUserDao(); + mAllSubscribedUsers = mSubscribedUserDao.getAllSubscribedUsers(accountName); } LiveData<List<SubscribedUserData>> getAllSubscribedSubreddits() { |