From cb241d80f32d81e370fd55984d6636e446a8a450 Mon Sep 17 00:00:00 2001 From: M M Arif Date: Mon, 1 Feb 2021 19:13:48 +0100 Subject: [PATCH] Fix crash on creating new file (#819) Allow multi line text in desc inputs Minor improvements. Improving the selection of branches. Default to first branch in spinner. Minor improvements. fix crash on creating new file Co-authored-by: M M Arif Co-authored-by: opyale Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/819 Reviewed-by: opyale Co-Authored-By: M M Arif Co-Committed-By: M M Arif --- .../gitnex/activities/CreateFileActivity.java | 289 +++++++----------- .../activities/CreateMilestoneActivity.java | 2 +- .../CreateOrganizationActivity.java | 2 +- .../gitnex/activities/CreateRepoActivity.java | 2 +- .../gitnex/activities/FileViewActivity.java | 4 +- .../java/org/mian/gitnex/helpers/AppUtil.java | 10 - .../main/res/layout/activity_create_file.xml | 50 +-- .../main/res/layout/activity_create_issue.xml | 2 +- .../res/layout/activity_create_milestone.xml | 2 +- .../layout/activity_create_organization.xml | 2 +- .../main/res/layout/activity_create_pr.xml | 2 +- .../res/layout/activity_create_release.xml | 2 +- .../main/res/layout/activity_create_repo.xml | 2 +- .../main/res/layout/activity_edit_issue.xml | 2 +- app/src/main/res/values/strings.xml | 5 +- 15 files changed, 134 insertions(+), 244 deletions(-) diff --git a/app/src/main/java/org/mian/gitnex/activities/CreateFileActivity.java b/app/src/main/java/org/mian/gitnex/activities/CreateFileActivity.java index 14f0f963..de0dfe88 100644 --- a/app/src/main/java/org/mian/gitnex/activities/CreateFileActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/CreateFileActivity.java @@ -21,6 +21,7 @@ import org.mian.gitnex.databinding.ActivityCreateFileBinding; import org.mian.gitnex.helpers.AlertDialogs; import org.mian.gitnex.helpers.AppUtil; import org.mian.gitnex.helpers.Authorization; +import org.mian.gitnex.helpers.NetworkStatusObserver; import org.mian.gitnex.helpers.Toasty; import org.mian.gitnex.models.Branches; import org.mian.gitnex.models.DeleteFile; @@ -43,21 +44,21 @@ public class CreateFileActivity extends BaseActivity { private EditText newFileName; private EditText newFileContent; - private EditText newFileBranchName; private EditText newFileCommitMessage; - private AutoCompleteTextView newFileBranchesSpinner; + private AutoCompleteTextView newFileBranches; private String filePath; private String fileSha; - private int fileAction = 0; // 0 = create, 1 = delete, 2 = edit - List branchesList = new ArrayList<>(); + public static final int FILE_ACTION_CREATE = 0; + public static final int FILE_ACTION_DELETE = 1; + public static final int FILE_ACTION_EDIT = 2; + + private int fileAction = FILE_ACTION_CREATE; + + private final List branches = new ArrayList<>(); - private String loginUid; private String repoOwner; private String repoName; - private String instanceToken; - - private String selectedBranch; @SuppressLint("ClickableViewAccessibility") @Override @@ -68,21 +69,16 @@ public class CreateFileActivity extends BaseActivity { ActivityCreateFileBinding activityCreateFileBinding = ActivityCreateFileBinding.inflate(getLayoutInflater()); setContentView(activityCreateFileBinding.getRoot()); - boolean connToInternet = AppUtil.hasNetworkConnection(appCtx); - InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); - loginUid = tinyDB.getString("loginUid"); String repoFullName = tinyDB.getString("repoFullName"); String[] parts = repoFullName.split("/"); repoOwner = parts[0]; repoName = parts[1]; - instanceToken = "token " + tinyDB.getString(loginUid + "-token"); closeActivity = activityCreateFileBinding.close; newFileName = activityCreateFileBinding.newFileName; newFileContent = activityCreateFileBinding.newFileContent; - newFileBranchName = activityCreateFileBinding.newFileBranchName; newFileCommitMessage = activityCreateFileBinding.newFileCommitMessage; TextView toolbarTitle = activityCreateFileBinding.toolbarTitle; @@ -91,10 +87,10 @@ public class CreateFileActivity extends BaseActivity { imm.showSoftInput(newFileName, InputMethodManager.SHOW_IMPLICIT); initCloseListener(); + closeActivity.setOnClickListener(onClickListener); newFileCreate = activityCreateFileBinding.newFileCreate; - newFileContent.setOnTouchListener((touchView, motionEvent) -> { touchView.getParent().requestDisallowInterceptTouchEvent(true); @@ -106,9 +102,9 @@ public class CreateFileActivity extends BaseActivity { return false; }); - if(getIntent().getStringExtra("filePath") != null && getIntent().getIntExtra("fileAction", 1) == 1) { + if(getIntent().getStringExtra("filePath") != null && getIntent().getIntExtra("fileAction", FILE_ACTION_DELETE) == FILE_ACTION_DELETE) { - fileAction = getIntent().getIntExtra("fileAction", 1); + fileAction = getIntent().getIntExtra("fileAction", FILE_ACTION_DELETE); filePath = getIntent().getStringExtra("filePath"); String fileContents = getIntent().getStringExtra("fileContents"); @@ -124,11 +120,12 @@ public class CreateFileActivity extends BaseActivity { newFileContent.setText(fileContents); newFileContent.setEnabled(false); newFileContent.setFocusable(false); + } - if(getIntent().getStringExtra("filePath") != null && getIntent().getIntExtra("fileAction", 2) == 2) { + if(getIntent().getStringExtra("filePath") != null && getIntent().getIntExtra("fileAction", FILE_ACTION_EDIT) == FILE_ACTION_EDIT) { - fileAction = getIntent().getIntExtra("fileAction", 2); + fileAction = getIntent().getIntExtra("fileAction", FILE_ACTION_EDIT); filePath = getIntent().getStringExtra("filePath"); String fileContents = getIntent().getStringExtra("fileContents"); @@ -142,24 +139,21 @@ public class CreateFileActivity extends BaseActivity { newFileName.setFocusable(false); newFileContent.setText(fileContents); + } initCloseListener(); closeActivity.setOnClickListener(onClickListener); - newFileBranchesSpinner = activityCreateFileBinding.newFileBranchesSpinner; - getBranches(instanceToken, repoOwner, repoName, loginUid); + newFileBranches = activityCreateFileBinding.newFileBranches; + getBranches(repoOwner, repoName); disableProcessButton(); - if(!connToInternet) { + NetworkStatusObserver networkStatusObserver = NetworkStatusObserver.get(ctx); + networkStatusObserver.registerNetworkStatusListener(hasNetworkConnection -> newFileCreate.setEnabled(hasNetworkConnection)); - newFileCreate.setEnabled(false); - } - else { - - newFileCreate.setOnClickListener(createFileListener); - } + newFileCreate.setOnClickListener(createFileListener); } @@ -172,7 +166,7 @@ public class CreateFileActivity extends BaseActivity { String newFileName_ = newFileName.getText().toString(); String newFileContent_ = newFileContent.getText().toString(); - String newFileBranchName_ = newFileBranchName.getText().toString(); + String newFileBranchName_ = newFileBranches.getText().toString(); String newFileCommitMessage_ = newFileCommitMessage.getText().toString(); if(!connToInternet) { @@ -187,25 +181,13 @@ public class CreateFileActivity extends BaseActivity { return; } - if(selectedBranch.equals("No branch")) { + if(!appUtil.checkStringsWithDash(newFileBranchName_)) { - if(newFileBranchName_.equals("")) { + Toasty.error(ctx, getString(R.string.newFileInvalidBranchName)); + return; + } - Toasty.error(ctx, getString(R.string.newFileRequiredFieldNewBranchName)); - return; - } - else { - - if(!appUtil.checkStringsWithDash(newFileBranchName_)) { - - Toasty.error(ctx, getString(R.string.newFileInvalidBranchName)); - return; - } - } - - } - - if(appUtil.charactersLength(newFileCommitMessage_) > 255) { + if(newFileCommitMessage_.length() > 255) { Toasty.warning(ctx, getString(R.string.newFileCommitMessageError)); } @@ -213,37 +195,30 @@ public class CreateFileActivity extends BaseActivity { disableProcessButton(); - if(fileAction == 1) { + switch(fileAction) { + + case FILE_ACTION_CREATE: + createNewFile(Authorization.get(ctx), repoOwner, repoName, newFileName_, appUtil.encodeBase64(newFileContent_), newFileCommitMessage_, newFileBranchName_); + break; + + case FILE_ACTION_DELETE: + deleteFile(Authorization.get(ctx), repoOwner, repoName, filePath, newFileCommitMessage_, newFileBranchName_, fileSha); + break; + + case FILE_ACTION_EDIT: + editFile(Authorization.get(ctx), repoOwner, repoName, filePath, + appUtil.encodeBase64(newFileContent_), newFileCommitMessage_, newFileBranchName_, fileSha); + break; - deleteFile(Authorization.get(ctx), repoOwner, repoName, filePath, - newFileBranchName_, newFileCommitMessage_, selectedBranch, fileSha); } - else if(fileAction == 2) { - - editFile(Authorization.get(ctx), repoOwner, repoName, filePath, - appUtil.encodeBase64(newFileContent_), newFileBranchName_, newFileCommitMessage_, selectedBranch, fileSha); - } - else { - - createNewFile(Authorization.get(ctx), repoOwner, repoName, newFileName_, - appUtil.encodeBase64(newFileContent_), newFileBranchName_, newFileCommitMessage_, selectedBranch); - } - } - } - private void createNewFile(final String token, String repoOwner, String repoName, String fileName, String fileContent, String fileBranchName, String fileCommitMessage, String currentBranch) { + private void createNewFile(final String token, String repoOwner, String repoName, String fileName, String fileContent, String fileCommitMessage, String branchName) { - NewFile createNewFileJsonStr; - if(currentBranch.equals("No branch")) { - - createNewFileJsonStr = new NewFile("", fileContent, fileCommitMessage, fileBranchName); - } - else { - - createNewFileJsonStr = new NewFile(currentBranch, fileContent, fileCommitMessage, ""); - } + NewFile createNewFileJsonStr = branches.contains(branchName) ? + new NewFile(branchName, fileContent, fileCommitMessage, "") : + new NewFile("", fileContent, fileCommitMessage, branchName); Call call = RetrofitClient .getApiInterface(ctx) @@ -254,33 +229,33 @@ public class CreateFileActivity extends BaseActivity { @Override public void onResponse(@NonNull Call call, @NonNull retrofit2.Response response) { - if(response.code() == 201) { + switch(response.code()) { - enableProcessButton(); - Toasty.success(ctx, getString(R.string.newFileSuccessMessage)); - finish(); - } - else if(response.code() == 401) { + case 201: + enableProcessButton(); + Toasty.success(ctx, getString(R.string.newFileSuccessMessage)); + finish(); + break; - enableProcessButton(); - AlertDialogs.authorizationTokenRevokedDialog(ctx, getResources().getString(R.string.alertDialogTokenRevokedTitle), - getResources().getString(R.string.alertDialogTokenRevokedMessage), - getResources().getString(R.string.alertDialogTokenRevokedCopyNegativeButton), - getResources().getString(R.string.alertDialogTokenRevokedCopyPositiveButton)); - } - else { + case 401: + enableProcessButton(); + AlertDialogs.authorizationTokenRevokedDialog(ctx, getResources().getString(R.string.alertDialogTokenRevokedTitle), + getResources().getString(R.string.alertDialogTokenRevokedMessage), + getResources().getString(R.string.alertDialogTokenRevokedCopyNegativeButton), + getResources().getString(R.string.alertDialogTokenRevokedCopyPositiveButton)); + break; - if(response.code() == 404) { + case 404: + enableProcessButton(); + Toasty.warning(ctx, getString(R.string.apiNotFound)); + break; - enableProcessButton(); - Toasty.warning(ctx, getString(R.string.apiNotFound)); - } - else { + default: + enableProcessButton(); + Toasty.error(ctx, getString(R.string.orgCreatedError)); + break; - enableProcessButton(); - Toasty.error(ctx, getString(R.string.orgCreatedError)); - } - } + } } @Override @@ -288,26 +263,17 @@ public class CreateFileActivity extends BaseActivity { Log.e("onFailure", t.toString()); enableProcessButton(); + } }); } - private void deleteFile(final String token, String repoOwner, String repoName, String fileName, String fileBranchName, String fileCommitMessage, String currentBranch, String fileSha) { + private void deleteFile(final String token, String repoOwner, String repoName, String fileName, String fileCommitMessage, String branchName, String fileSha) { - String branchName; - DeleteFile deleteFileJsonStr; - - if(currentBranch.equals("No branch")) { - - branchName = fileBranchName; - deleteFileJsonStr = new DeleteFile("", fileCommitMessage, fileBranchName, fileSha); - } - else { - - branchName = currentBranch; - deleteFileJsonStr = new DeleteFile(currentBranch, fileCommitMessage, "", fileSha); - } + DeleteFile deleteFileJsonStr = branches.contains(branchName) ? + new DeleteFile(branchName, fileCommitMessage, "", fileSha) : + new DeleteFile("", fileCommitMessage, branchName, fileSha); Call call = RetrofitClient .getApiInterface(ctx) @@ -321,7 +287,7 @@ public class CreateFileActivity extends BaseActivity { if(response.code() == 200) { enableProcessButton(); - Toasty.info(ctx, getString(R.string.deleteFileMessage, branchName)); + Toasty.info(ctx, getString(R.string.deleteFileMessage, tinyDB.getString("repoBranch"))); getIntent().removeExtra("filePath"); getIntent().removeExtra("fileSha"); getIntent().removeExtra("fileContents"); @@ -360,21 +326,11 @@ public class CreateFileActivity extends BaseActivity { } - private void editFile(final String token, String repoOwner, String repoName, String fileName, String fileContent, String fileBranchName, String fileCommitMessage, String currentBranch, String fileSha) { + private void editFile(final String token, String repoOwner, String repoName, String fileName, String fileContent, String fileCommitMessage, String branchName, String fileSha) { - String branchName; - EditFile editFileJsonStr; - - if(currentBranch.equals("No branch")) { - - branchName = fileBranchName; - editFileJsonStr = new EditFile("", fileCommitMessage, fileBranchName, fileSha, fileContent); - } - else { - - branchName = currentBranch; - editFileJsonStr = new EditFile(currentBranch, fileCommitMessage, "", fileSha, fileContent); - } + EditFile editFileJsonStr = branches.contains(branchName) ? + new EditFile(branchName, fileCommitMessage, "", fileSha, fileContent) : + new EditFile("", fileCommitMessage, branchName, fileSha, fileContent); Call call = RetrofitClient .getApiInterface(ctx) @@ -385,36 +341,36 @@ public class CreateFileActivity extends BaseActivity { @Override public void onResponse(@NonNull Call call, @NonNull retrofit2.Response response) { - if(response.code() == 200) { + switch(response.code()) { - enableProcessButton(); - Toasty.info(ctx, getString(R.string.editFileMessage, branchName)); - getIntent().removeExtra("filePath"); - getIntent().removeExtra("fileSha"); - getIntent().removeExtra("fileContents"); - tinyDB.putBoolean("fileModified", true); - finish(); - } - else if(response.code() == 401) { + case 200: + enableProcessButton(); + Toasty.info(ctx, getString(R.string.editFileMessage, branchName)); + getIntent().removeExtra("filePath"); + getIntent().removeExtra("fileSha"); + getIntent().removeExtra("fileContents"); + tinyDB.putBoolean("fileModified", true); + finish(); + break; - enableProcessButton(); - AlertDialogs.authorizationTokenRevokedDialog(ctx, getResources().getString(R.string.alertDialogTokenRevokedTitle), - getResources().getString(R.string.alertDialogTokenRevokedMessage), - getResources().getString(R.string.alertDialogTokenRevokedCopyNegativeButton), - getResources().getString(R.string.alertDialogTokenRevokedCopyPositiveButton)); - } - else { - - if(response.code() == 404) { + case 401: + enableProcessButton(); + AlertDialogs.authorizationTokenRevokedDialog(ctx, getResources().getString(R.string.alertDialogTokenRevokedTitle), + getResources().getString(R.string.alertDialogTokenRevokedMessage), + getResources().getString(R.string.alertDialogTokenRevokedCopyNegativeButton), + getResources().getString(R.string.alertDialogTokenRevokedCopyPositiveButton)); + break; + case 404: enableProcessButton(); Toasty.info(ctx, getString(R.string.apiNotFound)); - } - else { + break; + default: enableProcessButton(); Toasty.info(ctx, getString(R.string.genericError)); - } + break; + } } @@ -423,12 +379,13 @@ public class CreateFileActivity extends BaseActivity { Log.e("onFailure", t.toString()); enableProcessButton(); + } }); } - private void getBranches(String instanceToken, String repoOwner, String repoName, String loginUid) { + private void getBranches(String repoOwner, String repoName) { Call> call = RetrofitClient .getApiInterface(ctx) @@ -439,48 +396,18 @@ public class CreateFileActivity extends BaseActivity { @Override public void onResponse(@NonNull Call> call, @NonNull retrofit2.Response> response) { - if(response.isSuccessful()) { + if(response.code() == 200) { - if(response.code() == 200) { + assert response.body() != null; + for(Branches branch : response.body()) branches.add(branch.getName()); - List branchesList_ = response.body(); + ArrayAdapter adapter = new ArrayAdapter<>(CreateFileActivity.this, R.layout.list_spinner_items, branches); - branchesList.add(new Branches("No branch")); - assert branchesList_ != null; + newFileBranches.setAdapter(adapter); + newFileBranches.setText(tinyDB.getString("repoBranch"), false); - if(branchesList_.size() > 0) { + enableProcessButton(); - for (int i = 0; i < branchesList_.size(); i++) { - - Branches data = new Branches(branchesList_.get(i).getName()); - branchesList.add(data); - } - } - - ArrayAdapter adapter = new ArrayAdapter<>(CreateFileActivity.this, - R.layout.list_spinner_items, branchesList); - - newFileBranchesSpinner.setAdapter(adapter); - enableProcessButton(); - - newFileBranchesSpinner.setOnItemClickListener ((parent, view, position, id) -> { - - selectedBranch = branchesList.get(position).getName(); - - if(selectedBranch.equals("No branch")) { - - newFileBranchName.setEnabled(true); - newFileBranchName.setVisibility(View.VISIBLE); - } - else { - - newFileBranchName.setEnabled(false); - newFileBranchName.setVisibility(View.GONE); - newFileBranchName.setText(""); - } - - }); - } } } diff --git a/app/src/main/java/org/mian/gitnex/activities/CreateMilestoneActivity.java b/app/src/main/java/org/mian/gitnex/activities/CreateMilestoneActivity.java index 647834f5..4b1af58f 100644 --- a/app/src/main/java/org/mian/gitnex/activities/CreateMilestoneActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/CreateMilestoneActivity.java @@ -117,7 +117,7 @@ public class CreateMilestoneActivity extends BaseActivity implements View.OnClic if(!newMilestoneDescription.equals("")) { - if (appUtil.charactersLength(newMilestoneDescription) > 255) { + if (newMilestoneDescription.length() > 255) { Toasty.warning(ctx, getString(R.string.milestoneDescError)); return; diff --git a/app/src/main/java/org/mian/gitnex/activities/CreateOrganizationActivity.java b/app/src/main/java/org/mian/gitnex/activities/CreateOrganizationActivity.java index 6514596f..36296ace 100644 --- a/app/src/main/java/org/mian/gitnex/activities/CreateOrganizationActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/CreateOrganizationActivity.java @@ -108,7 +108,7 @@ public class CreateOrganizationActivity extends BaseActivity { if(!newOrgDesc.equals("")) { - if (appUtil.charactersLength(newOrgDesc) > 255) { + if (newOrgDesc.length() > 255) { Toasty.warning(ctx, getString(R.string.orgDescError)); return; diff --git a/app/src/main/java/org/mian/gitnex/activities/CreateRepoActivity.java b/app/src/main/java/org/mian/gitnex/activities/CreateRepoActivity.java index 73214690..6eaae9ef 100644 --- a/app/src/main/java/org/mian/gitnex/activities/CreateRepoActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/CreateRepoActivity.java @@ -118,7 +118,7 @@ public class CreateRepoActivity extends BaseActivity { if(!newRepoDesc.equals("")) { - if (appUtil.charactersLength(newRepoDesc) > 255) { + if (newRepoDesc.length() > 255) { Toasty.warning(ctx, getString(R.string.repoDescError)); return; diff --git a/app/src/main/java/org/mian/gitnex/activities/FileViewActivity.java b/app/src/main/java/org/mian/gitnex/activities/FileViewActivity.java index c533cdbc..6bf6f99f 100644 --- a/app/src/main/java/org/mian/gitnex/activities/FileViewActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/FileViewActivity.java @@ -361,7 +361,7 @@ public class FileViewActivity extends BaseActivity implements BottomSheetFileVie String fileExtension = FileUtils.getExtension(singleFileName); String data = appUtil.decodeBase64(tinyDB.getString("downloadFileContents")); Intent intent = new Intent(ctx, CreateFileActivity.class); - intent.putExtra("fileAction", 1); + intent.putExtra("fileAction", CreateFileActivity.FILE_ACTION_DELETE); intent.putExtra("filePath", singleFileName); intent.putExtra("fileSha", fileSha); @@ -382,7 +382,7 @@ public class FileViewActivity extends BaseActivity implements BottomSheetFileVie String fileExtension = FileUtils.getExtension(singleFileName); String data = appUtil.decodeBase64(tinyDB.getString("downloadFileContents")); Intent intent = new Intent(ctx, CreateFileActivity.class); - intent.putExtra("fileAction", 2); + intent.putExtra("fileAction", CreateFileActivity.FILE_ACTION_EDIT); intent.putExtra("filePath", singleFileName); intent.putExtra("fileSha", fileSha); diff --git a/app/src/main/java/org/mian/gitnex/helpers/AppUtil.java b/app/src/main/java/org/mian/gitnex/helpers/AppUtil.java index 4b1c01b4..8ff97995 100644 --- a/app/src/main/java/org/mian/gitnex/helpers/AppUtil.java +++ b/app/src/main/java/org/mian/gitnex/helpers/AppUtil.java @@ -26,11 +26,6 @@ import java.util.Locale; public class AppUtil { - public static String strReplace(String str, String original, String replace) { - - return str.replace(original, replace); - } - public static boolean hasNetworkConnection(Context context) { return NetworkStatusObserver.get(context).hasNetworkConnection(); @@ -62,11 +57,6 @@ public class AppUtil { return context.getPackageName().equals("org.mian.gitnex.pro"); } - public int charactersLength(String str) { - - return str.length(); - } - public Boolean checkStringsWithAlphaNumeric(String str) { // [a-zA-Z0-9] return str.matches("^[\\w]+$"); } diff --git a/app/src/main/res/layout/activity_create_file.xml b/app/src/main/res/layout/activity_create_file.xml index 4866e228..175a6ed9 100644 --- a/app/src/main/res/layout/activity_create_file.xml +++ b/app/src/main/res/layout/activity_create_file.xml @@ -100,18 +100,18 @@ android:id="@+id/newFileContent" android:layout_width="match_parent" android:layout_height="140dp" + android:gravity="top|start" + android:inputType="textMultiLine|textCapSentences" + android:scrollbars="vertical" android:textColor="?attr/inputTextColor" android:textColorHighlight="?attr/hintColor" android:textColorHint="?attr/hintColor" - android:gravity="top|start" - android:scrollbars="vertical" - android:inputType="textCapSentences" android:textSize="16sp" /> - - - - - - @@ -186,10 +160,10 @@ android:id="@+id/newFileCommitMessage" android:layout_width="match_parent" android:layout_height="wrap_content" + android:inputType="textMultiLine|textCapSentences" android:textColor="?attr/inputTextColor" android:textColorHighlight="?attr/hintColor" android:textColorHint="?attr/hintColor" - android:inputType="textCapSentences" android:textSize="16sp" /> diff --git a/app/src/main/res/layout/activity_create_issue.xml b/app/src/main/res/layout/activity_create_issue.xml index 63a804a8..c4586b87 100644 --- a/app/src/main/res/layout/activity_create_issue.xml +++ b/app/src/main/res/layout/activity_create_issue.xml @@ -105,7 +105,7 @@ android:textColorHint="?attr/hintColor" android:gravity="top|start" android:scrollbars="vertical" - android:inputType="textCapSentences" + android:inputType="textCapSentences|textMultiLine" android:textSize="16sp" /> diff --git a/app/src/main/res/layout/activity_create_milestone.xml b/app/src/main/res/layout/activity_create_milestone.xml index 113dfb4a..216c369f 100644 --- a/app/src/main/res/layout/activity_create_milestone.xml +++ b/app/src/main/res/layout/activity_create_milestone.xml @@ -105,7 +105,7 @@ android:textColorHint="?attr/hintColor" android:gravity="top|start" android:scrollbars="vertical" - android:inputType="textCapSentences" + android:inputType="textCapSentences|textMultiLine" android:textSize="16sp" /> diff --git a/app/src/main/res/layout/activity_create_organization.xml b/app/src/main/res/layout/activity_create_organization.xml index 6267f02f..50c4c6ba 100644 --- a/app/src/main/res/layout/activity_create_organization.xml +++ b/app/src/main/res/layout/activity_create_organization.xml @@ -105,7 +105,7 @@ android:textColorHint="?attr/hintColor" android:gravity="top|start" android:scrollbars="vertical" - android:inputType="textCapSentences" + android:inputType="textCapSentences|textMultiLine" android:textSize="16sp" /> diff --git a/app/src/main/res/layout/activity_create_pr.xml b/app/src/main/res/layout/activity_create_pr.xml index f12dd044..6ce160bc 100644 --- a/app/src/main/res/layout/activity_create_pr.xml +++ b/app/src/main/res/layout/activity_create_pr.xml @@ -105,7 +105,7 @@ android:textColorHint="?attr/hintColor" android:gravity="top|start" android:scrollbars="vertical" - android:inputType="textCapSentences" + android:inputType="textCapSentences|textMultiLine" android:textSize="16sp" /> diff --git a/app/src/main/res/layout/activity_create_release.xml b/app/src/main/res/layout/activity_create_release.xml index d60570ff..75147b09 100644 --- a/app/src/main/res/layout/activity_create_release.xml +++ b/app/src/main/res/layout/activity_create_release.xml @@ -74,7 +74,7 @@ android:textColor="?attr/inputTextColor" android:textColorHighlight="?attr/hintColor" android:textColorHint="?attr/hintColor" - android:inputType="textCapSentences" + android:inputType="textCapSentences|textMultiLine" android:textSize="16sp" /> diff --git a/app/src/main/res/layout/activity_create_repo.xml b/app/src/main/res/layout/activity_create_repo.xml index 9480ab9a..f2c5e83d 100644 --- a/app/src/main/res/layout/activity_create_repo.xml +++ b/app/src/main/res/layout/activity_create_repo.xml @@ -128,7 +128,7 @@ android:textColorHighlight="?attr/hintColor" android:textColorHint="?attr/hintColor" android:gravity="top|start" - android:inputType="textCapSentences" + android:inputType="textCapSentences|textMultiLine" android:textSize="16sp" /> diff --git a/app/src/main/res/layout/activity_edit_issue.xml b/app/src/main/res/layout/activity_edit_issue.xml index 85637bae..4449e83a 100644 --- a/app/src/main/res/layout/activity_edit_issue.xml +++ b/app/src/main/res/layout/activity_edit_issue.xml @@ -102,7 +102,7 @@ android:textColorHint="?attr/hintColor" android:gravity="top|start" android:scrollbars="vertical" - android:inputType="textCapSentences" + android:inputType="textCapSentences|textMultiLine" android:textSize="16sp" /> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f755bddd..9c071121 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -471,10 +471,9 @@ Invalid branch name, may only contain –, a–z, 0–9 Commit message is too long New file created - Current Branches + Select or create a branch Fields like filename, content and commit message are required - Selecting current branch will disable new branch - e.g: new-branch + Leave blank to push to the default branch New branch name cannot be empty if current branch is not selected Filter