Compare commits

...

2 Commits

Author SHA1 Message Date
M M Arif 74ba524a10 Refactor create release/tag screen 2023-10-07 12:03:51 +05:00
M M Arif 448ffc88d4 Refactor update merge request screen 2023-10-07 11:27:20 +05:00
12 changed files with 378 additions and 558 deletions

View File

@ -48,7 +48,8 @@
android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/>
<activity
android:name=".activities.EditIssueActivity"
android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/>
android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"
android:windowSoftInputMode="adjustResize"/>
<activity
android:name=".activities.CreateNewUserActivity"
android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"

View File

@ -1,15 +1,10 @@
package org.mian.gitnex.activities;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.os.Handler;
import android.view.MotionEvent;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.ArrayAdapter;
import androidx.annotation.NonNull;
import com.vdurmont.emoji.EmojiParser;
@ -25,9 +20,8 @@ import org.mian.gitnex.R;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.databinding.ActivityCreateReleaseBinding;
import org.mian.gitnex.helpers.AlertDialogs;
import org.mian.gitnex.helpers.AppUtil;
import org.mian.gitnex.helpers.Markdown;
import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.helpers.SnackBar;
import org.mian.gitnex.helpers.contexts.RepositoryContext;
import retrofit2.Call;
import retrofit2.Callback;
@ -39,10 +33,8 @@ public class CreateReleaseActivity extends BaseActivity {
private ActivityCreateReleaseBinding binding;
List<String> branchesList = new ArrayList<>();
private View.OnClickListener onClickListener;
private String selectedBranch;
private RepositoryContext repository;
private final View.OnClickListener createReleaseListener = v -> processNewRelease();
private boolean renderMd = false;
@SuppressLint("ClickableViewAccessibility")
@ -53,19 +45,9 @@ public class CreateReleaseActivity extends BaseActivity {
binding = ActivityCreateReleaseBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
setSupportActionBar(binding.toolbar);
boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
InputMethodManager imm =
(InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
repository = RepositoryContext.fromIntent(getIntent());
binding.releaseTitle.requestFocus();
assert imm != null;
imm.showSoftInput(binding.releaseTitle, InputMethodManager.SHOW_IMPLICIT);
binding.releaseContent.setOnTouchListener(
(touchView, motionEvent) -> {
touchView.getParent().requestDisallowInterceptTouchEvent(true);
@ -78,90 +60,72 @@ public class CreateReleaseActivity extends BaseActivity {
return false;
});
initCloseListener();
binding.close.setOnClickListener(onClickListener);
binding.topAppBar.setNavigationOnClickListener(
v -> {
finish();
});
binding.topAppBar.setOnMenuItemClickListener(
menuItem -> {
int id = menuItem.getItemId();
if (id == R.id.markdown) {
if (!renderMd) {
Markdown.render(
ctx,
EmojiParser.parseToUnicode(
Objects.requireNonNull(
Objects.requireNonNull(
binding.releaseContent
.getText())
.toString())),
binding.markdownPreview);
binding.markdownPreview.setVisibility(View.VISIBLE);
binding.releaseContentLayout.setVisibility(View.GONE);
renderMd = true;
} else {
binding.markdownPreview.setVisibility(View.GONE);
binding.releaseContentLayout.setVisibility(View.VISIBLE);
renderMd = false;
}
return true;
} else if (id == R.id.create) {
processNewRelease();
return true;
} else if (id == R.id.create_tag) {
createNewTag();
return true;
} else {
return super.onOptionsItemSelected(menuItem);
}
});
getBranches(repository.getOwner(), repository.getName());
disableProcessButton();
if (!connToInternet) {
disableProcessButton();
} else {
binding.createNewRelease.setOnClickListener(createReleaseListener);
}
binding.createNewTag.setOnClickListener(v -> createNewTag());
}
@Override
public boolean onCreateOptionsMenu(@NonNull Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.markdown_switcher, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.markdown) {
if (!renderMd) {
Markdown.render(
ctx,
EmojiParser.parseToUnicode(
Objects.requireNonNull(
Objects.requireNonNull(binding.releaseContent.getText())
.toString())),
binding.markdownPreview);
binding.markdownPreview.setVisibility(View.VISIBLE);
binding.releaseContentLayout.setVisibility(View.GONE);
renderMd = true;
} else {
binding.markdownPreview.setVisibility(View.GONE);
binding.releaseContentLayout.setVisibility(View.VISIBLE);
renderMd = false;
}
return true;
} else {
return super.onOptionsItemSelected(item);
}
}
private void createNewTag() {
boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
String tagName = Objects.requireNonNull(binding.releaseTagName.getText()).toString();
String message =
Objects.requireNonNull(binding.releaseTitle.getText()).toString()
Objects.requireNonNull(binding.releaseTitle.getText())
+ "\n\n"
+ Objects.requireNonNull(binding.releaseContent.getText()).toString();
if (!connToInternet) {
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
return;
}
+ Objects.requireNonNull(binding.releaseContent.getText());
if (tagName.equals("")) {
Toasty.error(ctx, getString(R.string.tagNameErrorEmpty));
SnackBar.error(
ctx, findViewById(android.R.id.content), getString(R.string.tagNameErrorEmpty));
return;
}
if (selectedBranch == null) {
Toasty.error(ctx, getString(R.string.selectBranchError));
SnackBar.error(
ctx, findViewById(android.R.id.content), getString(R.string.selectBranchError));
return;
}
disableProcessButton();
CreateTagOption createReleaseJson = new CreateTagOption();
createReleaseJson.setMessage(message);
createReleaseJson.setTagName(tagName);
@ -173,7 +137,7 @@ public class CreateReleaseActivity extends BaseActivity {
repository.getOwner(), repository.getName(), createReleaseJson);
call.enqueue(
new Callback<Tag>() {
new Callback<>() {
@Override
public void onResponse(
@ -182,35 +146,38 @@ public class CreateReleaseActivity extends BaseActivity {
if (response.code() == 201) {
RepoDetailActivity.updateFABActions = true;
Toasty.success(ctx, getString(R.string.tagCreated));
finish();
SnackBar.success(
ctx,
findViewById(android.R.id.content),
getString(R.string.tagCreated));
new Handler().postDelayed(() -> finish(), 3000);
} else if (response.code() == 401) {
enableProcessButton();
AlertDialogs.authorizationTokenRevokedDialog(ctx);
} else if (response.code() == 403) {
enableProcessButton();
Toasty.error(ctx, ctx.getString(R.string.authorizeError));
SnackBar.error(
ctx,
findViewById(android.R.id.content),
getString(R.string.authorizeError));
} else if (response.code() == 404) {
enableProcessButton();
Toasty.warning(ctx, ctx.getString(R.string.apiNotFound));
SnackBar.error(
ctx,
findViewById(android.R.id.content),
getString(R.string.apiNotFound));
} else {
enableProcessButton();
Toasty.error(ctx, ctx.getString(R.string.genericError));
SnackBar.error(
ctx,
findViewById(android.R.id.content),
getString(R.string.genericError));
}
}
@Override
public void onFailure(@NonNull Call<Tag> call, @NonNull Throwable t) {
Log.e("onFailure", t.toString());
enableProcessButton();
}
public void onFailure(@NonNull Call<Tag> call, @NonNull Throwable t) {}
});
}
private void processNewRelease() {
boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
String newReleaseTagName =
Objects.requireNonNull(binding.releaseTagName.getText()).toString();
String newReleaseTitle = Objects.requireNonNull(binding.releaseTitle.getText()).toString();
@ -220,31 +187,24 @@ public class CreateReleaseActivity extends BaseActivity {
boolean newReleaseType = binding.releaseType.isChecked();
boolean newReleaseDraft = binding.releaseDraft.isChecked();
if (!connToInternet) {
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
return;
}
if (newReleaseTitle.equals("")) {
Toasty.error(ctx, getString(R.string.titleErrorEmpty));
SnackBar.error(
ctx, findViewById(android.R.id.content), getString(R.string.titleErrorEmpty));
return;
}
if (newReleaseTagName.equals("")) {
Toasty.error(ctx, getString(R.string.tagNameErrorEmpty));
SnackBar.error(
ctx, findViewById(android.R.id.content), getString(R.string.tagNameErrorEmpty));
return;
}
if (checkBranch == null) {
Toasty.error(ctx, getString(R.string.selectBranchError));
SnackBar.error(
ctx, findViewById(android.R.id.content), getString(R.string.selectBranchError));
return;
}
disableProcessButton();
createNewReleaseFunc(
repository.getOwner(),
repository.getName(),
@ -289,31 +249,37 @@ public class CreateReleaseActivity extends BaseActivity {
if (response.code() == 201) {
RepoDetailActivity.updateFABActions = true;
Toasty.success(ctx, getString(R.string.releaseCreatedText));
finish();
SnackBar.success(
ctx,
findViewById(android.R.id.content),
getString(R.string.releaseCreatedText));
new Handler().postDelayed(() -> finish(), 3000);
} else if (response.code() == 401) {
enableProcessButton();
AlertDialogs.authorizationTokenRevokedDialog(ctx);
} else if (response.code() == 403) {
enableProcessButton();
Toasty.error(ctx, ctx.getString(R.string.authorizeError));
SnackBar.error(
ctx,
findViewById(android.R.id.content),
getString(R.string.authorizeError));
} else if (response.code() == 404) {
enableProcessButton();
Toasty.warning(ctx, ctx.getString(R.string.apiNotFound));
SnackBar.error(
ctx,
findViewById(android.R.id.content),
getString(R.string.apiNotFound));
} else {
enableProcessButton();
Toasty.error(ctx, ctx.getString(R.string.genericError));
SnackBar.error(
ctx,
findViewById(android.R.id.content),
getString(R.string.genericError));
}
}
@Override
public void onFailure(@NonNull Call<Release> call, @NonNull Throwable t) {
enableProcessButton();
}
public void onFailure(@NonNull Call<Release> call, @NonNull Throwable t) {}
});
}
@ -349,7 +315,6 @@ public class CreateReleaseActivity extends BaseActivity {
branchesList);
binding.releaseBranch.setAdapter(adapter);
enableProcessButton();
binding.releaseBranch.setOnItemClickListener(
(parent, view, position, id) ->
@ -366,21 +331,6 @@ public class CreateReleaseActivity extends BaseActivity {
});
}
private void initCloseListener() {
onClickListener = view -> finish();
}
private void disableProcessButton() {
binding.createNewTag.setEnabled(false);
binding.createNewRelease.setEnabled(false);
}
private void enableProcessButton() {
binding.createNewTag.setEnabled(true);
binding.createNewRelease.setEnabled(true);
}
@Override
public void onResume() {
super.onResume();

View File

@ -1,22 +1,18 @@
package org.mian.gitnex.activities;
import android.annotation.SuppressLint;
import android.app.DatePickerDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.google.android.material.datepicker.MaterialDatePicker;
import com.vdurmont.emoji.EmojiParser;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
@ -25,7 +21,9 @@ import java.util.Calendar;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.TimeZone;
import org.gitnex.tea4j.v2.models.EditIssueOption;
import org.gitnex.tea4j.v2.models.Issue;
import org.gitnex.tea4j.v2.models.Milestone;
@ -35,10 +33,9 @@ import org.mian.gitnex.databinding.ActivityEditIssueBinding;
import org.mian.gitnex.fragments.IssuesFragment;
import org.mian.gitnex.fragments.PullRequestsFragment;
import org.mian.gitnex.helpers.AlertDialogs;
import org.mian.gitnex.helpers.AppUtil;
import org.mian.gitnex.helpers.Constants;
import org.mian.gitnex.helpers.Markdown;
import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.helpers.SnackBar;
import org.mian.gitnex.helpers.contexts.IssueContext;
import retrofit2.Call;
import retrofit2.Callback;
@ -46,15 +43,12 @@ import retrofit2.Callback;
/**
* @author M M Arif
*/
public class EditIssueActivity extends BaseActivity implements View.OnClickListener {
public class EditIssueActivity extends BaseActivity {
private ActivityEditIssueBinding binding;
private final String msState = "open";
private final LinkedHashMap<String, Milestone> milestonesList = new LinkedHashMap<>();
private View.OnClickListener onClickListener;
private int resultLimit;
private int milestoneId = 0;
private Date currentDate = null;
private IssueContext issue;
private boolean renderMd = false;
@ -66,17 +60,16 @@ public class EditIssueActivity extends BaseActivity implements View.OnClickListe
binding = ActivityEditIssueBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
setSupportActionBar(binding.toolbar);
InputMethodManager imm =
(InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
resultLimit = Constants.getCurrentResultLimit(ctx);
int resultLimit = Constants.getCurrentResultLimit(ctx);
issue = IssueContext.fromIntent(getIntent());
binding.editIssueTitle.requestFocus();
assert imm != null;
imm.showSoftInput(binding.editIssueTitle, InputMethodManager.SHOW_IMPLICIT);
binding.topAppBar.setNavigationOnClickListener(v -> finish());
MenuItem attachment = binding.topAppBar.getMenu().getItem(0);
MenuItem create = binding.topAppBar.getMenu().getItem(2);
attachment.setVisible(false);
create.setTitle(getString(R.string.menuEditText));
binding.editIssueDescription.setOnTouchListener(
(touchView, motionEvent) -> {
@ -90,23 +83,51 @@ public class EditIssueActivity extends BaseActivity implements View.OnClickListe
return false;
});
initCloseListener();
binding.close.setOnClickListener(onClickListener);
binding.editIssueDueDate.setOnClickListener(this);
binding.editIssueButton.setOnClickListener(this);
if (issue.getIssueType().equalsIgnoreCase("Pull")) {
binding.toolbarTitle.setText(
binding.topAppBar.setTitle(
getString(R.string.editPrNavHeader, String.valueOf(issue.getIssueIndex())));
} else {
binding.toolbarTitle.setText(
binding.topAppBar.setTitle(
getString(R.string.editIssueNavHeader, String.valueOf(issue.getIssueIndex())));
}
disableProcessButton();
showDatePickerDialog();
binding.topAppBar.setOnMenuItemClickListener(
menuItem -> {
int id = menuItem.getItemId();
if (id == R.id.markdown) {
if (!renderMd) {
Markdown.render(
ctx,
EmojiParser.parseToUnicode(
Objects.requireNonNull(
binding.editIssueDescription.getText())
.toString()),
binding.markdownPreview,
issue.getRepository());
binding.markdownPreview.setVisibility(View.VISIBLE);
binding.editIssueDescriptionLayout.setVisibility(View.GONE);
renderMd = true;
} else {
binding.markdownPreview.setVisibility(View.GONE);
binding.editIssueDescriptionLayout.setVisibility(View.VISIBLE);
renderMd = false;
}
return true;
} else if (id == R.id.create) {
processEditIssue();
return true;
} else {
return super.onOptionsItemSelected(menuItem);
}
});
getIssue(
issue.getRepository().getOwner(),
issue.getRepository().getName(),
@ -119,81 +140,29 @@ public class EditIssueActivity extends BaseActivity implements View.OnClickListe
}
}
private void initCloseListener() {
onClickListener = view -> finish();
}
@Override
public boolean onCreateOptionsMenu(@NonNull Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.markdown_switcher, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.markdown) {
if (!renderMd) {
Markdown.render(
ctx,
EmojiParser.parseToUnicode(
Objects.requireNonNull(binding.editIssueDescription.getText())
.toString()),
binding.markdownPreview,
issue.getRepository());
binding.markdownPreview.setVisibility(View.VISIBLE);
binding.editIssueDescriptionLayout.setVisibility(View.GONE);
renderMd = true;
} else {
binding.markdownPreview.setVisibility(View.GONE);
binding.editIssueDescriptionLayout.setVisibility(View.VISIBLE);
renderMd = false;
}
return true;
} else {
return super.onOptionsItemSelected(item);
}
}
private void processEditIssue() {
boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
String editIssueTitleForm =
Objects.requireNonNull(binding.editIssueTitle.getText()).toString();
String editIssueDescriptionForm =
Objects.requireNonNull(binding.editIssueDescription.getText()).toString();
if (!connToInternet) {
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
return;
}
String dueDate = Objects.requireNonNull(binding.editIssueDueDate.getText()).toString();
if (editIssueTitleForm.equals("")) {
Toasty.error(ctx, getString(R.string.issueTitleEmpty));
SnackBar.error(
ctx, findViewById(android.R.id.content), getString(R.string.issueTitleEmpty));
return;
}
disableProcessButton();
editIssue(
issue.getRepository().getOwner(),
issue.getRepository().getName(),
issue.getIssueIndex(),
editIssueTitleForm,
editIssueDescriptionForm,
milestoneId);
milestoneId,
dueDate);
}
private void editIssue(
@ -202,12 +171,21 @@ public class EditIssueActivity extends BaseActivity implements View.OnClickListe
int issueIndex,
String title,
String description,
int milestoneId) {
int milestoneId,
String dueDate) {
EditIssueOption issueData = new EditIssueOption();
issueData.setTitle(title);
issueData.setBody(description);
issueData.setDueDate(currentDate);
String[] date = dueDate.split("-");
if (!dueDate.equalsIgnoreCase("")) {
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, Integer.parseInt(date[0]));
calendar.set(Calendar.MONTH, Integer.parseInt(date[1]));
calendar.set(Calendar.DATE, Integer.parseInt(date[2]));
Date dueDate_ = calendar.getTime();
issueData.setDueDate(dueDate_);
}
issueData.setMilestone((long) milestoneId);
Call<Issue> call =
@ -215,7 +193,7 @@ public class EditIssueActivity extends BaseActivity implements View.OnClickListe
.issueEditIssue(repoOwner, repoName, (long) issueIndex, issueData);
call.enqueue(
new Callback<Issue>() {
new Callback<>() {
@Override
public void onResponse(
@ -226,10 +204,16 @@ public class EditIssueActivity extends BaseActivity implements View.OnClickListe
if (issue.getIssueType().equalsIgnoreCase("Pull")) {
Toasty.success(ctx, getString(R.string.editPrSuccessMessage));
SnackBar.success(
ctx,
findViewById(android.R.id.content),
getString(R.string.editPrSuccessMessage));
} else {
Toasty.success(ctx, getString(R.string.editIssueSuccessMessage));
SnackBar.success(
ctx,
findViewById(android.R.id.content),
getString(R.string.editIssueSuccessMessage));
}
Intent result = new Intent();
@ -238,57 +222,44 @@ public class EditIssueActivity extends BaseActivity implements View.OnClickListe
PullRequestsFragment.resumePullRequests =
issue.getIssue().getPullRequest() != null;
setResult(200, result);
finish();
new Handler().postDelayed(() -> finish(), 3000);
} else if (response.code() == 401) {
enableProcessButton();
AlertDialogs.authorizationTokenRevokedDialog(ctx);
} else {
enableProcessButton();
Toasty.error(ctx, getString(R.string.genericError));
SnackBar.error(
ctx,
findViewById(android.R.id.content),
getString(R.string.genericError));
}
}
@Override
public void onFailure(@NonNull Call<Issue> call, @NonNull Throwable t) {
Log.e("onFailure", t.toString());
enableProcessButton();
}
public void onFailure(@NonNull Call<Issue> call, @NonNull Throwable t) {}
});
}
@Override
public void onClick(View v) {
private void showDatePickerDialog() {
if (v == binding.editIssueDueDate) {
MaterialDatePicker.Builder<Long> builder = MaterialDatePicker.Builder.datePicker();
builder.setSelection(Calendar.getInstance().getTimeInMillis());
builder.setTitleText(R.string.newIssueDueDateTitle);
MaterialDatePicker<Long> materialDatePicker = builder.build();
final Calendar c = Calendar.getInstance();
int mYear = c.get(Calendar.YEAR);
final int mMonth = c.get(Calendar.MONTH);
final int mDay = c.get(Calendar.DAY_OF_MONTH);
binding.editIssueDueDate.setOnClickListener(
v -> materialDatePicker.show(getSupportFragmentManager(), "DATE_PICKER"));
DatePickerDialog datePickerDialog =
new DatePickerDialog(
this,
(view, year, monthOfYear, dayOfMonth) -> {
binding.editIssueDueDate.setText(
getString(
R.string.setDueDate,
year,
(monthOfYear + 1),
dayOfMonth));
currentDate = new Date(year - 1900, monthOfYear, dayOfMonth);
},
mYear,
mMonth,
mDay);
datePickerDialog.show();
} else if (v == binding.editIssueButton) {
processEditIssue();
}
materialDatePicker.addOnPositiveButtonClickListener(
selection -> {
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
calendar.setTimeInMillis(selection);
SimpleDateFormat format =
new SimpleDateFormat(
"yyyy-MM-dd", new Locale(tinyDB.getString("locale")));
String formattedDate = format.format(calendar.getTime());
binding.editIssueDueDate.setText(formattedDate);
});
}
private void getIssue(
@ -431,8 +402,6 @@ public class EditIssueActivity extends BaseActivity implements View.OnClickListe
}
},
500);
enableProcessButton();
}
}
@ -454,35 +423,27 @@ public class EditIssueActivity extends BaseActivity implements View.OnClickListe
String dueDate = formatter.format(response.body().getDueDate());
binding.editIssueDueDate.setText(dueDate);
}
// enableProcessButton();
} else if (response.code() == 401) {
AlertDialogs.authorizationTokenRevokedDialog(ctx);
} else {
Toasty.error(ctx, getString(R.string.genericError));
SnackBar.error(
ctx,
findViewById(android.R.id.content),
getString(R.string.genericError));
}
}
@Override
public void onFailure(@NonNull Call<Issue> call, @NonNull Throwable t) {
Log.e("onFailure", t.toString());
// Log.e("onFailure", t.toString());
}
});
}
private void disableProcessButton() {
binding.editIssueButton.setEnabled(false);
}
private void enableProcessButton() {
binding.editIssueButton.setEnabled(true);
}
@Override
public void onResume() {
super.onResume();

View File

@ -1,11 +1,11 @@
package org.mian.gitnex.activities;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.ArrayAdapter;
import androidx.annotation.NonNull;
import java.util.ArrayList;
@ -17,9 +17,8 @@ import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.databinding.ActivityMergePullRequestBinding;
import org.mian.gitnex.fragments.PullRequestsFragment;
import org.mian.gitnex.helpers.AlertDialogs;
import org.mian.gitnex.helpers.AppUtil;
import org.mian.gitnex.helpers.MergePullRequestSpinner;
import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.helpers.SnackBar;
import org.mian.gitnex.helpers.contexts.IssueContext;
import retrofit2.Call;
import retrofit2.Callback;
@ -29,11 +28,9 @@ import retrofit2.Callback;
*/
public class MergePullRequestActivity extends BaseActivity {
private View.OnClickListener onClickListener;
private IssueContext issue;
private ActivityMergePullRequestBinding viewBinding;
private String Do;
private final View.OnClickListener mergePullRequest = v -> processMergePullRequest();
@SuppressLint("SetTextI18n")
@Override
@ -46,26 +43,22 @@ public class MergePullRequestActivity extends BaseActivity {
issue = IssueContext.fromIntent(getIntent());
boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
InputMethodManager imm =
(InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
viewBinding.mergeTitle.requestFocus();
assert imm != null;
imm.showSoftInput(viewBinding.mergeTitle, InputMethodManager.SHOW_IMPLICIT);
setMergeAdapter();
if (!issue.getPullRequest().getTitle().isEmpty()) {
viewBinding.toolbarTitle.setText(issue.getPullRequest().getTitle());
viewBinding.topAppBar.setTitle(issue.getPullRequest().getTitle());
viewBinding.mergeTitle.setText(
issue.getPullRequest().getTitle() + " (#" + issue.getIssueIndex() + ")");
}
initCloseListener();
viewBinding.close.setOnClickListener(onClickListener);
viewBinding.topAppBar.setNavigationOnClickListener(v -> finish());
MenuItem attachment = viewBinding.topAppBar.getMenu().getItem(0);
MenuItem markdown = viewBinding.topAppBar.getMenu().getItem(1);
MenuItem create = viewBinding.topAppBar.getMenu().getItem(2);
attachment.setVisible(false);
markdown.setVisible(false);
create.setTitle(getString(R.string.mergePullRequestButtonText));
// if gitea version is greater/equal(1.12.0) than user installed version
// (installed.higherOrEqual(compareVer))
@ -75,36 +68,37 @@ public class MergePullRequestActivity extends BaseActivity {
}
if (!issue.getPullRequest().isMergeable()) {
disableProcessButton();
viewBinding.mergeInfoDisabledMessage.setVisibility(View.VISIBLE);
create.setVisible(false);
} else {
viewBinding.mergeInfoDisabledMessage.setVisibility(View.GONE);
create.setVisible(true);
}
if (issue.prIsFork()) {
viewBinding.deleteBranchForkInfo.setVisibility(View.VISIBLE);
} else {
viewBinding.deleteBranchForkInfo.setVisibility(View.GONE);
}
if (!connToInternet) {
disableProcessButton();
} else {
viewBinding.mergeButton.setOnClickListener(mergePullRequest);
}
if (!(issue.getPullRequest().getHead().getRepo() != null
? issue.getPullRequest().getHead().getRepo().getPermissions().isPush()
: false)) {
viewBinding.deleteBranch.setVisibility(View.GONE);
viewBinding.deleteBranchForkInfo.setVisibility(View.GONE);
}
viewBinding.topAppBar.setOnMenuItemClickListener(
menuItem -> {
int id = menuItem.getItemId();
if (id == R.id.create) {
processMergePullRequest();
return true;
} else {
return super.onOptionsItemSelected(menuItem);
}
});
}
private void setMergeAdapter() {
@ -140,11 +134,6 @@ public class MergePullRequestActivity extends BaseActivity {
});
}
private void initCloseListener() {
onClickListener = view -> finish();
}
private void processMergePullRequest() {
String mergePRDesc =
@ -152,20 +141,14 @@ public class MergePullRequestActivity extends BaseActivity {
String mergePRTitle = Objects.requireNonNull(viewBinding.mergeTitle.getText()).toString();
boolean deleteBranch = viewBinding.deleteBranch.isChecked();
boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
if (!connToInternet) {
Toasty.error(ctx, getResources().getString(R.string.checkNetConnection));
return;
}
if (Do == null) {
Toasty.error(ctx, getResources().getString(R.string.selectMergeStrategy));
SnackBar.error(
ctx,
findViewById(android.R.id.content),
getString(R.string.selectMergeStrategy));
} else {
disableProcessButton();
mergeFunction(Do, mergePRDesc, mergePRTitle, deleteBranch);
}
}
@ -237,49 +220,46 @@ public class MergePullRequestActivity extends BaseActivity {
}
}
Toasty.success(ctx, getString(R.string.mergePRSuccessMsg));
SnackBar.success(
ctx,
findViewById(android.R.id.content),
getString(R.string.mergePRSuccessMsg));
Intent result = new Intent();
PullRequestsFragment.resumePullRequests = true;
IssueDetailActivity.singleIssueUpdate = true;
RepoDetailActivity.updateRepo = true;
setResult(200, result);
finish();
new Handler().postDelayed(() -> finish(), 3000);
} else if (response.code() == 401) {
enableProcessButton();
AlertDialogs.authorizationTokenRevokedDialog(ctx);
} else if (response.code() == 404) {
enableProcessButton();
Toasty.warning(ctx, getString(R.string.mergePR404ErrorMsg));
SnackBar.error(
ctx,
findViewById(android.R.id.content),
getString(R.string.mergePR404ErrorMsg));
} else if (response.code() == 405) {
enableProcessButton();
Toasty.warning(ctx, getString(R.string.mergeNotAllowed));
SnackBar.error(
ctx,
findViewById(android.R.id.content),
getString(R.string.mergeNotAllowed));
} else {
enableProcessButton();
Toasty.error(ctx, getString(R.string.genericError));
SnackBar.error(
ctx,
findViewById(android.R.id.content),
getString(R.string.genericError));
}
}
@Override
public void onFailure(@NonNull Call<Void> call, @NonNull Throwable t) {
enableProcessButton();
}
public void onFailure(@NonNull Call<Void> call, @NonNull Throwable t) {}
});
}
private void disableProcessButton() {
viewBinding.mergeButton.setEnabled(false);
}
private void enableProcessButton() {
viewBinding.mergeButton.setEnabled(true);
}
@Override
public void onResume() {
super.onResume();

View File

@ -67,7 +67,6 @@
android:id="@+id/addCollaboratorSearchLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:boxBackgroundColor="?attr/inputBackgroundColor"
android:textColorHint="?attr/hintColor"
app:hintTextColor="?attr/hintColor"
app:boxStrokeErrorColor="@color/darkRed"

View File

@ -1,61 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical">
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView"
app:elevation="@dimen/dimen0dp">
android:background="?attr/primaryBackgroundColor"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
<com.google.android.material.appbar.CollapsingToolbarLayout
style="?attr/collapsingToolbarLayoutLargeStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/primaryBackgroundColor">
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
android:background="?attr/primaryBackgroundColor"
app:contentScrim="?attr/primaryBackgroundColor"
android:layout_height="?attr/collapsingToolbarLayoutLargeSize">
<ImageView
android:id="@+id/close"
android:layout_width="@dimen/dimen26dp"
android:layout_height="@dimen/dimen26dp"
android:layout_marginStart="@dimen/dimen16dp"
android:layout_marginEnd="@dimen/dimen16dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/close"
android:focusable="true"
android:gravity="center_vertical"
android:src="@drawable/ic_close"/>
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/topAppBar"
android:layout_width="match_parent"
android:elevation="0dp"
android:layout_height="?attr/actionBarSize"
app:title="@string/createRelease"
app:layout_collapseMode="pin"
app:menu="@menu/create_release_tag_menu"
app:navigationIcon="@drawable/ic_close" />
<TextView
android:id="@+id/toolbar_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:maxLines="1"
android:text="@string/createRelease"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen20sp"/>
</com.google.android.material.appbar.MaterialToolbar>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/primaryBackgroundColor">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/dimen16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/dimen16dp">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/releaseTitleLayout"
@ -65,7 +54,6 @@
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/releaseTitleText"
android:textColorHint="?attr/hintColor"
app:boxBackgroundColor="?attr/inputBackgroundColor"
app:boxStrokeErrorColor="@color/darkRed"
app:endIconMode="clear_text"
app:endIconTint="?attr/iconsColor"
@ -93,7 +81,6 @@
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/releaseTagNameText"
android:textColorHint="?attr/hintColor"
app:boxBackgroundColor="?attr/inputBackgroundColor"
app:boxStrokeErrorColor="@color/darkRed"
app:endIconMode="clear_text"
app:endIconTint="?attr/iconsColor"
@ -121,7 +108,6 @@
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/releaseContentText"
android:textColorHint="?attr/hintColor"
app:boxBackgroundColor="?attr/inputBackgroundColor"
app:boxStrokeErrorColor="@color/darkRed"
app:endIconMode="clear_text"
app:endIconTint="?attr/iconsColor"
@ -162,7 +148,6 @@
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/releaseBranchText"
android:textColorHint="?attr/hintColor"
app:boxBackgroundColor="?attr/inputBackgroundColor"
app:endIconTint="?attr/iconsColor"
app:hintTextColor="?attr/hintColor">
@ -197,26 +182,8 @@
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen16sp"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/createNewRelease"
android:layout_width="match_parent"
android:layout_height="@dimen/dimen54dp"
android:layout_marginTop="@dimen/dimen8dp"
android:text="@string/newCreateButtonCopy"
android:textColor="?attr/materialCardBackgroundColor"
android:textStyle="bold"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/createNewTag"
android:layout_width="match_parent"
android:layout_height="@dimen/dimen54dp"
android:layout_marginTop="@dimen/dimen8dp"
android:text="@string/create_tag"
android:textColor="?attr/materialCardBackgroundColor"
android:textStyle="bold"/>
</LinearLayout>
</ScrollView>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,61 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical">
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView"
app:elevation="@dimen/dimen0dp">
android:background="?attr/primaryBackgroundColor"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
<com.google.android.material.appbar.CollapsingToolbarLayout
style="?attr/collapsingToolbarLayoutLargeStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/primaryBackgroundColor">
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
android:background="?attr/primaryBackgroundColor"
app:contentScrim="?attr/primaryBackgroundColor"
android:layout_height="?attr/collapsingToolbarLayoutLargeSize">
<ImageView
android:id="@+id/close"
android:layout_width="@dimen/dimen26dp"
android:layout_height="@dimen/dimen26dp"
android:layout_marginStart="@dimen/dimen16dp"
android:layout_marginEnd="@dimen/dimen16dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/close"
android:focusable="true"
android:gravity="center_vertical"
android:src="@drawable/ic_close"/>
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/topAppBar"
android:layout_width="match_parent"
android:elevation="0dp"
android:layout_height="?attr/actionBarSize"
app:title="@string/editIssueNavHeader"
app:layout_collapseMode="pin"
app:menu="@menu/create_issue_menu"
app:navigationIcon="@drawable/ic_close" />
<TextView
android:id="@+id/toolbar_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:maxLines="1"
android:text="@string/editIssueNavHeader"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen20sp"/>
</com.google.android.material.appbar.MaterialToolbar>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<ScrollView
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/primaryBackgroundColor">
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/dimen16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/dimen16dp">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/editIssueTitleLayout"
@ -65,7 +54,6 @@
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/newIssueTitle"
android:textColorHint="?attr/hintColor"
app:boxBackgroundColor="?attr/inputBackgroundColor"
app:boxStrokeErrorColor="@color/darkRed"
app:endIconMode="clear_text"
app:endIconTint="?attr/iconsColor"
@ -93,7 +81,6 @@
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/newIssueDescriptionTitle"
android:textColorHint="?attr/hintColor"
app:boxBackgroundColor="?attr/inputBackgroundColor"
app:boxStrokeErrorColor="@color/darkRed"
app:endIconMode="clear_text"
app:endIconTint="?attr/iconsColor"
@ -134,7 +121,6 @@
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/newIssueMilestoneTitle"
android:textColorHint="?attr/hintColor"
app:boxBackgroundColor="?attr/inputBackgroundColor"
app:endIconTint="?attr/iconsColor"
app:hintTextColor="?attr/hintColor">
@ -157,7 +143,6 @@
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/newIssueDueDateTitle"
android:textColorHint="?attr/hintColor"
app:boxBackgroundColor="?attr/inputBackgroundColor"
app:boxStrokeErrorColor="@color/darkRed"
app:endIconMode="clear_text"
app:endIconTint="?attr/iconsColor"
@ -176,17 +161,8 @@
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/editIssueButton"
android:layout_width="match_parent"
android:layout_height="@dimen/dimen54dp"
android:layout_marginTop="@dimen/dimen8dp"
android:text="@string/saveButton"
android:textColor="?attr/materialCardBackgroundColor"
android:textStyle="bold"/>
</LinearLayout>
</ScrollView>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,72 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical">
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView"
app:elevation="@dimen/dimen0dp">
android:background="?attr/primaryBackgroundColor"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
<com.google.android.material.appbar.CollapsingToolbarLayout
style="?attr/collapsingToolbarLayoutLargeStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/primaryBackgroundColor">
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
android:background="?attr/primaryBackgroundColor"
app:contentScrim="?attr/primaryBackgroundColor"
android:layout_height="?attr/collapsingToolbarLayoutLargeSize">
<ImageView
android:id="@+id/close"
android:layout_width="@dimen/dimen26dp"
android:layout_height="@dimen/dimen26dp"
android:layout_marginStart="@dimen/dimen16dp"
android:layout_marginEnd="@dimen/dimen16dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/close"
android:focusable="true"
android:gravity="center_vertical"
android:src="@drawable/ic_close"/>
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/topAppBar"
android:layout_width="match_parent"
android:elevation="0dp"
android:layout_height="?attr/actionBarSize"
app:title="@string/mergePullRequestButtonText"
app:layout_collapseMode="pin"
app:menu="@menu/create_issue_menu"
app:navigationIcon="@drawable/ic_close" />
<HorizontalScrollView
android:id="@+id/replyToPRNavHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dimen0dp"
android:layout_marginEnd="@dimen/dimen24dp"
android:fillViewport="true"
android:foregroundGravity="right"
android:scrollbarThumbHorizontal="@android:color/transparent">
<TextView
android:id="@+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:maxLines="1"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen20sp"/>
</HorizontalScrollView>
</com.google.android.material.appbar.MaterialToolbar>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/primaryBackgroundColor">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/dimen16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/dimen16dp">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/mergeTitleLayout"
@ -76,7 +54,6 @@
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/mergePullRequestButtonText"
android:textColorHint="?attr/hintColor"
app:boxBackgroundColor="?attr/inputBackgroundColor"
app:boxStrokeErrorColor="@color/darkRed"
app:counterEnabled="true"
app:counterMaxLength="255"
@ -95,7 +72,7 @@
android:textColor="?attr/inputTextColor"
android:textColorHighlight="?attr/hintColor"
android:textColorHint="?attr/hintColor"
android:textSize="@dimen/dimen16sp"/>
android:textSize="@dimen/dimen16sp" />
</com.google.android.material.textfield.TextInputLayout>
@ -107,7 +84,6 @@
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/mergeCommentText"
android:textColorHint="?attr/hintColor"
app:boxBackgroundColor="?attr/inputBackgroundColor"
app:boxStrokeErrorColor="@color/darkRed"
app:endIconMode="clear_text"
app:endIconTint="?attr/iconsColor"
@ -122,7 +98,7 @@
android:textColor="?attr/inputTextColor"
android:textColorHighlight="?attr/hintColor"
android:textColorHint="?attr/hintColor"
android:textSize="@dimen/dimen16sp"/>
android:textSize="@dimen/dimen16sp" />
</com.google.android.material.textfield.TextInputLayout>
@ -135,7 +111,6 @@
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/mergeStrategy"
android:textColorHint="?attr/hintColor"
app:boxBackgroundColor="?attr/inputBackgroundColor"
app:endIconTint="?attr/iconsColor"
app:hintTextColor="?attr/hintColor">
@ -146,7 +121,7 @@
android:inputType="none"
android:labelFor="@+id/mergeSpinner"
android:textColor="?attr/inputTextColor"
android:textSize="@dimen/dimen16sp"/>
android:textSize="@dimen/dimen16sp" />
</com.google.android.material.textfield.TextInputLayout>
@ -159,17 +134,17 @@
android:text="@string/deleteBranchAfterMerge"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen16sp"
android:visibility="gone"/>
android:visibility="gone" />
<TextView
android:id="@+id/deleteBranchForkInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen0dp"
android:layout_marginTop="@dimen/dimen10dp"
android:gravity="start"
android:text="@string/deleteBranchForkInfo"
android:textColor="?attr/hintColor"
android:textSize="@dimen/dimen12sp"/>
android:textSize="@dimen/dimen12sp" />
<TextView
android:id="@+id/mergeInfo"
@ -179,16 +154,7 @@
android:gravity="start"
android:text="@string/mergeNoteText"
android:textColor="?attr/hintColor"
android:textSize="@dimen/dimen12sp"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/mergeButton"
android:layout_width="match_parent"
android:layout_height="@dimen/dimen54dp"
android:layout_marginTop="@dimen/dimen8dp"
android:text="@string/mergePullRequestButtonText"
android:textColor="?attr/materialCardBackgroundColor"
android:textStyle="bold"/>
android:textSize="@dimen/dimen12sp" />
<TextView
android:id="@+id/mergeInfoDisabledMessage"
@ -199,11 +165,11 @@
android:text="@string/mergeInfoDisabledMessage"
android:textColor="?attr/hintColor"
android:textSize="@dimen/dimen12sp"
android:visibility="gone"/>
android:visibility="visible" />
</LinearLayout>
</ScrollView>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -61,7 +61,6 @@
android:text="@string/newIssueTitle"
android:textAlignment="gravity"
android:textColor="?attr/primaryTextColor"
android:textIsSelectable="true"
android:textSize="@dimen/dimen16sp"
tools:text="Id illum odio repellat omnis fuga deserunt aut. Ut est aut similique qui incidunt quia et." />

View File

@ -76,7 +76,6 @@
android:textAlignment="gravity"
android:text="@string/newIssueTitle"
android:textColor="?attr/primaryTextColor"
android:textIsSelectable="true"
android:textSize="@dimen/dimen16sp" />
</LinearLayout>

View File

@ -53,7 +53,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor"
android:textIsSelectable="true"
android:textSize="@dimen/dimen14sp"
tools:text="@string/orgName"/>
@ -65,7 +64,6 @@
android:layout_height="wrap_content"
android:text="@string/repoName"
android:textColor="?attr/primaryTextColor"
android:textIsSelectable="true"
android:textSize="@dimen/dimen18sp"
android:textStyle="bold"/>
@ -75,7 +73,6 @@
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dimen8dp"
android:textColor="?attr/primaryTextColor"
android:textIsSelectable="true"
android:textSize="@dimen/dimen16sp"
android:visibility="gone"
android:text="@string/noDataDescription"/>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/markdown"
android:icon="@drawable/ic_markdown"
android:orderInCategory="0"
android:title="@string/strMarkdown"
app:showAsAction="ifRoom" />
<item
android:id="@+id/create"
android:orderInCategory="1"
android:title="@string/newCreateButtonCopy"
android:contentDescription="@string/newCreateButtonCopy" />
<item
android:id="@+id/create_tag"
android:orderInCategory="2"
android:title="@string/create_tag"
android:contentDescription="@string/create_tag" />
</menu>