Refactored some of the untouched classes last time to support multi user. Bugs fixed related to subreddit selection in PostXXXActivity.

This commit is contained in:
Alex Ning
2019-08-08 11:14:18 +08:00
parent b5c9e98ec9
commit 1c8ba320bc
33 changed files with 299 additions and 211 deletions

View File

@@ -22,12 +22,16 @@ public interface AccountDao {
@Query("DELETE FROM accounts")
void deleteAllAccounts();
@Query("SELECT * FROM accounts WHERE username = :userName COLLATE NOCASE LIMIT 1")
LiveData<Account> getAccountLiveData(String userName);
@Query("SELECT * FROM accounts WHERE username = :username COLLATE NOCASE LIMIT 1")
LiveData<Account> getAccountLiveData(String username);
@Query("SELECT * FROM accounts WHERE username = :userName COLLATE NOCASE LIMIT 1")
Account getAccountData(String userName);
@Query("SELECT * FROM accounts WHERE username = :username COLLATE NOCASE LIMIT 1")
Account getAccountData(String username);
@Query("SELECT * FROM accounts WHERE is_current_user = 1 LIMIT 1")
Account getCurrentAccount();
@Query("UPDATE accounts SET profile_image_url = :profileImageUrl, banner_image_url = :bannerImageUrl, " +
"karma = :karma WHERE username = :username")
void updateAccountInfo(String username, String profileImageUrl, String bannerImageUrl, int karma);
}