App wide UI changes and refactors (#630)

Enhance and update the buttons across the app, colorful animation on tap

update toasty in view models

update toasty in fragments

update toasty in actions, activities, adapters

Alert dialogs buttons arrangements

strings fixes

switch to fab buttons

remove snackbar

Enhance whole app UI, bring consistency among the elements

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/630
This commit is contained in:
M M Arif 2020-08-06 17:16:51 +02:00
parent 30921ea330
commit 12a7b6040b
92 changed files with 628 additions and 1043 deletions

View File

@ -47,7 +47,7 @@ public class CollaboratorActions {
if(response.isSuccessful()) {
if(response.code() == 204) {
Toasty.info(context, context.getString(R.string.removeCollaboratorToastText));
Toasty.success(context, context.getString(R.string.removeCollaboratorToastText));
((AddCollaboratorToRepositoryActivity)context).finish();
//Log.i("addCollaboratorSearch", addCollaboratorSearch.getText().toString());
//tinyDb.putBoolean("updateDataSet", true);
@ -66,17 +66,17 @@ public class CollaboratorActions {
}
else if(response.code() == 403) {
Toasty.info(context, context.getString(R.string.authorizeError));
Toasty.error(context, context.getString(R.string.authorizeError));
}
else if(response.code() == 404) {
Toasty.info(context, context.getString(R.string.apiNotFound));
Toasty.warning(context, context.getString(R.string.apiNotFound));
}
else {
Toasty.info(context, context.getString(R.string.genericError));
Toasty.error(context, context.getString(R.string.genericError));
}
@ -117,7 +117,7 @@ public class CollaboratorActions {
if(response.isSuccessful()) {
if(response.code() == 204) {
Toasty.info(context, context.getString(R.string.addCollaboratorToastText));
Toasty.success(context, context.getString(R.string.addCollaboratorToastText));
((AddCollaboratorToRepositoryActivity)context).finish();
//AddCollaboratorToRepositoryActivity usersSearchData = new AddCollaboratorToRepositoryActivity();
//usersSearchData.loadUserSearchList(instanceUrl, instanceToken, searchKeyword, context);
@ -134,17 +134,17 @@ public class CollaboratorActions {
}
else if(response.code() == 403) {
Toasty.info(context, context.getString(R.string.authorizeError));
Toasty.error(context, context.getString(R.string.authorizeError));
}
else if(response.code() == 404) {
Toasty.info(context, context.getString(R.string.apiNotFound));
Toasty.warning(context, context.getString(R.string.apiNotFound));
}
else {
Toasty.info(context, context.getString(R.string.genericError));
Toasty.error(context, context.getString(R.string.genericError));
}

View File

@ -47,7 +47,7 @@ public class IssueActions {
if(response.code() == 200) {
tinyDb.putBoolean("commentEdited", true);
Toasty.info(ctx, ctx.getString(R.string.editCommentUpdatedText));
Toasty.success(ctx, ctx.getString(R.string.editCommentUpdatedText));
((ReplyToIssueActivity) ctx).finish();
}
@ -59,17 +59,17 @@ public class IssueActions {
}
else if(response.code() == 403) {
Toasty.info(ctx, ctx.getString(R.string.authorizeError));
Toasty.error(ctx, ctx.getString(R.string.authorizeError));
}
else if(response.code() == 404) {
Toasty.info(ctx, ctx.getString(R.string.apiNotFound));
Toasty.warning(ctx, ctx.getString(R.string.apiNotFound));
}
else {
Toasty.info(ctx, ctx.getString(R.string.genericError));
Toasty.error(ctx, ctx.getString(R.string.genericError));
}
@ -113,13 +113,13 @@ public class IssueActions {
if(issueState.equals("closed")) {
Toasty.info(ctx, ctx.getString(R.string.issueStateClosed));
Toasty.success(ctx, ctx.getString(R.string.issueStateClosed));
tinyDb.putString("issueState", "closed");
}
else if(issueState.equals("open")) {
Toasty.info(ctx, ctx.getString(R.string.issueStateReopened));
Toasty.success(ctx, ctx.getString(R.string.issueStateReopened));
tinyDb.putString("issueState", "open");
}
@ -133,17 +133,17 @@ public class IssueActions {
}
else if(response.code() == 403) {
Toasty.info(ctx, ctx.getString(R.string.authorizeError));
Toasty.error(ctx, ctx.getString(R.string.authorizeError));
}
else if(response.code() == 404) {
Toasty.info(ctx, ctx.getString(R.string.apiNotFound));
Toasty.warning(ctx, ctx.getString(R.string.apiNotFound));
}
else {
Toasty.info(ctx, ctx.getString(R.string.genericError));
Toasty.error(ctx, ctx.getString(R.string.genericError));
}
@ -184,14 +184,14 @@ public class IssueActions {
if(response.code() == 201) {
Toasty.info(ctx, ctx.getString(R.string.subscribedSuccessfully));
Toasty.success(ctx, ctx.getString(R.string.subscribedSuccessfully));
tinyDB.putBoolean("issueSubscribed", true);
}
else if(response.code() == 200) {
tinyDB.putBoolean("issueSubscribed", true);
Toasty.info(ctx, ctx.getString(R.string.alreadySubscribed));
Toasty.success(ctx, ctx.getString(R.string.alreadySubscribed));
}
@ -203,7 +203,7 @@ public class IssueActions {
}
else {
Toasty.info(ctx, ctx.getString(R.string.subscriptionError));
Toasty.error(ctx, ctx.getString(R.string.subscriptionError));
}
@ -212,7 +212,7 @@ public class IssueActions {
@Override
public void onFailure(@NonNull Call<Void> call, @NonNull Throwable t) {
Toasty.info(ctx, ctx.getString(R.string.unsubscribedSuccessfully));
Toasty.success(ctx, ctx.getString(R.string.unsubscribedSuccessfully));
}
});
@ -244,14 +244,14 @@ public class IssueActions {
if(response.code() == 201) {
Toasty.info(ctx, ctx.getString(R.string.unsubscribedSuccessfully));
Toasty.success(ctx, ctx.getString(R.string.unsubscribedSuccessfully));
tinyDB.putBoolean("issueSubscribed", false);
}
else if(response.code() == 200) {
tinyDB.putBoolean("issueSubscribed", false);
Toasty.info(ctx, ctx.getString(R.string.alreadyUnsubscribed));
Toasty.success(ctx, ctx.getString(R.string.alreadyUnsubscribed));
}
@ -263,7 +263,7 @@ public class IssueActions {
}
else {
Toasty.info(ctx, ctx.getString(R.string.unsubscriptionError));
Toasty.error(ctx, ctx.getString(R.string.unsubscriptionError));
}
@ -272,7 +272,7 @@ public class IssueActions {
@Override
public void onFailure(@NonNull Call<Void> call, @NonNull Throwable t) {
Toasty.info(ctx, ctx.getString(R.string.unsubscriptionError));
Toasty.error(ctx, ctx.getString(R.string.unsubscriptionError));
}
});
}

View File

@ -48,7 +48,7 @@ public class MilestoneActions {
if(response.isSuccessful()) {
Toasty.info(ctx, ctx.getString(R.string.milestoneStatusUpdate));
Toasty.success(ctx, ctx.getString(R.string.milestoneStatusUpdate));
}
else if(response.code() == 401) {
@ -61,7 +61,7 @@ public class MilestoneActions {
}
else {
Toasty.info(ctx, ctx.getString(R.string.genericError));
Toasty.error(ctx, ctx.getString(R.string.genericError));
}
@ -106,7 +106,7 @@ public class MilestoneActions {
if(response.isSuccessful()) {
Toasty.info(ctx, ctx.getString(R.string.milestoneStatusUpdate));
Toasty.success(ctx, ctx.getString(R.string.milestoneStatusUpdate));
}
else if(response.code() == 401) {
@ -119,7 +119,7 @@ public class MilestoneActions {
}
else {
Toasty.info(ctx, ctx.getString(R.string.genericError));
Toasty.error(ctx, ctx.getString(R.string.genericError));
}

View File

@ -46,7 +46,7 @@ public class RepositoryActions {
if(response.code() == 204) {
tinyDb.putBoolean("repoCreated", true);
Toasty.info(context, context.getString(R.string.starRepositorySuccess));
Toasty.success(context, context.getString(R.string.starRepositorySuccess));
}
}
@ -60,17 +60,17 @@ public class RepositoryActions {
}
else if(response.code() == 403) {
Toasty.info(context, context.getString(R.string.authorizeError));
Toasty.error(context, context.getString(R.string.authorizeError));
}
else if(response.code() == 404) {
Toasty.info(context, context.getString(R.string.apiNotFound));
Toasty.warning(context, context.getString(R.string.apiNotFound));
}
else {
Toasty.info(context, context.getString(R.string.genericError));
Toasty.error(context, context.getString(R.string.genericError));
}
@ -111,7 +111,7 @@ public class RepositoryActions {
if(response.code() == 204) {
tinyDb.putBoolean("repoCreated", true);
Toasty.info(context, context.getString(R.string.unStarRepositorySuccess));
Toasty.success(context, context.getString(R.string.unStarRepositorySuccess));
}
}
@ -125,17 +125,17 @@ public class RepositoryActions {
}
else if(response.code() == 403) {
Toasty.info(context, context.getString(R.string.authorizeError));
Toasty.error(context, context.getString(R.string.authorizeError));
}
else if(response.code() == 404) {
Toasty.info(context, context.getString(R.string.apiNotFound));
Toasty.warning(context, context.getString(R.string.apiNotFound));
}
else {
Toasty.info(context, context.getString(R.string.genericError));
Toasty.error(context, context.getString(R.string.genericError));
}
@ -176,7 +176,7 @@ public class RepositoryActions {
if(response.code() == 200) {
tinyDb.putBoolean("repoCreated", true);
Toasty.info(context, context.getString(R.string.watchRepositorySuccess));
Toasty.success(context, context.getString(R.string.watchRepositorySuccess));
}
}
@ -190,17 +190,17 @@ public class RepositoryActions {
}
else if(response.code() == 403) {
Toasty.info(context, context.getString(R.string.authorizeError));
Toasty.error(context, context.getString(R.string.authorizeError));
}
else if(response.code() == 404) {
Toasty.info(context, context.getString(R.string.apiNotFound));
Toasty.warning(context, context.getString(R.string.apiNotFound));
}
else {
Toasty.info(context, context.getString(R.string.genericError));
Toasty.error(context, context.getString(R.string.genericError));
}
@ -240,7 +240,7 @@ public class RepositoryActions {
if(response.code() == 204) {
tinyDb.putBoolean("repoCreated", true);
Toasty.info(context, context.getString(R.string.unWatchRepositorySuccess));
Toasty.success(context, context.getString(R.string.unWatchRepositorySuccess));
}
else if(response.code() == 401) {
@ -253,17 +253,17 @@ public class RepositoryActions {
}
else if(response.code() == 403) {
Toasty.info(context, context.getString(R.string.authorizeError));
Toasty.error(context, context.getString(R.string.authorizeError));
}
else if(response.code() == 404) {
Toasty.info(context, context.getString(R.string.apiNotFound));
Toasty.warning(context, context.getString(R.string.apiNotFound));
}
else {
Toasty.info(context, context.getString(R.string.genericError));
Toasty.error(context, context.getString(R.string.genericError));
}

View File

@ -43,7 +43,7 @@ public class TeamActions {
if(response.code() == 204) {
tinyDb.putBoolean("teamActionFlag", true);
Toasty.info(context, context.getString(R.string.memberRemovedMessage));
Toasty.success(context, context.getString(R.string.memberRemovedMessage));
((AddNewTeamMemberActivity)context).finish();
}
@ -59,17 +59,17 @@ public class TeamActions {
}
else if(response.code() == 403) {
Toasty.info(context, context.getString(R.string.authorizeError));
Toasty.error(context, context.getString(R.string.authorizeError));
}
else if(response.code() == 404) {
Toasty.info(context, context.getString(R.string.apiNotFound));
Toasty.warning(context, context.getString(R.string.apiNotFound));
}
else {
Toasty.info(context, context.getString(R.string.genericError));
Toasty.error(context, context.getString(R.string.genericError));
}
@ -109,7 +109,7 @@ public class TeamActions {
if(response.code() == 204) {
tinyDb.putBoolean("teamActionFlag", true);
Toasty.info(context, context.getString(R.string.memberAddedMessage));
Toasty.success(context, context.getString(R.string.memberAddedMessage));
((AddNewTeamMemberActivity)context).finish();
}
@ -125,17 +125,17 @@ public class TeamActions {
}
else if(response.code() == 403) {
Toasty.info(context, context.getString(R.string.authorizeError));
Toasty.error(context, context.getString(R.string.authorizeError));
}
else if(response.code() == 404) {
Toasty.info(context, context.getString(R.string.apiNotFound));
Toasty.warning(context, context.getString(R.string.apiNotFound));
}
else {
Toasty.info(context, context.getString(R.string.genericError));
Toasty.error(context, context.getString(R.string.genericError));
}

View File

@ -177,7 +177,7 @@ public class AddNewAccountActivity extends BaseActivity {
}
else {
Toasty.info(ctx, getResources().getString(R.string.versionUnsupportedNew));
Toasty.warning(ctx, getResources().getString(R.string.versionUnsupportedNew));
login(instanceUrl, loginToken);
}

View File

@ -28,6 +28,10 @@ import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
/**
* Author M M Arif
*/
public class AddNewTeamMemberActivity extends BaseActivity {
private View.OnClickListener onClickListener;

View File

@ -207,17 +207,17 @@ public class AddRemoveAssigneesActivity extends BaseActivity {
}
else if(response.code() == 403) {
Toasty.info(ctx, ctx.getString(R.string.authorizeError));
Toasty.error(ctx, ctx.getString(R.string.authorizeError));
}
else if(response.code() == 404) {
Toasty.info(ctx, ctx.getString(R.string.apiNotFound));
Toasty.warning(ctx, ctx.getString(R.string.apiNotFound));
}
else {
Toasty.info(ctx, getString(R.string.genericError));
Toasty.error(ctx, getString(R.string.genericError));
}
}
@ -254,7 +254,7 @@ public class AddRemoveAssigneesActivity extends BaseActivity {
if(response2.code() == 201) {
Toasty.info(ctx, ctx.getString(R.string.assigneesUpdated));
Toasty.success(ctx, ctx.getString(R.string.assigneesUpdated));
}
else if(response2.code() == 401) {
@ -267,17 +267,17 @@ public class AddRemoveAssigneesActivity extends BaseActivity {
}
else if(response2.code() == 403) {
Toasty.info(ctx, ctx.getString(R.string.authorizeError));
Toasty.error(ctx, ctx.getString(R.string.authorizeError));
}
else if(response2.code() == 404) {
Toasty.info(ctx, ctx.getString(R.string.apiNotFound));
Toasty.warning(ctx, ctx.getString(R.string.apiNotFound));
}
else {
Toasty.info(ctx, getString(R.string.genericError));
Toasty.error(ctx, getString(R.string.genericError));
}

View File

@ -224,17 +224,17 @@ public class AddRemoveLabelsActivity extends BaseActivity {
}
else if(response.code() == 403) {
Toasty.info(ctx, ctx.getString(R.string.authorizeError));
Toasty.error(ctx, ctx.getString(R.string.authorizeError));
}
else if(response.code() == 404) {
Toasty.info(ctx, ctx.getString(R.string.apiNotFound));
Toasty.warning(ctx, ctx.getString(R.string.apiNotFound));
}
else {
Toasty.info(ctx, getString(R.string.genericError));
Toasty.error(ctx, getString(R.string.genericError));
}
}
@ -265,7 +265,7 @@ public class AddRemoveLabelsActivity extends BaseActivity {
if(response.code() == 200) {
Toasty.info(ctx, ctx.getString(R.string.labelsUpdated));
Toasty.success(ctx, ctx.getString(R.string.labelsUpdated));
}
else if(response.code() == 401) {
@ -278,17 +278,17 @@ public class AddRemoveLabelsActivity extends BaseActivity {
}
else if(response.code() == 403) {
Toasty.info(ctx, ctx.getString(R.string.authorizeError));
Toasty.error(ctx, ctx.getString(R.string.authorizeError));
}
else if(response.code() == 404) {
Toasty.info(ctx, ctx.getString(R.string.apiNotFound));
Toasty.warning(ctx, ctx.getString(R.string.apiNotFound));
}
else {
Toasty.info(ctx, getString(R.string.genericError));
Toasty.error(ctx, getString(R.string.genericError));
}

View File

@ -2,7 +2,6 @@ package org.mian.gitnex.activities;
import android.content.Context;
import android.graphics.PorterDuff;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
@ -129,15 +128,10 @@ public class CreateFileActivity extends BaseActivity {
if(!connToInternet) {
newFileCreate.setEnabled(false);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.hintColor));
newFileCreate.setBackground(shape);
} else {
}
else {
newFileCreate.setOnClickListener(createFileListener);
}
}
@ -166,14 +160,14 @@ public class CreateFileActivity extends BaseActivity {
if(!connToInternet) {
Toasty.info(ctx, getResources().getString(R.string.checkNetConnection));
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
return;
}
if(newFileName_.equals("") || newFileContent_.equals("") || newFileCommitMessage_.equals("")) {
Toasty.info(ctx, getString(R.string.newFileRequiredFields));
Toasty.error(ctx, getString(R.string.newFileRequiredFields));
return;
}
@ -181,13 +175,13 @@ public class CreateFileActivity extends BaseActivity {
if(currentBranch.toString().equals("No branch")) {
if(newFileBranchName_.equals("")) {
Toasty.info(ctx, getString(R.string.newFileRequiredFieldNewBranchName));
Toasty.error(ctx, getString(R.string.newFileRequiredFieldNewBranchName));
return;
}
else {
if(!appUtil.checkStringsWithDash(newFileBranchName_)) {
Toasty.info(ctx, getString(R.string.newFileInvalidBranchName));
Toasty.error(ctx, getString(R.string.newFileInvalidBranchName));
return;
}
@ -197,7 +191,7 @@ public class CreateFileActivity extends BaseActivity {
if(appUtil.charactersLength(newFileCommitMessage_) > 255) {
Toasty.info(ctx, getString(R.string.newFileCommitMessageError));
Toasty.warning(ctx, getString(R.string.newFileCommitMessageError));
}
else {
@ -232,7 +226,7 @@ public class CreateFileActivity extends BaseActivity {
if(response.code() == 201) {
enableProcessButton();
Toasty.info(ctx, getString(R.string.newFileSuccessMessage));
Toasty.success(ctx, getString(R.string.newFileSuccessMessage));
finish();
}
@ -249,11 +243,11 @@ public class CreateFileActivity extends BaseActivity {
if(response.code() == 404) {
enableProcessButton();
Toasty.info(ctx, getString(R.string.apiNotFound));
Toasty.warning(ctx, getString(R.string.apiNotFound));
}
else {
enableProcessButton();
Toasty.info(ctx, getString(R.string.orgCreatedError));
Toasty.error(ctx, getString(R.string.orgCreatedError));
}
}
@ -326,21 +320,11 @@ public class CreateFileActivity extends BaseActivity {
private void disableProcessButton() {
newFileCreate.setEnabled(false);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.hintColor));
newFileCreate.setBackground(shape);
}
private void enableProcessButton() {
newFileCreate.setEnabled(true);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.btnBackground));
newFileCreate.setBackground(shape);
}
}

View File

@ -3,7 +3,6 @@ package org.mian.gitnex.activities;
import android.app.DatePickerDialog;
import android.content.Context;
import android.graphics.PorterDuff;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
@ -138,15 +137,10 @@ public class CreateIssueActivity extends BaseActivity implements View.OnClickLis
if(!connToInternet) {
createNewIssueButton.setEnabled(false);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.hintColor));
createNewIssueButton.setBackground(shape);
} else {
}
else {
createNewIssueButton.setOnClickListener(this);
}
}
@ -175,21 +169,21 @@ public class CreateIssueActivity extends BaseActivity implements View.OnClickLis
if(!connToInternet) {
Toasty.info(ctx, getResources().getString(R.string.checkNetConnection));
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
return;
}
if (newIssueTitleForm.equals("")) {
Toasty.info(ctx, getString(R.string.issueTitleEmpty));
Toasty.error(ctx, getString(R.string.issueTitleEmpty));
return;
}
/*if (newIssueDescriptionForm.equals("")) {
Toasty.info(ctx, getString(R.string.issueDescriptionEmpty));
Toasty.error(ctx, getString(R.string.issueDescriptionEmpty));
return;
}*/
@ -299,7 +293,7 @@ public class CreateIssueActivity extends BaseActivity implements View.OnClickLis
TinyDB tinyDb = new TinyDB(appCtx);
tinyDb.putBoolean("resumeIssues", true);
Toasty.info(ctx, getString(R.string.issueCreated));
Toasty.success(ctx, getString(R.string.issueCreated));
enableProcessButton();
finish();
@ -317,7 +311,7 @@ public class CreateIssueActivity extends BaseActivity implements View.OnClickLis
}
else {
Toasty.info(ctx, getString(R.string.issueCreatedError));
Toasty.error(ctx, getString(R.string.issueCreatedError));
enableProcessButton();
//Log.i("isSuccessful2", String.valueOf(response2.body()));
@ -335,12 +329,8 @@ public class CreateIssueActivity extends BaseActivity implements View.OnClickLis
}
private void initCloseListener() {
onClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
};
onClickListener = view -> finish();
}
private void getMilestones(String instanceUrl, String instanceToken, String repoOwner, String repoName, String loginUid, int resultLimit) {
@ -541,7 +531,7 @@ public class CreateIssueActivity extends BaseActivity implements View.OnClickLis
multiSelectDialog.show(getSupportFragmentManager(), "multiSelectDialog");
}
else {
Toasty.info(ctx, getResources().getString(R.string.noAssigneesFound));
Toasty.warning(ctx, getResources().getString(R.string.noAssigneesFound));
}
}
else if (v == newIssueLabels) {
@ -549,7 +539,7 @@ public class CreateIssueActivity extends BaseActivity implements View.OnClickLis
multiSelectDialogLabels.show(getSupportFragmentManager(), "multiSelectDialogLabels");
}
else {
Toasty.info(ctx, getResources().getString(R.string.noLabelsFound));
Toasty.warning(ctx, getResources().getString(R.string.noLabelsFound));
}
}
else if (v == newIssueDueDate) {
@ -581,20 +571,10 @@ public class CreateIssueActivity extends BaseActivity implements View.OnClickLis
private void disableProcessButton() {
createNewIssueButton.setEnabled(false);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.hintColor));
createNewIssueButton.setBackground(shape);
}
private void enableProcessButton() {
createNewIssueButton.setEnabled(true);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.btnBackground));
createNewIssueButton.setBackground(shape);
}
}

View File

@ -2,7 +2,6 @@ package org.mian.gitnex.activities;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
@ -118,38 +117,23 @@ public class CreateLabelActivity extends BaseActivity {
createLabelButton.setText(getResources().getString(R.string.newUpdateButtonCopy));
createLabelButton.setOnClickListener(updateLabelListener);
return;
}
if(!connToInternet) {
createLabelButton.setEnabled(false);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.hintColor));
createLabelButton.setBackground(shape);
} else {
}
else {
createLabelButton.setOnClickListener(createLabelListener);
}
}
private View.OnClickListener createLabelListener = new View.OnClickListener() {
public void onClick(View v) {
processCreateLabel();
}
};
private View.OnClickListener createLabelListener = v -> processCreateLabel();
private View.OnClickListener updateLabelListener = new View.OnClickListener() {
public void onClick(View v) {
processUpdateLabel();
}
};
private View.OnClickListener updateLabelListener = v -> processUpdateLabel();
private void processUpdateLabel() {
@ -176,27 +160,28 @@ public class CreateLabelActivity extends BaseActivity {
if(!connToInternet) {
Toasty.info(ctx, getResources().getString(R.string.checkNetConnection));
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
return;
}
if(updateLabelName.equals("")) {
Toasty.info(ctx, getString(R.string.labelEmptyError));
Toasty.error(ctx, getString(R.string.labelEmptyError));
return;
}
if(!appUtil.checkStrings(updateLabelName)) {
Toasty.info(ctx, getString(R.string.labelNameError));
Toasty.error(ctx, getString(R.string.labelNameError));
return;
}
disableProcessButton();
patchLabel(instanceUrl, instanceToken, repoOwner, repoName, updateLabelName, updateLabelColor, Integer.valueOf(getIntent().getStringExtra("labelId")), loginUid);
patchLabel(instanceUrl, instanceToken, repoOwner, repoName, updateLabelName, updateLabelColor, Integer.parseInt(
Objects.requireNonNull(getIntent().getStringExtra("labelId"))), loginUid);
}
@ -224,21 +209,21 @@ public class CreateLabelActivity extends BaseActivity {
if(!connToInternet) {
Toasty.info(ctx, getResources().getString(R.string.checkNetConnection));
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
return;
}
if(newLabelName.equals("")) {
Toasty.info(ctx, getString(R.string.labelEmptyError));
Toasty.error(ctx, getString(R.string.labelEmptyError));
return;
}
if(!appUtil.checkStrings(newLabelName)) {
Toasty.info(ctx, getString(R.string.labelNameError));
Toasty.error(ctx, getString(R.string.labelNameError));
return;
}
@ -267,7 +252,7 @@ public class CreateLabelActivity extends BaseActivity {
if(response.code() == 201) {
Toasty.info(ctx, getString(R.string.labelCreated));
Toasty.success(ctx, getString(R.string.labelCreated));
tinyDb.putString("labelColor", "");
tinyDb.putBoolean("labelsRefresh", true);
finish();
@ -286,7 +271,7 @@ public class CreateLabelActivity extends BaseActivity {
enableProcessButton();
tinyDb.putString("labelColor", "");
Toasty.info(ctx, getString(R.string.labelGeneralError));
Toasty.error(ctx, getString(R.string.labelGeneralError));
}
@ -294,6 +279,7 @@ public class CreateLabelActivity extends BaseActivity {
@Override
public void onFailure(@NonNull Call<CreateLabel> call, @NonNull Throwable t) {
tinyDb.putString("labelColor", "");
Log.e("onFailure", t.toString());
enableProcessButton();
@ -322,7 +308,7 @@ public class CreateLabelActivity extends BaseActivity {
if(response.isSuccessful()) {
if(response.code() == 200) {
Toasty.info(ctx, getString(R.string.labelUpdated));
Toasty.success(ctx, getString(R.string.labelUpdated));
tinyDb.putString("labelColor", "");
tinyDb.putBoolean("labelsRefresh", true);
tinyDb.putString("labelColorDefault", "");
@ -348,7 +334,7 @@ public class CreateLabelActivity extends BaseActivity {
enableProcessButton();
tinyDb.putString("labelColor", "");
tinyDb.putString("labelColorDefault", "");
Toasty.info(ctx, getString(R.string.labelGeneralError));
Toasty.error(ctx, getString(R.string.labelGeneralError));
}
@ -356,6 +342,7 @@ public class CreateLabelActivity extends BaseActivity {
@Override
public void onFailure(@NonNull Call<CreateLabel> call, @NonNull Throwable t) {
tinyDb.putString("labelColor", "");
tinyDb.putString("labelColorDefault", "");
Log.e("onFailure", t.toString());
@ -395,7 +382,7 @@ public class CreateLabelActivity extends BaseActivity {
if(response.isSuccessful()) {
if(response.code() == 204) {
Toasty.info(ctx, getString(R.string.labelDeleteText));
Toasty.success(ctx, getString(R.string.labelDeleteText));
LabelsViewModel.loadLabelsList(instanceUrl, instanceToken, repoOwner, repoName, ctx);
getIntent().removeExtra("labelAction");
getIntent().removeExtra("labelId");
@ -412,7 +399,7 @@ public class CreateLabelActivity extends BaseActivity {
}
else {
Toasty.info(ctx, getString(R.string.labelDeleteErrorText));
Toasty.error(ctx, getString(R.string.labelDeleteErrorText));
}
@ -429,21 +416,11 @@ public class CreateLabelActivity extends BaseActivity {
private void disableProcessButton() {
createLabelButton.setEnabled(false);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.hintColor));
createLabelButton.setBackground(shape);
}
private void enableProcessButton() {
createLabelButton.setEnabled(true);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.btnBackground));
createLabelButton.setBackground(shape);
}
}

View File

@ -2,7 +2,6 @@ package org.mian.gitnex.activities;
import android.app.DatePickerDialog;
import android.content.Context;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
@ -71,24 +70,15 @@ public class CreateMilestoneActivity extends BaseActivity implements View.OnClic
if(!connToInternet) {
createNewMilestoneButton.setEnabled(false);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.hintColor));
createNewMilestoneButton.setBackground(shape);
} else {
}
else {
createNewMilestoneButton.setOnClickListener(createMilestoneListener);
}
}
private View.OnClickListener createMilestoneListener = new View.OnClickListener() {
public void onClick(View v) {
processNewMilestone();
}
};
private View.OnClickListener createMilestoneListener = v -> processNewMilestone();
private void processNewMilestone() {
@ -110,14 +100,14 @@ public class CreateMilestoneActivity extends BaseActivity implements View.OnClic
if(!connToInternet) {
Toasty.info(ctx, getResources().getString(R.string.checkNetConnection));
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
return;
}
if(newMilestoneTitle.equals("")) {
Toasty.info(ctx, getString(R.string.milestoneNameErrorEmpty));
Toasty.error(ctx, getString(R.string.milestoneNameErrorEmpty));
return;
}
@ -125,7 +115,7 @@ public class CreateMilestoneActivity extends BaseActivity implements View.OnClic
if(!newMilestoneDescription.equals("")) {
if (appUtil.charactersLength(newMilestoneDescription) > 255) {
Toasty.info(ctx, getString(R.string.milestoneDescError));
Toasty.warning(ctx, getString(R.string.milestoneDescError));
return;
}
@ -133,10 +123,13 @@ public class CreateMilestoneActivity extends BaseActivity implements View.OnClic
String finalMilestoneDueDate = null;
if(!newMilestoneDueDate.isEmpty()) {
finalMilestoneDueDate = (AppUtil.customDateCombine(AppUtil.customDateFormat(newMilestoneDueDate)));
} else if (new Version(tinyDb.getString("giteaVersion")).less("1.10.0")) {
}
else if (new Version(tinyDb.getString("giteaVersion")).less("1.10.0")) {
// if Gitea version is less than 1.10.0 DueDate is required
Toasty.info(ctx, getString(R.string.milestoneDateEmpty));
Toasty.warning(ctx, getString(R.string.milestoneDateEmpty));
return;
}
@ -166,7 +159,7 @@ public class CreateMilestoneActivity extends BaseActivity implements View.OnClic
TinyDB tinyDb = new TinyDB(appCtx);
tinyDb.putBoolean("milestoneCreated", true);
Toasty.info(ctx, getString(R.string.milestoneCreated));
Toasty.success(ctx, getString(R.string.milestoneCreated));
enableProcessButton();
finish();
@ -184,7 +177,7 @@ public class CreateMilestoneActivity extends BaseActivity implements View.OnClic
else {
enableProcessButton();
Toasty.info(ctx, getString(R.string.milestoneCreatedError));
Toasty.error(ctx, getString(R.string.milestoneCreatedError));
}
@ -226,32 +219,18 @@ public class CreateMilestoneActivity extends BaseActivity implements View.OnClic
}
private void initCloseListener() {
onClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
};
onClickListener = view -> finish();
}
private void disableProcessButton() {
createNewMilestoneButton.setEnabled(false);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.hintColor));
createNewMilestoneButton.setBackground(shape);
}
private void enableProcessButton() {
createNewMilestoneButton.setEnabled(true);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.btnBackground));
createNewMilestoneButton.setBackground(shape);
}
}

View File

@ -1,7 +1,6 @@
package org.mian.gitnex.activities;
import android.content.Context;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.util.Log;
import android.util.Patterns;
@ -69,11 +68,10 @@ public class CreateNewUserActivity extends BaseActivity {
if(!connToInternet) {
disableProcessButton();
} else {
}
else {
createUserButton.setOnClickListener(createNewUserListener);
}
}
@ -94,35 +92,35 @@ public class CreateNewUserActivity extends BaseActivity {
if(!connToInternet) {
Toasty.info(ctx, getResources().getString(R.string.checkNetConnection));
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
return;
}
if(newFullName.equals("") || newUserName.equals("") | newUserEmail.equals("") || newUserPassword.equals("")) {
Toasty.info(ctx, getString(R.string.emptyFields));
Toasty.error(ctx, getString(R.string.emptyFields));
return;
}
if(!appUtil.checkStrings(newFullName)) {
Toasty.info(ctx, getString(R.string.userInvalidFullName));
Toasty.error(ctx, getString(R.string.userInvalidFullName));
return;
}
if(!appUtil.checkStringsWithAlphaNumeric(newUserName)) {
Toasty.info(ctx, getString(R.string.userInvalidUserName));
Toasty.error(ctx, getString(R.string.userInvalidUserName));
return;
}
if(!Patterns.EMAIL_ADDRESS.matcher(newUserEmail).matches()) {
Toasty.info(ctx, getString(R.string.userInvalidEmail));
Toasty.error(ctx, getString(R.string.userInvalidEmail));
return;
}
@ -150,7 +148,7 @@ public class CreateNewUserActivity extends BaseActivity {
if(response.code() == 201) {
Toasty.info(ctx, getString(R.string.userCreatedText));
Toasty.success(ctx, getString(R.string.userCreatedText));
enableProcessButton();
finish();
@ -167,25 +165,25 @@ public class CreateNewUserActivity extends BaseActivity {
else if(response.code() == 403) {
enableProcessButton();
Toasty.info(ctx, ctx.getString(R.string.authorizeError));
Toasty.error(ctx, ctx.getString(R.string.authorizeError));
}
else if(response.code() == 404) {
enableProcessButton();
Toasty.info(ctx, ctx.getString(R.string.apiNotFound));
Toasty.warning(ctx, ctx.getString(R.string.apiNotFound));
}
else if(response.code() == 422) {
enableProcessButton();
Toasty.info(ctx, ctx.getString(R.string.userExistsError));
Toasty.warning(ctx, ctx.getString(R.string.userExistsError));
}
else {
enableProcessButton();
Toasty.info(ctx, getString(R.string.genericError));
Toasty.error(ctx, getString(R.string.genericError));
}
@ -193,6 +191,7 @@ public class CreateNewUserActivity extends BaseActivity {
@Override
public void onFailure(@NonNull Call<UserInfo> call, @NonNull Throwable t) {
Log.e("onFailure", t.toString());
enableProcessButton();
}
@ -200,39 +199,21 @@ public class CreateNewUserActivity extends BaseActivity {
}
private View.OnClickListener createNewUserListener = new View.OnClickListener() {
public void onClick(View v) {
processCreateNewUser();
}
};
private View.OnClickListener createNewUserListener = v -> processCreateNewUser();
private void initCloseListener() {
onClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
};
onClickListener = view -> finish();
}
private void disableProcessButton() {
createUserButton.setEnabled(false);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.hintColor));
createUserButton.setBackground(shape);
}
private void enableProcessButton() {
createUserButton.setEnabled(true);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.btnBackground));
createUserButton.setBackground(shape);
}
}

View File

@ -1,7 +1,6 @@
package org.mian.gitnex.activities;
import android.content.Context;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
@ -67,15 +66,10 @@ public class CreateOrganizationActivity extends BaseActivity {
if(!connToInternet) {
createOrganizationButton.setEnabled(false);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.hintColor));
createOrganizationButton.setBackground(shape);
} else {
}
else {
createOrganizationButton.setOnClickListener(createOrgListener);
}
}
@ -109,7 +103,7 @@ public class CreateOrganizationActivity extends BaseActivity {
if(!connToInternet) {
Toasty.info(ctx, getResources().getString(R.string.checkNetConnection));
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
return;
}
@ -117,7 +111,7 @@ public class CreateOrganizationActivity extends BaseActivity {
if(!newOrgDesc.equals("")) {
if (appUtil.charactersLength(newOrgDesc) > 255) {
Toasty.info(ctx, getString(R.string.orgDescError));
Toasty.warning(ctx, getString(R.string.orgDescError));
return;
}
@ -125,12 +119,12 @@ public class CreateOrganizationActivity extends BaseActivity {
if(newOrgName.equals("")) {
Toasty.info(ctx, getString(R.string.orgNameErrorEmpty));
Toasty.error(ctx, getString(R.string.orgNameErrorEmpty));
}
else if(!appUtil.checkStrings(newOrgName)) {
Toasty.info(ctx, getString(R.string.orgNameErrorInvalid));
Toasty.warning(ctx, getString(R.string.orgNameErrorInvalid));
}
else {
@ -161,7 +155,7 @@ public class CreateOrganizationActivity extends BaseActivity {
TinyDB tinyDb = new TinyDB(appCtx);
tinyDb.putBoolean("orgCreated", true);
enableProcessButton();
Toasty.info(ctx, getString(R.string.orgCreated));
Toasty.success(ctx, getString(R.string.orgCreated));
finish();
}
@ -177,24 +171,24 @@ public class CreateOrganizationActivity extends BaseActivity {
else if(response.code() == 409) {
enableProcessButton();
Toasty.info(ctx, getString(R.string.orgExistsError));
Toasty.warning(ctx, getString(R.string.orgExistsError));
}
else if(response.code() == 422) {
enableProcessButton();
Toasty.info(ctx, getString(R.string.orgExistsError));
Toasty.warning(ctx, getString(R.string.orgExistsError));
}
else {
if(response.code() == 404) {
enableProcessButton();
Toasty.info(ctx, getString(R.string.apiNotFound));
Toasty.warning(ctx, getString(R.string.apiNotFound));
}
else {
enableProcessButton();
Toasty.info(ctx, getString(R.string.orgCreatedError));
Toasty.error(ctx, getString(R.string.orgCreatedError));
}
}
@ -213,21 +207,11 @@ public class CreateOrganizationActivity extends BaseActivity {
private void disableProcessButton() {
createOrganizationButton.setEnabled(false);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.hintColor));
createOrganizationButton.setBackground(shape);
}
private void enableProcessButton() {
createOrganizationButton.setEnabled(true);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.btnBackground));
createOrganizationButton.setBackground(shape);
}
}

View File

@ -2,7 +2,6 @@ package org.mian.gitnex.activities;
import android.content.Context;
import android.graphics.PorterDuff;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
@ -108,20 +107,15 @@ public class CreateReleaseActivity extends BaseActivity {
if(!connToInternet) {
disableProcessButton();
} else {
}
else {
createNewRelease.setOnClickListener(createReleaseListener);
}
}
private View.OnClickListener createReleaseListener = new View.OnClickListener() {
public void onClick(View v) {
processNewRelease();
}
};
private View.OnClickListener createReleaseListener = v -> processNewRelease();
private void processNewRelease() {
@ -145,21 +139,21 @@ public class CreateReleaseActivity extends BaseActivity {
if(!connToInternet) {
Toasty.info(ctx, getResources().getString(R.string.checkNetConnection));
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
return;
}
if(newReleaseTagName.equals("")) {
Toasty.info(ctx, getString(R.string.tagNameErrorEmpty));
Toasty.error(ctx, getString(R.string.tagNameErrorEmpty));
return;
}
if(newReleaseTitle.equals("")) {
Toasty.info(ctx, getString(R.string.titleErrorEmpty));
Toasty.error(ctx, getString(R.string.titleErrorEmpty));
return;
}
@ -189,7 +183,7 @@ public class CreateReleaseActivity extends BaseActivity {
TinyDB tinyDb = new TinyDB(appCtx);
tinyDb.putBoolean("updateReleases", true);
Toasty.info(ctx, getString(R.string.releaseCreatedText));
Toasty.success(ctx, getString(R.string.releaseCreatedText));
enableProcessButton();
finish();
@ -206,19 +200,19 @@ public class CreateReleaseActivity extends BaseActivity {
else if(response.code() == 403) {
enableProcessButton();
Toasty.info(ctx, ctx.getString(R.string.authorizeError));
Toasty.error(ctx, ctx.getString(R.string.authorizeError));
}
else if(response.code() == 404) {
enableProcessButton();
Toasty.info(ctx, ctx.getString(R.string.apiNotFound));
Toasty.warning(ctx, ctx.getString(R.string.apiNotFound));
}
else {
enableProcessButton();
Toasty.info(ctx, ctx.getString(R.string.genericError));
Toasty.error(ctx, ctx.getString(R.string.genericError));
}
@ -302,21 +296,11 @@ public class CreateReleaseActivity extends BaseActivity {
private void disableProcessButton() {
createNewRelease.setEnabled(false);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.hintColor));
createNewRelease.setBackground(shape);
}
private void enableProcessButton() {
createNewRelease.setEnabled(true);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.btnBackground));
createNewRelease.setBackground(shape);
}
}

View File

@ -2,7 +2,6 @@ package org.mian.gitnex.activities;
import android.content.Context;
import android.graphics.PorterDuff;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
@ -89,6 +88,7 @@ public class CreateRepoActivity extends BaseActivity {
spinner = findViewById(R.id.ownerSpinner);
spinner.getBackground().setColorFilter(getResources().getColor(R.color.colorWhite), PorterDuff.Mode.SRC_ATOP);
getOrganizations(instanceUrl, Authorization.returnAuthentication(ctx, loginUid, instanceToken), userLogin);
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
@ -107,12 +107,10 @@ public class CreateRepoActivity extends BaseActivity {
if(!connToInternet) {
disableProcessButton();
}
else {
createRepo.setOnClickListener(createRepoListener);
}
}
@ -138,45 +136,38 @@ public class CreateRepoActivity extends BaseActivity {
if(!connToInternet) {
Toasty.info(ctx, getResources().getString(R.string.checkNetConnection));
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
return;
}
if(!newRepoDesc.equals("")) {
if (appUtil.charactersLength(newRepoDesc) > 255) {
Toasty.info(ctx, getString(R.string.repoDescError));
Toasty.warning(ctx, getString(R.string.repoDescError));
return;
}
}
if(newRepoName.equals("")) {
Toasty.info(ctx, getString(R.string.repoNameErrorEmpty));
Toasty.error(ctx, getString(R.string.repoNameErrorEmpty));
}
else if(!appUtil.checkStrings(newRepoName)) {
Toasty.info(ctx, getString(R.string.repoNameErrorInvalid));
Toasty.warning(ctx, getString(R.string.repoNameErrorInvalid));
}
else if (reservedRepoNames.contains(newRepoName)) {
Toasty.info(ctx, getString(R.string.repoNameErrorReservedName));
Toasty.warning(ctx, getString(R.string.repoNameErrorReservedName));
}
else if (reservedRepoPatterns.matcher(newRepoName).find()) {
Toasty.info(ctx, getString(R.string.repoNameErrorReservedPatterns));
Toasty.warning(ctx, getString(R.string.repoNameErrorReservedPatterns));
}
else {
disableProcessButton();
createNewRepository(instanceUrl, Authorization.returnAuthentication(ctx, loginUid, instanceToken), loginUid, newRepoName, newRepoDesc, repoOwner, newRepoAccess);
}
}
@ -191,7 +182,6 @@ public class CreateRepoActivity extends BaseActivity {
.getInstance(instanceUrl, ctx)
.getApiInterface()
.createNewUserRepository(token, createRepository);
}
else {
@ -199,7 +189,6 @@ public class CreateRepoActivity extends BaseActivity {
.getInstance(instanceUrl, ctx)
.getApiInterface()
.createNewUserOrgRepository(token, repoOwner, createRepository);
}
call.enqueue(new Callback<OrganizationRepository>() {
@ -211,7 +200,7 @@ public class CreateRepoActivity extends BaseActivity {
TinyDB tinyDb = new TinyDB(appCtx);
tinyDb.putBoolean("repoCreated", true);
Toasty.info(ctx, getString(R.string.repoCreated));
Toasty.success(ctx, getString(R.string.repoCreated));
enableProcessButton();
finish();
}
@ -222,25 +211,23 @@ public class CreateRepoActivity extends BaseActivity {
getResources().getString(R.string.alertDialogTokenRevokedMessage),
getResources().getString(R.string.alertDialogTokenRevokedCopyNegativeButton),
getResources().getString(R.string.alertDialogTokenRevokedCopyPositiveButton));
}
else if(response.code() == 409) {
enableProcessButton();
Toasty.info(ctx, getString(R.string.repoExistsError));
Toasty.warning(ctx, getString(R.string.repoExistsError));
}
else {
enableProcessButton();
Toasty.info(ctx, getString(R.string.repoCreatedError));
Toasty.error(ctx, getString(R.string.repoCreatedError));
}
}
@Override
public void onFailure(@NonNull Call<OrganizationRepository> call, @NonNull Throwable t) {
Log.e("onFailure", t.toString());
enableProcessButton();
}
@ -271,13 +258,16 @@ public class CreateRepoActivity extends BaseActivity {
organizationsList.add(new OrgOwner(userLogin));
assert organizationsList_ != null;
if(organizationsList_.size() > 0) {
for (int i = 0; i < organizationsList_.size(); i++) {
if(!tinyDb.getString("organizationId").isEmpty()) {
if (Integer.parseInt(tinyDb.getString("organizationId")) == organizationsList_.get(i).getId()) {
organizationId = i + 1;
}
}
OrgOwner data = new OrgOwner(
organizationsList_.get(i).getUsername()
);
@ -293,6 +283,7 @@ public class CreateRepoActivity extends BaseActivity {
spinner.setAdapter(adapter);
if (tinyDb.getBoolean("organizationAction") & organizationId != 0) {
spinner.setSelection(organizationId);
tinyDb.putBoolean("organizationAction", false);
}
@ -308,13 +299,13 @@ public class CreateRepoActivity extends BaseActivity {
getResources().getString(R.string.alertDialogTokenRevokedMessage),
getResources().getString(R.string.alertDialogTokenRevokedCopyNegativeButton),
getResources().getString(R.string.alertDialogTokenRevokedCopyPositiveButton));
}
}
@Override
public void onFailure(@NonNull Call<List<OrgOwner>> call, @NonNull Throwable t) {
Log.e("onFailure", t.toString());
enableProcessButton();
}
@ -322,32 +313,18 @@ public class CreateRepoActivity extends BaseActivity {
}
private void initCloseListener() {
onClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
};
onClickListener = view -> finish();
}
private void disableProcessButton() {
createRepo.setEnabled(false);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.hintColor));
createRepo.setBackground(shape);
}
private void enableProcessButton() {
createRepo.setEnabled(true);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.btnBackground));
createRepo.setBackground(shape);
}
}

View File

@ -1,7 +1,6 @@
package org.mian.gitnex.activities;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.util.Log;
@ -98,134 +97,120 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
initCloseListener();
closeActivity.setOnClickListener(onClickListener);
teamPermission.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
teamPermission.setOnClickListener(view -> {
AlertDialog.Builder pBuilder = new AlertDialog.Builder(ctx);
pBuilder.setTitle(R.string.newTeamPermission);
if(permissionSelectedChoice != -1) {
pBuilder.setCancelable(true);
}
else {
pBuilder.setCancelable(false);
}
pBuilder.setSingleChoiceItems(permissionList, permissionSelectedChoice, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
permissionSelectedChoice = i;
teamPermission.setText(permissionList[i]);
if(permissionList[i].equals("Read")) {
teamPermissionDetail.setVisibility(View.VISIBLE);
teamPermissionDetail.setText(R.string.newTeamPermissionRead);
}
else if(permissionList[i].equals("Write")) {
teamPermissionDetail.setVisibility(View.VISIBLE);
teamPermissionDetail.setText(R.string.newTeamPermissionWrite);
}
else if(permissionList[i].equals("Admin")) {
teamPermissionDetail.setVisibility(View.VISIBLE);
teamPermissionDetail.setText(R.string.newTeamPermissionAdmin);
}
else {
teamPermissionDetail.setVisibility(View.GONE);
}
dialogInterface.dismiss();
}
});
AlertDialog pDialog = pBuilder.create();
pDialog.show();
AlertDialog.Builder pBuilder = new AlertDialog.Builder(ctx);
pBuilder.setTitle(R.string.newTeamPermission);
if(permissionSelectedChoice != -1) {
pBuilder.setCancelable(true);
}
else {
pBuilder.setCancelable(false);
}
pBuilder.setSingleChoiceItems(permissionList, permissionSelectedChoice, (dialogInterface, i) -> {
permissionSelectedChoice = i;
teamPermission.setText(permissionList[i]);
switch(permissionList[i]) {
case "Read":
teamPermissionDetail.setVisibility(View.VISIBLE);
teamPermissionDetail.setText(R.string.newTeamPermissionRead);
break;
case "Write":
teamPermissionDetail.setVisibility(View.VISIBLE);
teamPermissionDetail.setText(R.string.newTeamPermissionWrite);
break;
case "Admin":
teamPermissionDetail.setVisibility(View.VISIBLE);
teamPermissionDetail.setText(R.string.newTeamPermissionAdmin);
break;
default:
teamPermissionDetail.setVisibility(View.GONE);
break;
}
dialogInterface.dismiss();
});
AlertDialog pDialog = pBuilder.create();
pDialog.show();
});
teamAccessControls.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
teamAccessControls.setOnClickListener(v -> {
teamAccessControls.setText("");
teamAccessControlsArray.setText("");
pushAccessList = Arrays.asList(accessControlsList);
teamAccessControls.setText("");
teamAccessControlsArray.setText("");
pushAccessList = Arrays.asList(accessControlsList);
AlertDialog.Builder aDialogBuilder = new AlertDialog.Builder(ctx);
AlertDialog.Builder aDialogBuilder = new AlertDialog.Builder(ctx);
aDialogBuilder.setMultiChoiceItems(accessControlsList, selectedAccessControlsTrueFalse, new DialogInterface.OnMultiChoiceClickListener() {
aDialogBuilder.setMultiChoiceItems(accessControlsList, selectedAccessControlsTrueFalse, (dialog, which, isChecked) -> {
@Override
public void onClick(DialogInterface dialog, int which, boolean isChecked) {
})
.setCancelable(false)
.setTitle(R.string.newTeamAccessControls)
.setPositiveButton(R.string.okButton, (dialog, which) -> {
int selectedVal = 0;
while(selectedVal < selectedAccessControlsTrueFalse.length)
{
boolean value = selectedAccessControlsTrueFalse[selectedVal];
String repoCode = "";
if(selectedVal == 0) {
repoCode = "repo.code";
}
if(selectedVal == 1) {
repoCode = "repo.issues";
}
if(selectedVal == 2) {
repoCode = "repo.pulls";
}
if(selectedVal == 3) {
repoCode = "repo.releases";
}
if(selectedVal == 4) {
repoCode = "repo.wiki";
}
if(selectedVal == 5) {
repoCode = "repo.ext_wiki";
}
if(selectedVal == 6) {
repoCode = "repo.ext_issues";
}
})
.setCancelable(false)
.setTitle(R.string.newTeamAccessControls)
.setPositiveButton(R.string.okButton, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
int selectedVal = 0;
while(selectedVal < selectedAccessControlsTrueFalse.length)
{
boolean value = selectedAccessControlsTrueFalse[selectedVal];
String repoCode = "";
if(selectedVal == 0) {
repoCode = "repo.code";
}
if(selectedVal == 1) {
repoCode = "repo.issues";
}
if(selectedVal == 2) {
repoCode = "repo.pulls";
}
if(selectedVal == 3) {
repoCode = "repo.releases";
}
if(selectedVal == 4) {
repoCode = "repo.wiki";
}
if(selectedVal == 5) {
repoCode = "repo.ext_wiki";
}
if(selectedVal == 6) {
repoCode = "repo.ext_issues";
}
if(value){
teamAccessControls.setText(getString(R.string.newTeamPermissionValues, teamAccessControls.getText(), pushAccessList.get(selectedVal)));
teamAccessControlsArray.setText(getString(R.string.newTeamPermissionValuesFinal, teamAccessControlsArray.getText(), repoCode));
}
selectedVal++;
}
String data = String.valueOf(teamAccessControls.getText());
if(!data.equals("")) {
teamAccessControls.setText(data.substring(0, data.length() - 2));
}
String dataArray = String.valueOf(teamAccessControlsArray.getText());
if(!dataArray.equals("")) {
teamAccessControlsArray.setText(dataArray.substring(0, dataArray.length() - 2));
}
//Log.i("orgName", String.valueOf(teamAccessControlsArray.getText()));
if(value){
teamAccessControls.setText(getString(R.string.newTeamPermissionValues, teamAccessControls.getText(), pushAccessList.get(selectedVal)));
teamAccessControlsArray.setText(getString(R.string.newTeamPermissionValuesFinal, teamAccessControlsArray.getText(), repoCode));
}
selectedVal++;
}
});
String data = String.valueOf(teamAccessControls.getText());
if(!data.equals("")) {
teamAccessControls.setText(data.substring(0, data.length() - 2));
}
AlertDialog aDialog = aDialogBuilder.create();
aDialog.show();
}
String dataArray = String.valueOf(teamAccessControlsArray.getText());
if(!dataArray.equals("")) {
teamAccessControlsArray.setText(dataArray.substring(0, dataArray.length() - 2));
}
//Log.i("orgName", String.valueOf(teamAccessControlsArray.getText()));
});
AlertDialog aDialog = aDialogBuilder.create();
aDialog.show();
});
createTeamButton.setEnabled(false);
@ -264,21 +249,21 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
if(!connToInternet) {
Toasty.info(ctx, getResources().getString(R.string.checkNetConnection));
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
return;
}
if (newTeamName.equals("")) {
Toasty.info(ctx, getString(R.string.teamNameEmpty));
Toasty.error(ctx, getString(R.string.teamNameEmpty));
return;
}
if(!appUtil.checkStringsWithAlphaNumericDashDotUnderscore(newTeamName)) {
Toasty.info(ctx, getString(R.string.teamNameError));
Toasty.warning(ctx, getString(R.string.teamNameError));
return;
}
@ -286,12 +271,12 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
if(!newTeamDesc.equals("")) {
if(!appUtil.checkStrings(newTeamDesc)) {
Toasty.info(ctx, getString(R.string.teamDescError));
Toasty.warning(ctx, getString(R.string.teamDescError));
return;
}
if(newTeamDesc.length() > 100) {
Toasty.info(ctx, getString(R.string.teamDescLimit));
Toasty.warning(ctx, getString(R.string.teamDescLimit));
return;
}
@ -299,7 +284,7 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
if (newTeamPermission.equals("")) {
Toasty.info(ctx, getString(R.string.teamPermissionEmpty));
Toasty.error(ctx, getString(R.string.teamPermissionEmpty));
return;
}
@ -336,16 +321,14 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
TinyDB tinyDb = new TinyDB(appCtx);
tinyDb.putBoolean("resumeTeams", true);
Toasty.info(ctx, getString(R.string.teamCreated));
Toasty.success(ctx, getString(R.string.teamCreated));
finish();
}
}
else if(response2.code() == 404) {
Toasty.info(ctx, getString(R.string.apiNotFound));
Toasty.warning(ctx, getString(R.string.apiNotFound));
}
else if(response2.code() == 401) {
@ -353,12 +336,10 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
getResources().getString(R.string.alertDialogTokenRevokedMessage),
getResources().getString(R.string.alertDialogTokenRevokedCopyNegativeButton),
getResources().getString(R.string.alertDialogTokenRevokedCopyPositiveButton));
}
else {
Toasty.info(ctx, getString(R.string.teamCreatedError));
Toasty.error(ctx, getString(R.string.teamCreatedError));
}
}
@ -373,19 +354,15 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
@Override
public void onClick(View v) {
if(v == createTeamButton) {
processCreateTeam();
}
}
private void initCloseListener() {
onClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
};
onClickListener = view -> finish();
}
}

