Commit Graph

16 Commits

Author SHA1 Message Date
M M Arif 76f8f49cdf Code improvements 2024-03-28 17:02:17 +05:00
M M Arif 51d0e31adc Show org fullname and other improvements (#1324)
Closes #1323

Closes #1319

Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1324
Co-authored-by: M M Arif <mmarif@swatian.com>
Co-committed-by: M M Arif <mmarif@swatian.com>
2024-02-22 14:38:21 +00:00
DrMaxNix 163b780f0b Improve api version code validation (#1303)
### Describe what your pull request does and which issue you’re targeting
This PR improves the validation of the version code received from the api.
Closes #1287
<br><br>

<!-- Make sure you are targeting the "main" branch, pull requests on release branches are only allowed for bug fixes. -->

- [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: DrMaxNix <git@drmaxnix.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1303
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: DrMaxNix <mail@drmaxnix.de>
Co-committed-by: DrMaxNix <mail@drmaxnix.de>
2023-09-24 11:38:23 +00:00
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
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
Fettlaus 4a3397766f Add fallback for missing version information in database (#1175)
### Describe what your pull request does and which issue you’re targeting
As described in #1174 the app crashes if a bogus version (empty string) is stored in the database. In case of an empty version information in the database, the fallback should be to gracefully treat this as a version 0. This way every check for a "version greater than" fails.

After all the version information will be updated from the server anyways.
<br>
fixes #1174
<br>
- [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: Fettlaus <mail@fettlaus.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1175
Reviewed-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-authored-by: Fettlaus <fettlaus@noreply.codeberg.org>
Co-committed-by: Fettlaus <fettlaus@noreply.codeberg.org>
2022-07-28 16:23:33 +02:00
qwerty287 884054b772 Fix version check (#1131)
It used a TinyDB value which is empty, of course.

Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1131
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-15 13:12:36 +02:00
qwerty287 685844d41f Fix invalid version detection (#1116)
Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1116
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-30 13:47:15 +02:00
qwerty287 269f1fb32b Various refactoring (#1115)
Various refactoring to simplify code. See separate commit for the refactorings.

~~Note to the font refactoring: it didn't work for me. The font was always `Manrope`. I don't know why - the issue is the FontsOverride.setDefaultFont` method, however, how this works hasn't changed. Maybe it was an issue with my device, could you please test it?~~

Also closes #1110 and closes #1073

Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1115
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>
2022-04-25 07:42:52 +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
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
6543 d677c90b01 helper Version: add valid() function (#670)
Merge branch 'master' into VersionValid

format code

introduce Version.valid()

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/670
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
2020-09-04 16:33:37 +02:00
6543 8a7923cba7 Fix VersionCheck (#591)
code dedub

Bugfix & Test Correction

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/591
Reviewed-by: opyale <opyale@noreply.codeberg.org>
2020-07-14 18:20:00 +02:00
6543 f21f23c1f0 Refactor FileDiffActivety (#537)
use androidx @NonNull instead of jetbrains @NotNull

Merge branch 'master' into refactor_FileDiffActivity

code format corrections

Merge branch 'master' into refactor_FileDiffActivity

add Unit TESTs for ParseDiff.getFileDiffViewArray

add get methods

make rm/add similar to gitea stats

calc diff stat based on diff itself

rename getFileContents -> toString

fix empty content bug & add comments

format AppUtil.java

rm unused

working version

skip binary files for now ... [DONT CRASH]

better regex

format FileDiffView.java

rename toolbar_title -> toolbarTitle

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
2020-06-11 15:31:11 +02:00
6543 ad7c3696d5 [BugFix] Version Compare (#500)
BugFix of Version

add new TestCase

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/500
Reviewed-by: M M Arif <mmarif@swatian.com>
2020-05-21 14:13:14 +00:00
6543 3de4dd9463 Refactor Version Checks (#472)
Merge branch 'master' into refactor-versionCheck

Merge branch 'master' into refactor-versionCheck

Revert "test CI"

This reverts commit b56eff0920.

test CI

Reformat LoginActivity.java

cleanup

migrate

Working + Tests

add first UnitTest

wip ...

enum2class

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/472
Reviewed-by: M M Arif <mmarif@swatian.com>
2020-05-17 16:14:06 +00:00