Multiple accounts support (#624)

Title update

Color clean up

switch to another account and update the token at login

Add new account

Add fab button for new account and activity

update libs

Remove account from Manage accounts list

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/624
Reviewed-by: 6543 <6543@noreply.codeberg.org>
This commit is contained in:
M M Arif
2020-08-04 22:50:04 +02:00
committed by 6543
parent ea36a3f6d6
commit 30921ea330
40 changed files with 623 additions and 61 deletions

View File

@@ -48,11 +48,16 @@ public class UserAccountsApi {
new Thread(() -> userAccountsDao.updateServerVersion(serverVersion, accountId)).start();
}
public static void updateToken(final int accountId, final String token) {
public void updateToken(final int accountId, final String token) {
new Thread(() -> userAccountsDao.updateAccountToken(accountId, token)).start();
}
public void updateTokenByAccountName(final String accountName, final String token) {
new Thread(() -> userAccountsDao.updateAccountTokenByAccountName(accountName, token)).start();
}
public UserAccount getAccountData(String accountName) {
try {
@@ -90,7 +95,7 @@ public class UserAccountsApi {
return userAccountsDao.fetchAllAccounts();
}
public static void deleteAccount(final int accountId) {
public void deleteAccount(final int accountId) {
new Thread(() -> userAccountsDao.deleteAccount(accountId)).start();
}

View File

@@ -38,6 +38,9 @@ public interface UserAccountsDao {
@Query("UPDATE UserAccounts SET token = :token WHERE accountId = :accountId")
void updateAccountToken(int accountId, String token);
@Query("UPDATE UserAccounts SET token = :token WHERE accountName = :accountName")
void updateAccountTokenByAccountName(String accountName, String token);
@Query("UPDATE UserAccounts SET instanceUrl = :instanceUrl, token = :token WHERE accountId = :accountId")
void updateHostInfo(String instanceUrl, String token, int accountId);