View File

@ -58,11 +58,7 @@ public class CreditsActivity extends BaseActivity {
}
private void initCloseListener() {
onClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
};
onClickListener = view -> finish();
}
}

View File

@ -4,7 +4,6 @@ import android.annotation.SuppressLint;
import android.app.DatePickerDialog;
import android.content.Context;
import android.graphics.PorterDuff;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
@ -217,14 +216,14 @@ public class EditIssueActivity extends BaseActivity implements View.OnClickListe
if(!connToInternet) {
Toasty.info(ctx, getResources().getString(R.string.checkNetConnection));
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
return;
}
if (editIssueTitleForm.equals("")) {
Toasty.info(ctx, getString(R.string.issueTitleEmpty));
Toasty.error(ctx, getString(R.string.issueTitleEmpty));
return;
}
@ -267,10 +266,10 @@ public class EditIssueActivity extends BaseActivity implements View.OnClickListe
if(response.code() == 201) {
if(tinyDb.getString("issueType").equalsIgnoreCase("Pull")) {
Toasty.info(ctx, getString(R.string.editPrSuccessMessage));
Toasty.success(ctx, getString(R.string.editPrSuccessMessage));
}
else {
Toasty.info(ctx, getString(R.string.editIssueSuccessMessage));
Toasty.success(ctx, getString(R.string.editIssueSuccessMessage));
}
tinyDb.putBoolean("issueEdited", true);
@ -290,7 +289,7 @@ public class EditIssueActivity extends BaseActivity implements View.OnClickListe
else {
enableProcessButton();
Toasty.info(ctx, getString(R.string.genericError));
Toasty.error(ctx, getString(R.string.genericError));
}
@ -427,7 +426,6 @@ public class EditIssueActivity extends BaseActivity implements View.OnClickListe
@SuppressLint("SimpleDateFormat") DateFormat formatter = new SimpleDateFormat("yyyy-M-dd");
String dueDate = formatter.format(response.body().getDue_date());
editIssueDueDate.setText(dueDate);
}
//enableProcessButton();
@ -438,12 +436,10 @@ public class EditIssueActivity extends BaseActivity implements View.OnClickListe
getResources().getString(R.string.alertDialogTokenRevokedMessage),
getResources().getString(R.string.alertDialogTokenRevokedCopyNegativeButton),
getResources().getString(R.string.alertDialogTokenRevokedCopyPositiveButton));
}
else {
Toasty.info(ctx, getString(R.string.genericError));
Toasty.error(ctx, getString(R.string.genericError));
}
}
@ -459,21 +455,11 @@ public class EditIssueActivity extends BaseActivity implements View.OnClickListe
private void disableProcessButton() {
editIssueButton.setEnabled(false);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.hintColor));
editIssueButton.setBackground(shape);
}
private void enableProcessButton() {
editIssueButton.setEnabled(true);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.btnBackground));
editIssueButton.setBackground(shape);
}
}

