Commit Graph

29 Commits

Author SHA1 Message Date
qwerty287 325560c08d Use Gradle-native formatter (#1208)
Run `gradle :app:spotlessApply` to apply formatting.

# Changes from current code format

This does not match with the old intellij based code format because I can't apply some rules there.
- newlines after `else`, `catch` etc. (means there are `} else {` statements)
- no spaces around `if` braces (there are statements like `if (true) {` instead of `if(true) {`

Closes https://codeberg.org/gitnex/GitNex/issues/1187
Closes https://codeberg.org/gitnex/GitNex/issues/1202

Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1208
Reviewed-by: 6543 <6543@obermui.de>
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-09-21 07:43:00 +02:00
M M Arif 8c1b07c2c8 Timeline issue/pr (#1201)
Closes #953

Co-authored-by: M M Arif <mmarif@swatian.com>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1201
Reviewed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-09-14 20:40:44 +02:00
qwerty287 a7d9918b67 Format files (#1179)
use https://codeberg.org/qwerty287/woodpecker-intellij-formatter

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1179
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-08-15 16:26:02 +02:00
M M Arif e5f7975109 Wiki link handler (#1186)
Closes #1163

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1186
Reviewed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-08-15 09:57:07 +02:00
M M Arif 8975d5c7ca Fix intent (#1147)
Fix intent as requested by @qwerty287 in discord.

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1147
2022-05-21 13:39:23 +02:00
qwerty287 6916989ec1 Some fixes and cleanups for PRs (#1146)
1. improve menu time (show when loading finished)
2. fix crashes from deleted forks

I mainly tried to fix issue https://codeberg.org/gitnex/GitNex/issues/1137, but:
1. the missing UI options are Gitea's issue (the permission values are not correct when using notification endpoints)
2. the comments crash is an `SQLiteConstraintException` which we had already in #1084 but it seems that it wasn't fixed

Closes https://codeberg.org/gitnex/GitNex/issues/1137 closes https://codeberg.org/gitnex/GitNex/issues/1144

Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1146
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-05-21 11:38:15 +02:00
qwerty287 fbe55035f2 Move to tea4j-autodeploy (#1088)
Move to https://codeberg.org/GitNex/tea4j-autodeploy as Retrofit interfaces. Closes #907 closes #1084

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/1088
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-04-18 09:10:54 +02:00
qwerty287 7e514041bb Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.

### How is this working

Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after c9172f85ef, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes

Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues

Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
qwerty287 ea30556844 Add single commit screen with diff (#1048)
Also addresses the already closed #946

Closes https://codeberg.org/gitnex/GitNex/issues/335

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/1048
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-09 12:52:34 +01:00
qwerty287 8cfd4b6a31 Hide actions if the user can't use them (#977)
closes #919

TODO

- [X] repo and file actions (create release, label...)
	- [X] allow for repo admins
- [x] label actions (edit, delete)
	- [x] allow for repo admins
- [X] issue/pr action that are available for creators (close...)
	- [X] allow for creator
    - [X] allow for repo admins
- [x] pr actions that are allowed when having push access to pr source (there was a bug in Gitea that makes that this was not working and these features were not accessible -> https://github.com/go-gitea/gitea/issues/17181)
    - [x] allow deleting of head branch/updates only if you can do this
- [x] issue/pr action that are available for repo admins (merge)
    - [x] allow for repo admins
- [x] milestone actions (close/reopen)
    - [x] allow for repo admins
- [x] comment actions (delete, edit...)
	- [X] allow for creators
    - [x] allow for repo admins
- [x] org actions (create label, team, repo; req gitea 1.16.0)
- [x] actions when creating/editing issues
- [x] delete head when merging
- [x] All actions available to instance admins? (handled through API)

Maybe as extras:
- [x] Allow close/reopen also for PRs
- [x] Improve handling of these (multiple btns for the same action)

Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/977
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-02-11 15:27:31 +01:00
qwerty287 c378588a6d Switch to qwerty287/Prism4j (#1030)
* use qwerty287/Prism4j and qwerty287/markwonprism4j
* use androidx nullability annotations instead of jetbrains ones (were included in old prism4j lib)
* update some dependencies
* I had to update the SDK versions because the markwon plugin seems to be not compatible with older ones - I hope that's fine

Closes #853

Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1030
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-02-09 21:06:13 +01:00
qwerty287 23704e62d8 Allow clicks on submodules and symlinks (#1018)
Allows clicks on submodules and symlinks in the file browser.
Symlinks opens the file viewer which will view the link target (same behavior as Gitea)
Submodules will redirect to the repository from where they are

Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1018
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-01-01 00:46:10 +01:00
qwerty287 5550c153f2 Add support for custom tabs and improve various things (#1019)
Adds support for Custom Tabs (at laest supported by Chrome and Firefox).
This is also useful if you set the app as default app for links from the supported Gitea instances.
If you then try to use the "Open in browser" buttons, this will just open the link in GitNex itself.
With Custom Tabs, the links are opened as Custom Tabs (only if the default browser supports them).
I also deleted the unused `OpenRepoInBrowserActivity` and added the mechanism to open an URL in the browser to the `AppUtil`.

I also improved the setting switches:
* hide settings if required settings are disabled (only notification settings)
* allow click on full layouts

Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1019
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2021-12-17 20:56:12 +01:00
qwerty287 2659d87bbe Re-enable single release handler (#974)
Was disabled in #958 due to crashes related to this. This re-enables it but fixes the crashes.
Also adresses #955

- [X] I carefully read the [contribution guidelines](https://codeberg.org/GitNex/GitNex/src/branch/main/CONTRIBUTING.md).
- [X] I'm following the code standards as defined [here](https://codeberg.org/gitnex/GitNex/wiki/Code-Standards).
- [X] 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).

Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/974
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2021-09-02 08:07:11 +02:00
M M Arif e0ff35d530 [BUG] Releases should come before release tag (#958)
As title

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/958
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-committed-by: M M Arif <mmarif@noreply.codeberg.org>
2021-08-15 19:36:12 +02:00
qwerty287 f88a2df749 Enable user link handler and fix click on users in admin section (#957)
addresses #955
This pr does the following:
1. enables the users link handler
2. it allows clicks on the full `itemView` in the admin users section (related to https://codeberg.org/gitnex/GitNex/pulls/931#issuecomment-211296)

- [X] I carefully read the [contribution guidelines](https://codeberg.org/GitNex/GitNex/src/branch/main/CONTRIBUTING.md).
- [X] I'm following the code standards as defined [here](https://codeberg.org/gitnex/GitNex/wiki/Code-Standards).
- [X] 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).

Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/957
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2021-08-11 14:47:31 +02:00
qwerty287 36f20bb1aa Add more link handlers (#948)
I can't implement every handler correctly, if there are no views that display them (e.g. a single milestone or release)

- [X] Organization #915
- [X] Milestones
- [X] Milestone
- [X] New milestone
- [X] Files
- [ ] Lines *currently opens file viewer*
- [X] Folders/directory's
- [X] Branches list
- [X] Branches
- [X] Releases
- [X] Release
- [X] new Release
- [X] Labels
- [X] Explore (orgs/repos)
- [X] Commits list
- [X] New issue
- [ ] Issue comments *currently opens the issue details*
- [X] New PR
- [ ] PR comments *currently opens the PR details*
- [X] PR diff
- [X] Your user profile
- [ ] User profiles *blocked by #931*
- [X] Gitea administration
- [X] Notifications
- [X] repository settings (only for repo admins)
- [X] Login screen

Commits: not possible, Gitea's API doesn't provide enough information to view the correct branch in the list and/or to display the diff.

Closes #918
Closes #915

Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/948
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2021-07-23 17:41:19 +02:00
qwerty287 0e696eb46f 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>
2021-07-09 17:36:59 +02:00
opyale d72f097012 Implement multi-session notification polling and additional improvements/refactors/cleanups/fixes (#875)
Merge branch 'master' of https://codeberg.org/gitnex/GitNex into notifications-performance-improvements

 Conflicts:
	app/src/main/java/org/mian/gitnex/adapters/DraftsAdapter.java
	app/src/main/java/org/mian/gitnex/adapters/NotificationsAdapter.java
	app/src/main/java/org/mian/gitnex/adapters/UserAccountsAdapter.java
	app/src/main/java/org/mian/gitnex/adapters/UserAccountsNavAdapter.java
	app/src/main/res/layout/bottom_sheet_repository_in_list.xml
	app/src/main/res/layout/list_files.xml

Merge branch 'master' into notifications-performance-improvements

Merge branch 'master' into notifications-performance-improvements

Merge branch 'master' of https://codeberg.org/gitnex/GitNex into notifications-performance-improvements

 Conflicts:
	app/src/main/res/values-it/strings.xml

Add ripple effect to buttons.

Run syntax highlighting on separate thread. (#859)

Initial commit.

Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/875
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
Co-Authored-By: opyale <opyale@noreply.codeberg.org>
Co-Committed-By: opyale <opyale@noreply.codeberg.org>
2021-04-13 20:56:50 +02:00
M M Arif afffb7c15a Switch to proper account for popular instances and other ui improvements (#836)
* improve navigation via keyboard

* switch to proper account for popular instances

* ui improvements

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/836
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-Authored-By: M M Arif <mmarif@noreply.codeberg.org>
Co-Committed-By: M M Arif <mmarif@noreply.codeberg.org>
2021-02-25 00:22:11 +01:00
opyale d8a14105c9 Fixing and improving scaling of images, improving performance by doing work that has to be done once only once and using different terminology. (#831)
remove unknown case for editing

Improve var names and code formatting

Minor improvements.

Restoring ACRA functionality.

Fixing and improving scaling of images, improving performance by doing work that has to be done once only once and using different terminology.

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/831
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
Co-Authored-By: opyale <opyale@noreply.codeberg.org>
Co-Committed-By: opyale <opyale@noreply.codeberg.org>
2021-02-13 20:31:38 +01:00
opyale eb858f3535 Moving ApiInterface, WebInterface and models to different repository. (#824)
Gradle v6.8.2

Use release instead of commit hash.

Moving ApiInterface, WebInterface and models to different repository.

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/824
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
Co-Authored-By: opyale <opyale@noreply.codeberg.org>
Co-Committed-By: opyale <opyale@noreply.codeberg.org>
2021-02-11 11:23:35 +01:00
opyale 093204df43 Fixing layout issues and crashes. (#810)
Fixing layout issues and crashes.

Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/810
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
Co-Authored-By: opyale <opyale@noreply.codeberg.org>
Co-Committed-By: opyale <opyale@noreply.codeberg.org>
2021-01-26 18:43:25 +01:00
M M Arif a170c10e43 Improve deeplinks (#769)
Change to mainIntent

Add commit to deep links

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/769
2020-11-13 16:04:14 +01:00
M M Arif 87379ae0b2 Refactor deeplinks (#762)
Minor improvements.

refactor deeplinks

Add popular instances taken from #758

Co-authored-by: opyale <opyale@noreply.codeberg.org>
Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/762
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Reviewed-by: opyale <opyale@noreply.codeberg.org>
2020-11-02 18:01:06 +01:00
opyale a3bd5c2af2 Increasing performance, fixing bugs and adding syntax highlighting. (#755)
Merge branch 'performance-highlight-refactor' of https://codeberg.org/opyale/GitNex into performance-highlight-refactor

Fixing theme recognition.

Merge branch 'master' into performance-highlight-refactor

Merge commit 'refs/pull/755/head' of codeberg.org:gitnex/GitNex into performance-highlight-refactor

Add new field issueType to db

Improving theme recognition.

Fixing alignment of menu button.

Fixing cut off text.

Merge commit 'refs/pull/755/head' of codeberg.org:gitnex/GitNex into performance-highlight-refactor

Fixing crash.

Refactoring activities.

Improving drafts.

Calculating density for avatars.

Improving drafts.

Calculating density for avatars.

Increasing size of avatar.

Decreasing size of avatar.

Restoring DeepLinksActivity

Merge branch 'master' of https://codeberg.org/gitnex/GitNex into performance-highlight-refactor

 Conflicts:
	app/src/main/java/org/mian/gitnex/adapters/IssueCommentsAdapter.java

Initial commit.

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/755
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
2020-11-02 16:17:00 +01:00
M M Arif f64e23dcc1 Enhance settings screen and make it translation ready (#735)
Merge branch 'master' into enhance-settings-screen

# Conflicts:
#	app/src/main/java/org/mian/gitnex/activities/FileViewActivity.java

Cleanup and refactor of activities

Fix bottomsheet

enhance code blocks and refactors

Move home screen to general, make it ready for translation

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/735
2020-10-29 14:13:19 +01:00
M M Arif 65c0ecaad1 Fix deep links (#743)
Fix opening links

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/743
Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-10-29 00:21:47 +01:00
M M Arif 8e86fa668d Handle popular links (#730)
Fix settings layout

Merge branch 'master' into deeplinks

Support for all links, check gitea instance, add progress indicator

Enhance account checks, improve the experience of coming from links

Merge branch 'master' into deeplinks

Update libs

Minor layout fixes

gradle update

Fix show/hide views

Handle pr, repos. Handle settings for no action.

open issue from link

Add new settings section translation ready - General for generic settings

wip on handle popular links

Co-authored-by: M M Arif <mmarif@swatian.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: 6543 <6543@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/730
2020-10-23 20:13:13 +02:00