Implement multi-session notification polling and additional improvements/refactors/cleanups/fixes (#875)

Merge branch 'master' of https://codeberg.org/gitnex/GitNex into notifications-performance-improvements

 Conflicts:
	app/src/main/java/org/mian/gitnex/adapters/DraftsAdapter.java
	app/src/main/java/org/mian/gitnex/adapters/NotificationsAdapter.java
	app/src/main/java/org/mian/gitnex/adapters/UserAccountsAdapter.java
	app/src/main/java/org/mian/gitnex/adapters/UserAccountsNavAdapter.java
	app/src/main/res/layout/bottom_sheet_repository_in_list.xml
	app/src/main/res/layout/list_files.xml

Merge branch 'master' into notifications-performance-improvements

Merge branch 'master' into notifications-performance-improvements

Merge branch 'master' of https://codeberg.org/gitnex/GitNex into notifications-performance-improvements

 Conflicts:
	app/src/main/res/values-it/strings.xml

Add ripple effect to buttons.

Run syntax highlighting on separate thread. (#859)

Initial commit.

Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/875
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
Co-Authored-By: opyale <opyale@noreply.codeberg.org>
Co-Committed-By: opyale <opyale@noreply.codeberg.org>
This commit is contained in:
opyale 2021-04-13 20:56:50 +02:00 committed by M M Arif
parent 9d3cd49d23
commit d72f097012
108 changed files with 1211 additions and 908 deletions

View File

@ -12,6 +12,7 @@ import org.gitnex.tea4j.models.GiteaVersion;
import org.gitnex.tea4j.models.UserInfo;
import org.mian.gitnex.R;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.database.api.BaseApi;
import org.mian.gitnex.database.api.UserAccountsApi;
import org.mian.gitnex.databinding.ActivityAddNewAccountBinding;
import org.mian.gitnex.helpers.AppUtil;
@ -114,9 +115,7 @@ public class AddNewAccountActivity extends BaseActivity {
private void versionCheck(final String instanceUrl, final String loginToken) {
Call<GiteaVersion> callVersion;
callVersion = RetrofitClient.getApiInterface(ctx).getGiteaVersionWithToken("token " + loginToken);
callVersion.enqueue(new Callback<GiteaVersion>() {
@Override
@ -205,14 +204,15 @@ public class AddNewAccountActivity extends BaseActivity {
assert userDetails != null;
// insert new account to db if does not exist
String accountName = userDetails.getUsername() + "@" + instanceUrl;
UserAccountsApi userAccountsApi = new UserAccountsApi(ctx);
int checkAccount = userAccountsApi.getCount(accountName);
UserAccountsApi userAccountsApi = BaseApi.getInstance(ctx, UserAccountsApi.class);
boolean userAccountExists = userAccountsApi.userAccountExists(accountName);
if(checkAccount == 0) {
if(!userAccountExists) {
userAccountsApi.insertNewAccount(accountName, instanceUrl, userDetails.getUsername(), loginToken, "");
userAccountsApi.createNewAccount(accountName, instanceUrl, userDetails.getUsername(), loginToken, "");
Toasty.success(ctx, getResources().getString(R.string.accountAddedMessage));
finish();
}
else {

View File

@ -13,11 +13,13 @@ import org.gitnex.tea4j.models.PullRequests;
import org.gitnex.tea4j.models.UserRepositories;
import org.mian.gitnex.R;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.database.api.BaseApi;
import org.mian.gitnex.database.api.RepositoriesApi;
import org.mian.gitnex.database.api.UserAccountsApi;
import org.mian.gitnex.database.models.Repository;
import org.mian.gitnex.database.models.UserAccount;
import org.mian.gitnex.databinding.ActivityDeeplinksBinding;
import org.mian.gitnex.helpers.AppUtil;
import org.mian.gitnex.helpers.UrlHelper;
import java.net.URI;
import java.util.List;
@ -65,7 +67,7 @@ public class DeepLinksActivity extends BaseActivity {
}
// check for the links(URI) to be in the db
UserAccountsApi userAccountsApi = new UserAccountsApi(ctx);
UserAccountsApi userAccountsApi = BaseApi.getInstance(ctx, UserAccountsApi.class);
List<UserAccount> userAccounts = userAccountsApi.usersAccounts();
for(UserAccount userAccount : userAccounts) {
@ -79,13 +81,9 @@ public class DeepLinksActivity extends BaseActivity {
accountFound = true;
tinyDB.putString("loginUid", userAccount.getUserName());
tinyDB.putString("userLogin", userAccount.getUserName());
tinyDB.putString(userAccount.getUserName() + "-token", userAccount.getToken());
tinyDB.putString("instanceUrl", userAccount.getInstanceUrl());
tinyDB.putInt("currentActiveAccountId", userAccount.getAccountId());
AppUtil.switchToAccount(ctx, userAccount);
break;
}
}
@ -112,7 +110,7 @@ public class DeepLinksActivity extends BaseActivity {
final String repoName = restOfUrl[restOfUrl.length - 3];
int currentActiveAccountId = tinyDB.getInt("currentActiveAccountId");
RepositoriesApi repositoryData = new RepositoriesApi(ctx);
RepositoriesApi repositoryData = BaseApi.getInstance(ctx, RepositoriesApi.class);
Integer count = repositoryData.checkRepository(currentActiveAccountId, repoOwner, repoName);
@ -344,7 +342,7 @@ public class DeepLinksActivity extends BaseActivity {
tinyDB.putString("repoFullName", repoOwner + "/" + repoName);
int currentActiveAccountId = tinyDB.getInt("currentActiveAccountId");
RepositoriesApi repositoryData = new RepositoriesApi(ctx);
RepositoriesApi repositoryData = BaseApi.getInstance(ctx, RepositoriesApi.class);
Integer count = repositoryData.checkRepository(currentActiveAccountId, repoOwner, repoName);
@ -415,7 +413,7 @@ public class DeepLinksActivity extends BaseActivity {
tinyDB.putString("repoBranch", repoInfo.getDefault_branch());
int currentActiveAccountId = tinyDB.getInt("currentActiveAccountId");
RepositoriesApi repositoryData = new RepositoriesApi(ctx);
RepositoriesApi repositoryData = BaseApi.getInstance(ctx, RepositoriesApi.class);
Integer count = repositoryData.checkRepository(currentActiveAccountId, repoOwner, repoName);

View File

@ -17,6 +17,7 @@ import org.gitnex.tea4j.models.UserInfo;
import org.gitnex.tea4j.models.UserTokens;
import org.mian.gitnex.R;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.database.api.BaseApi;
import org.mian.gitnex.database.api.UserAccountsApi;
import org.mian.gitnex.database.models.UserAccount;
import org.mian.gitnex.databinding.ActivityLoginBinding;
@ -358,19 +359,19 @@ public class LoginActivity extends BaseActivity {
// insert new account to db if does not exist
String accountName = userDetails.getUsername() + "@" + TinyDB.getInstance(ctx).getString("instanceUrl");
UserAccountsApi userAccountsApi = new UserAccountsApi(ctx);
int checkAccount = userAccountsApi.getCount(accountName);
UserAccountsApi userAccountsApi = BaseApi.getInstance(ctx, UserAccountsApi.class);
boolean userAccountExists = userAccountsApi.userAccountExists(accountName);
long accountId;
if(checkAccount == 0) {
if(!userAccountExists) {
accountId = userAccountsApi.insertNewAccount(accountName, TinyDB.getInstance(ctx).getString("instanceUrl"), userDetails.getUsername(), loginToken, "");
accountId = userAccountsApi.createNewAccount(accountName, TinyDB.getInstance(ctx).getString("instanceUrl"), userDetails.getUsername(), loginToken, "");
tinyDB.putInt("currentActiveAccountId", (int) accountId);
}
else {
userAccountsApi.updateTokenByAccountName(accountName, loginToken);
UserAccount data = userAccountsApi.getAccountData(accountName);
UserAccount data = userAccountsApi.getAccountByName(accountName);
tinyDB.putInt("currentActiveAccountId", data.getAccountId());
}
@ -546,20 +547,20 @@ public class LoginActivity extends BaseActivity {
// insert new account to db if does not exist
String accountName = userDetails.getUsername() + "@" + TinyDB.getInstance(ctx).getString("instanceUrl");
UserAccountsApi userAccountsApi = new UserAccountsApi(ctx);
int checkAccount = userAccountsApi.getCount(accountName);
UserAccountsApi userAccountsApi = BaseApi.getInstance(ctx, UserAccountsApi.class);
boolean userAccountExists = userAccountsApi.userAccountExists(accountName);
long accountId;
if(checkAccount == 0) {
if(!userAccountExists) {
accountId = userAccountsApi
.insertNewAccount(accountName, TinyDB.getInstance(ctx).getString("instanceUrl"), userDetails.getUsername(), newToken.getSha1(), "");
.createNewAccount(accountName, TinyDB.getInstance(ctx).getString("instanceUrl"), userDetails.getUsername(), newToken.getSha1(), "");
tinyDB.putInt("currentActiveAccountId", (int) accountId);
}
else {
userAccountsApi.updateTokenByAccountName(accountName, newToken.getSha1());
UserAccount data = userAccountsApi.getAccountData(accountName);
UserAccount data = userAccountsApi.getAccountByName(accountName);
tinyDB.putInt("currentActiveAccountId", data.getAccountId());
}

View File

@ -20,7 +20,6 @@ import androidx.appcompat.widget.Toolbar;
import androidx.biometric.BiometricPrompt;
import androidx.cardview.widget.CardView;
import androidx.core.content.ContextCompat;
import androidx.core.content.res.ResourcesCompat;
import androidx.core.view.GravityCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.Fragment;
@ -34,6 +33,7 @@ import org.mian.gitnex.R;
import org.mian.gitnex.adapters.UserAccountsNavAdapter;
import org.mian.gitnex.clients.PicassoService;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.database.api.BaseApi;
import org.mian.gitnex.database.api.UserAccountsApi;
import org.mian.gitnex.database.models.UserAccount;
import org.mian.gitnex.databinding.ActivityMainBinding;
@ -90,38 +90,25 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
ActivityMainBinding activityMainBinding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(activityMainBinding.getRoot());
tinyDB.putBoolean("noConnection", false);
String currentVersion = tinyDB.getString("giteaVersion");
Intent mainIntent = getIntent();
String launchFragment = mainIntent.getStringExtra("launchFragment");
// DO NOT MOVE
if(mainIntent.hasExtra("switchAccountId") &&
AppUtil.switchToAccount(ctx, BaseApi.getInstance(ctx, UserAccountsApi.class)
.getAccountById(mainIntent.getIntExtra("switchAccountId", 0)))) {
mainIntent.removeExtra("switchAccountId");
recreate();
return;
}
// DO NOT MOVE
tinyDB.putBoolean("noConnection", false);
loginUid = tinyDB.getString("loginUid");
instanceToken = "token " + tinyDB.getString(loginUid + "-token");
if(tinyDB.getString("dateFormat").isEmpty()) {
tinyDB.putString("dateFormat", "pretty");
}
if(tinyDB.getString("codeBlockStr").isEmpty()) {
tinyDB.putInt("codeBlockColor", ResourcesCompat.getColor(getResources(), R.color.colorLightGreen, null));
tinyDB.putInt("codeBlockBackground", ResourcesCompat.getColor(getResources(), R.color.black, null));
}
if(tinyDB.getString("enableCounterIssueBadgeInit").isEmpty()) {
tinyDB.putBoolean("enableCounterIssueBadge", true);
}
if(tinyDB.getString("homeScreenStr").isEmpty()) {
tinyDB.putString("homeScreenStr", "yes");
tinyDB.putInt("homeScreenId", 0);
}
boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
if(!tinyDB.getBoolean("loggedInMode")) {
@ -130,9 +117,10 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
return;
}
if(tinyDB.getInt("currentActiveAccountId") <= 0) {
AlertDialogs.forceLogoutDialog(ctx, getResources().getString(R.string.forceLogoutDialogHeader), getResources().getString(R.string.forceLogoutDialogDescription), getResources().getString(R.string.alertDialogTokenRevokedCopyPositiveButton));
if(tinyDB.getInt("currentActiveAccountId", -1) <= 0) {
AlertDialogs.forceLogoutDialog(ctx,
getResources().getString(R.string.forceLogoutDialogHeader),
getResources().getString(R.string.forceLogoutDialogDescription), getResources().getString(R.string.alertDialogTokenRevokedCopyPositiveButton));
}
Toolbar toolbar = activityMainBinding.toolbar;
@ -141,17 +129,17 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
switch(tinyDB.getInt("customFontId", -1)) {
case 0:
myTypeface = Typeface.createFromAsset(getAssets(), "fonts/roboto.ttf");
break;
case 2:
case 2:
myTypeface = Typeface.createFromAsset(getAssets(), "fonts/sourcecodeproregular.ttf");
break;
default:
default:
myTypeface = Typeface.createFromAsset(getAssets(), "fonts/manroperegular.ttf");
break;
}
// biometric auth
@ -198,43 +186,33 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
Fragment fragmentById = fm.findFragmentById(R.id.fragment_container);
if(fragmentById instanceof SettingsFragment) {
toolbarTitle.setText(getResources().getString(R.string.pageTitleSettings));
}
else if(fragmentById instanceof MyRepositoriesFragment) {
toolbarTitle.setText(getResources().getString(R.string.pageTitleMyRepos));
}
else if(fragmentById instanceof StarredRepositoriesFragment) {
toolbarTitle.setText(getResources().getString(R.string.pageTitleStarredRepos));
}
else if(fragmentById instanceof OrganizationsFragment) {
toolbarTitle.setText(getResources().getString(R.string.pageTitleOrganizations));
}
else if(fragmentById instanceof ExploreFragment) {
toolbarTitle.setText(getResources().getString(R.string.pageTitleExplore));
}
else if(fragmentById instanceof NotificationsFragment) {
toolbarTitle.setText(R.string.pageTitleNotifications);
}
else if(fragmentById instanceof ProfileFragment) {
toolbarTitle.setText(getResources().getString(R.string.pageTitleProfile));
}
else if(fragmentById instanceof DraftsFragment) {
toolbarTitle.setText(getResources().getString(R.string.titleDrafts));
}
else if(fragmentById instanceof AdministrationFragment) {
toolbarTitle.setText(getResources().getString(R.string.pageTitleAdministration));
}
else if(fragmentById instanceof UserAccountsFragment) {
toolbarTitle.setText(getResources().getString(R.string.pageTitleUserAccounts));
}
@ -275,7 +253,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
List<UserAccount> userAccountsList = new ArrayList<>();
UserAccountsApi userAccountsApi;
userAccountsApi = new UserAccountsApi(ctx);
userAccountsApi = BaseApi.getInstance(ctx, UserAccountsApi.class);
RecyclerView navRecyclerViewUserAccounts = hView.findViewById(R.id.userAccounts);
UserAccountsNavAdapter adapterUserAccounts;
@ -294,12 +272,10 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
userFullName.setTypeface(myTypeface);
if(!userEmailNav.equals("")) {
userEmail.setText(userEmailNav);
}
if(!userFullNameNav.equals("")) {
userFullName.setText(Html.fromHtml(userFullNameNav));
}
@ -347,7 +323,8 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
public void onDrawerSlide(@NonNull View drawerView, float slideOffset) {
navigationView.getMenu().findItem(R.id.nav_administration).setVisible(tinyDB.getBoolean("userIsAdmin"));
navigationView.getMenu().findItem(R.id.nav_notifications).setVisible(new Version(currentVersion).higherOrEqual("1.12.3"));
navigationView.getMenu().findItem(R.id.nav_notifications).setVisible(new Version(tinyDB.getString("giteaVersion")).higherOrEqual("1.12.3"));
}
@Override
@ -361,6 +338,8 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
toggle.syncState();
toolbar.setNavigationIcon(R.drawable.ic_menu);
String launchFragment = mainIntent.getStringExtra("launchFragment");
if(launchFragment != null) {
mainIntent.removeExtra("launchFragment");
@ -368,13 +347,12 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
switch(launchFragment) {
case "drafts":
toolbarTitle.setText(getResources().getString(R.string.titleDrafts));
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new DraftsFragment()).commit();
navigationView.setCheckedItem(R.id.nav_comments_draft);
return;
case "notifications":
case "notifications":
toolbarTitle.setText(getResources().getString(R.string.pageTitleNotifications));
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new NotificationsFragment()).commit();
navigationView.setCheckedItem(R.id.nav_notifications);
@ -415,9 +393,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
if(savedInstanceState == null) {
if(!new Version(tinyDB.getString("giteaVersion")).higherOrEqual("1.12.3")) {
if(tinyDB.getInt("homeScreenId") == 7) {
tinyDB.putInt("homeScreenId", 0);
}
}
@ -658,29 +634,22 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
private void giteaVersion() {
final TinyDB tinyDb = TinyDB.getInstance(appCtx);
final String token = "token " + tinyDb.getString(tinyDb.getString("loginUid") + "-token");
Call<GiteaVersion> callVersion = RetrofitClient.getApiInterface(ctx).getGiteaVersionWithToken(token);
Call<GiteaVersion> callVersion = RetrofitClient.getApiInterface(ctx).getGiteaVersionWithToken(Authorization.get(ctx));
callVersion.enqueue(new Callback<GiteaVersion>() {
@Override
public void onResponse(@NonNull final Call<GiteaVersion> callVersion, @NonNull retrofit2.Response<GiteaVersion> responseVersion) {
if(responseVersion.code() == 200) {
if(responseVersion.code() == 200 && responseVersion.body() != null) {
String version = responseVersion.body().getVersion();
GiteaVersion version = responseVersion.body();
assert version != null;
tinyDb.putString("giteaVersion", version.getVersion());
tinyDB.putString("giteaVersion", version);
BaseApi.getInstance(ctx, UserAccountsApi.class).updateServerVersion(version, tinyDB.getInt("currentActiveAccountId"));
}
}
@Override
public void onFailure(@NonNull Call<GiteaVersion> callVersion, @NonNull Throwable t) {
Log.e("onFailure-version", t.toString());
}
});

View File

@ -14,6 +14,7 @@ import org.gitnex.tea4j.models.RepositoryTransfer;
import org.gitnex.tea4j.models.UserRepositories;
import org.mian.gitnex.R;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.database.api.BaseApi;
import org.mian.gitnex.database.api.RepositoriesApi;
import org.mian.gitnex.databinding.ActivityRepositorySettingsBinding;
import org.mian.gitnex.databinding.CustomRepositoryDeleteDialogBinding;
@ -139,7 +140,7 @@ public class RepositorySettingsActivity extends BaseActivity {
Toasty.success(ctx, getString(R.string.repoTransferSuccess));
finish();
RepositoriesApi.deleteRepository((int) tinyDB.getLong("repositoryId", 0));
BaseApi.getInstance(ctx, RepositoriesApi.class).deleteRepository((int) tinyDB.getLong("repositoryId", 0));
Intent intent = new Intent(RepositorySettingsActivity.this, MainActivity.class);
RepositorySettingsActivity.this.startActivity(intent);
}
@ -220,7 +221,7 @@ public class RepositorySettingsActivity extends BaseActivity {
Toasty.success(ctx, getString(R.string.repoDeletionSuccess));
finish();
RepositoriesApi.deleteRepository((int) tinyDB.getLong("repositoryId", 0));
BaseApi.getInstance(ctx, RepositoriesApi.class).deleteRepository((int) tinyDB.getLong("repositoryId", 0));
Intent intent = new Intent(RepositorySettingsActivity.this, MainActivity.class);
RepositorySettingsActivity.this.startActivity(intent);
}
@ -383,7 +384,7 @@ public class RepositorySettingsActivity extends BaseActivity {
if(!repositoryName.equals(repoName)) {
finish();
RepositoriesApi.updateRepositoryOwnerAndName(repositoryOwner, repoName, (int) tinyDB.getLong("repositoryId", 0));
BaseApi.getInstance(ctx, RepositoriesApi.class).updateRepositoryOwnerAndName(repositoryOwner, repoName, (int) tinyDB.getLong("repositoryId", 0));
Intent intent = new Intent(RepositorySettingsActivity.this, MainActivity.class);
RepositorySettingsActivity.this.startActivity(intent);
}

View File

@ -43,7 +43,13 @@ public class SettingsNotificationsActivity extends BaseActivity {
viewBinding.enableNotificationsMode.setOnCheckedChangeListener((buttonView, isChecked) -> {
tinyDB.putBoolean("notificationsEnabled", isChecked);
if(!isChecked) Notifications.stopWorker(ctx);
if(isChecked) {
Notifications.startWorker(ctx);
} else {
Notifications.stopWorker(ctx);
}
Toasty.info(appCtx, getResources().getString(R.string.settingsSave));
});

View File

@ -17,6 +17,7 @@ import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.RecyclerView;
import org.mian.gitnex.R;
import org.mian.gitnex.activities.IssueDetailActivity;
import org.mian.gitnex.database.api.BaseApi;
import org.mian.gitnex.database.api.DraftsApi;
import org.mian.gitnex.database.models.DraftWithRepository;
import org.mian.gitnex.fragments.BottomSheetReplyFragment;
@ -56,8 +57,10 @@ public class DraftsAdapter extends RecyclerView.Adapter<DraftsAdapter.DraftsView
int getDraftId = draftWithRepository.getDraftId();
deleteDraft(getAdapterPosition());
DraftsApi draftsApi = new DraftsApi(context);
DraftsApi draftsApi = BaseApi.getInstance(context, DraftsApi.class);
draftsApi.deleteSingleDraft(getDraftId);
});
itemView.setOnClickListener(itemEdit -> {

View File

@ -19,6 +19,7 @@ import org.mian.gitnex.R;
import org.mian.gitnex.activities.RepoDetailActivity;
import org.mian.gitnex.clients.PicassoService;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.database.api.BaseApi;
import org.mian.gitnex.database.api.RepositoriesApi;
import org.mian.gitnex.database.models.Repository;
import org.mian.gitnex.helpers.AppUtil;
@ -98,7 +99,7 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepo
final String repoName = parts[1];
int currentActiveAccountId = tinyDb.getInt("currentActiveAccountId");
RepositoriesApi repositoryData = new RepositoriesApi(context);
RepositoriesApi repositoryData = BaseApi.getInstance(context, RepositoriesApi.class);
//RepositoriesRepository.deleteRepositoriesByAccount(currentActiveAccountId);
Integer count = repositoryData.checkRepository(currentActiveAccountId, repoOwner, repoName);

View File

@ -21,6 +21,7 @@ import org.mian.gitnex.R;
import org.mian.gitnex.activities.RepoDetailActivity;
import org.mian.gitnex.clients.PicassoService;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.database.api.BaseApi;
import org.mian.gitnex.database.api.RepositoriesApi;
import org.mian.gitnex.database.models.Repository;
import org.mian.gitnex.helpers.AppUtil;
@ -96,7 +97,7 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
final String repoName = parts[1];
int currentActiveAccountId = tinyDb.getInt("currentActiveAccountId");
RepositoriesApi repositoryData = new RepositoriesApi(context);
RepositoriesApi repositoryData = BaseApi.getInstance(context, RepositoriesApi.class);
//RepositoriesRepository.deleteRepositoriesByAccount(currentActiveAccountId);
Integer count = repositoryData.checkRepository(currentActiveAccountId, repoOwner, repoName);

View File

@ -13,6 +13,7 @@ import androidx.core.text.HtmlCompat;
import androidx.recyclerview.widget.RecyclerView;
import org.gitnex.tea4j.models.NotificationThread;
import org.mian.gitnex.R;
import org.mian.gitnex.database.api.BaseApi;
import org.mian.gitnex.database.api.RepositoriesApi;
import org.mian.gitnex.database.models.Repository;
import org.mian.gitnex.helpers.TinyDB;
@ -87,8 +88,7 @@ public class NotificationsAdapter extends RecyclerView.Adapter<NotificationsAdap
if(notificationThread.isPinned()) {
holder.pinned.setVisibility(View.VISIBLE);
}
else {
} else {
holder.pinned.setVisibility(View.GONE);
}
@ -123,17 +123,14 @@ public class NotificationsAdapter extends RecyclerView.Adapter<NotificationsAdap
final String repoName = parts[1];
int currentActiveAccountId = tinyDb.getInt("currentActiveAccountId");
RepositoriesApi repositoryData = new RepositoriesApi(context);
RepositoriesApi repositoryData = BaseApi.getInstance(context, RepositoriesApi.class);
Integer count = repositoryData.checkRepository(currentActiveAccountId, repoOwner, repoName);
if(count == 0) {
long id = repositoryData.insertRepository(currentActiveAccountId, repoOwner, repoName);
tinyDb.putLong("repositoryId", id);
}
else {
} else {
Repository data = repositoryData.getRepository(currentActiveAccountId, repoOwner, repoName);
tinyDb.putLong("repositoryId", data.getRepositoryId());
}

View File

@ -20,6 +20,7 @@ import org.mian.gitnex.R;
import org.mian.gitnex.activities.RepoDetailActivity;
import org.mian.gitnex.clients.PicassoService;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.database.api.BaseApi;
import org.mian.gitnex.database.api.RepositoriesApi;
import org.mian.gitnex.database.models.Repository;
import org.mian.gitnex.helpers.AppUtil;
@ -220,7 +221,7 @@ public class RepoForksAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
final String repoName = parts[1];
int currentActiveAccountId = tinyDb.getInt("currentActiveAccountId");
RepositoriesApi repositoryData = new RepositoriesApi(context);
RepositoriesApi repositoryData = BaseApi.getInstance(context, RepositoriesApi.class);
//RepositoriesRepository.deleteRepositoriesByAccount(currentActiveAccountId);
Integer count = repositoryData.checkRepository(currentActiveAccountId, repoOwner, repoName);

View File

@ -21,6 +21,7 @@ import org.mian.gitnex.R;
import org.mian.gitnex.activities.RepoDetailActivity;
import org.mian.gitnex.clients.PicassoService;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.database.api.BaseApi;
import org.mian.gitnex.database.api.RepositoriesApi;
import org.mian.gitnex.database.models.Repository;
import org.mian.gitnex.helpers.AppUtil;
@ -96,7 +97,7 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
final String repoName = parts[1];
int currentActiveAccountId = tinyDb.getInt("currentActiveAccountId");
RepositoriesApi repositoryData = new RepositoriesApi(context);
RepositoriesApi repositoryData = BaseApi.getInstance(context, RepositoriesApi.class);
//RepositoriesRepository.deleteRepositoriesByAccount(currentActiveAccountId);
Integer count = repositoryData.checkRepository(currentActiveAccountId, repoOwner, repoName);

View File

@ -21,6 +21,7 @@ import org.mian.gitnex.R;
import org.mian.gitnex.activities.RepoDetailActivity;
import org.mian.gitnex.clients.PicassoService;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.database.api.BaseApi;
import org.mian.gitnex.database.api.RepositoriesApi;
import org.mian.gitnex.database.models.Repository;
import org.mian.gitnex.helpers.AppUtil;
@ -96,7 +97,7 @@ public class RepositoriesByOrgAdapter extends RecyclerView.Adapter<RepositoriesB
final String repoName = parts[1];
int currentActiveAccountId = tinyDb.getInt("currentActiveAccountId");
RepositoriesApi repositoryData = new RepositoriesApi(context);
RepositoriesApi repositoryData = BaseApi.getInstance(context, RepositoriesApi.class);
//RepositoriesRepository.deleteRepositoriesByAccount(currentActiveAccountId);
Integer count = repositoryData.checkRepository(currentActiveAccountId, repoOwner, repoName);

View File

@ -15,6 +15,7 @@ import org.gitnex.tea4j.models.Issues;
import org.mian.gitnex.R;
import org.mian.gitnex.activities.IssueDetailActivity;
import org.mian.gitnex.clients.PicassoService;
import org.mian.gitnex.database.api.BaseApi;
import org.mian.gitnex.database.api.RepositoriesApi;
import org.mian.gitnex.database.models.Repository;
import org.mian.gitnex.helpers.AppUtil;
@ -80,7 +81,7 @@ public class SearchIssuesAdapter extends RecyclerView.Adapter<SearchIssuesAdapte
final String repoName = parts[1];
int currentActiveAccountId = tinyDb.getInt("currentActiveAccountId");
RepositoriesApi repositoryData = new RepositoriesApi(context);
RepositoriesApi repositoryData = BaseApi.getInstance(context, RepositoriesApi.class);
Integer count = repositoryData.checkRepository(currentActiveAccountId, repoOwner, repoName);

View File

@ -21,6 +21,7 @@ import org.mian.gitnex.R;
import org.mian.gitnex.activities.RepoDetailActivity;
import org.mian.gitnex.clients.PicassoService;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.database.api.BaseApi;
import org.mian.gitnex.database.api.RepositoriesApi;
import org.mian.gitnex.database.models.Repository;
import org.mian.gitnex.helpers.AppUtil;
@ -96,7 +97,7 @@ public class StarredReposListAdapter extends RecyclerView.Adapter<StarredReposLi
final String repoName = parts[1];
int currentActiveAccountId = tinyDb.getInt("currentActiveAccountId");
RepositoriesApi repositoryData = new RepositoriesApi(context);
RepositoriesApi repositoryData = BaseApi.getInstance(context, RepositoriesApi.class);
//RepositoriesRepository.deleteRepositoriesByAccount(currentActiveAccountId);
Integer count = repositoryData.checkRepository(currentActiveAccountId, repoOwner, repoName);

View File

@ -14,6 +14,7 @@ import androidx.appcompat.content.res.AppCompatResources;
import androidx.recyclerview.widget.RecyclerView;
import org.mian.gitnex.R;
import org.mian.gitnex.clients.PicassoService;
import org.mian.gitnex.database.api.BaseApi;
import org.mian.gitnex.database.api.UserAccountsApi;
import org.mian.gitnex.database.models.UserAccount;
import org.mian.gitnex.helpers.AppUtil;
@ -63,7 +64,7 @@ public class UserAccountsAdapter extends RecyclerView.Adapter<UserAccountsAdapte
.setPositiveButton(context.getResources().getString(R.string.removeButton), (dialog, which) -> {
updateLayoutByPosition(getAdapterPosition());
UserAccountsApi userAccountsApi = new UserAccountsApi(context);
UserAccountsApi userAccountsApi = BaseApi.getInstance(context, UserAccountsApi.class);
userAccountsApi.deleteAccount(Integer.parseInt(String.valueOf(accountId)));
}).setNeutralButton(context.getResources().getString(R.string.cancelButton), null)
.show();
@ -71,25 +72,19 @@ public class UserAccountsAdapter extends RecyclerView.Adapter<UserAccountsAdapte
itemView.setOnClickListener(switchAccount -> {
UserAccountsApi userAccountsApi = new UserAccountsApi(context);
UserAccount userAccount = userAccountsApi.getAccountData(accountName);
UserAccountsApi userAccountsApi = BaseApi.getInstance(context, UserAccountsApi.class);
UserAccount userAccount = userAccountsApi.getAccountByName(accountName);
if(tinyDB.getInt("currentActiveAccountId") != userAccount.getAccountId()) {
if(AppUtil.switchToAccount(context, userAccount)) {
String url = UrlBuilder.fromString(userAccount.getInstanceUrl())
.withPath("/")
.toString();
tinyDB.putString("loginUid", userAccount.getUserName());
tinyDB.putString("userLogin", userAccount.getUserName());
tinyDB.putString(userAccount.getUserName() + "-token", userAccount.getToken());
tinyDB.putString("instanceUrl", userAccount.getInstanceUrl());
tinyDB.putInt("currentActiveAccountId", userAccount.getAccountId());
Toasty.success(context, context.getResources().getString(R.string.switchAccountSuccess, userAccount.getUserName(), url));
((Activity) context).recreate();
}
}
});
}

View File

@ -18,12 +18,10 @@ import androidx.drawerlayout.widget.DrawerLayout;
import androidx.recyclerview.widget.RecyclerView;
import org.mian.gitnex.R;
import org.mian.gitnex.clients.PicassoService;
import org.mian.gitnex.database.api.UserAccountsApi;
import org.mian.gitnex.database.models.UserAccount;
import org.mian.gitnex.fragments.UserAccountsFragment;
import org.mian.gitnex.helpers.AppUtil;
import org.mian.gitnex.helpers.RoundedTransformation;
import org.mian.gitnex.helpers.TinyDB;
import org.mian.gitnex.helpers.Toasty;
import java.util.List;
import io.mikael.urlbuilder.UrlBuilder;
@ -103,7 +101,6 @@ public class UserAccountsNavAdapter extends RecyclerView.Adapter<UserAccountsNav
private void customDialogUserAccountsList(List<UserAccount> allAccountsList) {
TinyDB tinyDB = TinyDB.getInstance(context);
Dialog dialog = new Dialog(context, R.style.ThemeOverlay_MaterialComponents_Dialog_Alert);
dialog.setContentView(R.layout.custom_user_accounts_dialog);
@ -120,6 +117,7 @@ public class UserAccountsNavAdapter extends RecyclerView.Adapter<UserAccountsNav
AppCompatActivity activity = (AppCompatActivity) context;
activity.getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new UserAccountsFragment()).commit();
dialog.dismiss();
});
UserAccountsListDialogAdapter arrayAdapter = new UserAccountsListDialogAdapter(context, R.layout.custom_user_accounts_list, allAccountsList);
@ -127,27 +125,21 @@ public class UserAccountsNavAdapter extends RecyclerView.Adapter<UserAccountsNav
listView.setOnItemClickListener((adapterView, view, which, l) -> {
String accountNameSwitch = allAccountsList.get(which).getAccountName();
UserAccountsApi userAccountsApi = new UserAccountsApi(context);
UserAccount userAccount = userAccountsApi.getAccountData(accountNameSwitch);
UserAccount userAccount = allAccountsList.get(which);
if(tinyDB.getInt("currentActiveAccountId") != userAccount.getAccountId()) {
if(AppUtil.switchToAccount(context, userAccount)) {
String url = UrlBuilder.fromString(userAccount.getInstanceUrl())
.withPath("/")
.toString();
tinyDB.putString("loginUid", userAccount.getUserName());
tinyDB.putString("userLogin", userAccount.getUserName());
tinyDB.putString(userAccount.getUserName() + "-token", userAccount.getToken());
tinyDB.putString("instanceUrl", userAccount.getInstanceUrl());
tinyDB.putInt("currentActiveAccountId", userAccount.getAccountId());
Toasty.success(context, context.getResources().getString(R.string.switchAccountSuccess, userAccount.getUserName(), url));
((Activity) context).recreate();
dialog.dismiss();
}
});
dialog.show();
}

View File

@ -3,6 +3,7 @@ package org.mian.gitnex.core;
import android.annotation.SuppressLint;
import android.app.Application;
import android.content.Context;
import androidx.core.content.res.ResourcesCompat;
import org.acra.ACRA;
import org.acra.BuildConfig;
import org.acra.ReportField;
@ -34,7 +35,6 @@ import org.mian.gitnex.notifications.Notifications;
public class MainApplication extends Application {
private Context appCtx;
private TinyDB tinyDB;
@Override
@ -42,7 +42,7 @@ public class MainApplication extends Application {
super.onCreate();
appCtx = getApplicationContext();
Context appCtx = getApplicationContext();
tinyDB = TinyDB.getInstance(appCtx);
setDefaults();
@ -76,6 +76,7 @@ public class MainApplication extends Application {
@Override
protected void attachBaseContext(Context context) {
super.attachBaseContext(context);
tinyDB = TinyDB.getInstance(context);
@ -97,46 +98,59 @@ public class MainApplication extends Application {
// enabling counter badges by default
if(tinyDB.getString("enableCounterBadgesInit").isEmpty()) {
tinyDB.putBoolean("enableCounterBadges", true);
tinyDB.putString("enableCounterBadgesInit", "yes");
}
// enable crash reports by default
if(tinyDB.getString("crashReportingEnabledInit").isEmpty()) {
tinyDB.putBoolean("crashReportingEnabled", true);
tinyDB.putString("crashReportingEnabledInit", "yes");
}
// default cache setter
if(tinyDB.getString("cacheSizeStr").isEmpty()) {
tinyDB.putString("cacheSizeStr", getResources().getString(R.string.cacheSizeDataSelectionSelectedText));
}
if(tinyDB.getString("cacheSizeImagesStr").isEmpty()) {
tinyDB.putString("cacheSizeImagesStr", getResources().getString(R.string.cacheSizeImagesSelectionSelectedText));
}
// enable comment drafts by default
if(tinyDB.getString("draftsCommentsDeletionEnabledInit").isEmpty()) {
tinyDB.putBoolean("draftsCommentsDeletionEnabled", true);
tinyDB.putString("draftsCommentsDeletionEnabledInit", "yes");
}
// setting default polling delay
if(tinyDB.getInt("pollingDelayMinutes", 0) <= 0) {
tinyDB.putInt("pollingDelayMinutes", Constants.defaultPollingDelay);
}
// disable biometric by default
if(tinyDB.getString("biometricStatusInit").isEmpty()) {
tinyDB.putBoolean("biometricStatus", false);
tinyDB.putString("biometricStatusInit", "yes");
}
// set default date format
if(tinyDB.getString("dateFormat").isEmpty()) {
tinyDB.putString("dateFormat", "pretty");
}
if(tinyDB.getString("codeBlockStr").isEmpty()) {
tinyDB.putInt("codeBlockColor", ResourcesCompat.getColor(getResources(), R.color.colorLightGreen, null));
tinyDB.putInt("codeBlockBackground", ResourcesCompat.getColor(getResources(), R.color.black, null));
}
if(tinyDB.getString("enableCounterIssueBadgeInit").isEmpty()) {
tinyDB.putBoolean("enableCounterIssueBadge", true);
}
if(tinyDB.getString("homeScreenStr").isEmpty()) {
tinyDB.putString("homeScreenStr", "yes");
tinyDB.putInt("homeScreenId", 0);
}
}
}

View File

@ -0,0 +1,57 @@
package org.mian.gitnex.database.api;
import android.content.Context;
import androidx.annotation.NonNull;
import org.mian.gitnex.database.db.GitnexDatabase;
import org.mian.gitnex.helpers.Constants;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* @author opyale
*/
public abstract class BaseApi {
private static final Map<Class<? extends BaseApi>, Object> instances = new HashMap<>();
protected static final ExecutorService executorService = Executors.newCachedThreadPool();
protected final GitnexDatabase gitnexDatabase;
protected BaseApi(Context context) {
gitnexDatabase = GitnexDatabase.getDatabaseInstance(context);
}
public static <T extends BaseApi> T getInstance(@NonNull Context context, @NonNull Class<T> clazz) {
try {
if(!instances.containsKey(clazz)) {
synchronized(BaseApi.class) {
if(!instances.containsKey(clazz)) {
T instance = clazz
.getDeclaredConstructor(Context.class)
.newInstance(context);
instances.put(clazz, instance);
return instance;
}
}
}
return (T) instances.get(clazz);
} catch(NoSuchMethodException | IllegalAccessException |
InvocationTargetException | InstantiationException ignored) {}
return null;
}
}

View File

@ -1,30 +1,23 @@
package org.mian.gitnex.database.api;
import android.content.Context;
import android.util.Log;
import androidx.lifecycle.LiveData;
import org.mian.gitnex.database.dao.DraftsDao;
import org.mian.gitnex.database.db.GitnexDatabase;
import org.mian.gitnex.database.models.Draft;
import org.mian.gitnex.database.models.DraftWithRepository;
import org.mian.gitnex.helpers.Constants;
import java.util.List;
/**
* Author M M Arif
*/
public class DraftsApi {
public class DraftsApi extends BaseApi {
private static DraftsDao draftsDao;
private static long draftId;
private static Integer checkDraftFlag;
private final DraftsDao draftsDao;
public DraftsApi(Context context) {
GitnexDatabase db;
db = GitnexDatabase.getDatabaseInstance(context);
draftsDao = db.draftsDao();
DraftsApi(Context context) {
super(context);
draftsDao = gitnexDatabase.draftsDao();
}
public long insertDraft(int repositoryId, int draftAccountId, int issueId, String draftText, String draftType, String commentId, String issueType) {
@ -41,87 +34,44 @@ public class DraftsApi {
return insertDraftAsyncTask(draft);
}
private static long insertDraftAsyncTask(final Draft draft) {
try {
Thread thread = new Thread(() -> draftId = draftsDao.insertDraft(draft));
thread.start();
thread.join();
}
catch(InterruptedException e) {
Log.e(Constants.draftsApi, e.toString());
}
return draftId;
private long insertDraftAsyncTask(final Draft draft) {
return draftsDao.insertDraft(draft);
}
public long getDraftIdAsync(int issueId, int draftRepositoryId) {
try {
Thread thread = new Thread(() -> draftId = draftsDao.getDraftId(issueId, draftRepositoryId));
thread.start();
thread.join();
}
catch(InterruptedException e) {
Log.e(Constants.draftsApi, e.toString());
}
return draftId;
return draftsDao.getDraftId(issueId, draftRepositoryId);
}
public Integer checkDraft(int issueId, int draftRepositoryId, String commentId) {
try {
Thread thread = new Thread(() -> checkDraftFlag = draftsDao.checkDraftDao(issueId, draftRepositoryId, commentId));
thread.start();
thread.join();
}
catch(InterruptedException e) {
Log.e(Constants.draftsApi, e.toString());
}
return checkDraftFlag;
return draftsDao.checkDraftDao(issueId, draftRepositoryId, commentId);
}
public LiveData<List<DraftWithRepository>> getDrafts(int accountId) {
return draftsDao.fetchAllDrafts(accountId);
}
public LiveData<Draft> getDraftByIssueId(int issueId) {
return draftsDao.fetchDraftByIssueId(issueId);
}
public void deleteSingleDraft(final int draftId) {
final LiveData<Draft> draft = draftsDao.fetchDraftById(draftId);
if(draft != null) {
new Thread(() -> draftsDao.deleteByDraftId(draftId)).start();
executorService.execute(() -> draftsDao.deleteByDraftId(draftId));
}
}
public static void deleteAllDrafts(final int accountId) {
new Thread(() -> draftsDao.deleteAllDrafts(accountId)).start();
public void deleteAllDrafts(final int accountId) {
executorService.execute(() -> draftsDao.deleteAllDrafts(accountId));
}
public static void updateDraft(final String draftText, final int draftId, final String commentId) {
new Thread(() -> draftsDao.updateDraft(draftText, draftId, commentId)).start();
public void updateDraft(final String draftText, final int draftId, final String commentId) {
executorService.execute(() -> draftsDao.updateDraft(draftText, draftId, commentId));
}
public static void updateDraftByIssueIdAsyncTask(final String draftText, final int issueId, final int draftRepositoryId, final String commentId) {
new Thread(() -> draftsDao.updateDraftByIssueId(draftText, issueId, draftRepositoryId, commentId)).start();
public void updateDraftByIssueIdAsyncTask(final String draftText, final int issueId, final int draftRepositoryId, final String commentId) {
executorService.execute(() -> draftsDao.updateDraftByIssueId(draftText, issueId, draftRepositoryId, commentId));
}
}

View File

@ -1,30 +1,22 @@
package org.mian.gitnex.database.api;
import android.content.Context;
import android.util.Log;
import androidx.lifecycle.LiveData;
import org.mian.gitnex.database.dao.RepositoriesDao;
import org.mian.gitnex.database.db.GitnexDatabase;
import org.mian.gitnex.database.models.Repository;
import org.mian.gitnex.helpers.Constants;
import java.util.List;
/**
* Author M M Arif
*/
public class RepositoriesApi {
public class RepositoriesApi extends BaseApi {
private static RepositoriesDao repositoriesDao;
private static long repositoryId;
private static Repository repository;
private static Integer checkRepository;
private final RepositoriesDao repositoriesDao;
public RepositoriesApi(Context context) {
GitnexDatabase db;
db = GitnexDatabase.getDatabaseInstance(context);
repositoriesDao = db.repositoriesDao();
RepositoriesApi(Context context) {
super(context);
repositoriesDao = gitnexDatabase.repositoriesDao();
}
public long insertRepository(int repoAccountId, String repositoryOwner, String repositoryName) {
@ -38,108 +30,43 @@ public class RepositoriesApi {
}
public long insertRepositoryAsyncTask(Repository repository) {
try {
Thread thread = new Thread(() -> repositoryId = repositoriesDao.newRepository(repository));
thread.start();
thread.join();
}
catch(InterruptedException e) {
Log.e(Constants.repositoriesApi, e.toString());
}
return repositoryId;
return repositoriesDao.newRepository(repository);
}
public Repository getRepository(int repoAccountId, String repositoryOwner, String repositoryName) {
try {
Thread thread = new Thread(() -> repository = repositoriesDao.getSingleRepositoryDao(repoAccountId, repositoryOwner, repositoryName));
thread.start();
thread.join();
}
catch(InterruptedException e) {
Log.e(Constants.repositoriesApi, e.toString());
}
return repository;
return repositoriesDao.getSingleRepositoryDao(repoAccountId, repositoryOwner, repositoryName);
}
public LiveData<List<Repository>> getAllRepositories() {
return repositoriesDao.fetchAllRepositories();
}
public LiveData<List<Repository>> getAllRepositoriesByAccount(int repoAccountId) {
return repositoriesDao.getAllRepositoriesByAccountDao(repoAccountId);
}
public Integer checkRepository(int repoAccountId, String repositoryOwner, String repositoryName) {
try {
Thread thread = new Thread(() -> checkRepository = repositoriesDao.checkRepositoryDao(repoAccountId, repositoryOwner, repositoryName));
thread.start();
thread.join();
}
catch(InterruptedException e) {
Log.e(Constants.repositoriesApi, e.toString());
}
return checkRepository;
return repositoriesDao.checkRepositoryDao(repoAccountId, repositoryOwner, repositoryName);
}
public Repository fetchRepositoryById(int repositoryId) {
try {
Thread thread = new Thread(() -> repository = repositoriesDao.fetchRepositoryByIdDao(repositoryId));
thread.start();
thread.join();
}
catch(InterruptedException e) {
Log.e(Constants.repositoriesApi, e.toString());
}
return repository;
return repositoriesDao.fetchRepositoryByIdDao(repositoryId);
}
public Repository fetchRepositoryByAccountIdByRepositoryId(int repositoryId, int repoAccountId) {
try {
Thread thread = new Thread(() -> repository = repositoriesDao.fetchRepositoryByAccountIdByRepositoryIdDao(repositoryId, repoAccountId));
thread.start();
thread.join();
}
catch(InterruptedException e) {
Log.e(Constants.repositoriesApi, e.toString());
}
return repository;
return repositoriesDao.fetchRepositoryByAccountIdByRepositoryIdDao(repositoryId, repoAccountId);
}
public static void updateRepositoryOwnerAndName(String repositoryOwner, String repositoryName, int repositoryId) {
new Thread(() -> repositoriesDao.updateRepositoryOwnerAndName(repositoryOwner, repositoryName, repositoryId)).start();
public void updateRepositoryOwnerAndName(String repositoryOwner, String repositoryName, int repositoryId) {
executorService.execute(() -> repositoriesDao.updateRepositoryOwnerAndName(repositoryOwner, repositoryName, repositoryId));
}
public static void deleteRepositoriesByAccount(final int repoAccountId) {
new Thread(() -> repositoriesDao.deleteRepositoriesByAccount(repoAccountId)).start();
public void deleteRepositoriesByAccount(final int repoAccountId) {
executorService.execute(() -> repositoriesDao.deleteRepositoriesByAccount(repoAccountId));
}
public static void deleteRepository(final int repositoryId) {
new Thread(() -> repositoriesDao.deleteRepository(repositoryId)).start();
public void deleteRepository(final int repositoryId) {
executorService.execute(() -> repositoriesDao.deleteRepository(repositoryId));
}
}

View File

@ -1,34 +1,25 @@
package org.mian.gitnex.database.api;
import android.content.Context;
import android.util.Log;
import androidx.lifecycle.LiveData;
import org.mian.gitnex.database.dao.UserAccountsDao;
import org.mian.gitnex.database.db.GitnexDatabase;
import org.mian.gitnex.database.models.UserAccount;
import org.mian.gitnex.helpers.Constants;
import java.util.List;
/**
* Author M M Arif
*/
public class UserAccountsApi {
public class UserAccountsApi extends BaseApi {
private static UserAccountsDao userAccountsDao;
private static UserAccount userAccount;
private static List<UserAccount> userAccounts;
private static Integer checkAccount;
private static long accountId;
private final UserAccountsDao userAccountsDao;
public UserAccountsApi(Context context) {
GitnexDatabase db;
db = GitnexDatabase.getDatabaseInstance(context);
userAccountsDao = db.userAccountsDao();
UserAccountsApi(Context context) {
super(context);
userAccountsDao = gitnexDatabase.userAccountsDao();
}
public long insertNewAccount(String accountName, String instanceUrl, String userName, String token, String serverVersion) {
public long createNewAccount(String accountName, String instanceUrl, String userName, String token, String serverVersion) {
UserAccount userAccount = new UserAccount();
userAccount.setAccountName(accountName);
@ -37,96 +28,48 @@ public class UserAccountsApi {
userAccount.setToken(token);
userAccount.setServerVersion(serverVersion);
return insertNewAccountAsync(userAccount);
return userAccountsDao.createAccount(userAccount);
}
private static long insertNewAccountAsync(final UserAccount userAccount) {
try {
Thread thread = new Thread(() -> accountId = userAccountsDao.newAccount(userAccount));
thread.start();
thread.join();
}
catch(InterruptedException e) {
Log.e(Constants.userAccountsApi, e.toString());
}
return accountId;
}
public static void updateServerVersion(final String serverVersion, final int accountId) {
new Thread(() -> userAccountsDao.updateServerVersion(serverVersion, accountId)).start();
public void updateServerVersion(final String serverVersion, final int accountId) {
executorService.execute(() -> userAccountsDao.updateServerVersion(serverVersion, accountId));
}
public void updateToken(final int accountId, final String token) {
new Thread(() -> userAccountsDao.updateAccountToken(accountId, token)).start();
executorService.execute(() -> userAccountsDao.updateAccountToken(accountId, token));
}
public void updateTokenByAccountName(final String accountName, final String token) {
new Thread(() -> userAccountsDao.updateAccountTokenByAccountName(accountName, token)).start();
executorService.execute(() -> userAccountsDao.updateAccountTokenByAccountName(accountName, token));
}
public UserAccount getAccountData(String accountName) {
try {
Thread thread = new Thread(() -> userAccount = userAccountsDao.fetchRowByAccount_(accountName));
thread.start();
thread.join();
}
catch(InterruptedException e) {
Log.e(Constants.userAccountsApi, e.toString());
}
return userAccount;
public UserAccount getAccountByName(String accountName) {
return userAccountsDao.getAccountByName(accountName);
}
public Integer getCount(String accountName) {
public UserAccount getAccountById(int accountId) {
return userAccountsDao.getAccountById(accountId);
}
try {
public Integer getCount() {
return userAccountsDao.getCount();
}
Thread thread = new Thread(() -> checkAccount = userAccountsDao.getCount(accountName));
thread.start();
thread.join();
}
catch(InterruptedException e) {
Log.e(Constants.userAccountsApi, e.toString());
}
return checkAccount;
public Boolean userAccountExists(String accountName) {
return userAccountsDao.userAccountExists(accountName);
}
public LiveData<List<UserAccount>> getAllAccounts() {
return userAccountsDao.fetchAllAccounts();
return userAccountsDao.getAllAccounts();
}
public List<UserAccount> usersAccounts() {
try {
Thread thread = new Thread(() -> userAccounts = userAccountsDao.userAccounts());
thread.start();
thread.join();
}
catch(InterruptedException e) {
Log.e(Constants.userAccountsApi, e.toString());
}
return userAccounts;
return userAccountsDao.userAccounts();
}
public void deleteAccount(final int accountId) {
new Thread(() -> userAccountsDao.deleteAccount(accountId)).start();
executorService.execute(() -> userAccountsDao.deleteAccount(accountId));
}
}

View File

@ -15,22 +15,25 @@ import java.util.List;
public interface UserAccountsDao {
@Insert
long newAccount(UserAccount userAccounts);
long createAccount(UserAccount userAccounts);
@Query("SELECT * FROM UserAccounts ORDER BY accountId ASC")
LiveData<List<UserAccount>> fetchAllAccounts();
LiveData<List<UserAccount>> getAllAccounts();
@Query("SELECT * FROM UserAccounts ORDER BY accountId ASC")
List<UserAccount> userAccounts();
@Query("SELECT COUNT(accountId) FROM UserAccounts WHERE accountName = :accountName")
Integer getCount(String accountName);
@Query("SELECT COUNT(accountId) FROM UserAccounts")
Integer getCount();
@Query("SELECT * FROM UserAccounts WHERE accountName = :accountName")
UserAccount fetchRowByAccount_(String accountName);
@Query("SELECT COUNT(accountId) FROM UserAccounts WHERE accountName = :accountName LIMIT 1")
Boolean userAccountExists(String accountName);
@Query("SELECT * FROM UserAccounts WHERE accountId = :accountId")
UserAccount fetchRowByAccountId(int accountId);
@Query("SELECT * FROM UserAccounts WHERE accountName = :accountName LIMIT 1")
UserAccount getAccountByName(String accountName);
@Query("SELECT * FROM UserAccounts WHERE accountId = :accountId LIMIT 1")
UserAccount getAccountById(int accountId);
@Query("UPDATE UserAccounts SET serverVersion = :serverVersion WHERE accountId = :accountId")
void updateServerVersion(String serverVersion, int accountId);

View File

@ -22,32 +22,16 @@ import org.mian.gitnex.database.models.UserAccount;
version = 3, exportSchema = false)
public abstract class GitnexDatabase extends RoomDatabase {
private static final String DB_NAME = "gitnex";
private static GitnexDatabase gitnexDatabase;
public static GitnexDatabase getDatabaseInstance(Context context) {
if (gitnexDatabase == null) {
String DB_NAME = "gitnex";
gitnexDatabase = Room.databaseBuilder(context, GitnexDatabase.class, DB_NAME)
//.fallbackToDestructiveMigration()
.addMigrations(MIGRATION_1_2, MIGRATION_2_3)
.build();
}
return gitnexDatabase;
}
public abstract DraftsDao draftsDao();
public abstract RepositoriesDao repositoriesDao();
public abstract UserAccountsDao userAccountsDao();
private static final Migration MIGRATION_1_2 = new Migration(1, 2) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase database) {
//database.execSQL("DROP TABLE Drafts");
database.execSQL("ALTER TABLE 'Drafts' ADD COLUMN 'commentId' TEXT");
}
@ -56,8 +40,27 @@ public abstract class GitnexDatabase extends RoomDatabase {
private static final Migration MIGRATION_2_3 = new Migration(2, 3) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase database) {
database.execSQL("ALTER TABLE 'Drafts' ADD COLUMN 'issueType' TEXT");
}
};
public static GitnexDatabase getDatabaseInstance(Context context) {
if (gitnexDatabase == null) {
synchronized(GitnexDatabase.class) {
if(gitnexDatabase == null) {
gitnexDatabase = Room.databaseBuilder(context, GitnexDatabase.class, DB_NAME)
// .fallbackToDestructiveMigration()
.allowMainThreadQueries()
.addMigrations(MIGRATION_1_2, MIGRATION_2_3)
.build();
}
}
}
return gitnexDatabase;
}
}

View File

@ -24,6 +24,7 @@ import org.mian.gitnex.R;
import org.mian.gitnex.actions.ActionResult;
import org.mian.gitnex.actions.IssueActions;
import org.mian.gitnex.activities.MainActivity;
import org.mian.gitnex.database.api.BaseApi;
import org.mian.gitnex.database.api.DraftsApi;
import org.mian.gitnex.databinding.BottomSheetReplyLayoutBinding;
import org.mian.gitnex.helpers.Constants;
@ -57,7 +58,7 @@ public class BottomSheetReplyFragment extends BottomSheetDialogFragment {
super.onAttach(context);
tinyDB = TinyDB.getInstance(context);
draftsApi = new DraftsApi(context);
draftsApi = BaseApi.getInstance(context, DraftsApi.class);
repositoryId = (int) tinyDB.getLong("repositoryId", 0);
currentActiveAccountId = tinyDB.getInt("currentActiveAccountId");
@ -281,7 +282,7 @@ public class BottomSheetReplyFragment extends BottomSheetDialogFragment {
}
else {
DraftsApi.updateDraft(text, (int) draftId, "TODO");
draftsApi.updateDraft(text, (int) draftId, "TODO");
}
draftsHint.setVisibility(View.VISIBLE);

View File

@ -22,6 +22,7 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import org.mian.gitnex.R;
import org.mian.gitnex.activities.MainActivity;
import org.mian.gitnex.adapters.DraftsAdapter;
import org.mian.gitnex.database.api.BaseApi;
import org.mian.gitnex.database.api.DraftsApi;
import org.mian.gitnex.database.models.DraftWithRepository;
import org.mian.gitnex.databinding.FragmentDraftsBinding;
@ -59,7 +60,7 @@ public class DraftsFragment extends Fragment {
TinyDB tinyDb = TinyDB.getInstance(ctx);
draftsList_ = new ArrayList<>();
draftsApi = new DraftsApi(ctx);
draftsApi = BaseApi.getInstance(ctx, DraftsApi.class);
noData = fragmentDraftsBinding.noData;
mRecyclerView = fragmentDraftsBinding.recyclerView;
@ -123,7 +124,7 @@ public class DraftsFragment extends Fragment {
if(draftsList_.size() > 0) {
DraftsApi.deleteAllDrafts(accountId);
BaseApi.getInstance(ctx, DraftsApi.class).deleteAllDrafts(accountId);
draftsList_.clear();
adapter.notifyDataSetChanged();
Toasty.success(ctx, getResources().getString(R.string.draftsDeleteSuccess));

View File

@ -63,8 +63,7 @@ public class RepositoriesFragment extends Fragment {
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(),
DividerItemDecoration.VERTICAL);
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(), DividerItemDecoration.VERTICAL);
mRecyclerView.addItemDecoration(dividerItemDecoration);
createNewRepo = fragmentRepositoriesBinding.addNewRepo;

View File

@ -18,6 +18,7 @@ import org.mian.gitnex.R;
import org.mian.gitnex.activities.AddNewAccountActivity;
import org.mian.gitnex.activities.MainActivity;
import org.mian.gitnex.adapters.UserAccountsAdapter;
import org.mian.gitnex.database.api.BaseApi;
import org.mian.gitnex.database.api.UserAccountsApi;
import org.mian.gitnex.database.models.UserAccount;
import org.mian.gitnex.databinding.FragmentUserAccountsBinding;
@ -48,7 +49,7 @@ public class UserAccountsFragment extends Fragment {
((MainActivity) requireActivity()).setActionBarTitle(getResources().getString(R.string.pageTitleUserAccounts));
userAccountsList = new ArrayList<>();
userAccountsApi = new UserAccountsApi(ctx);
userAccountsApi = BaseApi.getInstance(ctx, UserAccountsApi.class);
mRecyclerView = fragmentUserAccountsBinding.recyclerView;
final SwipeRefreshLayout swipeRefresh = fragmentUserAccountsBinding.pullToRefresh;

View File

@ -13,6 +13,7 @@ import android.util.TypedValue;
import android.view.View;
import androidx.annotation.ColorInt;
import androidx.core.content.pm.PackageInfoCompat;
import org.mian.gitnex.database.models.UserAccount;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@ -69,7 +70,6 @@ public class AppUtil {
}
public static boolean hasNetworkConnection(Context context) {
return NetworkStatusObserver.getInstance(context).hasNetworkConnection();
}
@ -274,32 +274,27 @@ public class AppUtil {
}
public static String getLastCharactersOfWord(String str, int count) {
return str.substring(str.length() - count);
}
public static void setMultiVisibility(int visibility, View... views) {
for(View view : views) {
view.setVisibility(visibility);
}
}
public static int getPixelsFromDensity(Context context, int dp) {
return (int) (context.getResources().getDisplayMetrics().density * dp);
}
public static int getPixelsFromScaledDensity(Context context, int sp) {
return (int) (context.getResources().getDisplayMetrics().scaledDensity * sp);
}
public static int getLineCount(String s) {
public static long getLineCount(String s) {
int lines = 0;
long lines = 0;
Pattern pattern = Pattern.compile("(\r\n|\r|\n)");
Matcher matcher = pattern.matcher(s);
@ -307,6 +302,11 @@ public class AppUtil {
while(matcher.find())
lines++;
// Sometimes there may be text, but no line breaks.
// This should still count as one line.
if(s.length() > 0 && lines == 0)
return 1;
return lines;
}
@ -320,5 +320,27 @@ public class AppUtil {
clipboard.setPrimaryClip(clip);
Toasty.info(ctx, message);
}
public static boolean switchToAccount(Context context, UserAccount userAccount) {
TinyDB tinyDB = TinyDB.getInstance(context);
if(tinyDB.getInt("currentActiveAccountId") != userAccount.getAccountId()) {
tinyDB.putString("loginUid", userAccount.getUserName());
tinyDB.putString("userLogin", userAccount.getUserName());
tinyDB.putString(userAccount.getUserName() + "-token", userAccount.getToken());
tinyDB.putString("instanceUrl", userAccount.getInstanceUrl());
tinyDB.putInt("currentActiveAccountId", userAccount.getAccountId());
return true;
}
return false;
}
}

View File

@ -1,6 +1,7 @@
package org.mian.gitnex.helpers;
import android.content.Context;
import org.mian.gitnex.database.models.UserAccount;
import okhttp3.Credentials;
/**
@ -24,11 +25,14 @@ public class Authorization {
}
public static String get(UserAccount userAccount) {
return "token " + userAccount.getToken();
}
public static String getWeb(Context context) {
TinyDB tinyDb = TinyDB.getInstance(context);
return Credentials.basic("", tinyDb.getString(tinyDb.getString("loginUid") + "-token"));
}
}

View File

@ -56,6 +56,11 @@ public class Constants {
public static final String mainNotificationChannelId = "main_channel";
public static final String downloadNotificationChannelId = "dl_channel";
public static final long[] defaultVibrationPattern = new long[] { 1000, 1000 };
public static final String[] fallbackReactions = new String[]{"+1", "-1", "laugh", "hooray", "confused", "heart", "rocket", "eyes"};
// work managers
public static final String notificationsWorkerId = "notifications_worker";
}

View File

@ -50,7 +50,7 @@ public class Version {
final Pattern pattern_number_dot_number = Pattern.compile("^\\d+(\\.(\\d)+)*");
if(!valid(raw)) {
throw new IllegalArgumentException("Invalid version format");
throw new IllegalArgumentException("Invalid version format: " + raw);
}
if(raw.charAt(0) == 'v' || raw.charAt(0) == 'V') {

View File

@ -1,5 +1,6 @@
package org.mian.gitnex.helpers.views;
import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
@ -36,19 +37,16 @@ public class SyntaxHighlightedArea extends LinearLayout {
private LinesView linesView;
public SyntaxHighlightedArea(@NonNull Context context) {
super(context);
setup();
}
public SyntaxHighlightedArea(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
setup();
}
public SyntaxHighlightedArea(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
setup();
}
@ -62,9 +60,10 @@ public class SyntaxHighlightedArea extends LinearLayout {
sourceView = new TextView(getContext());
sourceView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
sourceView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
sourceView.setTypeface(Typeface.createFromAsset(getContext().getAssets(), "fonts/sourcecodeproregular.ttf"));
sourceView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
sourceView.setTextColor(prism4jTheme.textColor());
sourceView.setTextIsSelectable(true);
int padding = AppUtil.getPixelsFromDensity(getContext(), 5);
sourceView.setPadding(padding, 0, padding, 0);
@ -97,34 +96,57 @@ public class SyntaxHighlightedArea extends LinearLayout {
public void setContent(@NonNull String source, @NonNull String extension) {
if(source.length() > 0) {
linesView.setLineCount(AppUtil.getLineCount(source));
try {
Thread highlightingThread = new Thread(() -> {
MainGrammarLocator mainGrammarLocator = MainGrammarLocator.getInstance();
Prism4j prism4j = new Prism4j(mainGrammarLocator);
try {
CharSequence highlightedSource = Prism4jSyntaxHighlight.create(prism4j, prism4jTheme, MainGrammarLocator.DEFAULT_FALLBACK_LANGUAGE)
.highlight(mainGrammarLocator.fromExtension(extension), source);
MainGrammarLocator mainGrammarLocator = MainGrammarLocator.getInstance();
if(highlightedSource.charAt(highlightedSource.length() - 1) == '\n') {
// Removes a line break which is probably added by Prism4j but not actually present in the source.
// This line should be altered in case this gets fixed.
sourceView.setText(highlightedSource.subSequence(0, highlightedSource.length() - 1));
}
else {
sourceView.setText(highlightedSource);
CharSequence highlightedSource = Prism4jSyntaxHighlight
.create(new Prism4j(mainGrammarLocator), prism4jTheme, MainGrammarLocator.DEFAULT_FALLBACK_LANGUAGE)
.highlight(mainGrammarLocator.fromExtension(extension), source);
getActivity().runOnUiThread(() -> {
if(highlightedSource.charAt(highlightedSource.length() - 1) == '\n') {
// Removes a line break which is probably added by Prism4j but not actually present in the source.
// This line should be altered in case this gets fixed.
sourceView.setText(highlightedSource.subSequence(0, highlightedSource.length() - 1));
} else {
sourceView.setText(highlightedSource);
}
});
} catch(Throwable ignored) {
// Fall back to plaintext if something fails
getActivity().runOnUiThread(() -> sourceView.setText(source));
}
} catch(Throwable ignored) {
// Fall back to plaintext if something fails
sourceView.setText(source);
}
});
Thread lineCountingThread = new Thread(() -> {
long lineCount = AppUtil.getLineCount(source);
try {
highlightingThread.join();
} catch(InterruptedException ignored) {}
getActivity().runOnUiThread(() -> linesView.setLineCount(lineCount));
});
highlightingThread.start();
lineCountingThread.start();
}
}
public String getContent() {
private Activity getActivity() {
return (Activity) getContext();
}
public String getContent() {
return sourceView.getText().toString();
}
@ -137,27 +159,31 @@ public class SyntaxHighlightedArea extends LinearLayout {
@ColorInt private int textColor;
@ColorInt private int lineColor;
private int lineCount;
private long lineCount;
public LinesView(Context context) {
super(context);
}
public void setLineCount(int lineCount) {
public void setLineCount(long lineCount) {
this.lineCount = lineCount;
requestLayout();
}
@Override
public void setBackgroundColor(@ColorInt int backgroundColor) {
this.backgroundColor = backgroundColor;
invalidate();
}
public void setTextColor(@ColorInt int textColor) {
this.textColor = textColor;
invalidate();
}
public void setLineColor(@ColorInt int lineColor) {
this.lineColor = lineColor;
invalidate();
}
public Paint getPaint() {

View File

@ -13,7 +13,6 @@ import androidx.work.WorkManager;
import org.mian.gitnex.R;
import org.mian.gitnex.helpers.Constants;
import org.mian.gitnex.helpers.TinyDB;
import org.mian.gitnex.helpers.Version;
import java.util.concurrent.TimeUnit;
/**
@ -22,8 +21,6 @@ import java.util.concurrent.TimeUnit;
public class Notifications {
private static int notificationsSupported = -1;
public static int uniqueNotificationId(Context context) {
TinyDB tinyDB = TinyDB.getInstance(context);
@ -51,7 +48,7 @@ public class Notifications {
mainChannel.setDescription(context.getString(R.string.mainNotificationChannelDescription));
if(tinyDB.getBoolean("notificationsEnableVibration", true)) {
mainChannel.setVibrationPattern(new long[] { 1000, 1000 });
mainChannel.setVibrationPattern(Constants.defaultVibrationPattern);
mainChannel.enableVibration(true);
} else {
mainChannel.enableVibration(false);
@ -75,7 +72,7 @@ public class Notifications {
public static void stopWorker(Context context) {
WorkManager.getInstance(context).cancelAllWorkByTag(context.getPackageName());
WorkManager.getInstance(context).cancelAllWorkByTag(Constants.notificationsWorkerId);
}
public static void startWorker(Context context) {
@ -84,42 +81,25 @@ public class Notifications {
if(tinyDB.getBoolean("notificationsEnabled", true)) {
if(notificationsSupported == -1) checkVersion(tinyDB);
if(notificationsSupported == 1) {
Constraints.Builder constraints = new Constraints.Builder()
.setRequiredNetworkType(NetworkType.CONNECTED)
.setRequiresBatteryNotLow(false)
.setRequiresStorageNotLow(false)
.setRequiresCharging(false);
if(android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
constraints.setRequiresDeviceIdle(false);
}
int pollingDelayMinutes = Math.max(tinyDB.getInt("pollingDelayMinutes", Constants.defaultPollingDelay), 15);
PeriodicWorkRequest periodicWorkRequest = new PeriodicWorkRequest.Builder(NotificationsWorker.class, pollingDelayMinutes, TimeUnit.MINUTES)
.setConstraints(constraints.build())
.addTag(context.getPackageName())
.build();
WorkManager.getInstance(context).enqueueUniquePeriodicWork(context.getPackageName(), ExistingPeriodicWorkPolicy.KEEP, periodicWorkRequest);
Constraints.Builder constraints = new Constraints.Builder()
.setRequiredNetworkType(NetworkType.CONNECTED)
.setRequiresBatteryNotLow(false)
.setRequiresStorageNotLow(false)
.setRequiresCharging(false);
if(android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
constraints.setRequiresDeviceIdle(false);
}
int pollingDelayMinutes = Math.max(tinyDB.getInt("pollingDelayMinutes", Constants.defaultPollingDelay), 15);
PeriodicWorkRequest periodicWorkRequest = new PeriodicWorkRequest.Builder(NotificationsWorker.class, pollingDelayMinutes, TimeUnit.MINUTES)
.setConstraints(constraints.build())
.addTag(Constants.notificationsWorkerId)
.build();
WorkManager.getInstance(context).enqueueUniquePeriodicWork(Constants.notificationsWorkerId, ExistingPeriodicWorkPolicy.KEEP, periodicWorkRequest);
}
}
private static void checkVersion(TinyDB tinyDB) {
String currentVersion = tinyDB.getString("giteaVersion");
if(tinyDB.getBoolean("loggedInMode") && !currentVersion.isEmpty()) {
notificationsSupported = new Version(currentVersion).higherOrEqual("1.12.3") ? 1 : 0;
}
}
}

View File

@ -15,12 +15,18 @@ import org.gitnex.tea4j.models.NotificationThread;
import org.mian.gitnex.R;
import org.mian.gitnex.activities.MainActivity;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.database.api.BaseApi;
import org.mian.gitnex.database.api.UserAccountsApi;
import org.mian.gitnex.database.models.UserAccount;
import org.mian.gitnex.helpers.AppUtil;
import org.mian.gitnex.helpers.Authorization;
import org.mian.gitnex.helpers.Constants;
import org.mian.gitnex.helpers.TinyDB;
import org.mian.gitnex.helpers.Version;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import retrofit2.Call;
import retrofit2.Response;
@ -30,86 +36,101 @@ import retrofit2.Response;
public class NotificationsWorker extends Worker {
private static final int MAXIMUM_NOTIFICATIONS = 100;
private final Context context;
private final TinyDB tinyDB;
private final Map<UserAccount, Map<String, String>> userAccounts;
public NotificationsWorker(@NonNull Context context, @NonNull WorkerParameters workerParams) {
super(context, workerParams);
UserAccountsApi userAccountsApi = BaseApi.getInstance(context, UserAccountsApi.class);
this.context = context;
this.tinyDB = TinyDB.getInstance(context);
this.userAccounts = new HashMap<>(userAccountsApi.getCount());
for(UserAccount userAccount : userAccountsApi.usersAccounts()) {
// We do also accept empty values, since the server version was not saved properly in the beginning.
if(userAccount.getServerVersion() == null || userAccount.getServerVersion().isEmpty() ||
new Version(userAccount.getServerVersion()).higherOrEqual("1.12.3")) {
Map<String, String> userAccountParameters = new HashMap<>();
userAccountParameters.put("previousTimestamp", AppUtil.getTimestampFromDate(context, new Date()));
userAccounts.put(userAccount, userAccountParameters);
}
}
}
@NonNull
@Override
public Result doWork() {
pollingLoops();
return Result.success();
}
int notificationLoops = tinyDB.getInt("pollingDelayMinutes", Constants.defaultPollingDelay) >= 15 ? 1 : Math.min(15 - tinyDB.getInt("pollingDelayMinutes"), 10);
/**
* Used to bypass the 15-minute limit of {@code WorkManager}.
*/
private void pollingLoops() {
int notificationLoops = tinyDB.getInt("pollingDelayMinutes", Constants.defaultPollingDelay) < 15 ?
Math.min(15 - tinyDB.getInt("pollingDelayMinutes"), 10) : 1;
for(int i = 0; i < notificationLoops; i++) {
long startPollingTime = System.currentTimeMillis();
try {
String previousRefreshTimestamp = tinyDB.getString("previousRefreshTimestamp", AppUtil.getTimestampFromDate(context, new Date()));
Call<List<NotificationThread>> call = RetrofitClient
.getApiInterface(context)
.getNotificationThreads(Authorization.get(context), false, new String[]{"unread"}, previousRefreshTimestamp,
null, 1, MAXIMUM_NOTIFICATIONS);
Response<List<NotificationThread>> response = call.execute();
if(response.code() == 200) {
assert response.body() != null;
List<NotificationThread> notificationThreads = response.body();
if(!notificationThreads.isEmpty())
sendNotification(notificationThreads);
tinyDB.putString("previousRefreshTimestamp", AppUtil.getTimestampFromDate(context, new Date()));
}
} catch(Exception ignored) {}
startPolling();
try {
if(notificationLoops > 1 && i < (notificationLoops - 1)) {
Thread.sleep(60000 - (System.currentTimeMillis() - startPollingTime));
}
} catch (InterruptedException ignored) {}
} catch(InterruptedException ignored) {}
}
return Result.success();
}
private void sendNotification(List<NotificationThread> notificationThreads) {
private void startPolling() {
for(UserAccount userAccount : userAccounts.keySet()) {
Map<String, String> userAccountParameters = userAccounts.get(userAccount);
int summaryId = 0;
PendingIntent pendingIntent = getPendingIntent();
try {
Call<List<NotificationThread>> call = RetrofitClient
.getApiInterface(context, userAccount.getInstanceUrl())
.getNotificationThreads(Authorization.get(userAccount), false, new String[]{"unread"},
userAccountParameters.get("previousTimestamp"), null, 1, Integer.MAX_VALUE);
Response<List<NotificationThread>> response = call.execute();
if(response.code() == 200 && response.body() != null) {
List<NotificationThread> notificationThreads = response.body();
if(!notificationThreads.isEmpty()) {
sendNotifications(userAccount, notificationThreads);
}
userAccountParameters.put("previousTimestamp", AppUtil.getTimestampFromDate(context, new Date()));
}
} catch(Exception ignored) {}
}
}
private void sendNotifications(@NonNull UserAccount userAccount, @NonNull List<NotificationThread> notificationThreads) {
PendingIntent pendingIntent = getPendingIntent(userAccount);
NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(context);
Notification summaryNotification = new NotificationCompat.Builder(context, context.getPackageName())
.setContentTitle(context.getString(R.string.newMessages))
Notification summaryNotification = new NotificationCompat.Builder(context, Constants.mainNotificationChannelId)
.setContentTitle(context.getString(R.string.newMessages, userAccount.getUserName()))
.setContentText(String.format(context.getString(R.string.youHaveGotNewNotifications), notificationThreads.size()))
.setSmallIcon(R.drawable.gitnex_transparent)
.setGroup(context.getPackageName())
.setGroup(userAccount.getUserName())
.setGroupSummary(true)
.setAutoCancel(true)
.setContentIntent(pendingIntent)
.setChannelId(Constants.mainNotificationChannelId)
.build();
notificationManagerCompat.notify(summaryId, summaryNotification);
notificationManagerCompat.notify(userAccount.getAccountId(), summaryNotification);
for(NotificationThread notificationThread : notificationThreads) {
@ -119,7 +140,7 @@ public class NotificationsWorker extends Worker {
NotificationCompat.Builder builder1 = getBaseNotificationBuilder()
.setContentTitle(notificationHeader)
.setGroup(context.getPackageName())
.setGroup(userAccount.getUserName())
.setContentIntent(pendingIntent);
notificationManagerCompat.notify(Notifications.uniqueNotificationId(context), builder1.build());
@ -129,21 +150,19 @@ public class NotificationsWorker extends Worker {
private NotificationCompat.Builder getBaseNotificationBuilder() {
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, context.getPackageName())
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, Constants.mainNotificationChannelId)
.setSmallIcon(R.drawable.gitnex_transparent)
.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))
.setCategory(NotificationCompat.CATEGORY_MESSAGE)
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
.setChannelId(Constants.mainNotificationChannelId)
.setAutoCancel(true);
if(tinyDB.getBoolean("notificationsEnableLights", true)) {
builder.setLights(tinyDB.getInt("notificationsLightColor", Color.GREEN), 1500, 1500);
}
if(tinyDB.getBoolean("notificationsEnableVibration", true)) {
builder.setVibrate(new long[]{ 1000, 1000 });
builder.setVibrate(Constants.defaultVibrationPattern);
} else {
builder.setVibrate(null);
}
@ -151,13 +170,16 @@ public class NotificationsWorker extends Worker {
return builder;
}
private PendingIntent getPendingIntent() {
private PendingIntent getPendingIntent(@NonNull UserAccount userAccount) {
Intent intent = new Intent(context, MainActivity.class);
intent.putExtra("launchFragment", "notifications");
intent.putExtra("switchAccountId", userAccount.getAccountId());
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
return PendingIntent.getActivity(context, 0, intent, 0);
return PendingIntent.getActivity(context, userAccount.getAccountId(), intent, PendingIntent.FLAG_UPDATE_CURRENT);
}
}

View File

@ -26,6 +26,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView

View File

@ -26,6 +26,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView

View File

@ -27,6 +27,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView

View File

@ -27,6 +27,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView

View File

@ -26,6 +26,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView

View File

@ -26,6 +26,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView

View File

@ -26,6 +26,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView

View File

@ -26,6 +26,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView

View File

@ -26,6 +26,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView

View File

@ -26,6 +26,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView

View File

@ -26,6 +26,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView

View File

@ -26,6 +26,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_arrow_back" />
<TextView

View File

@ -26,6 +26,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView

View File

@ -26,6 +26,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView

View File

@ -26,6 +26,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView

View File

@ -26,6 +26,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView

View File

@ -27,6 +27,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView

View File

@ -27,6 +27,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView

View File

@ -26,6 +26,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<HorizontalScrollView

View File

@ -26,6 +26,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView

View File

@ -28,6 +28,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView

View File

@ -26,6 +26,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView

View File

@ -27,6 +27,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView

View File

@ -27,6 +27,9 @@
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
@ -10,6 +11,7 @@
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:theme="@style/Widget.AppCompat.SearchView">
<com.google.android.material.appbar.MaterialToolbar
@ -22,10 +24,13 @@
android:id="@+id/close"
android:layout_width="@dimen/close_button_size"
android:layout_height="@dimen/close_button_size"
android:layout_marginRight="15dp"
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:layout_marginRight="15dp"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center_vertical"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_arrow_back" />
<TextView
@ -33,9 +38,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:maxLines="1"
android:text="@string/repoSettingsTitle"
android:textColor="?attr/primaryTextColor"
android:maxLines="1"
android:textSize="20sp" />
</com.google.android.material.appbar.MaterialToolbar>
@ -56,11 +61,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/repoSettingsEditProperties"
android:background="?android:attr/selectableItemBackground"
android:drawablePadding="32dp"
android:padding="16dp"
android:focusable="true"
android:clickable="true"
android:text="@string/repoSettingsEditProperties"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="16dp"
app:drawableStartCompat="@drawable/ic_edit" />
<View
@ -72,21 +80,25 @@
android:id="@+id/transferOwnerFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:orientation="vertical"
android:visibility="gone">
android:focusable="true"
android:clickable="true"
android:visibility="gone"
tools:visibility="visible">
<TextView
android:id="@+id/transferRepositoryOwnership"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/repoSettingsTransferOwnership"
android:drawablePadding="32dp"
android:paddingStart="16dp"
android:paddingTop="16dp"
android:paddingEnd="16dp"
android:text="@string/repoSettingsTransferOwnership"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:paddingTop="16dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
app:drawableStartCompat="@drawable/ic_arrow_up" />
<TextView
@ -94,12 +106,12 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingStart="72dp"
android:paddingEnd="16dp"
android:paddingBottom="16dp"
android:text="@string/repoSettingsTransferOwnershipHint"
android:textColor="?attr/hintColor"
android:textSize="12sp"
android:paddingBottom="16dp"
android:paddingStart="72dp"
android:paddingEnd="16dp" />
android:textSize="12sp" />
<View
android:layout_width="match_parent"
@ -110,8 +122,11 @@
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:orientation="vertical"
android:focusable="true"
android:clickable="true"
android:paddingBottom="16dp">
<TextView
@ -119,13 +134,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/repoSettingsDelete"
android:drawablePadding="32dp"
android:paddingStart="16dp"
android:paddingTop="16dp"
android:paddingEnd="16dp"
android:text="@string/repoSettingsDelete"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:paddingTop="16dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
app:drawableStartCompat="@drawable/ic_delete" />
<TextView
@ -133,11 +148,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingStart="72dp"
android:paddingEnd="16dp"
android:text="@string/repoSettingsDeleteHint"
android:textColor="?attr/hintColor"
android:textSize="12sp"
android:paddingStart="72dp"
android:paddingEnd="16dp" />
android:textSize="12sp" />
</LinearLayout>

View File

@ -10,6 +10,7 @@
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:theme="@style/Widget.AppCompat.SearchView">
<com.google.android.material.appbar.MaterialToolbar
@ -23,10 +24,13 @@
android:id="@+id/close"
android:layout_width="@dimen/close_button_size"
android:layout_height="@dimen/close_button_size"
android:layout_marginRight="15dp"
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:layout_marginRight="15dp"
android:contentDescription="@string/close"
android:gravity="center_vertical"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView
@ -34,9 +38,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:maxLines="1"
android:text="@string/settingsAppearanceHeader"
android:textColor="?attr/primaryTextColor"
android:maxLines="1"
android:textSize="20sp" />
</com.google.android.material.appbar.MaterialToolbar>
@ -47,29 +51,32 @@
android:id="@+id/themeSelectionFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="vertical">
android:background="?android:attr/selectableItemBackground"
android:orientation="vertical"
android:focusable="true"
android:clickable="true"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/themeHeaderSelector"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginTop="10dp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/themeSelectionHeaderText"
android:textColor="?attr/primaryTextColor"/>
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/themeSelected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/themeSelectionSelectedText"
android:textColor="?attr/selectedTextColor"/>
android:textColor="?attr/selectedTextColor"
android:textSize="14sp" />
</LinearLayout>
@ -77,29 +84,32 @@
android:id="@+id/customFontFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="vertical">
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/customFontHeaderSelector"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginTop="10dp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/settingsCustomFontHeaderText"
android:textColor="?attr/primaryTextColor"/>
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/customFontSelected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/settingsCustomFontDefault"
android:textColor="?attr/selectedTextColor"/>
android:textColor="?attr/selectedTextColor"
android:textSize="14sp" />
</LinearLayout>
@ -107,29 +117,32 @@
android:id="@+id/timeFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="vertical">
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/tvDateTimeHeaderSelector"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginTop="10dp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/settingsDateTimeHeaderText"
android:textColor="?attr/primaryTextColor"/>
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/tvDateTimeSelected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/settingsDateTimeHeaderDefault"
android:textColor="?attr/selectedTextColor"/>
android:textColor="?attr/selectedTextColor"
android:textSize="14sp" />
</LinearLayout>
@ -137,30 +150,31 @@
android:id="@+id/counterBadgeFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:orientation="horizontal">
android:orientation="horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/tvCounterBadgeHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/settingsCounterBadges"
android:textColor="?attr/primaryTextColor"/>
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/switchCounterBadge"
android:layout_toEndOf="@+id/tvCounterBadgeHeader"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:switchMinWidth="56dp"
android:layout_alignParentEnd="true"
android:layout_gravity="end"
android:layout_toEndOf="@+id/tvCounterBadgeHeader"
android:gravity="end"
android:paddingStart="0dp"
android:paddingEnd="24dp"
android:layout_alignParentEnd="true"
android:gravity="end"
android:layout_gravity="end" />
android:switchMinWidth="56dp" />
</RelativeLayout>

View File

@ -1,16 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/layoutReportingView"
android:orientation="vertical"
android:background="?attr/primaryBackgroundColor">
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:theme="@style/Widget.AppCompat.SearchView">
<com.google.android.material.appbar.MaterialToolbar
@ -24,10 +23,13 @@
android:id="@+id/close"
android:layout_width="@dimen/close_button_size"
android:layout_height="@dimen/close_button_size"
android:layout_marginRight="15dp"
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:layout_marginRight="15dp"
android:contentDescription="@string/close"
android:gravity="center_vertical"
android:focusable="true"
android:clickable="true"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_close" />
<TextView
@ -35,9 +37,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:maxLines="1"
android:text="@string/draftsHeader"
android:textColor="?attr/primaryTextColor"
android:maxLines="1"
android:textSize="20sp" />
</com.google.android.material.appbar.MaterialToolbar>
@ -48,42 +50,41 @@
android:id="@+id/enableDraftsCommentsDeletion"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:orientation="horizontal">
android:orientation="horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/enableCommentsDeletionHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/settingsEnableCommentsDeletionText"
android:textColor="?attr/primaryTextColor" />
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/commentsDeletionSwitch"
android:layout_toEndOf="@+id/enableCommentsDeletionHeader"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:switchMinWidth="56dp"
android:layout_alignParentEnd="true"
android:layout_gravity="end"
android:layout_toEndOf="@+id/enableCommentsDeletionHeader"
android:gravity="end"
android:paddingStart="0dp"
android:paddingEnd="25dp"
android:gravity="end"
android:layout_gravity="end"
android:layout_marginBottom="30dp" />
android:switchMinWidth="56dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/enableCommentsDeletionHeader"
android:layout_marginTop="5dp"
android:layout_marginStart="44dp"
android:layout_marginEnd="44dp"
android:text="@string/settingsEnableCommentsDeletionHintText"
android:textSize="12sp"
android:textColor="?attr/hintColor" />
android:textColor="?attr/hintColor"
android:textSize="12sp" />
</RelativeLayout>

View File

@ -1,16 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/layoutReportingView"
android:orientation="vertical"
android:background="?attr/primaryBackgroundColor">
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:theme="@style/Widget.AppCompat.SearchView">
<com.google.android.material.appbar.MaterialToolbar
@ -24,10 +23,13 @@
android:id="@+id/close"
android:layout_width="@dimen/close_button_size"
android:layout_height="@dimen/close_button_size"
android:layout_marginRight="15dp"
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:layout_marginRight="15dp"
android:contentDescription="@string/close"
android:gravity="center_vertical"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView
@ -35,9 +37,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:maxLines="1"
android:text="@string/settingsGeneralHeader"
android:textColor="?attr/primaryTextColor"
android:maxLines="1"
android:textSize="20sp" />
</com.google.android.material.appbar.MaterialToolbar>
@ -48,40 +50,41 @@
android:id="@+id/setDefaultLinkHandler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="vertical">
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/generalDeepLinkDefaultScreen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginTop="10dp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/generalDeepLinkDefaultScreen"
android:textColor="?attr/primaryTextColor"/>
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_marginStart="44dp"
android:layout_marginEnd="44dp"
android:text="@string/generalDeepLinkDefaultScreenHintText"
android:textSize="12sp"
android:textColor="?attr/hintColor" />
android:textColor="?attr/hintColor"
android:textSize="12sp" />
<TextView
android:id="@+id/generalDeepLinkSelected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/generalDeepLinkSelectedText"
android:textColor="?attr/selectedTextColor"/>
android:textColor="?attr/selectedTextColor"
android:textSize="14sp" />
</LinearLayout>
@ -89,29 +92,32 @@
android:id="@+id/homeScreenFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="vertical">
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/homeScreenHeaderSelector"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginTop="10dp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/settingsHomeScreenHeaderText"
android:textColor="?attr/primaryTextColor"/>
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/homeScreenSelected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/settingsHomeScreenSelectedText"
android:textColor="?attr/selectedTextColor"/>
android:textColor="?attr/selectedTextColor"
android:textSize="14sp" />
</LinearLayout>

View File

@ -1,18 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layoutSettingsNotifications"
android:orientation="vertical"
android:background="?attr/primaryBackgroundColor">
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
@ -27,10 +26,13 @@
android:id="@+id/close"
android:layout_width="@dimen/close_button_size"
android:layout_height="@dimen/close_button_size"
android:layout_marginRight="15dp"
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:layout_marginRight="15dp"
android:contentDescription="@string/close"
android:gravity="center_vertical"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView
@ -38,9 +40,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:maxLines="1"
android:text="@string/pageTitleNotifications"
android:textColor="?attr/primaryTextColor"
android:maxLines="1"
android:textSize="20sp" />
</androidx.appcompat.widget.Toolbar>
@ -51,8 +53,9 @@
android:id="@+id/enableNotificationsFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:orientation="horizontal">
android:orientation="horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/enableNotificationsHeader"
@ -66,15 +69,15 @@
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/enableNotificationsMode"
android:layout_toEndOf="@+id/enableNotificationsHeader"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:switchMinWidth="56dp"
android:layout_alignParentEnd="true"
android:layout_gravity="end"
android:layout_toEndOf="@+id/enableNotificationsHeader"
android:gravity="end"
android:paddingStart="0dp"
android:paddingEnd="25dp"
android:layout_alignParentEnd="true"
android:gravity="end"
android:layout_gravity="end" />
android:switchMinWidth="56dp" />
</RelativeLayout>
@ -82,29 +85,32 @@
android:id="@+id/pollingDelayFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="vertical">
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/pollingDelayHeaderSelector"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginTop="10dp"
android:layout_marginStart="44dp"
android:layout_marginEnd="4dp"
android:text="@string/notificationsPollingHeaderText"
android:textColor="?attr/primaryTextColor" />
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/pollingDelaySelected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_marginStart="44dp"
android:layout_marginEnd="4dp"
android:text="@string/pollingDelaySelectedText"
android:textColor="?attr/selectedTextColor" />
android:textColor="?attr/selectedTextColor"
android:textSize="14sp" />
</LinearLayout>
@ -112,30 +118,31 @@
android:id="@+id/enableLightsFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:orientation="horizontal">
android:orientation="horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/enableLightsHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/enableLightsHeaderText"
android:textColor="?attr/primaryTextColor" />
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/enableLightsMode"
android:layout_toEndOf="@+id/enableLightsHeader"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:switchMinWidth="56dp"
android:layout_alignParentEnd="true"
android:layout_gravity="end"
android:layout_toEndOf="@+id/enableLightsHeader"
android:gravity="end"
android:paddingStart="0dp"
android:paddingEnd="25dp"
android:layout_alignParentEnd="true"
android:gravity="end"
android:layout_gravity="end" />
android:switchMinWidth="56dp" />
</RelativeLayout>
@ -143,24 +150,25 @@
android:id="@+id/chooseColorFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:orientation="horizontal">
android:orientation="horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/chooseColorHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/chooseColorSelectorHeader"
android:textColor="?attr/primaryTextColor" />
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<androidx.cardview.widget.CardView
android:id="@+id/chooseColorState"
android:layout_alignEnd="@id/chooseColorHeader"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignEnd="@id/chooseColorHeader"
android:layout_alignParentEnd="true"
android:layout_marginEnd="30dp"
android:gravity="end"
@ -173,30 +181,31 @@
android:id="@+id/enableVibrationFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:orientation="horizontal">
android:orientation="horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/enableVibrationHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/enableVibrationHeaderText"
android:textColor="?attr/primaryTextColor" />
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/enableVibrationMode"
android:layout_toEndOf="@+id/enableVibrationHeader"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:switchMinWidth="56dp"
android:layout_alignParentEnd="true"
android:layout_gravity="end"
android:layout_toEndOf="@+id/enableVibrationHeader"
android:gravity="end"
android:paddingStart="0dp"
android:paddingEnd="25dp"
android:layout_alignParentEnd="true"
android:gravity="end"
android:layout_gravity="end" />
android:switchMinWidth="56dp" />
</RelativeLayout>

View File

@ -1,16 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/layoutReportingView"
android:orientation="vertical"
android:background="?attr/primaryBackgroundColor">
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:theme="@style/Widget.AppCompat.SearchView">
<com.google.android.material.appbar.MaterialToolbar
@ -23,10 +22,13 @@
android:id="@+id/close"
android:layout_width="@dimen/close_button_size"
android:layout_height="@dimen/close_button_size"
android:layout_marginRight="15dp"
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:layout_marginRight="15dp"
android:contentDescription="@string/close"
android:gravity="center_vertical"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView
@ -34,9 +36,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:maxLines="1"
android:text="@string/reportViewerHeader"
android:textColor="?attr/primaryTextColor"
android:maxLines="1"
android:textSize="20sp" />
</com.google.android.material.appbar.MaterialToolbar>
@ -47,31 +49,31 @@
android:id="@+id/enableSendReports"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:orientation="horizontal">
android:orientation="horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/enableReportsHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/settingsEnableReportsText"
android:textColor="?attr/primaryTextColor" />
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/crashReportsSwitch"
android:layout_toEndOf="@+id/enableReportsHeader"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:switchMinWidth="56dp"
android:layout_alignParentEnd="true"
android:layout_gravity="end"
android:layout_toEndOf="@+id/enableReportsHeader"
android:gravity="end"
android:paddingStart="0dp"
android:paddingEnd="25dp"
android:gravity="end"
android:layout_gravity="end"
android:layout_marginBottom="30dp" />
android:switchMinWidth="56dp" />
</RelativeLayout>

View File

@ -1,16 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/layoutSettingsCerts"
android:orientation="vertical"
android:background="?attr/primaryBackgroundColor">
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:theme="@style/Widget.AppCompat.SearchView">
<com.google.android.material.appbar.MaterialToolbar
@ -23,10 +22,13 @@
android:id="@+id/close"
android:layout_width="@dimen/close_button_size"
android:layout_height="@dimen/close_button_size"
android:layout_marginRight="15dp"
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:layout_marginRight="15dp"
android:contentDescription="@string/close"
android:gravity="center_vertical"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView
@ -34,9 +36,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:maxLines="1"
android:text="@string/settingsSecurityHeader"
android:textColor="?attr/primaryTextColor"
android:maxLines="1"
android:textSize="20sp" />
</com.google.android.material.appbar.MaterialToolbar>
@ -47,30 +49,31 @@
android:id="@+id/biometricFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:orientation="horizontal">
android:orientation="horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/biometricHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/settingsBiometricHeader"
android:textColor="?attr/primaryTextColor"/>
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/switchBiometric"
android:layout_toEndOf="@+id/biometricHeader"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:switchMinWidth="56dp"
android:layout_alignParentEnd="true"
android:layout_gravity="end"
android:layout_toEndOf="@+id/biometricHeader"
android:gravity="end"
android:paddingStart="0dp"
android:paddingEnd="24dp"
android:layout_alignParentEnd="true"
android:gravity="end"
android:layout_gravity="end" />
android:switchMinWidth="56dp" />
</RelativeLayout>
@ -78,19 +81,22 @@
android:id="@+id/certsFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="vertical">
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/tvCertHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginTop="10dp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/settingsCertsSelectorHeader"
android:textColor="?attr/primaryTextColor"/>
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
</LinearLayout>
@ -98,29 +104,32 @@
android:id="@+id/cacheSizeDataSelectionFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:orientation="vertical">
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/cacheSizeDataHeaderSelector"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginTop="10dp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/cacheSizeDataSelectionHeaderText"
android:textColor="?attr/primaryTextColor"/>
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/cacheSizeDataSelected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/cacheSizeDataSelectionSelectedText"
android:textColor="?attr/selectedTextColor"/>
android:textColor="?attr/selectedTextColor"
android:textSize="14sp" />
</LinearLayout>
@ -128,29 +137,32 @@
android:id="@+id/cacheSizeImagesSelectionFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="vertical">
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/cacheSizeImagesHeaderSelector"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginTop="10dp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/cacheSizeImagesSelectionHeaderText"
android:textColor="?attr/primaryTextColor"/>
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/cacheSizeImagesSelected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/cacheSizeImagesSelectionSelectedText"
android:textColor="?attr/selectedTextColor"/>
android:textColor="?attr/selectedTextColor"
android:textSize="14sp" />
</LinearLayout>
@ -158,29 +170,32 @@
android:id="@+id/clearCacheSelectionFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="vertical">
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/clearCacheHeaderSelector"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginTop="10dp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/clearCacheSelectionHeaderText"
android:textColor="?attr/primaryTextColor"/>
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/clearCacheSelected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/clearCacheSelectionSelectedText"
android:textColor="?attr/selectedTextColor"/>
android:textColor="?attr/selectedTextColor"
android:textSize="14sp" />
</LinearLayout>

View File

@ -10,6 +10,7 @@
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:theme="@style/Widget.AppCompat.SearchView">
<com.google.android.material.appbar.MaterialToolbar
@ -22,10 +23,13 @@
android:id="@+id/close"
android:layout_width="@dimen/close_button_size"
android:layout_height="@dimen/close_button_size"
android:layout_marginRight="15dp"
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:layout_marginRight="15dp"
android:contentDescription="@string/close"
android:gravity="center_vertical"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView
@ -33,9 +37,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:maxLines="1"
android:text="@string/settingsLanguageHeaderText"
android:textColor="?attr/primaryTextColor"
android:maxLines="1"
android:textSize="20sp" />
</com.google.android.material.appbar.MaterialToolbar>
@ -46,41 +50,44 @@
android:id="@+id/langFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="vertical">
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/tvLanguageHeaderSelector"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginTop="10dp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/settingsLanguageSelectorHeader"
android:textColor="?attr/primaryTextColor"/>
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/tvLanguageSelected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_marginStart="44dp"
android:layout_marginEnd="24dp"
android:text="@string/settingsLanguageSelectedHeaderDefault"
android:textColor="?attr/selectedTextColor"/>
android:textColor="?attr/selectedTextColor"
android:textSize="14sp" />
<TextView
android:id="@+id/helpTranslate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_marginStart="44dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="24dp"
android:autoLink="web"
android:layout_marginTop="20dp"
android:text="@string/settingsHelpTranslateText"
android:textColor="@color/lightBlue"/>
android:textColor="@color/lightBlue"
android:textSize="14sp" />
</LinearLayout>

View File

@ -15,19 +15,22 @@
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/createNewUser"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/adminCreateNewUser"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/adminCreateNewUser"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_person_add" />
</LinearLayout>

View File

@ -15,19 +15,22 @@
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/deleteAllDrafts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/deleteAllDrafts"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/deleteAllDrafts"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_delete" />
</LinearLayout>

View File

@ -23,9 +23,12 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/editFile"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/editFile"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_edit" />
@ -35,9 +38,12 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/deleteFile"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/deleteFile"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_delete" />
@ -47,11 +53,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/downloadFile"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/downloadFile"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_download" />
</LinearLayout>

View File

@ -30,11 +30,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/menuEditText"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/menuEditText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_edit" />
<TextView
@ -42,11 +45,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/menuDeleteText"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/menuDeleteText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_delete" />
<TextView
@ -54,11 +60,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/menuQuoteText"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/menuQuoteText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_comment" />
<TextView
@ -66,11 +75,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/copyCommentText"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/copyCommentText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_copy" />
<TextView
@ -78,11 +90,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/issueCommentShare"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/issueCommentShare"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_share" />
<TextView
@ -90,11 +105,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/genericCopyUrl"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/genericCopyUrl"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_link" />
</LinearLayout>

View File

@ -23,11 +23,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/isOpen"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/isOpen"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_issue" />
<TextView
@ -35,11 +38,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/isClosed"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/isClosed"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_done" />
</LinearLayout>

View File

@ -22,10 +22,10 @@
android:id="@+id/bottomSheetHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/labelName"
android:paddingStart="18dp"
android:paddingEnd="18dp"
android:paddingBottom="18dp"
android:text="@string/labelName"
android:textColor="?attr/primaryTextColor"
android:textSize="18sp" />
@ -41,11 +41,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/labelMenuEdit"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/labelMenuEdit"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_edit" />
<TextView
@ -53,11 +56,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/labelMenuDelete"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/labelMenuDelete"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_delete" />
</LinearLayout>

View File

@ -23,11 +23,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/isOpen"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/isOpen"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_milestone" />
<TextView
@ -35,11 +38,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/isClosed"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/isClosed"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_done" />
</LinearLayout>

View File

@ -23,11 +23,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/closeMilestone"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/closeMilestone"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_close" />
<TextView
@ -35,11 +38,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/openMilestone"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/openMilestone"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_check" />
</LinearLayout>

View File

@ -23,11 +23,14 @@ android:background="?attr/primaryBackgroundColor">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/pinNotification"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/pinNotification"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_pin" />
<TextView
@ -35,11 +38,14 @@ android:background="?attr/primaryBackgroundColor">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/markAsRead"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/markAsRead"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_unwatch" />
<TextView
@ -47,11 +53,14 @@ android:background="?attr/primaryBackgroundColor">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/markAsUnread"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/markAsUnread"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_watchers" />
</LinearLayout>

View File

@ -23,11 +23,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/isUnread"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/isUnread"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_watchers" />
<TextView
@ -35,11 +38,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/isRead"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/isRead"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_unwatch" />
</LinearLayout>

View File

@ -23,11 +23,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/createRepository"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/createRepository"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_repo" />
<TextView
@ -35,11 +38,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/createLabel"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/createLabel"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_label" />
<TextView
@ -47,11 +53,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/orgCreateTeam"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/orgCreateTeam"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_people" />
<TextView
@ -59,11 +68,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/genericCopyUrl"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/genericCopyUrl"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_copy" />
</LinearLayout>

View File

@ -23,11 +23,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/addNewMember"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/addNewMember"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_person_add" />
</LinearLayout>

View File

@ -23,11 +23,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/profileCreateNewEmailAddress"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/profileCreateNewEmailAddress"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_email" />
</LinearLayout>

View File

@ -23,11 +23,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/isOpen"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/isOpen"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_pull_request" />
<TextView
@ -35,11 +38,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/isClosed"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/isClosed"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_done" />
</LinearLayout>

View File

@ -31,8 +31,10 @@
android:layout_height="26dp"
android:layout_marginEnd="15dp"
android:layout_weight="0"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@string/close"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:src="@drawable/ic_close" />
<TextView
@ -52,6 +54,8 @@
android:layout_marginStart="15dp"
android:layout_weight="0"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:contentDescription="@string/close"
android:src="@drawable/ic_drafts" />
@ -63,6 +67,8 @@
android:layout_weight="0"
android:alpha=".5"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:contentDescription="@string/close"
android:enabled="false"
android:src="@drawable/ic_send" />

View File

@ -23,6 +23,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/pageTitleNewFile"
@ -35,6 +38,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/pageTitleCreateNewIssue"
@ -47,6 +53,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/pageTitleNewPullRequest"
@ -59,11 +68,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/pageTitleCreateMilestone"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/pageTitleCreateMilestone"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_milestone" />
<TextView
@ -71,11 +83,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/createLabel"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/createLabel"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_label" />
<TextView
@ -83,11 +98,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/createRelease"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/createRelease"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_release" />
<View
@ -103,11 +121,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/addCollaboratorTitle"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/addCollaboratorTitle"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_person_add" />
<TextView
@ -115,11 +136,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/starRepository"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/starRepository"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_star_unfilled" />
<TextView
@ -127,11 +151,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/unStarRepository"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/unStarRepository"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_star" />
<TextView
@ -139,11 +166,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/watchRepository"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/watchRepository"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_unwatch" />
<TextView
@ -151,11 +181,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/unWatchRepository"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/unWatchRepository"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_watchers" />
<View
@ -171,11 +204,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/genericCopyUrl"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_copy" />
<TextView
@ -183,11 +219,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/shareRepository"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_share" />
<TextView
@ -195,11 +234,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/openWebRepo"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_browser" />
<View
@ -216,11 +258,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/navSettings"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_settings" />
</LinearLayout>

View File

@ -2,6 +2,7 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
@ -30,24 +31,31 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/openFileDiffText"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/openFileDiffText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:visibility="gone"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_file" />
app:drawableStartCompat="@drawable/ic_file"
tools:visibility="visible" />
<TextView
android:id="@+id/mergePullRequest"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/mergePullRequestText"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/mergePullRequestText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_pull_request" />
<TextView
@ -55,11 +63,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/editIssue"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/editIssue"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_edit" />
<TextView
@ -67,11 +78,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/addRemoveAssignees"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/addRemoveAssignees"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_person_add" />
<TextView
@ -79,11 +93,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/singleIssueEditLabels"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/singleIssueEditLabels"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_label" />
<TextView
@ -91,11 +108,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/singleIssueSubscribe"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/singleIssueSubscribe"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_unwatch" />
<TextView
@ -103,13 +123,17 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/singleIssueUnSubscribe"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:visibility="gone"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_watchers" />
app:drawableStartCompat="@drawable/ic_watchers"
tools:visibility="visible" />
<View
android:layout_width="match_parent"
@ -124,11 +148,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/shareIssue"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_share" />
<TextView
@ -136,11 +163,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/copyIssueUrl"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_copy" />
<View
@ -156,11 +186,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/closeIssue"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/closeIssue"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_issue_closed" />
<TextView
@ -168,13 +201,17 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/reOpenIssue"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/reOpenIssue"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:visibility="gone"
android:padding="12dp"
app:drawableStartCompat="@drawable/ic_reopen" />
app:drawableStartCompat="@drawable/ic_reopen"
tools:visibility="visible" />
</LinearLayout>

View File

@ -94,17 +94,18 @@
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
android:theme="@style/AppTheme.AppBarOverlay"
app:elevation="0dp">
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabs"
app:tabMode="scrollable"
app:tabTextAppearance="@style/customTabLayout"
android:layout_width="match_parent"
app:tabTextColor="?attr/primaryTextColor"
android:layout_height="wrap_content"
android:background="?attr/primaryBackgroundColor"
app:tabIndicatorColor="?attr/pagerTabIndicatorColor"
android:layout_height="wrap_content">
app:tabMode="scrollable"
app:tabTextAppearance="@style/customTabLayout"
app:tabTextColor="?attr/primaryTextColor">
<com.google.android.material.tabs.TabItem
android:id="@+id/profileTabFollowers"

View File

@ -102,6 +102,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:gravity="center"
android:orientation="vertical">
@ -124,6 +127,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:gravity="center"
android:orientation="vertical">
@ -146,6 +152,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:gravity="center"
android:orientation="vertical">
@ -168,6 +177,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:clickable="true"
android:gravity="center"
android:orientation="vertical">

View File

@ -14,15 +14,20 @@
<LinearLayout
android:id="@+id/settingsMainFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_height="wrap_content">
android:paddingTop="10dp">
<LinearLayout
android:id="@+id/generalFrame"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_marginTop="20dp">
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/tvGeneral"
@ -52,9 +57,13 @@
<LinearLayout
android:id="@+id/appearanceFrame"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_marginTop="25dp">
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/tvAppearance"
@ -85,8 +94,12 @@
android:id="@+id/draftsFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:orientation="vertical"
android:layout_marginTop="25dp">
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/draftsHeader"
@ -117,8 +130,12 @@
android:id="@+id/securityFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:orientation="vertical"
android:layout_marginTop="25dp">
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/tvSecurity"
@ -137,9 +154,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/securityHintText"
android:paddingStart="60dp"
android:paddingEnd="12dp"
android:text="@string/securityHintText"
android:textColor="?attr/primaryTextColor"
android:textSize="12sp" />
@ -149,8 +166,12 @@
android:id="@+id/notificationsFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:visibility="gone">
<TextView
@ -182,8 +203,12 @@
android:id="@+id/languagesFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:orientation="vertical"
android:layout_marginTop="25dp">
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/tvLanguages"
@ -202,9 +227,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/languagesHintText"
android:paddingStart="60dp"
android:paddingEnd="12dp"
android:text="@string/languagesHintText"
android:textColor="?attr/primaryTextColor"
android:textSize="12sp" />
@ -214,8 +239,12 @@
android:id="@+id/reportsFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:orientation="vertical"
android:layout_marginTop="25dp">
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/appReports"
@ -234,9 +263,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/reportsHintText"
android:paddingStart="60dp"
android:paddingEnd="12dp"
android:text="@string/reportsHintText"
android:textColor="?attr/primaryTextColor"
android:textSize="12sp" />
@ -246,29 +275,33 @@
android:id="@+id/rateAppFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:orientation="vertical"
android:layout_marginTop="25dp">
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/rateApp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableStart="@drawable/ic_like"
android:drawablePadding="24dp"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:text="@string/navRate"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_like" />
<TextView
android:id="@+id/rateAppHintText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/rateAppHintText"
android:paddingStart="60dp"
android:paddingEnd="12dp"
android:text="@string/rateAppHintText"
android:textColor="?attr/primaryTextColor"
android:textSize="12sp" />
@ -278,9 +311,12 @@
android:id="@+id/aboutAppFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:orientation="vertical"
android:layout_marginTop="25dp"
android:layout_marginBottom="20dp">
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/aboutApp"
@ -299,9 +335,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/aboutAppHintText"
android:paddingStart="60dp"
android:paddingEnd="12dp"
android:text="@string/aboutAppHintText"
android:textColor="?attr/primaryTextColor"
android:textSize="12sp" />

View File

@ -560,7 +560,7 @@
<string name="enableLightsHeaderText">Enable Light</string>
<string name="enableVibrationHeaderText">Enable Vibration</string>
<string name="chooseColorSelectorHeader">Choose Color</string>
<string name="newMessages">New messages</string>
<string name="newMessages">New messages for %s</string>
<string name="youHaveGotNewNotifications">You\'ve got %d new notifications.</string>
<string name="mainNotificationChannelName">Notifications</string>
<string name="mainNotificationChannelDescription">This is the main notification channel of GitNex.</string>

View File

@ -557,7 +557,7 @@
<string name="enableLightsHeaderText">Enable Light</string>
<string name="enableVibrationHeaderText">Enable Vibration</string>
<string name="chooseColorSelectorHeader">Choose Color</string>
<string name="newMessages">New messages</string>
<string name="newMessages">New messages for %s</string>
<string name="youHaveGotNewNotifications">You\'ve got %d new notifications.</string>
<string name="mainNotificationChannelName">Notifications</string>
<string name="mainNotificationChannelDescription">This is the main notification channel of GitNex.</string>

View File

@ -557,7 +557,7 @@
<string name="enableLightsHeaderText">Aktiviere Hell</string>
<string name="enableVibrationHeaderText">Vibration aktivieren</string>
<string name="chooseColorSelectorHeader">Farbe auswählen</string>
<string name="newMessages">Neue Nachrichten</string>
<string name="newMessages">Neue Nachrichten für %s</string>
<string name="youHaveGotNewNotifications">Du hast %d neue Nachrichten.</string>
<string name="mainNotificationChannelName">Benachrichtigungen</string>
<string name="mainNotificationChannelDescription">Das ist der Haupt-Nachrichten-Kanal von GitNex.</string>

View File

@ -557,7 +557,7 @@
<string name="enableLightsHeaderText">Enable Light</string>
<string name="enableVibrationHeaderText">Enable Vibration</string>
<string name="chooseColorSelectorHeader">Choose Color</string>
<string name="newMessages">New messages</string>
<string name="newMessages">New messages for %s</string>
<string name="youHaveGotNewNotifications">You\'ve got %d new notifications.</string>
<string name="mainNotificationChannelName">Notifications</string>
<string name="mainNotificationChannelDescription">This is the main notification channel of GitNex.</string>

View File

@ -560,7 +560,7 @@
<string name="enableLightsHeaderText">Enable Light</string>
<string name="enableVibrationHeaderText">فعال‌سازی لرزش</string>
<string name="chooseColorSelectorHeader">انتخاب رنگ</string>
<string name="newMessages">پیام‌های جدید</string>
<string name="newMessages">New messages for %s</string>
<string name="youHaveGotNewNotifications">You\'ve got %d new notifications.</string>
<string name="mainNotificationChannelName">Notifications</string>
<string name="mainNotificationChannelDescription">This is the main notification channel of GitNex.</string>

View File

@ -557,7 +557,7 @@
<string name="enableLightsHeaderText">Enable Light</string>
<string name="enableVibrationHeaderText">Enable Vibration</string>
<string name="chooseColorSelectorHeader">Choose Color</string>
<string name="newMessages">New messages</string>
<string name="newMessages">New messages for %s</string>
<string name="youHaveGotNewNotifications">You\'ve got %d new notifications.</string>
<string name="mainNotificationChannelName">Notifications</string>
<string name="mainNotificationChannelDescription">This is the main notification channel of GitNex.</string>

View File

@ -557,7 +557,7 @@
<string name="enableLightsHeaderText">Activer le témoin lumineux</string>
<string name="enableVibrationHeaderText">Activer le vibreur</string>
<string name="chooseColorSelectorHeader">Couleur</string>
<string name="newMessages">Nouveaux messages</string>
<string name="newMessages">New messages for %s</string>
<string name="youHaveGotNewNotifications">Vous avez %d nouvelles notifications.</string>
<string name="mainNotificationChannelName">Notifications</string>
<string name="mainNotificationChannelDescription">Le canal de notifications principal de GitNex.</string>

View File

@ -69,7 +69,7 @@
<string name="malformedUrl">Impossibile connettersi all\'host. Controlla l\'URL o la porta per eventuali errori</string>
<string name="protocolError">Non si consiglia di utilizzare il protocollo HTTP a meno che non si stia testando sulla rete locale</string>
<string name="malformedJson">Malformed JSON was received. Server response was not successful</string>
<string name="emptyFieldURL">Istanza
<string name="emptyFieldURL">Istanza
URL è richiesto</string>
<string name="emptyFieldUsername">Nome utente obbligatorio</string>
<string name="emptyFieldPassword">Password obbligatoria</string>
@ -274,7 +274,7 @@ URL è richiesto</string>
<string name="newTeamPermissionAdmin">I membri possono inviare i repository del team e aggiungere loro collaboratori</string>
<string name="teamNameEmpty">Inserisci il nome del team</string>
<string name="teamNameError">Il nome del team deve contenere solo caratteri alfanumerici, trattino (-), trattino basso (_) e punto (.)</string>
<string name="teamPermissionEmpty">Seleziona
<string name="teamPermissionEmpty">Seleziona
autorizzazione</string>
<string name="teamDescError">La descrizione del team contiene caratteri non validi</string>
<string name="teamDescLimit">La descrizione del team ha più di 100 caratteri</string>
@ -559,7 +559,7 @@ autorizzazione</string>
<string name="enableLightsHeaderText">Enable Light</string>
<string name="enableVibrationHeaderText">Abilita la vibrazione</string>
<string name="chooseColorSelectorHeader">Scegli il colore</string>
<string name="newMessages">Nuovi messaggi</string>
<string name="newMessages">New messages for %s</string>
<string name="youHaveGotNewNotifications">You\'ve got %d new notifications.</string>
<string name="mainNotificationChannelName">Notifiche</string>
<string name="mainNotificationChannelDescription">This is the main notification channel of GitNex.</string>

View File

@ -557,7 +557,7 @@
<string name="enableLightsHeaderText">Enable Light</string>
<string name="enableVibrationHeaderText">Enable Vibration</string>
<string name="chooseColorSelectorHeader">Choose Color</string>
<string name="newMessages">New messages</string>
<string name="newMessages">New messages for %s</string>
<string name="youHaveGotNewNotifications">You\'ve got %d new notifications.</string>
<string name="mainNotificationChannelName">Notifications</string>
<string name="mainNotificationChannelDescription">This is the main notification channel of GitNex.</string>

View File

@ -557,7 +557,7 @@
<string name="enableLightsHeaderText">Enable Light</string>
<string name="enableVibrationHeaderText">Enable Vibration</string>
<string name="chooseColorSelectorHeader">Choose Color</string>
<string name="newMessages">New messages</string>
<string name="newMessages">New messages for %s</string>
<string name="youHaveGotNewNotifications">You\'ve got %d new notifications.</string>
<string name="mainNotificationChannelName">Notifications</string>
<string name="mainNotificationChannelDescription">This is the main notification channel of GitNex.</string>

View File

@ -557,7 +557,7 @@
<string name="enableLightsHeaderText">Enable Light</string>
<string name="enableVibrationHeaderText">Enable Vibration</string>
<string name="chooseColorSelectorHeader">Choose Color</string>
<string name="newMessages">New messages</string>
<string name="newMessages">New messages for %s</string>
<string name="youHaveGotNewNotifications">You\'ve got %d new notifications.</string>
<string name="mainNotificationChannelName">Notifications</string>
<string name="mainNotificationChannelDescription">This is the main notification channel of GitNex.</string>

View File

@ -557,7 +557,7 @@
<string name="enableLightsHeaderText">Enable Light</string>
<string name="enableVibrationHeaderText">Enable Vibration</string>
<string name="chooseColorSelectorHeader">Choose Color</string>
<string name="newMessages">New messages</string>
<string name="newMessages">New messages for %s</string>
<string name="youHaveGotNewNotifications">You\'ve got %d new notifications.</string>
<string name="mainNotificationChannelName">Notifications</string>
<string name="mainNotificationChannelDescription">This is the main notification channel of GitNex.</string>

Some files were not shown because too many files have changed in this diff Show More