View File

@ -139,17 +139,17 @@ public class FileDiffActivity extends BaseActivity {
}
else if(response.code() == 403) {
Toasty.info(ctx, ctx.getString(R.string.authorizeError));
Toasty.error(ctx, ctx.getString(R.string.authorizeError));
}
else if(response.code() == 404) {
Toasty.info(ctx, ctx.getString(R.string.apiNotFound));
Toasty.warning(ctx, ctx.getString(R.string.apiNotFound));
}
else {
Toasty.info(ctx, getString(R.string.labelGeneralError));
Toasty.error(ctx, getString(R.string.labelGeneralError));
}
@ -166,14 +166,10 @@ public class FileDiffActivity extends BaseActivity {
private void initCloseListener() {
onClickListener = new View.OnClickListener() {
onClickListener = view -> {
@Override
public void onClick(View view) {
getIntent().removeExtra("singleFileName");
finish();
}
getIntent().removeExtra("singleFileName");
finish();
};
}

View File

@ -267,17 +267,17 @@ public class FileViewActivity extends BaseActivity implements BottomSheetFileVie
}
else if(response.code() == 403) {
Toasty.info(ctx, ctx.getString(R.string.authorizeError));
Toasty.error(ctx, ctx.getString(R.string.authorizeError));
}
else if(response.code() == 404) {
Toasty.info(ctx, ctx.getString(R.string.apiNotFound));
Toasty.warning(ctx, ctx.getString(R.string.apiNotFound));
}
else {
Toasty.info(ctx, getString(R.string.labelGeneralError));
Toasty.error(ctx, getString(R.string.labelGeneralError));
}
@ -426,7 +426,7 @@ public class FileViewActivity extends BaseActivity implements BottomSheetFileVie
}
else {
Toasty.error(ctx, getString(R.string.waitLoadingDownloadFile));
Toasty.warning(ctx, getString(R.string.waitLoadingDownloadFile));
}
}
@ -452,7 +452,7 @@ public class FileViewActivity extends BaseActivity implements BottomSheetFileVie
outputStream.write(dataAsBytes);
outputStream.close();
Toasty.info(ctx, getString(R.string.downloadFileSaved));
Toasty.success(ctx, getString(R.string.downloadFileSaved));
}
catch(IOException e) {

View File

@ -32,6 +32,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.amulyakhare.textdrawable.TextDrawable;
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
import com.vdurmont.emoji.EmojiParser;
import org.mian.gitnex.R;
import org.mian.gitnex.adapters.IssueCommentsAdapter;
@ -96,7 +97,7 @@ public class IssueDetailActivity extends BaseActivity {
private HorizontalScrollView assigneesScrollView;
private ScrollView scrollViewComments;
private TextView issueModified;
private ImageView createNewComment;
private ExtendedFloatingActionButton createNewComment;
final Context ctx = this;
private Context appCtx;
private LinearLayout labelsLayout;

View File

@ -2,7 +2,6 @@ package org.mian.gitnex.activities;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
@ -13,7 +12,6 @@ import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RadioGroup;
import android.widget.ScrollView;
import android.widget.Spinner;
import android.widget.TextView;
import androidx.annotation.NonNull;
@ -25,8 +23,8 @@ import org.mian.gitnex.database.api.UserAccountsApi;
import org.mian.gitnex.helpers.AppUtil;
import org.mian.gitnex.helpers.NetworkObserver;
import org.mian.gitnex.helpers.PathsHelper;
import org.mian.gitnex.helpers.SnackBar;
import org.mian.gitnex.helpers.TinyDB;
import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.helpers.UrlHelper;
import org.mian.gitnex.helpers.Version;
import org.mian.gitnex.models.GiteaVersion;
@ -61,7 +59,6 @@ public class LoginActivity extends BaseActivity {
private TextView otpInfo;
private RadioGroup loginMethod;
private String device_id = "token";
private ScrollView layoutView;
@Override
protected int getLayoutResourceId() {
@ -88,7 +85,6 @@ public class LoginActivity extends BaseActivity {
protocolSpinner = findViewById(R.id.httpsSpinner);
loginMethod = findViewById(R.id.loginMethod);
loginTokenCode = findViewById(R.id.loginTokenCode);
layoutView = findViewById(R.id.loginForm);
((TextView) findViewById(R.id.appVersion)).setText(AppUtil.getAppVersion(appCtx));
@ -101,7 +97,7 @@ public class LoginActivity extends BaseActivity {
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
if(protocolSpinner.getSelectedItem() == Protocol.HTTP) {
SnackBar.warning(ctx, layoutView, getResources().getString(R.string.protocolError));
Toasty.warning(ctx, getResources().getString(R.string.protocolError));
}
}
@ -142,7 +138,7 @@ public class LoginActivity extends BaseActivity {
disableProcessButton();
loginButton.setText(getResources().getString(R.string.btnLogin));
SnackBar.error(ctx, layoutView, getResources().getString(R.string.checkNetConnection));
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
}
});
@ -183,7 +179,7 @@ public class LoginActivity extends BaseActivity {
if(instanceUrlET.getText().toString().equals("")) {
SnackBar.warning(ctx, layoutView, getResources().getString(R.string.emptyFieldURL));
Toasty.error(ctx, getResources().getString(R.string.emptyFieldURL));
enableProcessButton();
return;
@ -193,7 +189,7 @@ public class LoginActivity extends BaseActivity {
if(otpCode.length() != 0 && otpCode.length() != 6) {
SnackBar.warning(ctx, layoutView, getResources().getString(R.string.loginOTPTypeError));
Toasty.warning(ctx, getResources().getString(R.string.loginOTPTypeError));
enableProcessButton();
return;
@ -208,7 +204,7 @@ public class LoginActivity extends BaseActivity {
if(loginUid.equals("")) {
SnackBar.warning(ctx, layoutView, getResources().getString(R.string.emptyFieldUsername));
Toasty.error(ctx, getResources().getString(R.string.emptyFieldUsername));
enableProcessButton();
return;
@ -216,7 +212,7 @@ public class LoginActivity extends BaseActivity {
if(loginUid.contains("@")) {
SnackBar.warning(ctx, layoutView, getResources().getString(R.string.userInvalidUserName));
Toasty.warning(ctx, getResources().getString(R.string.userInvalidUserName));
enableProcessButton();
return;
@ -224,7 +220,7 @@ public class LoginActivity extends BaseActivity {
if(loginPass.equals("")) {
SnackBar.warning(ctx, layoutView, getResources().getString(R.string.emptyFieldPassword));
Toasty.error(ctx, getResources().getString(R.string.emptyFieldPassword));
enableProcessButton();
return;
@ -240,7 +236,7 @@ public class LoginActivity extends BaseActivity {
if(loginToken.equals("")) {
SnackBar.warning(ctx, layoutView, getResources().getString(R.string.loginTokenError));
Toasty.error(ctx, getResources().getString(R.string.loginTokenError));
enableProcessButton();
return;
@ -254,7 +250,7 @@ public class LoginActivity extends BaseActivity {
catch(Exception e) {
Log.e("onFailure-login", e.toString());
SnackBar.error(ctx, layoutView, getResources().getString(R.string.malformedUrl));
Toasty.error(ctx, getResources().getString(R.string.malformedUrl));
enableProcessButton();
}
@ -296,7 +292,7 @@ public class LoginActivity extends BaseActivity {
}
catch(Exception e) {
SnackBar.error(ctx, layoutView, getResources().getString(R.string.versionUnknown));
Toasty.error(ctx, getResources().getString(R.string.versionUnknown));
enableProcessButton();
return;
}
@ -328,7 +324,7 @@ public class LoginActivity extends BaseActivity {
}
else {
SnackBar.info(ctx, layoutView, getResources().getString(R.string.versionUnsupportedNew));
Toasty.warning(ctx, getResources().getString(R.string.versionUnsupportedNew));
login(loginType, instanceUrl, loginUid, loginPass, loginOTP, loginToken);
}
@ -357,7 +353,7 @@ public class LoginActivity extends BaseActivity {
public void onFailure(@NonNull Call<GiteaVersion> callVersion, @NonNull Throwable t) {
Log.e("onFailure-versionCheck", t.toString());
SnackBar.error(ctx, layoutView, getResources().getString(R.string.errorOnLogin));
Toasty.error(ctx, getResources().getString(R.string.errorOnLogin));
enableProcessButton();
}
});
@ -401,12 +397,12 @@ public class LoginActivity extends BaseActivity {
break;
case 401:
SnackBar.error(ctx, layoutView, getResources().getString(R.string.unauthorizedApiError));
Toasty.error(ctx, getResources().getString(R.string.unauthorizedApiError));
enableProcessButton();
break;
default:
SnackBar.error(ctx, layoutView, getResources().getString(R.string.genericApiStatusError) + response.code());
Toasty.error(ctx, getResources().getString(R.string.genericApiStatusError) + response.code());
enableProcessButton();
}
@ -417,7 +413,7 @@ public class LoginActivity extends BaseActivity {
public void onFailure(@NonNull Call<UserInfo> call, @NonNull Throwable t) {
Log.e("onFailure", t.toString());
SnackBar.error(ctx, layoutView, getResources().getString(R.string.genericError));
Toasty.error(ctx, getResources().getString(R.string.genericError));
enableProcessButton();
}
@ -477,7 +473,7 @@ public class LoginActivity extends BaseActivity {
}
else {
SnackBar.error(ctx, layoutView, getResources().getString(R.string.genericApiStatusError) + response.code());
Toasty.error(ctx, getResources().getString(R.string.genericApiStatusError) + response.code());
enableProcessButton();
}
@ -487,7 +483,7 @@ public class LoginActivity extends BaseActivity {
public void onFailure(@NonNull Call<Void> delcall, @NonNull Throwable t) {
Log.e("onFailure-login", t.toString());
SnackBar.error(ctx, layoutView, getResources().getString(R.string.malformedJson));
Toasty.error(ctx, getResources().getString(R.string.malformedJson));
enableProcessButton();
}
@ -500,7 +496,7 @@ public class LoginActivity extends BaseActivity {
}
else {
SnackBar.error(ctx, layoutView, getResources().getString(R.string.genericApiStatusError) + response.code());
Toasty.error(ctx, getResources().getString(R.string.genericApiStatusError) + response.code());
enableProcessButton();
}
@ -510,7 +506,7 @@ public class LoginActivity extends BaseActivity {
public void onFailure(@NonNull Call<List<UserTokens>> call, @NonNull Throwable t) {
Log.e("onFailure-login", t.toString());
SnackBar.error(ctx, layoutView, getResources().getString(R.string.malformedJson));
Toasty.error(ctx, getResources().getString(R.string.malformedJson));
enableProcessButton();
}
@ -585,12 +581,12 @@ public class LoginActivity extends BaseActivity {
break;
case 401:
SnackBar.error(ctx, layoutView, getResources().getString(R.string.unauthorizedApiError));
Toasty.error(ctx, getResources().getString(R.string.unauthorizedApiError));
enableProcessButton();
break;
default:
SnackBar.error(ctx, layoutView, getResources().getString(R.string.genericApiStatusError) + response.code());
Toasty.error(ctx, getResources().getString(R.string.genericApiStatusError) + response.code());
enableProcessButton();
}
@ -601,7 +597,7 @@ public class LoginActivity extends BaseActivity {
public void onFailure(@NonNull Call<UserInfo> call, @NonNull Throwable t) {
Log.e("onFailure", t.toString());
SnackBar.error(ctx, layoutView, getResources().getString(R.string.genericError));
Toasty.error(ctx, getResources().getString(R.string.genericError));
enableProcessButton();
}
@ -610,7 +606,7 @@ public class LoginActivity extends BaseActivity {
}
else if(responseCreate.code() == 500) {
SnackBar.error(ctx, layoutView, getResources().getString(R.string.genericApiStatusError) + responseCreate.code());
Toasty.error(ctx, getResources().getString(R.string.genericApiStatusError) + responseCreate.code());
enableProcessButton();
}
@ -659,26 +655,14 @@ public class LoginActivity extends BaseActivity {
private void disableProcessButton() {
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius(8);
shape.setColor(getResources().getColor(R.color.hintColor));
loginButton.setText(R.string.processingText);
loginButton.setBackground(shape);
loginButton.setEnabled(false);
}
private void enableProcessButton() {
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius(8);
shape.setColor(getResources().getColor(R.color.btnBackground));
loginButton.setText(R.string.btnLogin);
loginButton.setBackground(shape);
loginButton.setEnabled(true);
}
}

View File

@ -199,7 +199,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
public void onDrawerOpened(@NonNull View drawerView) {
if(tinyDb.getBoolean("noConnection")) {
Toasty.info(ctx, getResources().getString(R.string.checkNetConnection));
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
tinyDb.putBoolean("noConnection", false);
}
@ -369,7 +369,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
if(!connToInternet) {
if(!tinyDb.getBoolean("noConnection")) {
Toasty.info(ctx, getResources().getString(R.string.checkNetConnection));
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
}
tinyDb.putBoolean("noConnection", true);
@ -421,12 +421,18 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
if(frag != null) {
new AlertDialog.Builder(ctx).setTitle(R.string.deleteAllDrafts).setIcon(R.drawable.ic_delete).setCancelable(false).setMessage(R.string.deleteAllDraftsDialogMessage).setPositiveButton(R.string.menuDeleteText, (dialog, which) -> {
new AlertDialog.Builder(ctx)
.setTitle(R.string.deleteAllDrafts)
.setIcon(R.drawable.ic_delete)
.setCancelable(false)
.setMessage(R.string.deleteAllDraftsDialogMessage)
.setPositiveButton(R.string.menuDeleteText, (dialog, which) -> {
frag.deleteAllDrafts(currentActiveAccountId);
dialog.dismiss();
frag.deleteAllDrafts(currentActiveAccountId);
dialog.dismiss();
}).setNegativeButton(R.string.cancelButton, (dialog, which) -> dialog.dismiss()).show();
})
.setNeutralButton(R.string.cancelButton, null).show();
}
else {
@ -665,7 +671,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
else {
String toastError = getResources().getString(R.string.genericApiStatusError) + response.code();
Toasty.info(ctx, toastError);
Toasty.error(ctx, toastError);
}

View File

@ -126,12 +126,10 @@ public class MergePullRequestActivity extends BaseActivity {
if(!connToInternet) {
disableProcessButton();
}
else {
viewBinding.mergeButton.setOnClickListener(mergePullRequest);
}
}
@ -221,7 +219,7 @@ public class MergePullRequestActivity extends BaseActivity {
if(!connToInternet) {
Toasty.info(ctx, getResources().getString(R.string.checkNetConnection));
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
return;
}
@ -266,7 +264,7 @@ public class MergePullRequestActivity extends BaseActivity {
deleteBranchFunction(repoOwner, repoName);
Toasty.info(ctx, getString(R.string.mergePRSuccessMsg));
Toasty.success(ctx, getString(R.string.mergePRSuccessMsg));
tinyDb.putBoolean("prMerged", true);
tinyDb.putBoolean("resumePullRequests", true);
finish();
@ -281,7 +279,7 @@ public class MergePullRequestActivity extends BaseActivity {
deleteBranchFunction(repoOwner, repoName);
Toasty.info(ctx, getString(R.string.mergePRSuccessMsg));
Toasty.success(ctx, getString(R.string.mergePRSuccessMsg));
tinyDb.putBoolean("prMerged", true);
tinyDb.putBoolean("resumePullRequests", true);
finish();
@ -291,7 +289,7 @@ public class MergePullRequestActivity extends BaseActivity {
}
else {
Toasty.info(ctx, getString(R.string.mergePRSuccessMsg));
Toasty.success(ctx, getString(R.string.mergePRSuccessMsg));
tinyDb.putBoolean("prMerged", true);
tinyDb.putBoolean("resumePullRequests", true);
finish();
@ -308,13 +306,13 @@ public class MergePullRequestActivity extends BaseActivity {
else if(response.code() == 404) {
enableProcessButton();
Toasty.info(ctx, getString(R.string.mergePR404ErrorMsg));
Toasty.warning(ctx, getString(R.string.mergePR404ErrorMsg));
}
else {
enableProcessButton();
Toasty.info(ctx, getString(R.string.genericError));
Toasty.error(ctx, getString(R.string.genericError));
}
@ -373,15 +371,11 @@ public class MergePullRequestActivity extends BaseActivity {
private void disableProcessButton() {
viewBinding.mergeButton.setEnabled(false);
viewBinding.mergeButton.setBackground(getResources().getDrawable(R.drawable.shape_buttons_disabled));
}
private void enableProcessButton() {
viewBinding.mergeButton.setEnabled(true);
viewBinding.mergeButton.setBackground(getResources().getDrawable(R.drawable.shape_buttons));
}
}

View File

@ -1,7 +1,6 @@
package org.mian.gitnex.activities;
import android.content.Context;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.util.Log;
import android.util.Patterns;
@ -67,11 +66,9 @@ public class ProfileEmailActivity extends BaseActivity {
if(!connToInternet) {
disableProcessButton();
} else {
addEmailButton.setOnClickListener(addEmailListener);
}
}
@ -94,20 +91,20 @@ public class ProfileEmailActivity extends BaseActivity {
if(!connToInternet) {
Toasty.info(ctx, getResources().getString(R.string.checkNetConnection));
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
return;
}
if(newUserEmail.equals("")) {
Toasty.info(ctx, getString(R.string.emailErrorEmpty));
Toasty.error(ctx, getString(R.string.emailErrorEmpty));
return;
}
else if(!Patterns.EMAIL_ADDRESS.matcher(newUserEmail).matches()) {
Toasty.info(ctx, getString(R.string.emailErrorInvalid));
Toasty.warning(ctx, getString(R.string.emailErrorInvalid));
return;
}
@ -138,7 +135,7 @@ public class ProfileEmailActivity extends BaseActivity {
if(response.code() == 201) {
Toasty.info(ctx, getString(R.string.emailAddedText));
Toasty.success(ctx, getString(R.string.emailAddedText));
tinyDb.putBoolean("emailsRefresh", true);
enableProcessButton();
finish();
@ -156,25 +153,25 @@ public class ProfileEmailActivity extends BaseActivity {
else if(response.code() == 403) {
enableProcessButton();
Toasty.info(ctx, ctx.getString(R.string.authorizeError));
Toasty.error(ctx, ctx.getString(R.string.authorizeError));
}
else if(response.code() == 404) {
enableProcessButton();
Toasty.info(ctx, ctx.getString(R.string.apiNotFound));
Toasty.warning(ctx, ctx.getString(R.string.apiNotFound));
}
else if(response.code() == 422) {
enableProcessButton();
Toasty.info(ctx, ctx.getString(R.string.emailErrorInUse));
Toasty.warning(ctx, ctx.getString(R.string.emailErrorInUse));
}
else {
enableProcessButton();
Toasty.info(ctx, getString(R.string.labelGeneralError));
Toasty.error(ctx, getString(R.string.labelGeneralError));
}
@ -190,32 +187,18 @@ public class ProfileEmailActivity extends BaseActivity {
}
private void initCloseListener() {
onClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
};
onClickListener = view -> finish();
}
private void disableProcessButton() {
addEmailButton.setEnabled(false);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.hintColor));
addEmailButton.setBackground(shape);
}
private void enableProcessButton() {
addEmailButton.setEnabled(true);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius( 8 );
shape.setColor(getResources().getColor(R.color.btnBackground));
addEmailButton.setBackground(shape);
}
}

View File

@ -2,7 +2,6 @@ package org.mian.gitnex.activities;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
@ -272,14 +271,14 @@ public class ReplyToIssueActivity extends BaseActivity {
if(!connToInternet) {
Toasty.info(ctx, getResources().getString(R.string.checkNetConnection));
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
return;
}
if(newReplyDT.equals("")) {
Toasty.info(ctx, getString(R.string.commentEmptyError));
Toasty.error(ctx, getString(R.string.commentEmptyError));
}
else {
@ -318,7 +317,7 @@ public class ReplyToIssueActivity extends BaseActivity {
if(response.code() == 201) {
Toasty.info(ctx, getString(R.string.commentSuccess));
Toasty.success(ctx, getString(R.string.commentSuccess));
tinyDb.putBoolean("commentPosted", true);
tinyDb.putBoolean("resumeIssues", true);
tinyDb.putBoolean("resumePullRequests", true);
@ -349,7 +348,7 @@ public class ReplyToIssueActivity extends BaseActivity {
else {
enableProcessButton();
Toasty.info(ctx, getString(R.string.commentError));
Toasty.error(ctx, getString(R.string.commentError));
}
@ -397,21 +396,11 @@ public class ReplyToIssueActivity extends BaseActivity {
private void disableProcessButton() {
replyButton.setEnabled(false);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius(8);
shape.setColor(getResources().getColor(R.color.hintColor));
replyButton.setBackground(shape);
}
private void enableProcessButton() {
replyButton.setEnabled(true);
GradientDrawable shape = new GradientDrawable();
shape.setCornerRadius(8);
shape.setColor(getResources().getColor(R.color.btnBackground));
replyButton.setBackground(shape);
}
}

View File

@ -432,6 +432,7 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
dialogInterface.dismiss();
}
});
pBuilder.setNeutralButton(R.string.cancelButton, null);
pBuilder.create().show();

View File

@ -93,12 +93,8 @@ public class RepoStargazersActivity extends BaseActivity {
}
private void initCloseListener() {
onClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
};
onClickListener = view -> finish();
}
}

View File

@ -93,12 +93,8 @@ public class RepoWatchersActivity extends BaseActivity {
}
private void initCloseListener() {
onClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
};
onClickListener = view -> finish();
}
}

View File

@ -121,11 +121,11 @@ public class SettingsAppearanceActivity extends BaseActivity {
if (isChecked) {
tinyDb.putBoolean("enableCounterBadges", true);
Toasty.info(appCtx, getResources().getString(R.string.settingsSave));
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
}
else {
tinyDb.putBoolean("enableCounterBadges", false);
Toasty.info(appCtx, getResources().getString(R.string.settingsSave));
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
}
});
@ -154,7 +154,7 @@ public class SettingsAppearanceActivity extends BaseActivity {
this.recreate();
this.overridePendingTransition(0, 0);
dialogInterfaceTheme.dismiss();
Toasty.info(appCtx, getResources().getString(R.string.settingsSave));
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
});
@ -187,7 +187,7 @@ public class SettingsAppearanceActivity extends BaseActivity {
this.recreate();
this.overridePendingTransition(0, 0);
dialogInterfaceCustomFont.dismiss();
Toasty.info(appCtx, appCtx.getResources().getString(R.string.settingsSave));
Toasty.success(appCtx, appCtx.getResources().getString(R.string.settingsSave));
});
@ -217,7 +217,7 @@ public class SettingsAppearanceActivity extends BaseActivity {
tinyDb.putInt("homeScreenId", i);
dialogInterfaceHomeScreen.dismiss();
Toasty.info(appCtx, getResources().getString(R.string.settingsSave));
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
});
@ -270,7 +270,7 @@ public class SettingsAppearanceActivity extends BaseActivity {
}
dialogInterfaceCodeBlock.dismiss();
Toasty.info(appCtx, getResources().getString(R.string.settingsSave));
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
});
@ -307,7 +307,7 @@ public class SettingsAppearanceActivity extends BaseActivity {
}
dialogInterfaceTime.dismiss();
Toasty.info(appCtx, getResources().getString(R.string.settingsSave));
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
});
@ -320,9 +320,7 @@ public class SettingsAppearanceActivity extends BaseActivity {
}
private void initCloseListener() {
onClickListener = view -> {
finish();
};
onClickListener = view -> finish();
}
}

View File

@ -51,11 +51,11 @@ public class SettingsDraftsActivity extends BaseActivity {
if(isChecked) {
tinyDb.putBoolean("draftsCommentsDeletionEnabled", true);
Toasty.info(appCtx, getResources().getString(R.string.settingsSave));
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
}
else {
tinyDb.putBoolean("draftsCommentsDeletionEnabled", false);
Toasty.info(appCtx, getResources().getString(R.string.settingsSave));
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
}
});

View File

@ -85,7 +85,7 @@ public class SettingsFileViewerActivity extends BaseActivity {
tinyDb.putInt("fileviewerSourceCodeThemeId", i);
dialogInterfaceTheme.dismiss();
Toasty.info(appCtx, getResources().getString(R.string.settingsSave));
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
});
@ -100,12 +100,12 @@ public class SettingsFileViewerActivity extends BaseActivity {
if(isChecked) {
tinyDb.putBoolean("enablePdfMode", true);
tinyDb.putString("enablePdfModeInit", "yes");
Toasty.info(appCtx, getResources().getString(R.string.settingsSave));
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
}
else {
tinyDb.putBoolean("enablePdfMode", false);
tinyDb.putString("enablePdfModeInit", "yes");
Toasty.info(appCtx, getResources().getString(R.string.settingsSave));
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
}
});

View File

@ -51,11 +51,11 @@ public class SettingsReportsActivity extends BaseActivity {
if(isChecked) {
tinyDb.putBoolean("crashReportingEnabled", true);
Toasty.info(appCtx, getResources().getString(R.string.settingsSave));
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
}
else {
tinyDb.putBoolean("crashReportingEnabled", false);
Toasty.info(appCtx, getResources().getString(R.string.settingsSave));
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
}
});
@ -63,9 +63,7 @@ public class SettingsReportsActivity extends BaseActivity {
}
private void initCloseListener() {
onClickListener = view -> {
finish();
};
onClickListener = view -> finish();
}
}

View File

@ -155,7 +155,7 @@ public class SettingsSecurityActivity extends BaseActivity {
tinyDb.putInt("cacheSizeImagesId", i);
dialogInterfaceTheme.dismiss();
Toasty.info(appCtx, getResources().getString(R.string.settingsSave));
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
});
@ -185,7 +185,7 @@ public class SettingsSecurityActivity extends BaseActivity {
tinyDb.putInt("cacheSizeId", i);
dialogInterfaceTheme.dismiss();
Toasty.info(appCtx, getResources().getString(R.string.settingsSave));
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
});
@ -242,11 +242,11 @@ public class SettingsSecurityActivity extends BaseActivity {
NotificationsMaster.hireWorker(ctx);
pollingDelaySelected.setText(String.format(getString(R.string.pollingDelaySelectedText), numberPicker.getValue()));
Toasty.info(appCtx, getResources().getString(R.string.settingsSave));
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
});
builder.setNegativeButton(R.string.cancelButton, (dialog, which) -> dialog.dismiss());
builder.setNeutralButton(R.string.cancelButton, null);
builder.setView(numberPicker);
builder.create().show();

View File

@ -143,11 +143,11 @@ public class SettingsTranslationActivity extends BaseActivity {
this.recreate();
this.overridePendingTransition(0, 0);
dialogInterface.dismiss();
Toasty.info(appCtx, getResources().getString(R.string.settingsSave));
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
});
lBuilder.setNegativeButton(getString(R.string.cancelButton), (dialog, which) -> dialog.dismiss());
lBuilder.setNeutralButton(getString(R.string.cancelButton), null);
AlertDialog lDialog = lBuilder.create();
lDialog.show();
@ -157,9 +157,7 @@ public class SettingsTranslationActivity extends BaseActivity {
}
private void initCloseListener() {
onClickListener = view -> {
finish();
};
onClickListener = view -> finish();
}
}

View File

@ -59,12 +59,8 @@ public class SponsorsActivity extends BaseActivity {
}
private void initCloseListener() {
onClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
};
onClickListener = view -> finish();
}
}

View File

@ -93,7 +93,7 @@ public class DraftsAdapter extends RecyclerView.Adapter<DraftsAdapter.DraftsView
draftsList.remove(position);
notifyItemRemoved(position);
notifyItemRangeChanged(position, draftsList.size());
Toasty.info(mCtx, mCtx.getResources().getString(R.string.draftsSingleDeleteSuccess));
Toasty.success(mCtx, mCtx.getResources().getString(R.string.draftsSingleDeleteSuccess));
}

View File

@ -149,7 +149,7 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepo
if(response.code() != 404) {
Toasty.info(context, context.getString(R.string.genericApiStatusError));
Toasty.error(context, context.getString(R.string.genericApiStatusError));
}
@ -161,7 +161,7 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepo
public void onFailure(@NonNull Call<WatchInfo> call, @NonNull Throwable t) {
tinyDb.putBoolean("repoWatch", false);
Toasty.info(context, context.getString(R.string.genericApiStatusError));
Toasty.error(context, context.getString(R.string.genericApiStatusError));
}
});

View File

@ -62,7 +62,7 @@ public class FilesAdapter extends RecyclerView.Adapter<FilesAdapter.FilesViewHol
filesListener.onClickDir(fileName.getText().toString());
}
else {
Toasty.info(context, context.getString(R.string.filesGenericError));
Toasty.warning(context, context.getString(R.string.filesGenericError));
}
});

