Allow navigating from issue to repo (#937)

Allow navigating from issue opend by link to go back to repo

Closes #747

Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/937
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
This commit is contained in:
qwerty287 2021-07-09 17:36:59 +02:00 committed by 6543
parent 2b3b0fbe0f
commit 0e696eb46f
2 changed files with 7 additions and 0 deletions

View File

@ -100,6 +100,7 @@ public class DeepLinksActivity extends BaseActivity {
if(!Objects.requireNonNull(data.getLastPathSegment()).contains("issues") & StringUtils.isNumeric(data.getLastPathSegment())) {
issueIntent.putExtra("issueNumber", data.getLastPathSegment());
issueIntent.putExtra("openedFromLink", "true");
tinyDB.putString("issueNumber", data.getLastPathSegment());
tinyDB.putString("issueType", "Issue");
@ -316,6 +317,7 @@ public class DeepLinksActivity extends BaseActivity {
issueIntent.putExtra("issueNumber", index);
issueIntent.putExtra("prMergeable", prInfo.isMergeable());
issueIntent.putExtra("openedFromLink", "true");
if(prInfo.getHead() != null) {

View File

@ -434,6 +434,11 @@ public class IssueDetailActivity extends BaseActivity implements LabelsListAdapt
if(id == android.R.id.home) {
if(getIntent().getStringExtra("openedFromLink") != null && getIntent().getStringExtra("openedFromLink").equals("true")) {
Intent intent = new Intent(ctx, RepoDetailActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
}
finish();
return true;
}