From a7d9918b6715def79482b984849c05c737131427 Mon Sep 17 00:00:00 2001 From: qwerty287 Date: Mon, 15 Aug 2022 16:26:02 +0200 Subject: [PATCH] Format files (#1179) use https://codeberg.org/qwerty287/woodpecker-intellij-formatter Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: M M Arif Co-authored-by: qwerty287 Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1179 Reviewed-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: qwerty287 Co-committed-by: qwerty287 --- .editorconfig | 1 + .gitea/issue_template/bug.md | 17 +- .gitea/issue_template/feature.md | 3 +- .gitea/issue_template/suggestion.md | 17 +- .gitea/pull_request_template.md | 4 +- .idea/codeStyles/Project.xml | 344 ++++++------- .idea/codeStyles/codeStyleConfig.xml | 8 +- .woodpecker/check.yml | 5 + .woodpecker/finish.yml | 32 +- CHANGELOG.md | 1 + README.md | 22 +- app/build.gradle | 2 +- .../org/main/gitnex/helpers/AppUtilTest.java | 5 +- app/src/main/AndroidManifest.xml | 135 ++--- .../org/mian/gitnex/actions/ActionResult.java | 18 +- .../mian/gitnex/actions/AssigneesActions.java | 12 +- .../gitnex/actions/CollaboratorActions.java | 131 +++-- .../org/mian/gitnex/actions/IssueActions.java | 35 +- .../mian/gitnex/actions/LabelsActions.java | 16 +- .../mian/gitnex/actions/MilestoneActions.java | 4 +- .../gitnex/actions/PullRequestActions.java | 8 +- .../gitnex/actions/RepositoryActions.java | 241 +++++---- .../org/mian/gitnex/actions/TeamActions.java | 17 +- .../AddCollaboratorToRepositoryActivity.java | 128 +++-- .../activities/AddNewAccountActivity.java | 21 +- .../activities/AddNewTeamMemberActivity.java | 2 +- .../activities/AddNewTeamRepoActivity.java | 3 +- .../activities/AdminCronTasksActivity.java | 8 +- .../activities/AdminGetUsersActivity.java | 112 ++-- .../AdminUnadoptedReposActivity.java | 4 +- .../mian/gitnex/activities/BaseActivity.java | 24 +- .../gitnex/activities/CodeEditorActivity.java | 11 +- .../activities/CommitDetailActivity.java | 13 +- .../gitnex/activities/CommitsActivity.java | 5 +- .../gitnex/activities/CreateFileActivity.java | 338 ++++++------ .../activities/CreateIssueActivity.java | 358 ++++++------- .../activities/CreateLabelActivity.java | 440 ++++++++-------- .../activities/CreateMilestoneActivity.java | 236 +++++---- .../activities/CreateNewUserActivity.java | 221 ++++---- .../CreateOrganizationActivity.java | 229 ++++----- .../activities/CreatePullRequestActivity.java | 63 +-- .../activities/CreateReleaseActivity.java | 439 ++++++++-------- .../gitnex/activities/CreateRepoActivity.java | 352 ++++++------- .../activities/CreateTeamByOrgActivity.java | 420 +++++++-------- .../gitnex/activities/DeepLinksActivity.java | 101 ++-- .../mian/gitnex/activities/DiffActivity.java | 13 +- .../gitnex/activities/EditIssueActivity.java | 424 ++++++++------- .../gitnex/activities/FileViewActivity.java | 207 ++++---- .../activities/IssueDetailActivity.java | 220 +++----- .../mian/gitnex/activities/LoginActivity.java | 68 +-- .../mian/gitnex/activities/MainActivity.java | 83 ++- .../activities/MergePullRequestActivity.java | 9 +- .../activities/MyProfileEmailActivity.java | 190 ++++--- .../OrganizationDetailActivity.java | 261 +++++----- .../OrganizationTeamInfoActivity.java | 179 +++---- .../gitnex/activities/ProfileActivity.java | 92 ++-- .../gitnex/activities/RepoDetailActivity.java | 319 ++++++------ .../gitnex/activities/RepoForksActivity.java | 14 +- .../activities/RepoStargazersActivity.java | 86 ++-- .../activities/RepoWatchersActivity.java | 86 ++-- .../RepositorySettingsActivity.java | 44 +- .../SettingsAppearanceActivity.java | 47 +- .../activities/SettingsDraftsActivity.java | 4 +- .../activities/SettingsGeneralActivity.java | 31 +- .../SettingsNotificationsActivity.java | 41 +- .../activities/SettingsReportsActivity.java | 3 +- .../activities/SettingsSecurityActivity.java | 31 +- .../SettingsTranslationActivity.java | 20 +- .../mian/gitnex/activities/WikiActivity.java | 61 +-- .../adapters/AdminCronTasksAdapter.java | 153 +++--- .../gitnex/adapters/AdminGetUsersAdapter.java | 143 +++--- .../adapters/AdminUnadoptedReposAdapter.java | 64 ++- .../gitnex/adapters/AssigneesListAdapter.java | 54 +- .../adapters/CollaboratorSearchAdapter.java | 223 ++++---- .../gitnex/adapters/CollaboratorsAdapter.java | 129 ++--- .../mian/gitnex/adapters/CommitsAdapter.java | 281 +++++----- .../org/mian/gitnex/adapters/DiffAdapter.java | 29 +- .../gitnex/adapters/DiffFilesAdapter.java | 93 ++-- .../mian/gitnex/adapters/DraftsAdapter.java | 201 ++++---- .../gitnex/adapters/ExploreIssuesAdapter.java | 91 ++-- .../adapters/ExploreRepositoriesAdapter.java | 53 +- .../mian/gitnex/adapters/FilesAdapter.java | 261 +++++----- .../gitnex/adapters/IssueCommentsAdapter.java | 250 +++++---- .../mian/gitnex/adapters/IssuesAdapter.java | 65 +-- .../mian/gitnex/adapters/LabelsAdapter.java | 202 ++++---- .../gitnex/adapters/LabelsListAdapter.java | 55 +- .../gitnex/adapters/MilestonesAdapter.java | 96 ++-- .../adapters/MostVisitedReposAdapter.java | 57 +- .../adapters/MyProfileEmailsAdapter.java | 83 ++- .../gitnex/adapters/NotificationsAdapter.java | 60 ++- .../adapters/OrganizationsListAdapter.java | 226 ++++---- .../gitnex/adapters/PullRequestsAdapter.java | 64 +-- .../adapters/ReactionAuthorsAdapter.java | 10 +- .../mian/gitnex/adapters/ReleasesAdapter.java | 388 +++++++------- .../adapters/ReleasesDownloadsAdapter.java | 23 +- .../gitnex/adapters/RepoForksAdapter.java | 56 +- .../gitnex/adapters/ReposListAdapter.java | 164 +++--- .../org/mian/gitnex/adapters/TagsAdapter.java | 261 +++++----- .../TeamMembersByOrgPreviewAdapter.java | 8 +- .../adapters/TeamRepositoriesAdapter.java | 123 +++-- .../gitnex/adapters/TeamsByOrgAdapter.java | 228 ++++---- .../gitnex/adapters/UserAccountsAdapter.java | 195 ++++--- .../adapters/UserAccountsNavAdapter.java | 48 +- .../mian/gitnex/adapters/UserGridAdapter.java | 198 ++++--- .../UserSearchForTeamMemberAdapter.java | 92 ++-- .../mian/gitnex/adapters/UsersAdapter.java | 44 +- .../mian/gitnex/adapters/WikiListAdapter.java | 155 +++--- .../mian/gitnex/clients/PicassoService.java | 19 +- .../mian/gitnex/clients/RetrofitClient.java | 48 +- .../org/mian/gitnex/core/MainApplication.java | 20 +- .../mian/gitnex/core/MainGrammarLocator.java | 31 +- .../org/mian/gitnex/database/api/BaseApi.java | 12 +- .../gitnex/database/api/RepositoriesApi.java | 1 + .../mian/gitnex/database/dao/DraftsDao.java | 46 +- .../gitnex/database/dao/RepositoriesDao.java | 37 +- .../gitnex/database/dao/UserAccountsDao.java | 52 +- .../gitnex/database/db/GitnexDatabase.java | 41 +- .../gitnex/database/models/Repository.java | 65 ++- .../gitnex/database/models/UserAccount.java | 96 ++-- .../BottomSheetAdminUsersFragment.java | 42 +- .../fragments/BottomSheetDraftsFragment.java | 4 +- .../BottomSheetFileViewerFragment.java | 71 +-- .../BottomSheetMyIssuesFilterFragment.java | 1 + .../BottomSheetMyProfileFragment.java | 20 +- .../BottomSheetNotificationsFragment.java | 68 ++- .../BottomSheetOrganizationFragment.java | 118 ++--- .../BottomSheetOrganizationTeamsFragment.java | 2 +- .../BottomSheetPullRequestFilterFragment.java | 2 +- .../BottomSheetReleasesTagsFragment.java | 3 +- .../fragments/BottomSheetReplyFragment.java | 115 ++--- .../fragments/BottomSheetRepoFragment.java | 254 ++++----- .../BottomSheetSingleIssueFragment.java | 24 +- .../BottomSheetUserProfileFragment.java | 58 +-- .../fragments/BottomSheetWikiFragment.java | 1 + .../fragments/CollaboratorsFragment.java | 85 ++- .../fragments/CommitDetailFragment.java | 190 ++++--- .../gitnex/fragments/DiffFilesFragment.java | 11 +- .../mian/gitnex/fragments/DiffFragment.java | 23 +- .../mian/gitnex/fragments/DraftsFragment.java | 122 +++-- .../gitnex/fragments/ExploreFragment.java | 15 +- .../fragments/ExploreIssuesFragment.java | 8 +- .../ExplorePublicOrganizationsFragment.java | 9 +- .../ExploreRepositoriesFragment.java | 23 +- .../fragments/ExploreUsersFragment.java | 13 +- .../mian/gitnex/fragments/FilesFragment.java | 49 +- .../mian/gitnex/fragments/IssuesFragment.java | 20 +- .../mian/gitnex/fragments/LabelsFragment.java | 121 +++-- .../fragments/MembersByOrgFragment.java | 158 +++--- .../gitnex/fragments/MilestonesFragment.java | 192 ++++--- .../fragments/MostVisitedReposFragment.java | 7 +- .../gitnex/fragments/MyIssuesFragment.java | 17 +- .../fragments/MyProfileEmailsFragment.java | 81 ++- .../fragments/MyProfileFollowersFragment.java | 60 +-- .../fragments/MyProfileFollowingFragment.java | 13 +- .../gitnex/fragments/MyProfileFragment.java | 257 +++++---- .../fragments/MyRepositoriesFragment.java | 71 ++- .../fragments/NotificationsFragment.java | 61 +-- .../fragments/OrganizationInfoFragment.java | 174 +++---- .../fragments/OrganizationLabelsFragment.java | 11 +- .../OrganizationTeamInfoMembersFragment.java | 12 +- ...ganizationTeamInfoPermissionsFragment.java | 3 +- .../OrganizationTeamInfoReposFragment.java | 12 +- .../fragments/OrganizationsFragment.java | 71 ++- .../fragments/PullRequestChangesFragment.java | 9 +- .../fragments/PullRequestCommitsFragment.java | 31 +- .../fragments/PullRequestsFragment.java | 18 +- .../gitnex/fragments/ReleasesFragment.java | 417 ++++++++------- .../gitnex/fragments/RepoInfoFragment.java | 44 +- .../fragments/RepositoriesByOrgFragment.java | 103 ++-- .../fragments/RepositoriesFragment.java | 69 ++- .../gitnex/fragments/SettingsFragment.java | 11 +- .../StarredRepositoriesFragment.java | 53 +- .../gitnex/fragments/TeamsByOrgFragment.java | 189 ++++--- .../mian/gitnex/fragments/WikiFragment.java | 3 +- .../fragments/profile/DetailFragment.java | 47 +- .../fragments/profile/FollowersFragment.java | 27 +- .../fragments/profile/FollowingFragment.java | 27 +- .../profile/OrganizationsFragment.java | 27 +- .../profile/RepositoriesFragment.java | 21 +- .../profile/StarredRepositoriesFragment.java | 26 +- .../org/mian/gitnex/helpers/AlertDialogs.java | 119 ++--- .../java/org/mian/gitnex/helpers/AppUtil.java | 165 +++--- .../org/mian/gitnex/helpers/ChangeLog.java | 29 +- .../mian/gitnex/helpers/ClickListener.java | 34 +- .../mian/gitnex/helpers/ColorInverter.java | 43 +- .../org/mian/gitnex/helpers/Constants.java | 22 +- .../gitnex/helpers/DividerItemDecorator.java | 3 +- .../org/mian/gitnex/helpers/FileDiffView.java | 169 +++--- .../org/mian/gitnex/helpers/FilesData.java | 1 + .../mian/gitnex/helpers/FontsOverride.java | 39 +- .../java/org/mian/gitnex/helpers/Images.java | 4 +- .../gitnex/helpers/LabelWidthCalculator.java | 16 +- .../org/mian/gitnex/helpers/Markdown.java | 75 +-- .../helpers/MergePullRequestSpinner.java | 2 +- .../gitnex/helpers/NetworkStatusObserver.java | 37 +- .../org/mian/gitnex/helpers/ParseDiff.java | 3 +- .../java/org/mian/gitnex/helpers/Path.java | 31 +- .../org/mian/gitnex/helpers/PicassoCache.java | 18 +- .../helpers/RecyclerViewEmptySupport.java | 95 ++-- .../gitnex/helpers/RoundedTransformation.java | 62 +-- .../mian/gitnex/helpers/SimpleCallback.java | 5 +- .../org/mian/gitnex/helpers/SnackBar.java | 1 + .../org/mian/gitnex/helpers/TimeHelper.java | 7 +- .../java/org/mian/gitnex/helpers/TinyDB.java | 486 +++++++++--------- .../java/org/mian/gitnex/helpers/Version.java | 3 +- .../codeeditor/CustomCodeViewAdapter.java | 10 +- .../helpers/codeeditor/LanguageManager.java | 71 ++- .../codeeditor/SourcePositionListener.java | 43 +- .../codeeditor/languages/GoLanguage.java | 11 +- .../codeeditor/languages/JavaLanguage.java | 14 +- .../codeeditor/languages/PhpLanguage.java | 13 +- .../codeeditor/languages/PythonLanguage.java | 11 +- .../helpers/contexts/AccountContext.java | 13 +- .../gitnex/helpers/contexts/IssueContext.java | 51 +- .../helpers/contexts/RepositoryContext.java | 108 ++-- .../mian/gitnex/helpers/ssl/MTMDecision.java | 6 +- .../helpers/ssl/MemorizingTrustManager.java | 226 ++++---- .../gitnex/notifications/Notifications.java | 25 +- .../notifications/NotificationsWorker.java | 52 +- .../gitnex/structs/BottomSheetListener.java | 4 +- .../viewmodels/AdminCronTasksViewModel.java | 5 +- .../viewmodels/AdminGetUsersViewModel.java | 55 +- .../AdminUnadoptedReposViewModel.java | 8 +- .../viewmodels/CollaboratorsViewModel.java | 51 +- .../gitnex/viewmodels/FilesViewModel.java | 109 ++-- .../viewmodels/IssueCommentsViewModel.java | 57 +- .../gitnex/viewmodels/IssuesViewModel.java | 8 +- .../gitnex/viewmodels/LabelsViewModel.java | 51 +- .../viewmodels/MembersByOrgViewModel.java | 51 +- .../viewmodels/MilestonesViewModel.java | 1 + .../OrganizationLabelsViewModel.java | 21 +- .../viewmodels/OrganizationsViewModel.java | 55 +- .../viewmodels/ProfileEmailsViewModel.java | 51 +- .../gitnex/viewmodels/ReleasesViewModel.java | 68 ++- .../viewmodels/RepoStargazersViewModel.java | 51 +- .../viewmodels/RepoWatchersViewModel.java | 51 +- .../viewmodels/RepositoriesViewModel.java | 83 +-- .../viewmodels/TeamsByOrgViewModel.java | 69 ++- .../mian/gitnex/viewmodels/WikiViewModel.java | 1 + .../org/mian/gitnex/views/ReactionList.java | 26 +- .../mian/gitnex/views/ReactionSpinner.java | 70 +-- .../gitnex/views/SyntaxHighlightedArea.java | 87 ++-- .../gitnex_transparent.xml | 80 +-- app/src/main/res/drawable/app_logo.xml | 78 +-- .../main/res/drawable/app_logo_background.xml | 140 ++--- app/src/main/res/drawable/ic_add.xml | 6 +- app/src/main/res/drawable/ic_android.xml | 9 +- app/src/main/res/drawable/ic_appearance.xml | 42 +- app/src/main/res/drawable/ic_arrow_back.xml | 28 +- app/src/main/res/drawable/ic_arrow_down.xml | 28 +- app/src/main/res/drawable/ic_arrow_right.xml | 28 +- app/src/main/res/drawable/ic_arrow_up.xml | 28 +- app/src/main/res/drawable/ic_branch.xml | 56 +- app/src/main/res/drawable/ic_browser.xml | 7 +- app/src/main/res/drawable/ic_bug_report.xml | 154 +++--- app/src/main/res/drawable/ic_calendar.xml | 56 +- app/src/main/res/drawable/ic_check.xml | 14 +- app/src/main/res/drawable/ic_chevron_down.xml | 14 +- app/src/main/res/drawable/ic_chevron_left.xml | 14 +- .../main/res/drawable/ic_chevron_right.xml | 14 +- app/src/main/res/drawable/ic_chevron_up.xml | 14 +- app/src/main/res/drawable/ic_close.xml | 28 +- app/src/main/res/drawable/ic_code.xml | 28 +- app/src/main/res/drawable/ic_comment.xml | 14 +- app/src/main/res/drawable/ic_commit.xml | 42 +- app/src/main/res/drawable/ic_copy.xml | 28 +- app/src/main/res/drawable/ic_delete.xml | 56 +- app/src/main/res/drawable/ic_diff.xml | 8 +- app/src/main/res/drawable/ic_directory.xml | 8 +- app/src/main/res/drawable/ic_done.xml | 9 +- app/src/main/res/drawable/ic_dotted_menu.xml | 42 +- .../drawable/ic_dotted_menu_horizontal.xml | 8 +- app/src/main/res/drawable/ic_download.xml | 42 +- app/src/main/res/drawable/ic_drafts.xml | 28 +- app/src/main/res/drawable/ic_edit.xml | 10 +- app/src/main/res/drawable/ic_email.xml | 28 +- app/src/main/res/drawable/ic_file.xml | 8 +- app/src/main/res/drawable/ic_filter.xml | 14 +- .../main/res/drawable/ic_filter_closed.xml | 22 +- app/src/main/res/drawable/ic_flag.xml | 28 +- app/src/main/res/drawable/ic_fork.xml | 24 +- app/src/main/res/drawable/ic_info.xml | 42 +- app/src/main/res/drawable/ic_issue.xml | 28 +- app/src/main/res/drawable/ic_issue_closed.xml | 28 +- app/src/main/res/drawable/ic_keyword.xml | 12 +- app/src/main/res/drawable/ic_label.xml | 28 +- app/src/main/res/drawable/ic_language.xml | 9 +- app/src/main/res/drawable/ic_like.xml | 14 +- app/src/main/res/drawable/ic_link.xml | 28 +- app/src/main/res/drawable/ic_loader.xml | 12 +- app/src/main/res/drawable/ic_location.xml | 28 +- app/src/main/res/drawable/ic_lock.xml | 28 +- app/src/main/res/drawable/ic_logout.xml | 42 +- app/src/main/res/drawable/ic_markdown.xml | 7 +- app/src/main/res/drawable/ic_menu.xml | 42 +- app/src/main/res/drawable/ic_migrate.xml | 12 +- app/src/main/res/drawable/ic_milestone.xml | 8 +- .../main/res/drawable/ic_notifications.xml | 28 +- app/src/main/res/drawable/ic_organization.xml | 14 +- app/src/main/res/drawable/ic_otp.xml | 28 +- app/src/main/res/drawable/ic_people.xml | 56 +- app/src/main/res/drawable/ic_person.xml | 28 +- app/src/main/res/drawable/ic_person_add.xml | 56 +- .../main/res/drawable/ic_person_remove.xml | 42 +- app/src/main/res/drawable/ic_pin.xml | 8 +- app/src/main/res/drawable/ic_play.xml | 14 +- app/src/main/res/drawable/ic_pull_request.xml | 56 +- app/src/main/res/drawable/ic_question.xml | 14 +- app/src/main/res/drawable/ic_release.xml | 56 +- app/src/main/res/drawable/ic_remove.xml | 6 +- app/src/main/res/drawable/ic_reopen.xml | 28 +- app/src/main/res/drawable/ic_reply.xml | 6 +- app/src/main/res/drawable/ic_repo.xml | 14 +- app/src/main/res/drawable/ic_save.xml | 42 +- app/src/main/res/drawable/ic_search.xml | 28 +- app/src/main/res/drawable/ic_security.xml | 14 +- app/src/main/res/drawable/ic_send.xml | 28 +- app/src/main/res/drawable/ic_settings.xml | 28 +- app/src/main/res/drawable/ic_share.xml | 70 +-- app/src/main/res/drawable/ic_snippet.xml | 12 +- app/src/main/res/drawable/ic_star.xml | 8 +- .../main/res/drawable/ic_star_unfilled.xml | 14 +- app/src/main/res/drawable/ic_submodule.xml | 8 +- app/src/main/res/drawable/ic_symlink.xml | 8 +- app/src/main/res/drawable/ic_tasks.xml | 28 +- app/src/main/res/drawable/ic_tool.xml | 14 +- app/src/main/res/drawable/ic_trending.xml | 28 +- app/src/main/res/drawable/ic_unlock.xml | 28 +- app/src/main/res/drawable/ic_unwatch.xml | 14 +- app/src/main/res/drawable/ic_update.xml | 42 +- .../main/res/drawable/ic_verified_user.xml | 9 +- app/src/main/res/drawable/ic_warning.xml | 6 +- app/src/main/res/drawable/ic_watchers.xml | 9 +- app/src/main/res/drawable/ic_wiki.xml | 28 +- app/src/main/res/drawable/loader_animated.xml | 4 +- app/src/main/res/drawable/progress_bar.xml | 10 +- app/src/main/res/drawable/shape_archived.xml | 4 +- .../res/drawable/shape_badge_background.xml | 4 +- .../shape_bottom_sheet_top_corners.xml | 6 +- .../main/res/drawable/shape_full_circle.xml | 2 +- app/src/main/res/drawable/shape_inputs.xml | 8 +- .../main/res/drawable/shape_list_divider.xml | 4 +- .../main/res/drawable/shape_round_corners.xml | 2 +- app/src/main/res/drawable/switch_thumb.xml | 2 +- app/src/main/res/drawable/switch_track.xml | 4 +- ...ctivity_add_collaborator_to_repository.xml | 64 +-- .../res/layout/activity_add_new_account.xml | 74 +-- .../layout/activity_add_new_team_member.xml | 64 +-- .../res/layout/activity_admin_cron_tasks.xml | 32 +- .../res/layout/activity_admin_get_users.xml | 40 +- .../main/res/layout/activity_code_editor.xml | 34 +- app/src/main/res/layout/activity_commits.xml | 34 +- .../main/res/layout/activity_create_file.xml | 104 ++-- .../main/res/layout/activity_create_issue.xml | 132 ++--- .../main/res/layout/activity_create_label.xml | 60 +-- .../res/layout/activity_create_milestone.xml | 92 ++-- .../res/layout/activity_create_new_user.xml | 100 ++-- .../layout/activity_create_organization.xml | 76 +-- .../main/res/layout/activity_create_pr.xml | 144 +++--- .../res/layout/activity_create_release.xml | 122 ++--- .../main/res/layout/activity_create_repo.xml | 90 ++-- .../layout/activity_create_team_by_org.xml | 112 ++-- .../main/res/layout/activity_deeplinks.xml | 64 +-- app/src/main/res/layout/activity_diff.xml | 4 +- .../main/res/layout/activity_edit_issue.xml | 100 ++-- .../main/res/layout/activity_file_view.xml | 46 +- .../main/res/layout/activity_issue_detail.xml | 134 ++--- app/src/main/res/layout/activity_login.xml | 152 +++--- app/src/main/res/layout/activity_main.xml | 16 +- .../layout/activity_merge_pull_request.xml | 124 ++--- .../main/res/layout/activity_org_detail.xml | 36 +- .../res/layout/activity_org_team_info.xml | 16 +- app/src/main/res/layout/activity_profile.xml | 24 +- .../res/layout/activity_profile_email.xml | 50 +- .../main/res/layout/activity_repo_detail.xml | 28 +- .../main/res/layout/activity_repo_forks.xml | 42 +- .../res/layout/activity_repo_stargazers.xml | 34 +- .../res/layout/activity_repo_watchers.xml | 34 +- .../layout/activity_repository_settings.xml | 56 +- .../layout/activity_settings_appearance.xml | 96 ++-- .../res/layout/activity_settings_drafts.xml | 30 +- .../res/layout/activity_settings_general.xml | 48 +- .../activity_settings_notifications.xml | 58 +-- .../res/layout/activity_settings_reports.xml | 26 +- .../res/layout/activity_settings_security.xml | 56 +- .../layout/activity_settings_translation.xml | 36 +- app/src/main/res/layout/activity_wiki.xml | 90 ++-- .../res/layout/add_new_team_repository.xml | 42 +- app/src/main/res/layout/badge_issue.xml | 14 +- .../main/res/layout/badge_notification.xml | 8 +- app/src/main/res/layout/badge_pull.xml | 4 +- app/src/main/res/layout/badge_release.xml | 4 +- .../res/layout/bottom_sheet_admin_users.xml | 26 +- .../main/res/layout/bottom_sheet_drafts.xml | 26 +- .../res/layout/bottom_sheet_file_viewer.xml | 46 +- .../layout/bottom_sheet_issue_comments.xml | 86 ++-- .../res/layout/bottom_sheet_issues_filter.xml | 46 +- .../layout/bottom_sheet_labels_in_list.xml | 38 +- .../layout/bottom_sheet_milestones_filter.xml | 38 +- .../bottom_sheet_milestones_in_list.xml | 38 +- .../layout/bottom_sheet_my_issues_filter.xml | 46 +- .../res/layout/bottom_sheet_notifications.xml | 46 +- .../bottom_sheet_notifications_filter.xml | 38 +- .../res/layout/bottom_sheet_organization.xml | 88 ++-- .../bottom_sheet_organization_teams.xml | 38 +- .../main/res/layout/bottom_sheet_profile.xml | 30 +- .../bottom_sheet_pull_request_filter.xml | 38 +- .../layout/bottom_sheet_release_in_list.xml | 30 +- .../res/layout/bottom_sheet_releases_tags.xml | 38 +- .../res/layout/bottom_sheet_reply_layout.xml | 30 +- app/src/main/res/layout/bottom_sheet_repo.xml | 168 +++--- .../res/layout/bottom_sheet_single_issue.xml | 140 ++--- .../res/layout/bottom_sheet_tag_in_list.xml | 30 +- .../res/layout/bottom_sheet_user_profile.xml | 34 +- .../res/layout/bottom_sheet_wiki_in_list.xml | 38 +- .../main/res/layout/custom_about_dialog.xml | 94 ++-- .../main/res/layout/custom_assignees_list.xml | 16 +- .../custom_assignees_selection_dialog.xml | 14 +- .../custom_explore_repositories_dialog.xml | 32 +- .../main/res/layout/custom_labels_list.xml | 16 +- .../layout/custom_labels_selection_dialog.xml | 14 +- .../res/layout/custom_markdown_adapter.xml | 4 +- .../res/layout/custom_markdown_code_block.xml | 4 +- .../main/res/layout/custom_markdown_table.xml | 2 +- .../main/res/layout/custom_pr_info_dialog.xml | 20 +- .../custom_pr_update_strategy_dialog.xml | 18 +- .../res/layout/custom_progress_loader.xml | 6 +- .../custom_repository_delete_dialog.xml | 44 +- ...stom_repository_edit_properties_dialog.xml | 100 ++-- .../custom_repository_transfer_dialog.xml | 58 +-- .../main/res/layout/custom_toast_error.xml | 10 +- app/src/main/res/layout/custom_toast_info.xml | 10 +- .../main/res/layout/custom_toast_success.xml | 10 +- .../main/res/layout/custom_toast_warning.xml | 10 +- .../layout/custom_user_accounts_dialog.xml | 10 +- .../res/layout/fragment_administration.xml | 30 +- .../res/layout/fragment_collaborators.xml | 16 +- .../res/layout/fragment_commit_details.xml | 34 +- app/src/main/res/layout/fragment_diff.xml | 12 +- .../main/res/layout/fragment_diff_files.xml | 20 +- app/src/main/res/layout/fragment_drafts.xml | 8 +- app/src/main/res/layout/fragment_explore.xml | 16 +- .../main/res/layout/fragment_explore_repo.xml | 10 +- .../res/layout/fragment_explore_users.xml | 10 +- app/src/main/res/layout/fragment_files.xml | 8 +- app/src/main/res/layout/fragment_issues.xml | 12 +- app/src/main/res/layout/fragment_labels.xml | 10 +- .../res/layout/fragment_members_by_org.xml | 16 +- .../main/res/layout/fragment_milestones.xml | 16 +- .../res/layout/fragment_notifications.xml | 18 +- .../res/layout/fragment_organization_info.xml | 44 +- ...ragment_organization_team_info_members.xml | 12 +- ...ent_organization_team_info_permissions.xml | 4 +- .../res/layout/fragment_organizations.xml | 24 +- .../main/res/layout/fragment_pr_changes.xml | 24 +- app/src/main/res/layout/fragment_profile.xml | 58 +-- .../res/layout/fragment_profile_detail.xml | 178 +++---- .../res/layout/fragment_profile_emails.xml | 12 +- .../fragment_profile_followers_following.xml | 12 +- .../res/layout/fragment_pull_requests.xml | 12 +- app/src/main/res/layout/fragment_releases.xml | 10 +- .../main/res/layout/fragment_repo_info.xml | 316 ++++++------ .../main/res/layout/fragment_repositories.xml | 20 +- .../res/layout/fragment_search_issues.xml | 10 +- app/src/main/res/layout/fragment_settings.xml | 120 ++--- .../main/res/layout/fragment_teams_by_org.xml | 10 +- app/src/main/res/layout/fragment_wiki.xml | 10 +- .../main/res/layout/layout_cron_task_info.xml | 18 +- .../res/layout/layout_deprecation_dialog.xml | 8 +- .../main/res/layout/layout_reaction_badge.xml | 4 +- .../res/layout/layout_reaction_button.xml | 4 +- .../main/res/layout/layout_repo_more_info.xml | 24 +- app/src/main/res/layout/layout_tab_text.xml | 2 +- .../main/res/layout/list_admin_cron_tasks.xml | 14 +- .../res/layout/list_admin_unadopted_repos.xml | 6 +- app/src/main/res/layout/list_admin_users.xml | 28 +- .../main/res/layout/list_collaborators.xml | 16 +- .../res/layout/list_collaborators_search.xml | 66 +-- app/src/main/res/layout/list_commits.xml | 22 +- app/src/main/res/layout/list_diff_files.xml | 10 +- app/src/main/res/layout/list_drafts.xml | 16 +- app/src/main/res/layout/list_files.xml | 10 +- .../main/res/layout/list_issue_comments.xml | 26 +- app/src/main/res/layout/list_issues.xml | 42 +- .../main/res/layout/list_item_suggestion.xml | 2 +- .../res/layout/list_items_autocomplete.xml | 6 +- app/src/main/res/layout/list_labels.xml | 14 +- .../layout/list_members_by_org_preview.xml | 10 +- app/src/main/res/layout/list_milestones.xml | 28 +- .../res/layout/list_most_visited_repos.xml | 12 +- .../main/res/layout/list_notifications.xml | 28 +- .../main/res/layout/list_organizations.xml | 10 +- app/src/main/res/layout/list_pr.xml | 46 +- .../main/res/layout/list_profile_emails.xml | 16 +- .../main/res/layout/list_reaction_authors.xml | 24 +- app/src/main/res/layout/list_releases.xml | 86 ++-- .../res/layout/list_releases_downloads.xml | 10 +- app/src/main/res/layout/list_repositories.xml | 24 +- .../main/res/layout/list_spinner_items.xml | 8 +- app/src/main/res/layout/list_tags.xml | 46 +- app/src/main/res/layout/list_teams_by_org.xml | 18 +- .../main/res/layout/list_user_accounts.xml | 14 +- app/src/main/res/layout/list_users.xml | 26 +- app/src/main/res/layout/list_users_grid.xml | 20 +- app/src/main/res/layout/list_wiki.xml | 14 +- app/src/main/res/layout/nav_header.xml | 18 +- app/src/main/res/layout/nav_user_accounts.xml | 6 +- app/src/main/res/menu/drawer_menu.xml | 36 +- app/src/main/res/menu/edit_menu.xml | 4 +- .../res/menu/files_switch_branches_menu.xml | 18 +- app/src/main/res/menu/filter_menu.xml | 6 +- app/src/main/res/menu/filter_menu_explore.xml | 4 +- .../main/res/menu/filter_menu_milestone.xml | 6 +- .../res/menu/filter_menu_notifications.xml | 4 +- app/src/main/res/menu/filter_menu_pr.xml | 6 +- .../main/res/menu/filter_menu_releases.xml | 4 +- .../main/res/menu/generic_nav_dotted_menu.xml | 6 +- app/src/main/res/menu/markdown_switcher.xml | 4 +- app/src/main/res/menu/pr_info_menu.xml | 4 +- app/src/main/res/menu/profile_dotted_menu.xml | 6 +- app/src/main/res/menu/repo_dotted_menu.xml | 4 +- app/src/main/res/menu/save.xml | 4 +- app/src/main/res/menu/search_menu.xml | 2 +- app/src/main/res/values-ar/strings.xml | 65 ++- app/src/main/res/values-cs/strings.xml | 63 ++- app/src/main/res/values-de/strings.xml | 95 +++- app/src/main/res/values-es/strings.xml | 103 +++- app/src/main/res/values-fa/strings.xml | 65 ++- app/src/main/res/values-fi/strings.xml | 62 ++- app/src/main/res/values-fr/strings.xml | 78 ++- app/src/main/res/values-it/strings.xml | 80 ++- app/src/main/res/values-ko/strings.xml | 62 ++- app/src/main/res/values-lv/strings.xml | 62 ++- app/src/main/res/values-nl/strings.xml | 64 ++- app/src/main/res/values-pl/strings.xml | 63 ++- app/src/main/res/values-pt/strings.xml | 75 ++- app/src/main/res/values-ru/strings.xml | 77 ++- app/src/main/res/values-si/strings.xml | 67 ++- app/src/main/res/values-sk/strings.xml | 62 ++- app/src/main/res/values-sr/strings.xml | 57 +- app/src/main/res/values-tr/strings.xml | 62 ++- app/src/main/res/values-uk/strings.xml | 67 ++- app/src/main/res/values-zh/strings.xml | 24 +- app/src/main/res/values/attrs.xml | 24 +- app/src/main/res/values/strings.xml | 66 ++- app/src/main/res/values/styles.xml | 4 +- .../main/res/xml/network_security_config.xml | 6 +- .../org/mian/gitnex/helpers/AppUtilTest.java | 4 +- .../mian/gitnex/helpers/ParseDiffTest.java | 8 +- assets/license.svg | 22 +- build.gradle | 2 +- crowdin.example.yml | 28 +- 552 files changed, 15039 insertions(+), 15130 deletions(-) diff --git a/.editorconfig b/.editorconfig index 3a04062e..c8ba226b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,6 +13,7 @@ line_comment = // block_comment_start = /* block_comment = * block_comment_end = */ +max_line_length = 220 [*.json] indent_size = 2 diff --git a/.gitea/issue_template/bug.md b/.gitea/issue_template/bug.md index 9ae53483..0cdffe9e 100644 --- a/.gitea/issue_template/bug.md +++ b/.gitea/issue_template/bug.md @@ -9,6 +9,7 @@ labels: --- ## # Describe your matter briefly +

##### What did you expect? @@ -18,13 +19,13 @@ labels: ##### Some additional details --- -* The version of **Gitea** you are using: -* The version of **GitNex** you are using: -* Source of installation (Play Store, F-Droid, APK): -* Current android version and phone model/manufacturer: -* The type of certificate your instance is using (self-signed, signed): -* How you used to log in (via password or token): -
+* The version of **Gitea** you are using: +* The version of **GitNex** you are using: +* Source of installation (Play Store, F-Droid, APK): +* Current android version and phone model/manufacturer: +* The type of certificate your instance is using (self-signed, signed): +* How you used to log in (via password or token): +
##### We would appreciate some screenshots or stacktrace's, but this is also not required. --- @@ -32,6 +33,6 @@ labels:

- [ ] I carefully read the [contribution guidelines](https://codeberg.org/gitnex/GitNex/wiki/Contributing). -
+
diff --git a/.gitea/issue_template/feature.md b/.gitea/issue_template/feature.md index 14d225b9..4eed2529 100644 --- a/.gitea/issue_template/feature.md +++ b/.gitea/issue_template/feature.md @@ -9,9 +9,10 @@ labels: --- ## # Describe your matter briefly +

- [ ] I carefully read the [contribution guidelines](https://codeberg.org/gitnex/GitNex/wiki/Contributing). -
+
diff --git a/.gitea/issue_template/suggestion.md b/.gitea/issue_template/suggestion.md index 0e00e914..625f9af6 100644 --- a/.gitea/issue_template/suggestion.md +++ b/.gitea/issue_template/suggestion.md @@ -9,6 +9,7 @@ labels: --- ## # Describe your matter briefly +

##### What did you expect? @@ -18,13 +19,13 @@ labels: ##### Some additional details --- -* The version of **Gitea** you are using: -* The version of **GitNex** you are using: -* Source of installation (Play Store, F-Droid, APK): -* Current android version and phone model/manufacturer: -* The type of certificate your instance is using (self-signed, signed): -* How you used to log in (via password or token): -
+* The version of **Gitea** you are using: +* The version of **GitNex** you are using: +* Source of installation (Play Store, F-Droid, APK): +* Current android version and phone model/manufacturer: +* The type of certificate your instance is using (self-signed, signed): +* How you used to log in (via password or token): +
##### We would appreciate some screenshots or stacktrace's, but this is also not required. --- @@ -32,6 +33,6 @@ labels:

- [ ] I carefully read the [contribution guidelines](https://codeberg.org/gitnex/GitNex/wiki/Contributing). -
+
diff --git a/.gitea/pull_request_template.md b/.gitea/pull_request_template.md index b9a0ce9a..96fb4b18 100644 --- a/.gitea/pull_request_template.md +++ b/.gitea/pull_request_template.md @@ -1,4 +1,5 @@ ### Describe what your pull request does and which issue you’re targeting +

@@ -6,4 +7,5 @@ - [ ] I carefully read the [contribution guidelines](https://codeberg.org/GitNex/GitNex/src/branch/main/CONTRIBUTING.md). - [ ] I'm following the code standards as defined [here](https://codeberg.org/gitnex/GitNex/wiki/Code-Standards). -- [ ] By submitting this pull request, I permit GitNex to license my work under the [GNU General Public License v3](https://codeberg.org/GitNex/GitNex/src/branch/main/LICENSE). \ No newline at end of file +- [ ] By submitting this pull request, I permit GitNex to license my work under + the [GNU General Public License v3](https://codeberg.org/GitNex/GitNex/src/branch/main/LICENSE). \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index e22b2741..9b23ea37 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,182 +1,166 @@ - - - - - - - - - - - - - - - -
- - - - xmlns:android - - ^$ - - - -
-
- - - - xmlns:.* - - ^$ - - - BY_NAME - -
-
- - - - .*:id - - http://schemas.android.com/apk/res/android - - - -
-
- - - - .*:name - - http://schemas.android.com/apk/res/android - - - -
-
- - - - name - - ^$ - - - -
-
- - - - style - - ^$ - - - -
-
- - - - .* - - ^$ - - - BY_NAME - -
-
- - - - .* - - http://schemas.android.com/apk/res/android - - - ANDROID_ATTRIBUTE_ORDER - -
-
- - - - .* - - .* - - - BY_NAME - -
-
-
-
-
+ + + + + + + + + + + + + +
+ + + + xmlns:android + + ^$ + + + +
+
+ + + + xmlns:.* + + ^$ + + + BY_NAME + +
+
+ + + + .*:id + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:name + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + name + + ^$ + + + +
+
+ + + + style + + ^$ + + + +
+
+ + + + .* + + ^$ + + + BY_NAME + +
+
+ + + + .* + + http://schemas.android.com/apk/res/android + + + ANDROID_ATTRIBUTE_ORDER + +
+
+ + + + .* + + .* + + + BY_NAME + +
+
+
+
+
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml index 79ee123c..a4e3ea4b 100644 --- a/.idea/codeStyles/codeStyleConfig.xml +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -1,5 +1,5 @@ - - - \ No newline at end of file + + + diff --git a/.woodpecker/check.yml b/.woodpecker/check.yml index bde80909..3d929904 100644 --- a/.woodpecker/check.yml +++ b/.woodpecker/check.yml @@ -1,6 +1,7 @@ pipeline: author-header: image: qwerty287/woodpecker-regex-check + group: check settings: pattern: "*.java" regex: " \\\\* \\\\@author [\\\\S\\\\s]+" @@ -8,3 +9,7 @@ pipeline: style: image: qwerty287/woodpecker-intellij-formatter + group: check + settings: + file_pattern: "*.java" + path: "app/" diff --git a/.woodpecker/finish.yml b/.woodpecker/finish.yml index b6bdcf3b..7202f32d 100644 --- a/.woodpecker/finish.yml +++ b/.woodpecker/finish.yml @@ -1,22 +1,22 @@ depends_on: - - build - - locale - - check + - build + - locale + - check run_on: [ success, failure ] skip_clone: true pipeline: - discord: - image: appleboy/drone-discord - settings: - message: "{{#success build.status}} ✅ Build #{{build.number}} of `{{repo.name}}` succeeded.\n\n📝 Commit by {{commit.author}}:\n``` {{commit.message}} ```\n\n🌐 {{ build.link }} {{else}} ❌ Build #{{build.number}} of `{{repo.name}}` failed.\n\n📝 Commit by {{commit.author}}:\n``` {{commit.message}} ```\n\n🌐 {{ build.link }} {{/success}}\n" - webhook_id: - from_secret: - DISCORD_BOT_ID - webhook_token: - from_secret: - DISCORD_BOT_SECRET - when: - event: [ push ] - branch: main + discord: + image: appleboy/drone-discord + settings: + message: "{{#success build.status}} ✅ Build #{{build.number}} of `{{repo.name}}` succeeded.\n\n📝 Commit by {{commit.author}}:\n``` {{commit.message}} ```\n\n🌐 {{ build.link }} {{else}} ❌ Build #{{build.number}} of `{{repo.name}}` failed.\n\n📝 Commit by {{commit.author}}:\n``` {{commit.message}} ```\n\n🌐 {{ build.link }} {{/success}}\n" + webhook_id: + from_secret: + DISCORD_BOT_ID + webhook_token: + from_secret: + DISCORD_BOT_SECRET + when: + event: [ push ] + branch: main diff --git a/CHANGELOG.md b/CHANGELOG.md index b5e68948..0fb76b5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,3 @@ # Changelog + [Check out the release notes](https://codeberg.org/gitnex/GitNex/releases) diff --git a/README.md b/README.md index 3a99f1ba..e118d1cd 100644 --- a/README.md +++ b/README.md @@ -4,26 +4,33 @@ # GitNex - Android client for Gitea -GitNex is a free/paid, open-source Android client for Git repository management tool Gitea. Gitea is a community managed fork of Gogs, lightweight code hosting solution written in Go. +GitNex is a free/paid, open-source Android client for Git repository management tool Gitea. Gitea is a community managed fork of Gogs, lightweight +code hosting solution written in Go. -GitNex is licensed under GPLv3 License. See the LICENSE file for the full license text. **No trackers are used** and source code is available here for anyone to audit. +GitNex is licensed under GPLv3 License. See the LICENSE file for the full license text. **No trackers are used** and source code is available here for +anyone to audit. ## Downloads + [Get it on F-Droid](https://f-droid.org/en/packages/org.mian.gitnex/) [Get it on Google Play](https://play.google.com/store/apps/details?id=org.mian.gitnex.pro) [Download builds and releases](https://cloud.swatian.com/s/DN7E5xxtaw4fRbE) ## Note about Gitea version + Please make sure that you are on latest stable release or later for better app experience. -Check the versions [compatibility page](https://codeberg.org/gitnex/GitNex/wiki/Compatibility) which lists all the supported versions with compatibility ratio. +Check the versions [compatibility page](https://codeberg.org/gitnex/GitNex/wiki/Compatibility) which lists all the supported versions with +compatibility ratio. ## Build from source + Option 1 - Download the source code, open it in Android Studio and build it there. Option 2 - Open terminal(Linux) and cd to the project dir. Run `./gradlew assembleFree`. ## Features + - Multiple accounts support - File and directory browser - File viewer @@ -37,12 +44,15 @@ Option 2 - Open terminal(Linux) and cd to the project dir. Run `./gradlew assemb - [& more...](https://codeberg.org/gitnex/GitNex/wiki/Features) ## Contributing + [Contributing](https://codeberg.org/gitnex/GitNex/wiki/Contributing) ## Translation + Help us translate GitNex to your native language. -We use [Crowdin](https://crowdin.com/project/gitnex) for translation. If your language is not listed, please request [here](https://codeberg.org/gitnex/GitNex/issues) to add it to the project. +We use [Crowdin](https://crowdin.com/project/gitnex) for translation. If your language is not listed, please +request [here](https://codeberg.org/gitnex/GitNex/issues) to add it to the project. **Link: https://crowdin.com/project/GitNex** @@ -53,6 +63,7 @@ We use [Crowdin](https://crowdin.com/project/gitnex) for translation. If your la [005.png](https://codeberg.org/gitnex/GitNex/raw/branch/main/fastlane/metadata/android/en-US/images/phoneScreenshots/005.png) | [006.png](https://codeberg.org/gitnex/GitNex/raw/branch/main/fastlane/metadata/android/en-US/images/phoneScreenshots/006.png) | [007.png](https://codeberg.org/gitnex/GitNex/raw/branch/main/fastlane/metadata/android/en-US/images/phoneScreenshots/007.png) | [008.png](https://codeberg.org/gitnex/GitNex/raw/branch/main/fastlane/metadata/android/en-US/images/phoneScreenshots/008.png) ## Links + [Website](https://gitnex.com) [Wiki](https://codeberg.org/gitnex/GitNex/wiki/Home) @@ -64,9 +75,11 @@ We use [Crowdin](https://crowdin.com/project/gitnex) for translation. If your la [Release Blog](https://gitnex.codeberg.page) ## Thanks + Thanks to all the open source libraries, contributors and donators. #### Open source libraries + - [square/retrofit](https://github.com/square/retrofit) - [google/gson](https://github.com/google/gson) - [square/okhttp](https://github.com/square/okhttp) @@ -89,6 +102,7 @@ Thanks to all the open source libraries, contributors and donators. - [AmrDeveloper/CodeView](https://github.com/AmrDeveloper/CodeView) #### Icon sets + - [lucide-icons/lucide](https://github.com/lucide-icons/lucide) - [primer/octicons](https://github.com/primer/octicons) - [google/material-design-icons](https://github.com/google/material-design-icons) diff --git a/app/build.gradle b/app/build.gradle index dbceb658..1e2668fa 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -39,7 +39,7 @@ android { lint { abortOnError false } - defaultConfig{ + defaultConfig { vectorDrawables.useSupportLibrary = true } } diff --git a/app/src/androidTest/java/org/main/gitnex/helpers/AppUtilTest.java b/app/src/androidTest/java/org/main/gitnex/helpers/AppUtilTest.java index ec387e2b..d8b19d11 100644 --- a/app/src/androidTest/java/org/main/gitnex/helpers/AppUtilTest.java +++ b/app/src/androidTest/java/org/main/gitnex/helpers/AppUtilTest.java @@ -8,9 +8,7 @@ import androidx.test.platform.app.InstrumentationRegistry; import org.junit.Test; import org.junit.runner.RunWith; import org.mian.gitnex.helpers.AppUtil; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.*; /** * @author qwerty287 @@ -109,5 +107,6 @@ public class AppUtilTest { assertEquals("https://gitnex.com", AppUtil.changeScheme(Uri.parse("http://gitnex.com"), "https").toString()); assertEquals("ssh://codeberg.org/gitnex/GitNex", AppUtil.changeScheme(Uri.parse("http://codeberg.org/gitnex/GitNex"), "ssh").toString()); } + } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 595f6c2b..2aaa6ec5 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -3,10 +3,10 @@ xmlns:tools="http://schemas.android.com/tools" package="org.mian.gitnex"> - - - - + + + + + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:theme="@style/AppTheme.NoActionBar"/> + android:theme="@style/AppTheme.NoActionBar"/> + android:theme="@style/AppTheme.NoActionBar"/> + android:theme="@style/AppTheme.NoActionBar"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:theme="@style/AppTheme.NoActionBar"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:windowSoftInputMode="adjustNothing"/> + android:theme="@style/AppTheme.NoActionBar"/> + android:exported="true" + android:theme="@android:style/Theme.NoTitleBar"> - - + + + android:theme="@android:style/Theme.NoTitleBar"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:theme="@android:style/Theme.NoTitleBar"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:theme="@android:style/Theme.NoTitleBar"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/> + android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation" + android:windowSoftInputMode="adjustResize"/> + + android:value="true"/> + android:value="true"/> + android:theme="@android:style/Theme.Translucent.NoTitleBar"> - + - - + + - - - - - - - - + + + + + + + + diff --git a/app/src/main/java/org/mian/gitnex/actions/ActionResult.java b/app/src/main/java/org/mian/gitnex/actions/ActionResult.java index 4c88eeff..3fe1077d 100644 --- a/app/src/main/java/org/mian/gitnex/actions/ActionResult.java +++ b/app/src/main/java/org/mian/gitnex/actions/ActionResult.java @@ -14,11 +14,8 @@ import java.util.concurrent.TimeUnit; public class ActionResult { - public enum Status { SUCCESS, FAILED } - private final BlockingQueue blockingQueue; private final List> onFinishedListeners; - private boolean invalidated = false; public ActionResult() { @@ -42,13 +39,17 @@ public class ActionResult { onFinishedListener.onFinished(status, result); } - } catch (InterruptedException ignored) {} + } + catch(InterruptedException ignored) { + } } public void invalidate() { - if(invalidated) throw new IllegalStateException("Already invalidated"); + if(invalidated) { + throw new IllegalStateException("Already invalidated"); + } this.invalidated = true; } @@ -70,11 +71,16 @@ public class ActionResult { } - public static class None {} + public enum Status {SUCCESS, FAILED} public interface OnFinishedListener { void onFinished(Status status, R result); + + } + + public static class None { + } } diff --git a/app/src/main/java/org/mian/gitnex/actions/AssigneesActions.java b/app/src/main/java/org/mian/gitnex/actions/AssigneesActions.java index 5144420f..1bf05b25 100644 --- a/app/src/main/java/org/mian/gitnex/actions/AssigneesActions.java +++ b/app/src/main/java/org/mian/gitnex/actions/AssigneesActions.java @@ -24,9 +24,7 @@ public class AssigneesActions { public static void getCurrentIssueAssignees(Context ctx, String repoOwner, String repoName, int issueIndex, List currentAssignees) { - Call callSingleIssueLabels = RetrofitClient - .getApiInterface(ctx) - .issueGetIssue(repoOwner, repoName, (long) issueIndex); + Call callSingleIssueLabels = RetrofitClient.getApiInterface(ctx).issueGetIssue(repoOwner, repoName, (long) issueIndex); callSingleIssueLabels.enqueue(new Callback<>() { @@ -63,11 +61,10 @@ public class AssigneesActions { }); } - public static void getRepositoryAssignees(Context ctx, String repoOwner, String repoName, List assigneesList, MaterialAlertDialogBuilder materialAlertDialogBuilder, AssigneesListAdapter assigneesAdapter, CustomAssigneesSelectionDialogBinding assigneesBinding, ProgressBar progressBar) { + public static void getRepositoryAssignees(Context ctx, String repoOwner, String repoName, List assigneesList, MaterialAlertDialogBuilder materialAlertDialogBuilder, AssigneesListAdapter assigneesAdapter, + CustomAssigneesSelectionDialogBinding assigneesBinding, ProgressBar progressBar) { - Call> call = RetrofitClient - .getApiInterface(ctx) - .repoGetAssignees(repoOwner, repoName); + Call> call = RetrofitClient.getApiInterface(ctx).repoGetAssignees(repoOwner, repoName); call.enqueue(new Callback<>() { @@ -113,4 +110,5 @@ public class AssigneesActions { } }); } + } diff --git a/app/src/main/java/org/mian/gitnex/actions/CollaboratorActions.java b/app/src/main/java/org/mian/gitnex/actions/CollaboratorActions.java index fa65264a..bccf8195 100644 --- a/app/src/main/java/org/mian/gitnex/actions/CollaboratorActions.java +++ b/app/src/main/java/org/mian/gitnex/actions/CollaboratorActions.java @@ -19,97 +19,94 @@ import retrofit2.Callback; public class CollaboratorActions { - public static void deleteCollaborator(final Context context, String userName, RepositoryContext repository) { + public static void deleteCollaborator(final Context context, String userName, RepositoryContext repository) { - Call call = RetrofitClient - .getApiInterface(context) - .repoDeleteCollaborator(repository.getOwner(), repository.getName(), userName); + Call call = RetrofitClient.getApiInterface(context).repoDeleteCollaborator(repository.getOwner(), repository.getName(), userName); - call.enqueue(new Callback<>() { + call.enqueue(new Callback<>() { - @Override - public void onResponse(@NonNull Call call, @NonNull retrofit2.Response response) { + @Override + public void onResponse(@NonNull Call call, @NonNull retrofit2.Response response) { - if(response.isSuccessful()) { - if(response.code() == 204) { + if(response.isSuccessful()) { + if(response.code() == 204) { - CollaboratorsFragment.refreshCollaborators = true; - Toasty.success(context, context.getString(R.string.removeCollaboratorToastText)); - ((AddCollaboratorToRepositoryActivity) context).finish(); - } - } - else if(response.code() == 401) { + CollaboratorsFragment.refreshCollaborators = true; + Toasty.success(context, context.getString(R.string.removeCollaboratorToastText)); + ((AddCollaboratorToRepositoryActivity) context).finish(); + } + } + else if(response.code() == 401) { - AlertDialogs.authorizationTokenRevokedDialog(context); - } - else if(response.code() == 403) { + AlertDialogs.authorizationTokenRevokedDialog(context); + } + else if(response.code() == 403) { - Toasty.error(context, context.getString(R.string.authorizeError)); - } - else if(response.code() == 404) { + Toasty.error(context, context.getString(R.string.authorizeError)); + } + else if(response.code() == 404) { - Toasty.warning(context, context.getString(R.string.apiNotFound)); - } - else { + Toasty.warning(context, context.getString(R.string.apiNotFound)); + } + else { - Toasty.error(context, context.getString(R.string.genericError)); - } - } + Toasty.error(context, context.getString(R.string.genericError)); + } + } - @Override - public void onFailure(@NonNull Call call, @NonNull Throwable t) { + @Override + public void onFailure(@NonNull Call call, @NonNull Throwable t) { - Toasty.error(context, context.getResources().getString(R.string.genericServerResponseError)); - } - }); + Toasty.error(context, context.getResources().getString(R.string.genericServerResponseError)); + } + }); - } + } - public static void addCollaborator(final Context context, String permission, String userName, RepositoryContext repository) { + public static void addCollaborator(final Context context, String permission, String userName, RepositoryContext repository) { - AddCollaboratorOption permissionString = new AddCollaboratorOption(); + AddCollaboratorOption permissionString = new AddCollaboratorOption(); permissionString.setPermission(permission); - Call call = RetrofitClient - .getApiInterface(context) - .repoAddCollaborator(repository.getOwner(), repository.getName(), userName, permissionString); + Call call = RetrofitClient.getApiInterface(context).repoAddCollaborator(repository.getOwner(), repository.getName(), userName, permissionString); - call.enqueue(new Callback<>() { + call.enqueue(new Callback<>() { - @Override - public void onResponse(@NonNull Call call, @NonNull retrofit2.Response response) { + @Override + public void onResponse(@NonNull Call call, @NonNull retrofit2.Response response) { - if(response.isSuccessful()) { - if(response.code() == 204) { + if(response.isSuccessful()) { + if(response.code() == 204) { - CollaboratorsFragment.refreshCollaborators = true; - Toasty.success(context, context.getString(R.string.addCollaboratorToastText)); - ((AddCollaboratorToRepositoryActivity) context).finish(); - } - } - else if(response.code() == 401) { + CollaboratorsFragment.refreshCollaborators = true; + Toasty.success(context, context.getString(R.string.addCollaboratorToastText)); + ((AddCollaboratorToRepositoryActivity) context).finish(); + } + } + else if(response.code() == 401) { - AlertDialogs.authorizationTokenRevokedDialog(context); - } - else if(response.code() == 403) { + AlertDialogs.authorizationTokenRevokedDialog(context); + } + else if(response.code() == 403) { - Toasty.error(context, context.getString(R.string.authorizeError)); - } - else if(response.code() == 404) { + Toasty.error(context, context.getString(R.string.authorizeError)); + } + else if(response.code() == 404) { - Toasty.warning(context, context.getString(R.string.apiNotFound)); - } - else { + Toasty.warning(context, context.getString(R.string.apiNotFound)); + } + else { - Toasty.error(context, context.getString(R.string.genericError)); - } - } + Toasty.error(context, context.getString(R.string.genericError)); + } + } - @Override - public void onFailure(@NonNull Call call, @NonNull Throwable t) { + @Override + public void onFailure(@NonNull Call call, @NonNull Throwable t) { + + Toasty.error(context, context.getResources().getString(R.string.genericServerResponseError)); + } + }); + } - Toasty.error(context, context.getResources().getString(R.string.genericServerResponseError)); - } - }); - } } diff --git a/app/src/main/java/org/mian/gitnex/actions/IssueActions.java b/app/src/main/java/org/mian/gitnex/actions/IssueActions.java index 9590fba0..a8856641 100644 --- a/app/src/main/java/org/mian/gitnex/actions/IssueActions.java +++ b/app/src/main/java/org/mian/gitnex/actions/IssueActions.java @@ -3,11 +3,7 @@ package org.mian.gitnex.actions; import android.app.Activity; import android.content.Context; import androidx.annotation.NonNull; -import org.gitnex.tea4j.v2.models.Comment; -import org.gitnex.tea4j.v2.models.CreateIssueCommentOption; -import org.gitnex.tea4j.v2.models.EditIssueCommentOption; -import org.gitnex.tea4j.v2.models.EditIssueOption; -import org.gitnex.tea4j.v2.models.Issue; +import org.gitnex.tea4j.v2.models.*; import org.mian.gitnex.R; import org.mian.gitnex.activities.BaseActivity; import org.mian.gitnex.activities.IssueDetailActivity; @@ -35,10 +31,7 @@ public class IssueActions { EditIssueCommentOption commentObj = new EditIssueCommentOption(); commentObj.setBody(comment); - Call call = RetrofitClient - .getApiInterface(context) - .issueEditComment(issue.getRepository().getOwner(), - issue.getRepository().getName(), (long) commentId, commentObj); + Call call = RetrofitClient.getApiInterface(context).issueEditComment(issue.getRepository().getOwner(), issue.getRepository().getName(), (long) commentId, commentObj); call.enqueue(new Callback<>() { @@ -77,10 +70,7 @@ public class IssueActions { EditIssueOption issueStatJson = new EditIssueOption(); issueStatJson.setState(issueState); - Call call = RetrofitClient - .getApiInterface(ctx) - .issueEditIssue(issue.getRepository().getOwner(), - issue.getRepository().getName(), (long) issue.getIssueIndex(), issueStatJson); + Call call = RetrofitClient.getApiInterface(ctx).issueEditIssue(issue.getRepository().getOwner(), issue.getRepository().getName(), (long) issue.getIssueIndex(), issueStatJson); call.enqueue(new Callback<>() { @@ -113,8 +103,7 @@ public class IssueActions { IssueDetailActivity.singleIssueUpdate = true; ((IssueDetailActivity) ctx).onResume(); - if(((Activity) ctx).getIntent().getStringExtra("openedFromLink") == null || - !((Activity) ctx).getIntent().getStringExtra("openedFromLink").equals("true")) { + if(((Activity) ctx).getIntent().getStringExtra("openedFromLink") == null || !((Activity) ctx).getIntent().getStringExtra("openedFromLink").equals("true")) { RepoDetailActivity.updateRepo = true; } } @@ -150,10 +139,8 @@ public class IssueActions { Call call; - call = RetrofitClient - .getApiInterface(ctx) - .issueAddSubscription(issue.getRepository().getOwner(), - issue.getRepository().getName(), (long) issue.getIssueIndex(), ((BaseActivity) ctx).getAccount().getAccount().getUserName()); + call = RetrofitClient.getApiInterface(ctx) + .issueAddSubscription(issue.getRepository().getOwner(), issue.getRepository().getName(), (long) issue.getIssueIndex(), ((BaseActivity) ctx).getAccount().getAccount().getUserName()); call.enqueue(new Callback<>() { @@ -193,8 +180,8 @@ public class IssueActions { Call call; - call = RetrofitClient.getApiInterface(ctx).issueDeleteSubscription(issue.getRepository().getOwner(), - issue.getRepository().getName(), (long) issue.getIssueIndex(), ((BaseActivity) ctx).getAccount().getAccount().getUserName()); + call = RetrofitClient.getApiInterface(ctx) + .issueDeleteSubscription(issue.getRepository().getOwner(), issue.getRepository().getName(), (long) issue.getIssueIndex(), ((BaseActivity) ctx).getAccount().getAccount().getUserName()); call.enqueue(new Callback<>() { @@ -237,10 +224,7 @@ public class IssueActions { CreateIssueCommentOption issueComment = new CreateIssueCommentOption(); issueComment.setBody(comment); - Call call = RetrofitClient - .getApiInterface(context) - .issueCreateComment(issue.getRepository().getOwner(), - issue.getRepository().getName(), (long) issue.getIssueIndex(), issueComment); + Call call = RetrofitClient.getApiInterface(context).issueCreateComment(issue.getRepository().getOwner(), issue.getRepository().getName(), (long) issue.getIssueIndex(), issueComment); call.enqueue(new Callback<>() { @@ -275,4 +259,5 @@ public class IssueActions { return actionResult; } + } diff --git a/app/src/main/java/org/mian/gitnex/actions/LabelsActions.java b/app/src/main/java/org/mian/gitnex/actions/LabelsActions.java index eb0c340a..c020a977 100644 --- a/app/src/main/java/org/mian/gitnex/actions/LabelsActions.java +++ b/app/src/main/java/org/mian/gitnex/actions/LabelsActions.java @@ -23,9 +23,7 @@ public class LabelsActions { public static void getCurrentIssueLabels(Context ctx, String repoOwner, String repoName, int issueIndex, List currentLabelsIds) { - Call> callSingleIssueLabels = RetrofitClient - .getApiInterface(ctx) - .issueGetLabels(repoOwner, repoName, (long) issueIndex); + Call> callSingleIssueLabels = RetrofitClient.getApiInterface(ctx).issueGetLabels(repoOwner, repoName, (long) issueIndex); callSingleIssueLabels.enqueue(new Callback<>() { @@ -59,11 +57,10 @@ public class LabelsActions { }); } - public static void getRepositoryLabels(Context ctx, String repoOwner, String repoName, List