View File

@ -242,7 +242,7 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<IssueCommentsAdap
if(response.code() == 204) {
updateAdapter(position);
Toasty.info(ctx, ctx.getResources().getString(R.string.deleteCommentSuccess));
Toasty.success(ctx, ctx.getResources().getString(R.string.deleteCommentSuccess));
}
else if(response.code() == 401) {
@ -255,17 +255,17 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<IssueCommentsAdap
}
else if(response.code() == 403) {
Toasty.info(ctx, ctx.getString(R.string.authorizeError));
Toasty.error(ctx, ctx.getString(R.string.authorizeError));
}
else if(response.code() == 404) {
Toasty.info(ctx, ctx.getString(R.string.apiNotFound));
Toasty.warning(ctx, ctx.getString(R.string.apiNotFound));
}
else {
Toasty.info(ctx, ctx.getString(R.string.genericError));
Toasty.error(ctx, ctx.getString(R.string.genericError));
}

View File

@ -146,7 +146,7 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
if(response.code() != 404) {
Toasty.info(context, context.getString(R.string.genericApiStatusError));
Toasty.error(context, context.getString(R.string.genericApiStatusError));
}
@ -158,7 +158,7 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
public void onFailure(@NonNull Call<WatchInfo> call, @NonNull Throwable t) {
tinyDb.putBoolean("repoWatch", false);
Toasty.info(context, context.getString(R.string.genericApiStatusError));
Toasty.error(context, context.getString(R.string.genericApiStatusError));
}
});

