Handle popular links (#730)
Fix settings layout Merge branch 'master' into deeplinks Support for all links, check gitea instance, add progress indicator Enhance account checks, improve the experience of coming from links Merge branch 'master' into deeplinks Update libs Minor layout fixes gradle update Fix show/hide views Handle pr, repos. Handle settings for no action. open issue from link Add new settings section translation ready - General for generic settings wip on handle popular links Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: 6543 <6543@noreply.codeberg.org> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/730
This commit is contained in:
@@ -50,7 +50,7 @@ public class DraftsApi {
|
||||
}
|
||||
catch(InterruptedException e) {
|
||||
|
||||
Log.e(StaticGlobalVariables.draftsRepository, e.toString());
|
||||
Log.e(StaticGlobalVariables.draftsApi, e.toString());
|
||||
}
|
||||
|
||||
return draftId;
|
||||
@@ -66,7 +66,7 @@ public class DraftsApi {
|
||||
}
|
||||
catch(InterruptedException e) {
|
||||
|
||||
Log.e(StaticGlobalVariables.draftsRepository, e.toString());
|
||||
Log.e(StaticGlobalVariables.draftsApi, e.toString());
|
||||
}
|
||||
|
||||
return draftId;
|
||||
@@ -82,7 +82,7 @@ public class DraftsApi {
|
||||
}
|
||||
catch(InterruptedException e) {
|
||||
|
||||
Log.e(StaticGlobalVariables.draftsRepository, e.toString());
|
||||
Log.e(StaticGlobalVariables.draftsApi, e.toString());
|
||||
}
|
||||
|
||||
return checkDraftFlag;
|
||||
|
||||
@@ -47,7 +47,7 @@ public class RepositoriesApi {
|
||||
}
|
||||
catch(InterruptedException e) {
|
||||
|
||||
Log.e(StaticGlobalVariables.repositoriesRepository, e.toString());
|
||||
Log.e(StaticGlobalVariables.repositoriesApi, e.toString());
|
||||
}
|
||||
|
||||
return repositoryId;
|
||||
@@ -63,7 +63,7 @@ public class RepositoriesApi {
|
||||
}
|
||||
catch(InterruptedException e) {
|
||||
|
||||
Log.e(StaticGlobalVariables.repositoriesRepository, e.toString());
|
||||
Log.e(StaticGlobalVariables.repositoriesApi, e.toString());
|
||||
}
|
||||
|
||||
return repository;
|
||||
@@ -89,7 +89,7 @@ public class RepositoriesApi {
|
||||
}
|
||||
catch(InterruptedException e) {
|
||||
|
||||
Log.e(StaticGlobalVariables.repositoriesRepository, e.toString());
|
||||
Log.e(StaticGlobalVariables.repositoriesApi, e.toString());
|
||||
}
|
||||
|
||||
return checkRepository;
|
||||
@@ -105,7 +105,7 @@ public class RepositoriesApi {
|
||||
}
|
||||
catch(InterruptedException e) {
|
||||
|
||||
Log.e(StaticGlobalVariables.repositoriesRepository, e.toString());
|
||||
Log.e(StaticGlobalVariables.repositoriesApi, e.toString());
|
||||
}
|
||||
|
||||
return repository;
|
||||
@@ -121,7 +121,7 @@ public class RepositoriesApi {
|
||||
}
|
||||
catch(InterruptedException e) {
|
||||
|
||||
Log.e(StaticGlobalVariables.repositoriesRepository, e.toString());
|
||||
Log.e(StaticGlobalVariables.repositoriesApi, e.toString());
|
||||
}
|
||||
|
||||
return repository;
|
||||
|
||||
@@ -17,6 +17,7 @@ public class UserAccountsApi {
|
||||
|
||||
private static UserAccountsDao userAccountsDao;
|
||||
private static UserAccount userAccount;
|
||||
private static List<UserAccount> userAccounts;
|
||||
private static Integer checkAccount;
|
||||
private static long accountId;
|
||||
|
||||
@@ -49,7 +50,7 @@ public class UserAccountsApi {
|
||||
}
|
||||
catch(InterruptedException e) {
|
||||
|
||||
Log.e(StaticGlobalVariables.userAccountsRepository, e.toString());
|
||||
Log.e(StaticGlobalVariables.userAccountsApi, e.toString());
|
||||
}
|
||||
|
||||
return accountId;
|
||||
@@ -80,7 +81,7 @@ public class UserAccountsApi {
|
||||
}
|
||||
catch(InterruptedException e) {
|
||||
|
||||
Log.e(StaticGlobalVariables.userAccountsRepository, e.toString());
|
||||
Log.e(StaticGlobalVariables.userAccountsApi, e.toString());
|
||||
}
|
||||
|
||||
return userAccount;
|
||||
@@ -96,7 +97,7 @@ public class UserAccountsApi {
|
||||
}
|
||||
catch(InterruptedException e) {
|
||||
|
||||
Log.e(StaticGlobalVariables.userAccountsRepository, e.toString());
|
||||
Log.e(StaticGlobalVariables.userAccountsApi, e.toString());
|
||||
}
|
||||
|
||||
return checkAccount;
|
||||
@@ -107,6 +108,22 @@ public class UserAccountsApi {
|
||||
return userAccountsDao.fetchAllAccounts();
|
||||
}
|
||||
|
||||
public List<UserAccount> usersAccounts() {
|
||||
|
||||
try {
|
||||
|
||||
Thread thread = new Thread(() -> userAccounts = userAccountsDao.userAccounts());
|
||||
thread.start();
|
||||
thread.join();
|
||||
}
|
||||
catch(InterruptedException e) {
|
||||
|
||||
Log.e(StaticGlobalVariables.userAccountsApi, e.toString());
|
||||
}
|
||||
|
||||
return userAccounts;
|
||||
}
|
||||
|
||||
public void deleteAccount(final int accountId) {
|
||||
|
||||
new Thread(() -> userAccountsDao.deleteAccount(accountId)).start();
|
||||
|
||||
@@ -20,6 +20,9 @@ public interface UserAccountsDao {
|
||||
@Query("SELECT * FROM UserAccounts ORDER BY accountId ASC")
|
||||
LiveData<List<UserAccount>> fetchAllAccounts();
|
||||
|
||||
@Query("SELECT * FROM UserAccounts ORDER BY accountId ASC")
|
||||
List<UserAccount> userAccounts();
|
||||
|
||||
@Query("SELECT COUNT(accountId) FROM UserAccounts WHERE accountName = :accountName")
|
||||
Integer getCount(String accountName);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user