GitNex-Android-App/app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java

209 lines
5.8 KiB
Java
Raw Normal View History

package org.mian.gitnex.fragments;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import org.mian.gitnex.R;
2019-10-11 22:03:01 +02:00
import org.mian.gitnex.actions.RepositoryActions;
import org.mian.gitnex.helpers.TinyDB;
/**
* Author M M Arif
*/
public class BottomSheetRepoFragment extends BottomSheetDialogFragment {
private BottomSheetListener bmListener;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.bottom_sheet_repo, container, false);
final TinyDB tinyDb = new TinyDB(getContext());
TextView createLabel = v.findViewById(R.id.createLabel);
TextView createIssue = v.findViewById(R.id.createNewIssue);
TextView createMilestone = v.findViewById(R.id.createNewMilestone);
TextView addCollaborator = v.findViewById(R.id.addCollaborator);
TextView createRelease = v.findViewById(R.id.createRelease);
2019-09-06 01:01:46 +02:00
TextView openWebRepo = v.findViewById(R.id.openWebRepo);
2019-09-17 08:17:05 +02:00
TextView newFile = v.findViewById(R.id.newFile);
2019-10-11 22:03:01 +02:00
TextView starRepository = v.findViewById(R.id.starRepository);
TextView unStarRepository = v.findViewById(R.id.unStarRepository);
TextView watchRepository = v.findViewById(R.id.watchRepository);
TextView unWatchRepository = v.findViewById(R.id.unWatchRepository);
TextView shareRepository = v.findViewById(R.id.shareRepository);
TextView copyRepoUrl = v.findViewById(R.id.copyRepoUrl);
View repoSettingsDivider = v.findViewById(R.id.repoSettingsDivider);
TextView repoSettings = v.findViewById(R.id.repoSettings);
TextView createPullRequest = v.findViewById(R.id.createPullRequest);
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
createLabel.setOnClickListener(v112 -> {
bmListener.onButtonClicked("label");
dismiss();
});
if(tinyDb.getBoolean("hasIssues")) {
createIssue.setVisibility(View.VISIBLE);
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
createIssue.setOnClickListener(v12 -> {
bmListener.onButtonClicked("newIssue");
dismiss();
});
}
else {
createIssue.setVisibility(View.GONE);
}
if(tinyDb.getBoolean("hasPullRequests")) {
createPullRequest.setVisibility(View.VISIBLE);
createPullRequest.setOnClickListener(vPr -> {
bmListener.onButtonClicked("newPullRequest");
dismiss();
});
}
else {
createPullRequest.setVisibility(View.GONE);
}
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
createMilestone.setOnClickListener(v13 -> {
bmListener.onButtonClicked("newMilestone");
dismiss();
});
if (tinyDb.getBoolean("isRepoAdmin")) {
repoSettings.setOnClickListener(repoSettingsView -> {
bmListener.onButtonClicked("repoSettings");
dismiss();
});
addCollaborator.setOnClickListener(v1 -> {
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
bmListener.onButtonClicked("addCollaborator");
dismiss();
});
}
else {
addCollaborator.setVisibility(View.GONE);
repoSettingsDivider.setVisibility(View.GONE);
repoSettings.setVisibility(View.GONE);
}
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
createRelease.setOnClickListener(v14 -> {
bmListener.onButtonClicked("createRelease");
dismiss();
});
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
shareRepository.setOnClickListener(v15 -> {
bmListener.onButtonClicked("shareRepo");
dismiss();
});
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
openWebRepo.setOnClickListener(v16 -> {
bmListener.onButtonClicked("openWebRepo");
dismiss();
2019-09-06 01:01:46 +02:00
});
copyRepoUrl.setOnClickListener(copyUrl -> {
bmListener.onButtonClicked("copyRepoUrl");
dismiss();
});
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
newFile.setOnClickListener(v17 -> {
bmListener.onButtonClicked("newFile");
dismiss();
2019-09-17 08:17:05 +02:00
});
2019-10-11 22:03:01 +02:00
if(tinyDb.getInt("repositoryStarStatus") == 204) { // star a repo
starRepository.setVisibility(View.GONE);
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
unStarRepository.setOnClickListener(v18 -> {
2019-10-11 22:03:01 +02:00
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
RepositoryActions.unStarRepository(getContext());
tinyDb.putInt("repositoryStarStatus", 404);
dismiss();
2019-10-11 22:03:01 +02:00
});
}
else if(tinyDb.getInt("repositoryStarStatus") == 404) {
unStarRepository.setVisibility(View.GONE);
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
starRepository.setOnClickListener(v19 -> {
2019-10-11 22:03:01 +02:00
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
RepositoryActions.starRepository(getContext());
tinyDb.putInt("repositoryStarStatus", 204);
dismiss();
});
}
if(tinyDb.getBoolean("repositoryWatchStatus")) { // watch a repo
watchRepository.setVisibility(View.GONE);
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
unWatchRepository.setOnClickListener(v110 -> {
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
RepositoryActions.unWatchRepository(getContext());
tinyDb.putBoolean("repositoryWatchStatus", false);
dismiss();
});
}
else {
unWatchRepository.setVisibility(View.GONE);
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
watchRepository.setOnClickListener(v111 -> {
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
RepositoryActions.watchRepository(getContext());
tinyDb.putBoolean("repositoryWatchStatus", true);
dismiss();
2019-10-11 22:03:01 +02:00
});
}
return v;
}
public interface BottomSheetListener {
void onButtonClicked(String text);
}
@Override
public void onAttach(@NonNull Context context) {
super.onAttach(context);
try {
bmListener = (BottomSheetListener) context;
}
catch (ClassCastException e) {
throw new ClassCastException(context.toString() + " must implement BottomSheetListener");
}
}
}