View File

@ -270,7 +270,7 @@ public class RepoForksAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
if(response.code() != 404) {
Toasty.info(context, context.getString(R.string.genericApiStatusError));
Toasty.error(context, context.getString(R.string.genericApiStatusError));
}
@ -282,7 +282,7 @@ public class RepoForksAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
public void onFailure(@NonNull Call<WatchInfo> call, @NonNull Throwable t) {
tinyDb.putBoolean("repoWatch", false);
Toasty.info(context, context.getString(R.string.genericApiStatusError));
Toasty.error(context, context.getString(R.string.genericApiStatusError));
}
});

View File

@ -147,7 +147,7 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
if(response.code() != 404) {
Toasty.info(context, context.getString(R.string.genericApiStatusError));
Toasty.error(context, context.getString(R.string.genericApiStatusError));
}
@ -159,7 +159,7 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
public void onFailure(@NonNull Call<WatchInfo> call, @NonNull Throwable t) {
tinyDb.putBoolean("repoWatch", false);
Toasty.info(context, context.getString(R.string.genericApiStatusError));
Toasty.error(context, context.getString(R.string.genericApiStatusError));
}
});

View File

@ -142,7 +142,7 @@ public class RepositoriesByOrgAdapter extends RecyclerView.Adapter<RepositoriesB
if(response.code() != 404) {
Toasty.info(context, context.getString(R.string.genericApiStatusError));
Toasty.error(context, context.getString(R.string.genericApiStatusError));
}
@ -154,7 +154,7 @@ public class RepositoriesByOrgAdapter extends RecyclerView.Adapter<RepositoriesB
public void onFailure(@NonNull Call<WatchInfo> call, @NonNull Throwable t) {
tinyDb.putBoolean("repoWatch", false);
Toasty.info(context, context.getString(R.string.genericApiStatusError));
Toasty.error(context, context.getString(R.string.genericApiStatusError));
}
});

