Commit Graph

27 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
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 23df83110d Port app to M3 (Material You) (#1181)
There are not any functinality changes except more of UI changes which comes with M3. There are still few things left but that are not there yet from Google side.

I will be merging this PR as it does not break any function but attaching a few screenshots if you would like to know how it looks like. Feel free to build from `main` to test it out.

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1181
2022-08-07 21:34:02 +02:00
qwerty287 6a84e4d897 Extend CI workflows (#1155)
Extend CI workflows (-> https://codeberg.org/gitnex/GitNex/issues/1099)
	1. pull translations and push them again on every pull
       @mmarif this needs the secrets and `BOT_TOKEN`
       the code for this comes from tea4j-autodeploy
    2. add a **template** for a check workflow which only does some static checks right now. It is disabled because it requires some investigation and discussion on how we should deal with these issues. The checks are currently (if we would enable it):
    	1. check code style and formatting according to the project file in `.idea/`
        2. make sure every Java file has an `@author` annotation

I would wait until you reviewed with enabling them because we have to reformat all the files which results in changes with a few thousand changed lines (tried this once).

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

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/1155
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-07-29 14:08:44 +02:00
qwerty287 7d6a92b5a8 TinyDB cleanups (#1122)
* never save a string from settings, fetch this from the list
* remove some unused methods which are
	* not native (saving `double` values) or
    * we should not use (saving `List`s or `Object`s
* fix some Javadoc comments

Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1122
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-04 19:02:56 +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
M M Arif 1e7a0a20b2 Show labels in list / show draft status for release (#1083)
Closes #258
Closes #877

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1083
2022-03-28 19:57:47 +02:00
qwerty287 fea6457358 Add system theme (#1095)
* Add new themes `Follow system (Light/Dark)` (new default) and `Follow system (Light/Pitch Black)` that follows system color scheme -> closes https://codeberg.org/gitnex/GitNex/issues/961
* also fixes `In Settings ->Appearance, the theme and time shows wrong values. Also the time selection is not shown upon theme change.` in https://codeberg.org/gitnex/GitNex/issues/1084

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/1095
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-27 20:47:08 +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 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 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 5544ae4248 Add option to change times that are used to switch to light/dark theme (#932)
### Describe what your pull request does and which issue you’re targeting
Closes #928

This allows to select the time to switch between themes. The mentioned color/contrast problem with the time selection isn't fixed. I also simplified the settings code (0fe854fd49). And with [this](a590f5bc4c) GitNex hides the two options to change the time if your theme isn't `Auto (Light/Dark)` or `Auto (Retro/Dark)`. I could apply this also to the notifications settings, that means that the advanced settings for notifications (polling delay, light...) are hidden if the notifications aren't enabled.

this is ready to review/merge
<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: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/932
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-02 18:59:30 +02:00
qwerty287 b97fa45b18 Move settings arrays to resources (#924)
### Describe what your pull request does and which issue you’re targeting
<!-- Create a new issue, if it doesn't exist yet -->
Closes #920
<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: qwerty287 <ndev@web.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/924
Reviewed-by: opyale <opyale@noreply.codeberg.org>
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-06-05 16:07:05 +02: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
opyale a26737e510 Rewriting deprecated code and adding view bindings to all fragments and activities. (#809)
Remove jetbrain import

Merge branch 'master' into deprecations

View bindings #3

View bindings #2

View bindings #1

Rewriting deprecated code.

Co-authored-by: M M Arif <mmarif@swatian.com>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/809
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 16:10:31 +01:00
M M Arif a6e97a1b36 Add new theme - Pitch Black (#787)
update drawables

Add new theme - Pitch Black

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/787
Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-11-29 22:51:35 +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 5fc6cdde63 New Retro theme (#654)
New Retro theme

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/654
2020-08-20 18:21:55 +02:00
M M Arif 7dd231ee95 Set notifications as home srceen (#644) 2020-08-12 09:31:39 +02:00
M M Arif 12a7b6040b App wide UI changes and refactors (#630)
Enhance and update the buttons across the app, colorful animation on tap

update toasty in view models

update toasty in fragments

update toasty in actions, activities, adapters

Alert dialogs buttons arrangements

strings fixes

switch to fab buttons

remove snackbar

Enhance whole app UI, bring consistency among the elements

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/630
2020-08-06 17:16:51 +02:00
M M Arif 30921ea330 Multiple accounts support (#624)
Title update

Color clean up

switch to another account and update the token at login

Add new account

Add fab button for new account and activity

update libs

Remove account from Manage accounts list

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/624
Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-08-04 22:50:04 +02:00
M M Arif 26f54280a1 Add explore and drafts to set as home screen options (#588)
Fix icon cut off sizes

Add explore and drafts to set as home screen options

Co-authored-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/588
Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-19 12:05:08 +02:00
opyale 500dc019c1 Moving TinyDB and AppUtil to helpers. (#579)
Moving TinyDB and AppUtil to helpers.

Co-authored-by: opyale <opyale@noreply.gitea.io>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/579
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
2020-07-07 19:15:01 +02:00
M M Arif e267aa5100 Show archived repo message (#530)
Implement archived repo in all adapters

Merge branch 'archive-repo2' into archive-repo

Fix typos

Fixing gravity.

Restoring old names.

Design changes.

Adjusting sizing.

Improving design of archived message.

Show archived repo message and other fixes

Co-authored-by: M M Arif <mmarif@swatian.com>
Co-authored-by: opyale <opyale@noreply.gitea.io>
Reviewed-by: opyale <opyale@noreply.codeberg.org>
2020-06-06 21:41:19 +02:00
6543 c41ab845fd Refactor Context (#469)
Merge branch 'master' into fix-refactor-context

reorder + space

fix

R E F A C T O R

set ctx and appCtx in LoginActivity

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/469
Reviewed-by: M M Arif <mmarif@swatian.com>
Reviewed-by: opyale <opyale@noreply.gitea.io>
2020-04-28 13:47:25 +00:00
M M Arif 48abe71645 Split settings screen into different sections (#457)
add reports section

Add translation, fix change lang bug not taking affect

Add security section

Add file viewer section

Change settings screen into different sections

Co-authored-by: 6543 <6543@noreply.gitea.io>
Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/457
Reviewed-by: 6543 <6543@noreply.gitea.io>
2020-04-26 13:36:33 +00:00