View File

@ -111,7 +111,7 @@ public class UserAccountsAdapter extends RecyclerView.Adapter<UserAccountsAdapte
userAccountsList.remove(position);
notifyItemRemoved(position);
notifyItemRangeChanged(position, userAccountsList.size());
Toasty.info(mCtx, mCtx.getResources().getString(R.string.accountDeletedMessage));
Toasty.success(mCtx, mCtx.getResources().getString(R.string.accountDeletedMessage));
}

View File

@ -26,12 +26,10 @@ public class BottomSheetAdminUsersFragment extends BottomSheetDialogFragment {
TextView createNewUser = v.findViewById(R.id.createNewUser);
createNewUser.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bmListener.onButtonClicked("newUser");
dismiss();
}
createNewUser.setOnClickListener(v1 -> {
bmListener.onButtonClicked("newUser");
dismiss();
});
return v;
@ -47,9 +45,9 @@ public class BottomSheetAdminUsersFragment extends BottomSheetDialogFragment {
try {
bmListener = (BottomSheetAdminUsersFragment.BottomSheetListener) context;
} catch (ClassCastException e) {
throw new ClassCastException(context.toString()
+ " must implement BottomSheetListener");
}
catch (ClassCastException e) {
throw new ClassCastException(context.toString() + " must implement BottomSheetListener");
}
}

View File

@ -48,9 +48,9 @@ public class BottomSheetFileViewerFragment extends BottomSheetDialogFragment {
try {
bmListener = (BottomSheetFileViewerFragment.BottomSheetListener) context;
} catch (ClassCastException e) {
throw new ClassCastException(context.toString()
+ " must implement BottomSheetListener");
}
catch (ClassCastException e) {
throw new ClassCastException(context.toString() + " must implement BottomSheetListener");
}
}

View File

@ -25,12 +25,10 @@ public class BottomSheetProfileFragment extends BottomSheetDialogFragment {
TextView addNewEmailAddress = v.findViewById(R.id.addNewEmailAddress);
addNewEmailAddress.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(getContext(), ProfileEmailActivity.class));
dismiss();
}
addNewEmailAddress.setOnClickListener(v1 -> {
startActivity(new Intent(getContext(), ProfileEmailActivity.class));
dismiss();
});
return v;

View File

@ -162,9 +162,9 @@ public class BottomSheetRepoFragment extends BottomSheetDialogFragment {
try {
bmListener = (BottomSheetListener) context;
} catch (ClassCastException e) {
throw new ClassCastException(context.toString()
+ " must implement BottomSheetListener");
}
catch (ClassCastException e) {
throw new ClassCastException(context.toString() + " must implement BottomSheetListener");
}
}

View File

@ -85,59 +85,39 @@ public class BottomSheetSingleIssueFragment extends BottomSheetDialogFragment {
}
mergePullRequest.setOnClickListener(new View.OnClickListener() {
mergePullRequest.setOnClickListener(v13 -> {
@Override
public void onClick(View v) {
startActivity(new Intent(ctx, MergePullRequestActivity.class));
dismiss();
startActivity(new Intent(ctx, MergePullRequestActivity.class));
dismiss();
}
});
openFilesDiff.setOnClickListener(new View.OnClickListener() {
openFilesDiff.setOnClickListener(v14 -> {
@Override
public void onClick(View v) {
startActivity(new Intent(ctx, FileDiffActivity.class));
dismiss();
startActivity(new Intent(ctx, FileDiffActivity.class));
dismiss();
}
});
editIssue.setOnClickListener(new View.OnClickListener() {
editIssue.setOnClickListener(v15 -> {
@Override
public void onClick(View v) {
startActivity(new Intent(ctx, EditIssueActivity.class));
dismiss();
startActivity(new Intent(ctx, EditIssueActivity.class));
dismiss();
}
});
editLabels.setOnClickListener(new View.OnClickListener() {
editLabels.setOnClickListener(v16 -> {
@Override
public void onClick(View v) {
startActivity(new Intent(ctx, AddRemoveLabelsActivity.class));
dismiss();
startActivity(new Intent(ctx, AddRemoveLabelsActivity.class));
dismiss();
}
});
addRemoveAssignees.setOnClickListener(new View.OnClickListener() {
addRemoveAssignees.setOnClickListener(v17 -> {
@Override
public void onClick(View v) {
startActivity(new Intent(ctx, AddRemoveAssigneesActivity.class));
dismiss();
startActivity(new Intent(ctx, AddRemoveAssigneesActivity.class));
dismiss();
}
});
shareIssue.setOnClickListener(v1 -> {

View File

@ -122,11 +122,11 @@ public class DraftsFragment extends Fragment {
DraftsApi.deleteAllDrafts(accountId);
draftsList_.clear();
adapter.notifyDataSetChanged();
Toasty.info(ctx, getResources().getString(R.string.draftsDeleteSuccess));
Toasty.success(ctx, getResources().getString(R.string.draftsDeleteSuccess));
}
else {
Toasty.error(ctx, getResources().getString(R.string.draftsListEmpty));
Toasty.warning(ctx, getResources().getString(R.string.draftsListEmpty));
}
}

View File

@ -253,7 +253,7 @@ public class IssuesFragment extends Fragment {
}
else {
Toasty.info(context, getString(R.string.noMoreData));
Toasty.warning(context, getString(R.string.noMoreData));
adapter.setMoreDataAvailable(false);
}

View File

@ -11,7 +11,6 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
@ -23,6 +22,7 @@ import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
import org.mian.gitnex.R;
import org.mian.gitnex.activities.CreateRepoActivity;
import org.mian.gitnex.adapters.MyReposListAdapter;
@ -45,7 +45,7 @@ public class MyRepositoriesFragment extends Fragment {
private ProgressBar mProgressBar;
private RecyclerView mRecyclerView;
private MyReposListAdapter adapter;
private ImageView createNewRepo;
private ExtendedFloatingActionButton createNewRepo;
private TextView noDataMyRepo;
private int pageSize = 1;
@ -105,15 +105,10 @@ public class MyRepositoriesFragment extends Fragment {
mRecyclerView.addItemDecoration(dividerItemDecoration);
createNewRepo = v.findViewById(R.id.addNewRepo);
createNewRepo.setOnClickListener(new View.OnClickListener() {
createNewRepo.setOnClickListener(view -> {
@Override
public void onClick(View view) {
Intent intent = new Intent(view.getContext(), CreateRepoActivity.class);
startActivity(intent);
}
Intent intent = new Intent(view.getContext(), CreateRepoActivity.class);
startActivity(intent);
});
@ -135,18 +130,11 @@ public class MyRepositoriesFragment extends Fragment {
}
});
swipeRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
swipeRefresh.setRefreshing(false);
MyRepositoriesViewModel.loadMyReposList(instanceUrl, Authorization.returnAuthentication(getContext(), loginUid, instanceToken), userLogin, getContext(), pageSize, resultLimit);
}
}, 50);
}
});
swipeRefresh.setOnRefreshListener(() -> new Handler().postDelayed(() -> {
swipeRefresh.setRefreshing(false);
MyRepositoriesViewModel.loadMyReposList(instanceUrl, Authorization.returnAuthentication(getContext(), loginUid, instanceToken), userLogin, getContext(), pageSize, resultLimit);
}, 50));
fetchDataAsync(instanceUrl, Authorization.returnAuthentication(getContext(), loginUid, instanceToken), userLogin, pageSize, resultLimit);

View File

@ -11,9 +11,7 @@ import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@ -21,6 +19,7 @@ import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
import org.apache.commons.lang3.StringUtils;
import org.mian.gitnex.R;
import org.mian.gitnex.actions.NotificationsActions;
@ -29,9 +28,9 @@ import org.mian.gitnex.adapters.NotificationsAdapter;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.helpers.AppUtil;
import org.mian.gitnex.helpers.InfiniteScrollListener;
import org.mian.gitnex.helpers.SnackBar;
import org.mian.gitnex.helpers.StaticGlobalVariables;
import org.mian.gitnex.helpers.TinyDB;
import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.models.NotificationThread;
import java.io.IOException;
import java.util.ArrayList;
@ -52,9 +51,8 @@ public class NotificationsFragment extends Fragment implements NotificationsAdap
private NotificationsAdapter notificationsAdapter;
private NotificationsActions notificationsActions;
private ImageView markAllAsRead;
private ExtendedFloatingActionButton markAllAsRead;
private ProgressBar progressBar;
private RelativeLayout mainLayout;
private ProgressBar loadingMoreView;
private TextView noDataNotifications;
private SwipeRefreshLayout pullToRefresh;
@ -88,7 +86,6 @@ public class NotificationsFragment extends Fragment implements NotificationsAdap
pageResultLimit = StaticGlobalVariables.getCurrentResultLimit(context);
tinyDB.putString("notificationsFilterState", currentFilterMode);
mainLayout = v.findViewById(R.id.mainLayout);
markAllAsRead = v.findViewById(R.id.markAllAsRead);
noDataNotifications = v.findViewById(R.id.noDataNotifications);
loadingMoreView = v.findViewById(R.id.loadingMoreView);
@ -150,7 +147,7 @@ public class NotificationsFragment extends Fragment implements NotificationsAdap
activity.runOnUiThread(() -> {
SnackBar.info(context, mainLayout, getString(R.string.markedNotificationsAsRead));
Toasty.success(context, getString(R.string.markedNotificationsAsRead));
loadNotifications(true);
});
@ -158,7 +155,7 @@ public class NotificationsFragment extends Fragment implements NotificationsAdap
}
catch(IOException e) {
activity.runOnUiThread(() -> SnackBar.error(context, mainLayout, getString(R.string.genericError)));
activity.runOnUiThread(() -> Toasty.error(context, getString(R.string.genericError)));
Log.e("onError", e.toString());
}

View File

@ -10,7 +10,6 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
@ -22,6 +21,7 @@ import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
import org.mian.gitnex.R;
import org.mian.gitnex.activities.CreateOrganizationActivity;
import org.mian.gitnex.adapters.OrganizationsListAdapter;
@ -42,7 +42,7 @@ public class OrganizationsFragment extends Fragment {
private ProgressBar mProgressBar;
private OrganizationsListAdapter adapter;
private RecyclerView mRecyclerView;
private ImageView createNewOrganization;
private ExtendedFloatingActionButton createNewOrganization;
private TextView noDataOrg;
@Nullable

View File

@ -456,7 +456,7 @@ public class RepoInfoFragment extends Fragment {
} else if (response.code() == 403) {
Toasty.info(ctx, ctx.getString(R.string.authorizeError));
Toasty.error(ctx, ctx.getString(R.string.authorizeError));
} else if (response.code() == 404) {
@ -465,7 +465,7 @@ public class RepoInfoFragment extends Fragment {
} else {
Toasty.info(getContext(), getString(R.string.genericError));
Toasty.error(getContext(), getString(R.string.genericError));
}
}

View File

@ -10,7 +10,6 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
@ -22,6 +21,7 @@ import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
import org.mian.gitnex.R;
import org.mian.gitnex.activities.CreateRepoActivity;
import org.mian.gitnex.adapters.ReposListAdapter;
@ -42,7 +42,7 @@ public class RepositoriesFragment extends Fragment {
private ProgressBar mProgressBar;
private RecyclerView mRecyclerView;
private ReposListAdapter adapter;
private ImageView createNewRepo;
private ExtendedFloatingActionButton createNewRepo;
private TextView noDataRepo;
private int pageSize = 1;
private int resultLimit = 50;

View File

@ -11,7 +11,6 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
@ -23,6 +22,7 @@ import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
import org.mian.gitnex.R;
import org.mian.gitnex.activities.CreateRepoActivity;
import org.mian.gitnex.adapters.StarredReposListAdapter;
@ -45,7 +45,7 @@ public class StarredRepositoriesFragment extends Fragment {
private ProgressBar mProgressBar;
private RecyclerView mRecyclerView;
private StarredReposListAdapter adapter;
private ImageView createNewRepo;
private ExtendedFloatingActionButton createNewRepo;
private TextView noData;
private int pageSize = 1;
private int resultLimit = 50;

View File

@ -22,7 +22,7 @@ public class AlertDialogs {
.setMessage(message)
.setCancelable(true)
.setIcon(R.drawable.ic_warning)
.setNegativeButton(copyNegativeButton, (dialog, which) -> dialog.dismiss())
.setNeutralButton(copyNegativeButton, (dialog, which) -> dialog.dismiss())
.setPositiveButton(copyPositiveButton, (dialog, which) -> {
final TinyDB tinyDb = new TinyDB(context);
@ -76,7 +76,7 @@ public class AlertDialogs {
context.startActivity(intent);
})
.setNegativeButton(negativeButton, null).show();
.setNeutralButton(negativeButton, null).show();
}
@ -86,7 +86,7 @@ public class AlertDialogs {
.setTitle(title + userNameMain)
.setMessage(message)
.setPositiveButton(positiveButton, (dialog, whichButton) -> CollaboratorActions.deleteCollaborator(context, searchKeyword, userNameMain))
.setNegativeButton(negativeButton, null).show();
.setNeutralButton(negativeButton, null).show();
}
@ -96,7 +96,7 @@ public class AlertDialogs {
.setTitle(title + userNameMain)
.setMessage(message)
.setPositiveButton(positiveButton, (dialog, whichButton) -> TeamActions.addTeamMember(context, userNameMain, teamId))
.setNegativeButton(negativeButton, null).show();
.setNeutralButton(negativeButton, null).show();
}
@ -106,7 +106,7 @@ public class AlertDialogs {
.setTitle(title + userNameMain)
.setMessage(message)
.setPositiveButton(positiveButton, (dialog, whichButton) -> TeamActions.removeTeamMember(context, userNameMain, teamId))
.setNegativeButton(negativeButton, null).show();
.setNeutralButton(negativeButton, null).show();
}

View File

@ -1,63 +0,0 @@
package org.mian.gitnex.helpers;
import android.content.Context;
import android.view.View;
import android.widget.TextView;
import com.google.android.material.snackbar.Snackbar;
import org.mian.gitnex.R;
/**
* Author M M Arif
*/
public class SnackBar {
public static void info(Context context, View createRepository, String message) {
Snackbar snackBar = Snackbar.make(createRepository, message, Snackbar.LENGTH_LONG);
View sbView = snackBar.getView();
TextView textView = sbView.findViewById(R.id.snackbar_text);
textView.setTextColor(context.getResources().getColor(R.color.lightBlue));
snackBar.show();
}
public static void success(Context context, View createRepository, String message) {
Snackbar snackBar = Snackbar.make(createRepository, message, Snackbar.LENGTH_LONG);
View sbView = snackBar.getView();
TextView textView = sbView.findViewById(R.id.snackbar_text);
textView.setTextColor(context.getResources().getColor(R.color.colorWhite));
snackBar.show();
}
public static void warning(Context context, View createRepository, String message) {
Snackbar snackBar = Snackbar.make(createRepository, message, Snackbar.LENGTH_LONG);
View sbView = snackBar.getView();
TextView textView = sbView.findViewById(R.id.snackbar_text);
textView.setTextColor(context.getResources().getColor(R.color.lightYellow));
snackBar.show();
}
public static void error(Context context, View createRepository, String message) {
Snackbar snackBar = Snackbar.make(createRepository, message, Snackbar.LENGTH_LONG);
View sbView = snackBar.getView();
TextView textView = sbView.findViewById(R.id.snackbar_text);
textView.setTextColor(context.getResources().getColor(R.color.darkRed));
snackBar.show();
}
}

View File

@ -58,17 +58,17 @@ public class AdminGetUsersViewModel extends ViewModel {
}
else if(response.code() == 403) {
Toasty.info(ctx, ctx.getString(R.string.authorizeError));
Toasty.error(ctx, ctx.getString(R.string.authorizeError));
}
else if(response.code() == 404) {
Toasty.info(ctx, ctx.getString(R.string.apiNotFound));
Toasty.warning(ctx, ctx.getString(R.string.apiNotFound));
}
else {
Toasty.info(ctx, ctx.getString(R.string.genericError));
Toasty.error(ctx, ctx.getString(R.string.genericError));
Log.i("onResponse", String.valueOf(response.code()));
}

View File

@ -53,7 +53,7 @@ public class FilesViewModel extends ViewModel {
} else {
Toasty.info(ctx, ctx.getString(R.string.noDataFilesTab));
Toasty.warning(ctx, ctx.getString(R.string.noDataFilesTab));
Log.i("onResponse", String.valueOf(response.code()));
}
@ -95,7 +95,7 @@ public class FilesViewModel extends ViewModel {
} else {
Toasty.info(ctx, ctx.getString(R.string.noDataFilesTab));
Toasty.warning(ctx, ctx.getString(R.string.noDataFilesTab));
Log.i("onResponse", String.valueOf(response.code()));
}

View File

@ -1,39 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/colorPrimaryDark">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="@color/btnBackground" />
<corners android:radius="3dp" />
</shape>
</item>
<item android:id="@android:id/background">
<shape android:shape="rectangle">
<gradient
android:angle="90"
android:endColor="@color/btnBackground"
android:startColor="@color/btnBackground"
android:type="linear" />
<corners android:radius="3dp" />
<padding
android:top="0dp"
android:bottom="0dp"
android:left="10dp"
android:right="10dp"
/>
</shape>
</item>
</ripple>

View File

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="@color/hintColor">
</solid>
<corners
android:radius="3dp">
</corners>
<padding
android:top="0dp"
android:right="10dp"
android:left="10dp"
android:bottom="0dp">
</padding>
</shape>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<corners android:radius="5dp"/>
<corners android:radius="8dp"/>
</shape>
</shape>

View File

@ -113,12 +113,11 @@
<Button
android:id="@+id/addNewAccount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="60dp"
android:layout_marginStart="10dp"
android:layout_marginTop="15dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="15dp"
android:background="@drawable/shape_buttons"
android:text="@string/addNewAccountText"
android:textColor="@color/btnTextColor"
android:textSize="16sp" />

View File

@ -213,9 +213,8 @@
android:layout_gravity="end"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_height="60dp"
android:text="@string/newCreateButtonCopy"
android:background="@drawable/shape_buttons"
android:textColor="@color/btnTextColor" />
</LinearLayout>

View File

@ -103,11 +103,10 @@
android:layout_gravity="end"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_height="60dp"
android:text="@string/newCreateButtonCopy"
android:background="@drawable/shape_buttons"
android:textColor="@color/btnTextColor" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

View File

@ -152,9 +152,8 @@
android:layout_gravity="end"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_height="60dp"
android:text="@string/newCreateButtonCopy"
android:background="@drawable/shape_buttons"
android:textColor="@color/btnTextColor" />
<View
@ -165,4 +164,4 @@
</ScrollView>
</LinearLayout>
</LinearLayout>

View File

@ -181,9 +181,8 @@
android:layout_gravity="end"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_height="60dp"
android:text="@string/newCreateButtonCopy"
android:background="@drawable/shape_buttons"
android:textColor="@color/btnTextColor" />
<View

View File

@ -164,9 +164,8 @@
android:layout_gravity="end"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_height="60dp"
android:text="@string/newCreateButtonCopy"
android:background="@drawable/shape_buttons"
android:textColor="@color/btnTextColor" />
<View

View File

@ -164,9 +164,8 @@
android:layout_gravity="end"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_height="60dp"
android:text="@string/saveButton"
android:background="@drawable/shape_buttons"
android:textColor="@color/btnTextColor" />
</LinearLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
@ -38,6 +38,7 @@
<RelativeLayout
android:id="@+id/relativeMainLayoutFrame"
android:layout_width="match_parent"
android:layout_marginTop="50dp"
android:layout_height="match_parent">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
@ -225,19 +226,6 @@
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<ImageView
android:id="@+id/addNewComment"
android:src="@drawable/ic_reply"
android:tint="@color/colorWhite"
android:layout_width="54dp"
android:layout_height="54dp"
android:layout_margin="15dp"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:background="@drawable/shape_circle"
android:padding="@dimen/fab_padding"
android:contentDescription="@string/addNewContent" />
<ProgressBar
android:id="@+id/progressBar"
style="@style/Base.Widget.AppCompat.ProgressBar"
@ -248,4 +236,18 @@
</RelativeLayout>
</LinearLayout>
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/addNewComment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="16dp"
android:text="@string/commentButtonText"
android:contentDescription="@string/commentButtonText"
android:textColor="@color/colorWhite"
android:backgroundTint="@color/darkGreen"
app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior"
app:iconTint="@color/colorWhite"
app:icon="@drawable/ic_reply" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -202,7 +202,7 @@
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="60dp"
android:text="@string/btnLogin"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
@ -210,7 +210,6 @@
android:layout_marginTop="15dp"
android:textColor="@color/btnTextColor"
android:textSize="16sp"
android:background="@drawable/shape_buttons"
android:id="@+id/login_button"/>
<TextView

View File

@ -160,9 +160,8 @@
android:layout_gravity="end"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_height="60dp"
android:text="@string/mergePullRequestButtonText"
android:background="@drawable/shape_buttons"
android:textColor="@color/btnTextColor" />
<TextView

View File

@ -228,10 +228,8 @@
android:layout_gravity="end"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:width="140dp"
android:layout_height="60dp"
android:text="@string/newFileButtonCopy"
android:background="@drawable/shape_buttons"
android:textColor="@color/btnTextColor" />
</LinearLayout>

View File

@ -144,9 +144,8 @@
android:layout_gravity="end"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_height="6dp"
android:text="@string/newCreateButtonCopy"
android:background="@drawable/shape_buttons"
android:textColor="@color/btnTextColor" />
</LinearLayout>

View File

@ -120,9 +120,8 @@
android:layout_gravity="end"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_height="60dp"
android:text="@string/newCreateButtonCopy"
android:background="@drawable/shape_buttons"
android:textColor="@color/btnTextColor" />
</LinearLayout>

View File

@ -158,9 +158,8 @@
android:layout_gravity="end"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_height="60dp"
android:text="@string/newCreateButtonCopy"
android:background="@drawable/shape_buttons"
android:textColor="@color/btnTextColor" />
</LinearLayout>

View File

@ -78,11 +78,10 @@
android:layout_gravity="end"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_height="60dp"
android:text="@string/profileEmailButton"
android:background="@drawable/shape_buttons"
android:textColor="@color/btnTextColor" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

View File

@ -103,9 +103,8 @@
android:layout_gravity="end"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_height="60dp"
android:text="@string/commentButtonText"
android:background="@drawable/shape_buttons"
android:textColor="@color/btnTextColor" />
</LinearLayout>

View File

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".activities.MainActivity">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
@ -28,18 +30,6 @@
android:indeterminate="true"
android:visibility="visible" />
<ImageView
android:src="@drawable/ic_add"
android:id="@+id/addNewRepo"
android:layout_width="54dp"
android:layout_height="54dp"
android:layout_margin="15dp"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:background="@drawable/shape_circle"
android:padding="@dimen/fab_padding"
android:contentDescription="@string/addNewContent" />
<TextView
android:id="@+id/noDataMyRepo"
android:layout_width="match_parent"
@ -51,4 +41,18 @@
android:textSize="20sp"
android:visibility="gone" />
</RelativeLayout>
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/addNewRepo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="16dp"
android:text="@string/pageTitleNewRepo"
android:contentDescription="@string/pageTitleNewRepo"
android:textColor="@color/colorWhite"
android:backgroundTint="@color/darkGreen"
app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior"
app:iconTint="@color/colorWhite"
app:icon="@drawable/ic_add" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/mainLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -44,17 +46,18 @@
android:textSize="20sp"
android:visibility="gone" />
<ImageView
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/markAllAsRead"
android:layout_width="54dp"
android:layout_height="54dp"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_margin="15dp"
android:background="@drawable/shape_circle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="16dp"
android:text="@string/markAsRead"
android:contentDescription="@string/markAsRead"
android:padding="@dimen/fab_padding"
android:src="@drawable/ic_done"
android:tint="@color/colorWhite" />
android:textColor="@color/colorWhite"
android:backgroundTint="@color/darkGreen"
app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior"
app:iconTint="@color/colorWhite"
app:icon="@drawable/ic_done" />
</RelativeLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/pullToRefresh"
@ -26,18 +28,6 @@
android:indeterminate="true"
android:visibility="visible" />
<ImageView
android:src="@drawable/ic_add"
android:id="@+id/addNewOrganization"
android:layout_width="54dp"
android:layout_height="54dp"
android:layout_margin="15dp"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:background="@drawable/shape_circle"
android:padding="@dimen/fab_padding"
android:contentDescription="@string/addNewContent" />
<TextView
android:id="@+id/noDataOrg"
android:layout_width="match_parent"
@ -49,4 +39,18 @@
android:textSize="20sp"
android:visibility="gone" />
</RelativeLayout>
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/addNewOrganization"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="16dp"
android:text="@string/pageTitleCreateOrganization"
android:contentDescription="@string/pageTitleCreateOrganization"
android:textColor="@color/colorWhite"
android:backgroundTint="@color/darkGreen"
app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior"
app:iconTint="@color/colorWhite"
app:icon="@drawable/ic_add" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -306,11 +306,10 @@
<Button
android:id="@+id/repoAdditionalButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="60dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
android:layout_marginBottom="20dp"
android:background="@drawable/shape_buttons"
android:text="@string/infoShowMoreInformation"
android:textColor="@color/btnTextColor" />

View File

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".activities.MainActivity">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
@ -39,16 +41,18 @@
android:indeterminate="true"
android:visibility="visible" />
<ImageView
android:src="@drawable/ic_add"
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/addNewRepo"
android:layout_width="54dp"
android:layout_height="54dp"
android:layout_margin="15dp"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:background="@drawable/shape_circle"
android:padding="@dimen/fab_padding"
android:contentDescription="@string/addNewContent" />
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="16dp"
android:text="@string/pageTitleNewRepo"
android:contentDescription="@string/pageTitleNewRepo"
android:textColor="@color/colorWhite"
android:backgroundTint="@color/darkGreen"
app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior"
app:iconTint="@color/colorWhite"
app:icon="@drawable/ic_add" />
</RelativeLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".activities.MainActivity">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
@ -39,16 +41,18 @@
android:indeterminate="true"
android:visibility="visible" />
<ImageView
android:src="@drawable/ic_add"
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/addNewRepo"
android:layout_width="54dp"
android:layout_height="54dp"
android:layout_margin="15dp"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:background="@drawable/shape_circle"
android:padding="@dimen/fab_padding"
android:contentDescription="@string/addNewContent" />
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="16dp"
android:text="@string/pageTitleNewRepo"
android:contentDescription="@string/pageTitleNewRepo"
android:textColor="@color/colorWhite"
android:backgroundTint="@color/darkGreen"
app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior"
app:iconTint="@color/colorWhite"
app:icon="@drawable/ic_add" />
</RelativeLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -35,15 +35,14 @@
<Button
android:id="@+id/branchCommitHash"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="60dp"
android:text="@string/viewCommits"
android:layout_marginTop="15dp"
android:textColor="@color/btnTextColor"
android:textSize="14sp"
android:minHeight="0dp"
android:minWidth="0dp"
android:padding="8dp"
android:background="@drawable/shape_buttons" />
android:padding="8dp" />
</LinearLayout>

View File

@ -46,15 +46,14 @@
<Button
android:id="@+id/commitHtmlUrlVw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="60dp"
android:text="@string/viewInBrowser"
android:layout_marginTop="15dp"
android:textColor="@color/btnTextColor"
android:textSize="14sp"
android:minHeight="0dp"
android:minWidth="0dp"
android:padding="8dp"
android:background="@drawable/shape_buttons" />
android:padding="8dp" />
</LinearLayout>

View File

@ -87,9 +87,9 @@
<string name="navigation_drawer_close">Close Navigation Drawer</string>
<string name="logo">Login to Gitea</string>
<string name="urlInfoTooltip">1- Choose the correct protocol(https or http). \n2- Enter Gitea url e.g: try.gitea.io. \n3- If you have enabled 2FA for your account, enter the code in the OTP Code field. \n4- For HTTP basic auth use USERNAME@DOMAIN.COM in the URL field.</string>
<string name="malformedUrl">Couldn\'t connect to host. Please check your URL or port for any errors.</string>
<string name="protocolError">It is not recommended to use HTTP protocol unless you are testing on local network.</string>
<string name="malformedJson">Malformed JSON was received. Server response was not successful.</string>
<string name="malformedUrl">Couldn\'t connect to host. Please check your URL or port for any errors</string>
<string name="protocolError">It is not recommended to use HTTP protocol unless you are testing on local network</string>
<string name="malformedJson">Malformed JSON was received. Server response was not successful</string>
<string name="emptyFieldURL">Instance URL is required</string>
<string name="emptyFieldUsername">Username is required</string>
<string name="emptyFieldPassword">Password is required</string>
@ -114,7 +114,7 @@
<string name="orgExistsError">Organization already exists</string>
<string name="binaryFileError">Binary files are not supported yet.</string>
<string name="fileTooLarge">This file exceeds the maximum possible diff lines.</string>
<string name="fileTooLarge">This file exceeds the maximum possible diff lines</string>
<string name="processingText">Processing</string>
<string name="search">Search</string>
@ -168,7 +168,7 @@
<string name="commentSuccess">Comment posted</string>
<string name="commentError">Something went wrong, please try again</string>
<string name="featureDeprecated">This function will be removed in the future.</string>
<string name="featureDeprecated">This function will be removed in the future</string>
<string name="screamingInFearEmoticon" translatable="false">😱</string>
<string name="generalImgContentText">Avatar</string>
@ -287,7 +287,7 @@
<string name="noDataBranchesTab">No branches found</string>
<string name="alertDialogTokenRevokedTitle">Authorization Error</string>
<string name="alertDialogTokenRevokedMessage">It seems that the Access Token is revoked OR your are not allowed to see these contents. In case of revoked Token, please logout and login again</string>
<string name="alertDialogTokenRevokedMessage">It seems that the Access Token is revoked OR your are not allowed to see these contents.\n\nIn case of revoked Token, please logout and login again</string>
<string name="alertDialogTokenRevokedCopyNegativeButton">Cancel</string>
<string name="alertDialogTokenRevokedCopyPositiveButton">Logout</string>
<string name="labelDeleteTitle">Delete\u0020</string>
@ -360,8 +360,8 @@
<string name="profileCreateNewEmailAddress">Add Email Address</string>
<string name="profileEmailButton">Save</string>
<string name="profileEmailTitle">Email Address</string>
<string name="emailAddedText">New email added successfully.</string>
<string name="emailErrorEmpty">Email address is empty.</string>
<string name="emailAddedText">New email added successfully</string>
<string name="emailErrorEmpty">Email address is empty</string>
<string name="emailErrorInvalid">Email address is not valid</string>
<string name="emailErrorInUse">Email address is already in use</string>
<string name="emailTypeText">Primary</string>
@ -430,9 +430,9 @@
<string name="releaseCreatedText">New release created</string>
<!-- release -->
<string name="loginOTPTypeError">OTP code should be numbers.</string>
<string name="loginOTPTypeError">OTP code should be numbers</string>
<string name="loginOTP">OTP Code (Optional)</string>
<string name="otpMessage">Enter the otp code if 2FA is enabled</string>
<string name="otpMessage">Enter otp code if 2FA is enabled</string>
<string name="openWebRepo">Open in Browser</string>
@ -527,7 +527,7 @@
<string name="titleDrafts">Drafts</string>
<string name="filesBreadcrumbRoot" translatable="false">Root</string>
<string name="versionUnsupportedOld">Unsupported old version(%1$s) of Gitea detected. Please update to latest stable version. If you continue, the app may not function properly.</string>
<string name="versionUnsupportedOld">Unsupported old version(%1$s) of Gitea detected. Please update to latest stable version. If you continue, the app may not function properly</string>
<string name="versionUnsupportedNew">New Gitea version detected! Please UPDATE GitNex!</string>
<string name="versionUnknown">No Gitea detected!</string>
<string name="versionAlertDialogHeader">Unsupported Version of Gitea</string>
@ -551,7 +551,7 @@
<string name="mergePullRequestButtonText">Merge</string>
<string name="deleteBranchAfterMerge">Delete branch after merge</string>
<string name="mergeNoteText">Merge may fail if you are not authorized to merge this Pull Request.</string>
<string name="mergeInfoDisabledMessage">Disabled Merge button means that there are conflicts OR other things to fix before Merge.</string>
<string name="mergeInfoDisabledMessage">Disabled Merge button means that there are conflicts OR other things to fix before Merge</string>
<string name="deleteBranchForkInfo">This branch belong to a forked repository</string>
<string name="mergeCommentText">Merge comment</string>
<string name="mergePRSuccessMsg">Pull Request was merged successfully</string>
@ -579,7 +579,7 @@
<!-- Memorizing Trust Manager -->
<string name="mtm_notification">Certificate Verification</string>
<string name="mtm_accept_cert">Accept Unknown Certificate?</string>
<string name="mtm_trust_anchor">The server certificate is not signed by a known Certificate Authority.</string>
<string name="mtm_trust_anchor">The server certificate is not signed by a known Certificate Authority</string>
<string name="mtm_cert_expired">The server certificate is expired.</string>
<string name="mtm_accept_server_name">Accept Mismatching Server Name?</string>
<string name="mtm_hostname_mismatch">Server could not authenticate as \&quot;%s\&quot;. The certificate is only valid for:</string>
@ -627,7 +627,7 @@
<string name="accountDeletedMessage">Account deleted successfully</string>
<string name="removeAccountPopupTitle">Remove Account</string>
<string name="removeAccountPopupMessage">Are you sure you want to remove this account from the app?\nThis will remove all the data related to this account on the app only.</string>
<string name="removeAccountPopupMessage">Are you sure you want to remove this account from the app?\n\nThis will remove all the data related to this account on the app only.</string>
<string name="addNewAccount">New Account</string>
<string name="addNewAccountText">Add New Account</string>
<string name="accountAlreadyExistsError">Account already exists in the app</string>
@ -643,12 +643,12 @@
<string name="notificationsPollingHeaderText">Notifications Polling Delay</string>
<string name="pollingDelaySelectedText">%d Minutes</string>
<string name="pollingDelayDialogHeaderText">Select Polling Delay</string>
<string name="pollingDelayDialogDescriptionText">Choose a minutely delay in which GitNex tries to poll new notifications.</string>
<string name="pollingDelayDialogDescriptionText">Choose a minutely delay in which GitNex tries to poll new notifications</string>
<string name="markAsRead">Mark as Read</string>
<string name="markAsUnread">Mark as Unread</string>
<string name="pinNotification">Pin Notification</string>
<string name="markedNotificationsAsRead">Successfully marked all notifications as read.</string>
<string name="markedNotificationsAsRead">Successfully marked all notifications as read</string>
<string name="isRead">Read</string>
<string name="isUnread">Unread</string>