Compare commits

...

26 Commits

Author SHA1 Message Date
Shihaam Abdul Rahman
b2604c1650 added mine and athafans domains 2021-11-04 23:20:31 +05:00
M M Arif
a4dee6a179 Update readme (#1013)
Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1013
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-committed-by: M M Arif <mmarif@noreply.codeberg.org>
2021-11-01 09:15:55 +01:00
M M Arif
8d69c7b9ce Update CI (#1012)
Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1012
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-committed-by: M M Arif <mmarif@noreply.codeberg.org>
2021-11-01 09:11:10 +01:00
M M Arif
367380921f Update CI (#1011)
Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1011
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-committed-by: M M Arif <mmarif@noreply.codeberg.org>
2021-11-01 08:00:52 +01:00
qwerty287
471889f744 Fix CI (#1010)
* replace docker image with newer version (tested locally, `curl` and `apksigner` are available)
* update the container before signing. This is necessary because `curl` is outdated, but can be updated via `apt` (tested locally, working **only** after update)

I hope this way is fine, I don't really anything about docker and just tried to fix it :)

Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1010
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-10-31 21:26:08 +01:00
qwerty287
84551ca8be Split issue templates (#999)
Split the issue templates into `Bug`, `Feature` and `Suggestion`.

Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/999
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-10-24 14:55:48 +02:00
qwerty287
b4d08a6733 Improve behavior of Android's back button in file browser (#1006)
Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1006
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-10-24 12:17:54 +02:00
qwerty287
2cf702982a Fix crash on issue search (#1005)
Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1005
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-10-24 12:10:22 +02:00
qwerty287
65ca86847f Update README (#1004)
* fix typo
* remove link to archived website repo
* change `F-droid` to `F-Droid`

Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1004
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2021-10-20 18:12:05 +02:00
M M Arif
64b9b07a9e CI (#998)
Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/998
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-committed-by: M M Arif <mmarif@noreply.codeberg.org>
2021-10-14 21:20:27 +02:00
M M Arif
d5cf4295bd Check CI (#997)
As title

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/997
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-committed-by: M M Arif <mmarif@noreply.codeberg.org>
2021-10-14 20:40:51 +02:00
M M Arif
8b0e3ee53d Kick start 4.2.0 (#996)
As title

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/996
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-committed-by: M M Arif <mmarif@noreply.codeberg.org>
2021-10-14 17:08:17 +02:00
Epsilon_02
a2cf46a896 Fix newline glitch on issue description. (#995)
### Describe what your pull request does and which issue you’re targeting
A single newline did not work in the description. Only with two newlines they are shown but now as two newlines.
<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: Epsilon_02 <epsilon_02+codeberg@mailbox.org>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/995
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: Epsilon_02 <epsilon_02@noreply.codeberg.org>
Co-committed-by: Epsilon_02 <epsilon_02@noreply.codeberg.org>
2021-10-14 17:04:08 +02:00
M M Arif
495c9b4179 Prepare release 4.1.0 (#994)
Closes #978

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/994
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-committed-by: M M Arif <mmarif@noreply.codeberg.org>
2021-10-12 18:39:45 +02:00
6543
122c5c068d Crowdin 2021-10-06 (#991)
as title

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/991
Reviewed-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-authored-by: 6543 <6543@noreply.codeberg.org>
Co-committed-by: 6543 <6543@noreply.codeberg.org>
2021-10-06 17:13:50 +02:00
M M Arif
a08cf13382 Render md in org/repo info (#986)
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-committed-by: M M Arif <mmarif@noreply.codeberg.org>
2021-10-05 17:16:22 +02:00
qwerty287
ba930021e7 Allow nav from issue to repo when coming from explore/notifications (#988)
Adds the navigation to explore/notifications too
closes #747

Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/988
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-10-04 21:08:34 +02:00
qwerty287
6d9a64596f Center icons (#987)
As discussed in Discord

Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/987
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-10-04 21:07:57 +02:00
M M Arif
22cd23525e Explore users (#972)
Closes #960

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/972
Reviewed-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-committed-by: M M Arif <mmarif@noreply.codeberg.org>
2021-10-04 15:35:34 +02:00
M M Arif
f4cd3c9a4d Refactors and clean up (#979)
Related #278

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/979
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-committed-by: M M Arif <mmarif@noreply.codeberg.org>
2021-09-29 11:29:39 +02:00
M M Arif
b493dfc567 Filter issues by milestone (#980)
Closes #693

Right now I like how the API(filters) is for issues, for PRs it is only accepting Ids. It should be more like issues which has optional titles and more forgiving.

Maybe in the future will implement for PRs when the API become updated.

Issues:
https://codeberg.org/api/swagger#/issue/issueListIssues

PR:
https://codeberg.org/api/swagger#/repository/repoListPullRequests

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/980
Reviewed-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-committed-by: M M Arif <mmarif@noreply.codeberg.org>
2021-09-28 11:10:27 +02:00
qwerty287
95aea16a07 Add option to update PR (#973)
### Describe what your pull request does and which issue you’re targeting
<!-- Create a new issue, if it doesn't exist yet -->
Closes #967
<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/973
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-14 16:18:28 +02:00
qwerty287
77d1d448ba Fix visibility of "Mark as read" button (#975)
### Describe what your pull request does and which issue you’re targeting
<!-- Create a new issue, if it doesn't exist yet -->
Closes #970
<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/975
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:52:18 +02: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
qwerty287
3a38e4d7d5 Add options to follow and unfollow users (#971)
### Describe what your pull request does and which issue you’re targeting
<!-- Create a new issue, if it doesn't exist yet -->
Adds options to follow and unfollow users. Closes #968
<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/971
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-31 09:33:26 +02:00
M M Arif
244dc12fc3 Kick start 4.1.0 (#966)
As title

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/966
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-committed-by: M M Arif <mmarif@noreply.codeberg.org>
2021-08-24 21:29:34 +02:00
115 changed files with 2948 additions and 1702 deletions

View File

@ -1,22 +1,22 @@
## # What do you want to address?
<!-- This step is required; examples are shown below -->
---
- [ ] Bug
- [ ] Feature
- [ ] Suggestion
name: "Bug"
about: "Something isn't working"
labels:
- Bug
---
## # Describe your matter briefly
<!-- This step is required. -->
<br><br>
##### What did you expect? <!-- Useful when addressing bugs -->
##### What did you expect?
---
<!-- This step is optional. -->
<br><br>
##### Some additional details <!-- Useful, when we are trying to reproduce a bug -->
##### Some additional details
---
<!-- This step is optional; an example is shown below -->
* The version of **Gitea** you are using:
* The version of **GitNex** you are using:
@ -34,4 +34,4 @@
- [ ] I carefully read the [contribution guidelines](https://codeberg.org/GitNex/GitNex/src/branch/main/CONTRIBUTING.md).
<br>
#### Thank you for your time.
<!-- Thank you for your time. -->

View File

@ -0,0 +1,17 @@
---
name: "Feature"
about: "A new feature or an enhancement to an existing feature"
labels:
- Feature
---
## # Describe your matter briefly
<br><br>
- [ ] I carefully read the [contribution guidelines](https://codeberg.org/GitNex/GitNex/src/branch/main/CONTRIBUTING.md).
<br>
<!-- Thank you for your time. -->

View File

@ -0,0 +1,37 @@
---
name: "Suggestion"
about: "A general suggestion"
labels:
- Suggestion
---
## # Describe your matter briefly
<br><br>
##### What did you expect?
---
<br><br>
##### 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):
<br>
##### We would appreciate some screenshots or stacktrace's, but this is also not required.
---
<!-- Screenshots and stacktrace's can go here. -->
<br><br>
- [ ] I carefully read the [contribution guidelines](https://codeberg.org/GitNex/GitNex/src/branch/main/CONTRIBUTING.md).
<br>
<!-- Thank you for your time. -->

View File

@ -17,7 +17,7 @@ on_setup:
- ./scripts/add-commit-status.sh
build:
image: nextcloudci/android:android-54
image: nextcloudci/android8:android-61
stage: build
only:
- main
@ -30,7 +30,7 @@ build:
expire_in: 15 minutes
sign:
image: nextcloudci/android:android-54
image: nextcloudci/android8:android-61
stage: sign
only:
- main

View File

@ -1,6 +1,6 @@
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Pipeline status](https://img.shields.io/gitlab/pipeline/opyale/gitnex/main)](https://gitlab.com/opyale/gitnex/-/pipelines) [![Release](https://img.shields.io/badge/dynamic/json.svg?label=release&url=https://codeberg.org/api/v1/repos/gitnex/GitNex/releases&query=$[0].tag_name)](https://codeberg.org/gitnex/GitNex/releases) [![Crowdin](https://badges.crowdin.net/gitnex/localized.svg)](https://crowdin.com/project/gitnex) [![Join the Discord chat at https://discord.gg/FbSS4rf](https://img.shields.io/discord/632219664587685908.svg)](https://discord.gg/FbSS4rf)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Pipeline status](https://img.shields.io/gitlab/pipeline/mmarif4u/gitnex-ci/main)](https://gitlab.com/mmarif4u/gitnex-ci/-/pipelines) [![Release](https://img.shields.io/badge/dynamic/json.svg?label=release&url=https://codeberg.org/api/v1/repos/gitnex/GitNex/releases&query=$[0].tag_name)](https://codeberg.org/gitnex/GitNex/releases) [![Crowdin](https://badges.crowdin.net/gitnex/localized.svg)](https://crowdin.com/project/gitnex) [![Join the Discord chat at https://discord.gg/FbSS4rf](https://img.shields.io/discord/632219664587685908.svg)](https://discord.gg/FbSS4rf)
[<img alt="Become a Patroen" src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" height="40"/>](https://www.patreon.com/mmarif)
[<img alt="Become a Patreon" src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" height="40"/>](https://www.patreon.com/mmarif)
# GitNex - Android client for Gitea
@ -9,7 +9,7 @@ GitNex is a free/paid, open-source Android client for Git repository management
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
[<img alt='Get it on F-droid' src='https://gitlab.com/fdroid/artwork/raw/master/badge/get-it-on.png' height="80"/>](https://f-droid.org/en/packages/org.mian.gitnex/)
[<img alt='Get it on F-Droid' src='https://gitlab.com/fdroid/artwork/raw/master/badge/get-it-on.png' height="80"/>](https://f-droid.org/en/packages/org.mian.gitnex/)
[<img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png' height="80"/>](https://play.google.com/store/apps/details?id=org.mian.gitnex.pro)
[<img alt='Download builds and releases' src='https://codeberg.org/gitnex/GitNex/raw/branch/main/assets/apk-badge.png' height="82"/>](https://cloud.swatian.com/s/DN7E5xxtaw4fRbE)
@ -57,8 +57,6 @@ We use [Crowdin](https://crowdin.com/project/gitnex) for translation. If your la
[Wiki](https://codeberg.org/gitnex/GitNex/wiki/Home)
[Website Repository](https://gitlab.com/mmarif4u/gitnex-website)
[Troubleshoot Guide](https://codeberg.org/gitnex/GitNex/wiki/Troubleshoot-Guide)
[Faq](https://codeberg.org/gitnex/GitNex/wiki/FAQ)

View File

@ -6,8 +6,8 @@ android {
applicationId "org.mian.gitnex"
minSdkVersion 21
targetSdkVersion 30
versionCode 400
versionName "4.0.0"
versionCode 415
versionName "4.2.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
@ -62,8 +62,8 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.4.0-alpha03'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.viewpager2:viewpager2:1.1.0-alpha01'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version"
testImplementation 'junit:junit:4.13.2'
@ -109,7 +109,7 @@ dependencies {
implementation "androidx.work:work-runtime:$work_version"
implementation "io.mikael:urlbuilder:2.0.9"
implementation "org.codeberg.gitnex-garage:emoji-java:v5.1.2"
implementation "org.codeberg.gitnex:tea4j:1.0.16"
implementation "org.codeberg.gitnex:tea4j:1.0.24"
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5"
implementation 'androidx.biometric:biometric:1.1.0'
implementation 'com.github.chrisvest:stormpot:2.4.2'

View File

@ -88,7 +88,8 @@
<activity
android:name=".activities.MainActivity"
android:theme="@android:style/Theme.NoTitleBar"
android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|uiMode|keyboard|keyboardHidden|navigation">
android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|uiMode|keyboard|keyboardHidden|navigation"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@ -173,7 +174,8 @@
android:name=".activities.DeepLinksActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:noHistory="true"
android:launchMode="singleTask">
android:launchMode="singleTask"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
@ -187,6 +189,10 @@
<data android:host="code.obermui.de" />
<data android:host="git.fsfe.org" />
<data android:host="opendev.org" />
<data android:host="git.shihaam.dev" />
<data android:host="git.athfan.com" />
<data android:host="git.athfan.dev" />
</intent-filter>
</activity>

View File

@ -10,6 +10,7 @@ import org.mian.gitnex.helpers.Authorization;
import org.mian.gitnex.helpers.Toasty;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
/**
* Author qwerty287
@ -59,4 +60,43 @@ public class PullRequestActions {
});
}
public static void updatePr(Context context, String repoOwner, String repoName, String index, Boolean rebase) {
String strategy;
if(rebase == null) {
strategy = null;
}
else if(!rebase) {
strategy = "merge";
}
else {
strategy = "rebase";
}
RetrofitClient.getApiInterface(context).updatePullRequest(Authorization.get(context), repoOwner, repoName, Integer.parseInt(index), strategy)
.enqueue(new Callback<Void>() {
@Override
public void onResponse(@NonNull Call call, @NonNull Response response) {
if(response.isSuccessful()) {
Toasty.success(context, context.getString(R.string.updatePrSuccess));
}
else {
if(response.code() == 403) {
Toasty.error(context, context.getString(R.string.authorizeError));
}
else if(response.code() == 409) {
Toasty.error(context, context.getString(R.string.updatePrConflict));
}
else {
Toasty.error(context, context.getString(R.string.genericError));
}
}
}
@Override
public void onFailure(@NonNull Call call, @NonNull Throwable t) {
Toasty.error(context, context.getString(R.string.genericError));
}
});
}
}

View File

@ -81,7 +81,7 @@ public class AddCollaboratorToRepositoryActivity extends BaseActivity {
Call<UserSearch> call = RetrofitClient
.getApiInterface(appCtx)
.getUserBySearch(Authorization.get(ctx), searchKeyword, 10);
.getUserBySearch(Authorization.get(ctx), searchKeyword, 10, 1);
call.enqueue(new Callback<UserSearch>() {

View File

@ -143,7 +143,7 @@ public class AddNewAccountActivity extends BaseActivity {
.setMessage(getResources().getString(R.string.versionUnsupportedOld, version.getVersion())).setIcon(R.drawable.ic_warning)
.setCancelable(true);
alertDialogBuilder.setNegativeButton(getString(R.string.cancelButton), (dialog, which) -> {
alertDialogBuilder.setNeutralButton(getString(R.string.cancelButton), (dialog, which) -> {
dialog.dismiss();
});

View File

@ -110,7 +110,7 @@ public class AddNewTeamMemberActivity extends BaseActivity {
public void loadUserSearchList(String searchKeyword, String teamId) {
Call<UserSearch> call = RetrofitClient.getApiInterface(ctx).getUserBySearch(Authorization.get(ctx), searchKeyword, 10);
Call<UserSearch> call = RetrofitClient.getApiInterface(ctx).getUserBySearch(Authorization.get(ctx), searchKeyword, 10, 1);
mProgressBar.setVisibility(View.VISIBLE);

View File

@ -274,13 +274,14 @@ public class DeepLinksActivity extends BaseActivity {
goToRepoSection(currentInstance, instanceToken, data.getPathSegments().get(0), data.getPathSegments().get(1), "newRelease"), 500);
}
else if(data.getPathSegments().get(2).equals("releases")) { // releases
new Handler(Looper.getMainLooper()).postDelayed(() ->
goToRepoSection(currentInstance, instanceToken, data.getPathSegments().get(0), data.getPathSegments().get(1), "releases"), 500);
}
else if(data.getPathSegments().get(2).equals("releases") && data.getPathSegments().get(3).equals("tag") && data.getPathSegments().size() == 5) { // release
if(data.getPathSegments().size() == 5) {
if(data.getPathSegments().get(2).equals("releases") && data.getPathSegments().get(3).equals("tag")) {
repoIntent.putExtra("releaseTagName", data.getLastPathSegment());
new Handler(Looper.getMainLooper()).postDelayed(() ->
goToRepoSection(currentInstance, instanceToken, data.getPathSegments().get(0), data.getPathSegments().get(1), "releases"), 500);
}
}
new Handler(Looper.getMainLooper()).postDelayed(
() -> goToRepoSection(currentInstance, instanceToken, data.getPathSegments().get(0), data.getPathSegments().get(1),
"releases"), 500);
}
else if(data.getPathSegments().get(2).equals("labels")) { // labels
new Handler(Looper.getMainLooper()).postDelayed(() ->

View File

@ -1,7 +1,6 @@
package org.mian.gitnex.activities;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.Typeface;
@ -590,7 +589,7 @@ public class IssueDetailActivity extends BaseActivity implements LabelsListAdapt
String issueNumber_ = "<font color='" + ResourcesCompat.getColor(getResources(), R.color.lightGray, null) + "'>" + appCtx.getResources()
.getString(R.string.hash) + singleIssue.getNumber() + "</font>";
viewBinding.issueTitle.setText(HtmlCompat.fromHtml(issueNumber_ + " " + EmojiParser.parseToUnicode(singleIssue.getTitle()), HtmlCompat.FROM_HTML_MODE_LEGACY));
String cleanIssueDescription = singleIssue.getBody().trim();
String cleanIssueDescription = singleIssue.getBody().trim().replace("\n", "<br/>");
viewBinding.assigneeAvatar.setOnClickListener(loginId -> {
Intent intent = new Intent(ctx, ProfileActivity.class);

View File

@ -280,7 +280,7 @@ public class LoginActivity extends BaseActivity {
.setIcon(R.drawable.ic_warning)
.setCancelable(true);
alertDialogBuilder.setNegativeButton(getString(R.string.cancelButton), (dialog, which) -> {
alertDialogBuilder.setNeutralButton(getString(R.string.cancelButton), (dialog, which) -> {
dialog.dismiss();
enableProcessButton();

View File

@ -3,6 +3,7 @@ package org.mian.gitnex.activities;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
@ -15,23 +16,31 @@ import androidx.viewpager2.adapter.FragmentStateAdapter;
import androidx.viewpager2.widget.ViewPager2;
import com.google.android.material.tabs.TabLayout;
import com.google.android.material.tabs.TabLayoutMediator;
import com.google.gson.JsonElement;
import org.mian.gitnex.R;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.fragments.BottomSheetUserProfileFragment;
import org.mian.gitnex.fragments.profile.DetailFragment;
import org.mian.gitnex.fragments.profile.FollowersFragment;
import org.mian.gitnex.fragments.profile.FollowingFragment;
import org.mian.gitnex.fragments.profile.OrganizationsFragment;
import org.mian.gitnex.fragments.profile.RepositoriesFragment;
import org.mian.gitnex.fragments.profile.StarredRepositoriesFragment;
import org.mian.gitnex.helpers.Authorization;
import org.mian.gitnex.helpers.Toasty;
import java.util.Objects;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
/**
* Author M M Arif
*/
public class ProfileActivity extends BaseActivity {
public class ProfileActivity extends BaseActivity implements BottomSheetUserProfileFragment.BottomSheetListener {
private String username;
private boolean following;
@Override
public void onCreate(Bundle savedInstanceState) {
@ -94,8 +103,85 @@ public class ProfileActivity extends BaseActivity {
((TextView) tabViewChild).setTypeface(myTypeface);
}
}
if(!username.equals(tinyDB.getString("userLogin"))) {
checkFollowStatus();
}
}
}
@Override
public void onButtonClicked(String text) {
if(text.equals("follow")) {
followUnfollow();
}
}
private void checkFollowStatus() {
RetrofitClient.getApiInterface(this).checkFollowing(Authorization.get(this), username).enqueue(new Callback<JsonElement>() {
@Override
public void onResponse(@NonNull Call<JsonElement> call, @NonNull Response<JsonElement> response) {
if(response.code() == 204) {
following = true;
}
else if(response.code() == 404) {
following = false;
}
else {
following = false;
}
}
@Override
public void onFailure(@NonNull Call<JsonElement> call, @NonNull Throwable t) {
following = false;
}
});
}
private void followUnfollow() {
Call<JsonElement> call;
if (following) {
call = RetrofitClient.getApiInterface(this).unfollowUser(Authorization.get(this), username);
}
else {
call = RetrofitClient.getApiInterface(this).followUser(Authorization.get(this), username);
}
call.enqueue(new Callback<JsonElement>() {
@Override
public void onResponse(@NonNull Call<JsonElement> call, @NonNull Response<JsonElement> response) {
if (response.isSuccessful()) {
following = !following;
if (following) {
Toasty.success(ProfileActivity.this, String.format(getString(R.string.nowFollowUser), username));
}
else {
Toasty.success(ProfileActivity.this, String.format(getString(R.string.unfollowedUser), username));
}
} else {
if (following) {
Toasty.error(ProfileActivity.this, getString(R.string.unfollowingFailed));
}
else {
Toasty.error(ProfileActivity.this, getString(R.string.followingFailed));
}
}
}
@Override
public void onFailure(@NonNull Call<JsonElement> call, @NonNull Throwable t) {
if (following) {
Toasty.error(ProfileActivity.this, getString(R.string.unfollowingFailed));
}
else {
Toasty.error(ProfileActivity.this, getString(R.string.followingFailed));
}
}
});
}
public class ViewPagerAdapter extends FragmentStateAdapter {
@ -136,8 +222,21 @@ public class ProfileActivity extends BaseActivity {
finish();
return true;
}
else if(id == R.id.genericMenu) {
new BottomSheetUserProfileFragment(following).show(getSupportFragmentManager(), "userProfileBottomSheet");
return true;
}
else {
return super.onOptionsItemSelected(item);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
if(!username.equals(tinyDB.getString("userLogin"))) {
getMenuInflater().inflate(R.menu.generic_nav_dotted_menu, menu);
}
return super.onCreateOptionsMenu(menu);
}
}

View File

@ -1,10 +1,10 @@
package org.mian.gitnex.activities;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.graphics.Typeface;
@ -29,6 +29,7 @@ import androidx.viewpager.widget.ViewPager;
import com.google.android.material.tabs.TabLayout;
import com.google.gson.JsonElement;
import org.gitnex.tea4j.models.Branches;
import org.gitnex.tea4j.models.Milestones;
import org.gitnex.tea4j.models.UserRepositories;
import org.gitnex.tea4j.models.WatchInfo;
import org.mian.gitnex.R;
@ -70,6 +71,7 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
private FragmentRefreshListenerPr fragmentRefreshListenerPr;
private FragmentRefreshListenerMilestone fragmentRefreshListenerMilestone;
private FragmentRefreshListenerFiles fragmentRefreshListenerFiles;
private FragmentRefreshListenerFilterIssuesByMilestone fragmentRefreshListenerFilterIssuesByMilestone;
private String repositoryOwner;
private String repositoryName;
@ -441,6 +443,9 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
startActivity(new Intent(RepoDetailActivity.this, CreateFileActivity.class));
break;
case "filterByMilestone":
filterIssuesByMilestone();
break;
case "openIssues":
if(getFragmentRefreshListener() != null) {
@ -494,8 +499,73 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
}
}
private void filterIssuesByMilestone() {
Dialog progressDialog = new Dialog(this);
progressDialog.setContentView(R.layout.custom_progress_loader);
progressDialog.show();
Call<List<Milestones>> call = RetrofitClient
.getApiInterface(ctx)
.getMilestones(Authorization.get(ctx), repositoryOwner, repositoryName, 1, 50, "open");
call.enqueue(new Callback<List<Milestones>>() {
@Override
public void onResponse(@NonNull Call<List<Milestones>> call, @NonNull Response<List<Milestones>> response) {
progressDialog.hide();
if(response.code() == 200) {
Milestones milestones;
List<String> milestonesList = new ArrayList<>();
int selectedMilestone = 0;
assert response.body() != null;
milestonesList.add("All");
for(int i = 0; i < response.body().size(); i++) {
milestones = response.body().get(i);
milestonesList.add(milestones.getTitle());
}
for(int j = 0; j < milestonesList.size(); j++) {
if(tinyDB.getString("issueMilestoneFilterId").equals(milestonesList.get(j))) {
selectedMilestone = j;
}
}
AlertDialog.Builder pBuilder = new AlertDialog.Builder(ctx);
pBuilder.setTitle(R.string.selectMilestone);
pBuilder.setSingleChoiceItems(milestonesList.toArray(new String[0]), selectedMilestone, (dialogInterface, i) -> {
tinyDB.putString("issueMilestoneFilterId", milestonesList.get(i));
if(getFragmentRefreshListenerFilterIssuesByMilestone() != null) {
getFragmentRefreshListenerFilterIssuesByMilestone().onRefresh(milestonesList.get(i));
}
dialogInterface.dismiss();
});
pBuilder.setNeutralButton(R.string.cancelButton, null);
pBuilder.create().show();
}
}
@Override
public void onFailure(@NonNull Call<List<Milestones>> call, @NonNull Throwable t) {
progressDialog.hide();
Log.e("onFailure", t.toString());
}
});
}
private void chooseBranch() {
Dialog progressDialog = new Dialog(this);
progressDialog.setContentView(R.layout.custom_progress_loader);
progressDialog.show();
Call<List<Branches>> call = RetrofitClient
.getApiInterface(ctx)
.getBranches(Authorization.get(ctx), repositoryOwner, repositoryName);
@ -505,6 +575,7 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
@Override
public void onResponse(@NonNull Call<List<Branches>> call, @NonNull Response<List<Branches>> response) {
progressDialog.hide();
if(response.code() == 200) {
List<String> branchesList = new ArrayList<>();
@ -517,7 +588,6 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
branchesList.add(branches.getName());
if(tinyDB.getString("repoBranch").equals(branches.getName())) {
selectedBranch = i;
}
}
@ -525,33 +595,27 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
AlertDialog.Builder pBuilder = new AlertDialog.Builder(ctx);
pBuilder.setTitle(R.string.pageTitleChooseBranch);
pBuilder.setSingleChoiceItems(branchesList.toArray(new String[0]), selectedBranch, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
pBuilder.setSingleChoiceItems(branchesList.toArray(new String[0]), selectedBranch, (dialogInterface, i) -> {
tinyDB.putString("repoBranch", branchesList.get(i));
if(getFragmentRefreshListenerFiles() != null) {
getFragmentRefreshListenerFiles().onRefresh(branchesList.get(i));
}
dialogInterface.dismiss();
}
});
pBuilder.setNeutralButton(R.string.cancelButton, null);
pBuilder.setNeutralButton(R.string.cancelButton, null);
pBuilder.create().show();
}
}
@Override
public void onFailure(@NonNull Call<List<Branches>> call, @NonNull Throwable t) {
progressDialog.hide();
Log.e("onFailure", t.toString());
}
});
}
public class SectionsPagerAdapter extends FragmentStatePagerAdapter {
@ -715,6 +779,13 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
}
// Issues milestone filter interface
public FragmentRefreshListenerFilterIssuesByMilestone getFragmentRefreshListenerFilterIssuesByMilestone() { return fragmentRefreshListenerFilterIssuesByMilestone; }
public void setFragmentRefreshListenerFilterIssuesByMilestone(FragmentRefreshListenerFilterIssuesByMilestone fragmentRefreshListener) { this.fragmentRefreshListenerFilterIssuesByMilestone = fragmentRefreshListener; }
public interface FragmentRefreshListenerFilterIssuesByMilestone { void onRefresh(String text); }
// Issues interface
public FragmentRefreshListener getFragmentRefreshListener() { return fragmentRefreshListener; }

View File

@ -1,5 +1,6 @@
package org.mian.gitnex.adapters;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
@ -34,31 +35,69 @@ import java.util.Locale;
* Author M M Arif
*/
public class ExploreIssuesAdapter extends RecyclerView.Adapter<ExploreIssuesAdapter.SearchViewHolder> {
public class ExploreIssuesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private final List<Issues> searchedList;
private final Context context;
private final int TYPE_LOAD = 0;
private List<Issues> searchedList;
private OnLoadMoreListener loadMoreListener;
private boolean isLoading = false, isMoreDataAvailable = true;
private final TinyDB tinyDb;
public ExploreIssuesAdapter(List<Issues> dataList, Context ctx) {
this.context = ctx;
this.searchedList = dataList;
this.tinyDb = TinyDB.getInstance(context);
}
class SearchViewHolder extends RecyclerView.ViewHolder {
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
LayoutInflater inflater = LayoutInflater.from(context);
if(viewType == TYPE_LOAD) {
return new ExploreIssuesAdapter.IssuesHolder(inflater.inflate(R.layout.list_issues, parent, false));
}
else {
return new ExploreIssuesAdapter.LoadHolder(inflater.inflate(R.layout.row_load, parent, false));
}
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
if(position >= getItemCount() - 1 && isMoreDataAvailable && !isLoading && loadMoreListener != null) {
isLoading = true;
loadMoreListener.onLoadMore();
}
if(getItemViewType(position) == TYPE_LOAD) {
((ExploreIssuesAdapter.IssuesHolder) holder).bindData(searchedList.get(position));
}
}
@Override
public int getItemViewType(int position) {
if(searchedList.get(position).getTitle() != null) {
return TYPE_LOAD;
}
else {
return 1;
}
}
@Override
public int getItemCount() {
return searchedList.size();
}
class IssuesHolder extends RecyclerView.ViewHolder {
private Issues issue;
private final ImageView issueAssigneeAvatar;
private final TextView issueTitle;
private final TextView issueCreatedTime;
private final TextView issueCommentsCount;
private SearchViewHolder(View itemView) {
IssuesHolder(View itemView) {
super(itemView);
issueAssigneeAvatar = itemView.findViewById(R.id.assigneeAvatar);
issueTitle = itemView.findViewById(R.id.issueTitle);
issueCommentsCount = itemView.findViewById(R.id.issueCommentsCount);
@ -67,6 +106,7 @@ public class ExploreIssuesAdapter extends RecyclerView.Adapter<ExploreIssuesAdap
itemView.setOnClickListener(v -> {
Intent intent = new Intent(context, IssueDetailActivity.class);
intent.putExtra("issueNumber", issue.getNumber());
intent.putExtra("openedFromLink", "true");
tinyDb.putString("issueNumber", String.valueOf(issue.getNumber()));
tinyDb.putString("issueType", "Issue");
@ -108,68 +148,79 @@ public class ExploreIssuesAdapter extends RecyclerView.Adapter<ExploreIssuesAdap
return true;
});
}
}
@NonNull
@Override
public ExploreIssuesAdapter.SearchViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_issues, parent, false);
return new ExploreIssuesAdapter.SearchViewHolder(v);
}
@Override
public void onBindViewHolder(@NonNull final ExploreIssuesAdapter.SearchViewHolder holder, int position) {
Issues currentItem = searchedList.get(position);
@SuppressLint("SetTextI18n")
void bindData(Issues issue) {
this.issue = issue;
int imgRadius = AppUtil.getPixelsFromDensity(context, 3);
Locale locale = context.getResources().getConfiguration().locale;
String timeFormat = tinyDb.getString("dateFormat");
PicassoService.getInstance(context).get()
.load(currentItem.getUser().getAvatar_url())
.load(issue.getUser().getAvatar_url())
.placeholder(R.drawable.loader_animated)
.transform(new RoundedTransformation(imgRadius, 0))
.resize(120, 120)
.centerCrop()
.into(holder.issueAssigneeAvatar);
.into(issueAssigneeAvatar);
String issueNumber_ = "<font color='" + ResourcesCompat.getColor(context.getResources(), R.color.lightGray, null) + "'>" + currentItem.getRepository().getFull_name() + context.getResources().getString(R.string.hash) + currentItem.getNumber() + "</font>";
String issueNumber_ = "<font color='" + ResourcesCompat.getColor(context.getResources(), R.color.lightGray, null) + "'>" + issue.getRepository().getFull_name() + context.getResources().getString(R.string.hash) + issue.getNumber() + "</font>";
holder.issue = currentItem;
holder.issueTitle.setText(HtmlCompat.fromHtml(issueNumber_ + " " + currentItem.getTitle(), HtmlCompat.FROM_HTML_MODE_LEGACY));
holder.issueCommentsCount.setText(String.valueOf(currentItem.getComments()));
issueTitle.setText(HtmlCompat.fromHtml(issueNumber_ + " " + issue.getTitle(), HtmlCompat.FROM_HTML_MODE_LEGACY));
issueCommentsCount.setText(String.valueOf(issue.getComments()));
switch(timeFormat) {
case "pretty": {
PrettyTime prettyTime = new PrettyTime(locale);
String createdTime = prettyTime.format(currentItem.getCreated_at());
holder.issueCreatedTime.setText(createdTime);
holder.issueCreatedTime.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(currentItem.getCreated_at()), context));
String createdTime = prettyTime.format(issue.getCreated_at());
issueCreatedTime.setText(createdTime);
issueCreatedTime.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(issue.getCreated_at()), context));
break;
}
case "normal": {
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd '" + context.getResources().getString(R.string.timeAtText) + "' HH:mm", locale);
String createdTime = formatter.format(currentItem.getCreated_at());
holder.issueCreatedTime.setText(createdTime);
String createdTime = formatter.format(issue.getCreated_at());
issueCreatedTime.setText(createdTime);
break;
}
case "normal1": {
DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy '" + context.getResources().getString(R.string.timeAtText) + "' HH:mm", locale);
String createdTime = formatter.format(currentItem.getCreated_at());
holder.issueCreatedTime.setText(createdTime);
String createdTime = formatter.format(issue.getCreated_at());
issueCreatedTime.setText(createdTime);
break;
}
}
}
}
@Override
public int getItemCount() {
return searchedList.size();
static class LoadHolder extends RecyclerView.ViewHolder {
LoadHolder(View itemView) {
super(itemView);
}
}
public void setMoreDataAvailable(boolean moreDataAvailable) {
isMoreDataAvailable = moreDataAvailable;
}
@SuppressLint("NotifyDataSetChanged")
public void notifyDataChanged() {
notifyDataSetChanged();
isLoading = false;
}
public interface OnLoadMoreListener {
void onLoadMore();
}
public void setLoadMoreListener(OnLoadMoreListener loadMoreListener) {
this.loadMoreListener = loadMoreListener;
}
public void updateList(List<Issues> list) {
searchedList = list;
notifyDataChanged();
}
}

View File

@ -112,9 +112,14 @@ public class ExplorePublicOrganizationsAdapter extends RecyclerView.Adapter<Recy
.resize(120, 120)
.centerCrop()
.into(image);
if(!organization.getDescription().equals("")) {
orgDescription.setVisibility(View.VISIBLE);
orgDescription.setText(organization.getDescription());
}
else {
orgDescription.setVisibility(View.GONE);
}
}
}
@ -128,6 +133,7 @@ public class ExplorePublicOrganizationsAdapter extends RecyclerView.Adapter<Recy
isMoreDataAvailable = moreDataAvailable;
}
@SuppressLint("NotifyDataSetChanged")
public void notifyDataChanged() {
notifyDataSetChanged();
isLoading = false;
@ -143,6 +149,6 @@ public class ExplorePublicOrganizationsAdapter extends RecyclerView.Adapter<Recy
public void updateList(List<Organization> list) {
organizationsList = list;
notifyDataSetChanged();
notifyDataChanged();
}
}

View File

@ -1,5 +1,6 @@
package org.mian.gitnex.adapters;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.graphics.Typeface;
@ -40,19 +41,61 @@ import retrofit2.Callback;
* Author M M Arif
*/
public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepositoriesAdapter.ReposSearchViewHolder> {
public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private final List<UserRepositories> reposList;
private final Context context;
private final int TYPE_LOAD = 0;
private List<UserRepositories> reposList;
private OnLoadMoreListener loadMoreListener;
private boolean isLoading = false, isMoreDataAvailable = true;
private final TinyDB tinyDb;
public ExploreRepositoriesAdapter(List<UserRepositories> dataList, Context ctx) {
this.context = ctx;
this.reposList = dataList;
this.tinyDb = TinyDB.getInstance(context);
}
static class ReposSearchViewHolder extends RecyclerView.ViewHolder {
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
LayoutInflater inflater = LayoutInflater.from(context);
if(viewType == TYPE_LOAD) {
return new ExploreRepositoriesAdapter.RepositoriesHolder(inflater.inflate(R.layout.list_repositories, parent, false));
}
else {
return new ExploreRepositoriesAdapter.LoadHolder(inflater.inflate(R.layout.row_load, parent, false));
}
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
if(position >= getItemCount() - 1 && isMoreDataAvailable && !isLoading && loadMoreListener != null) {
isLoading = true;
loadMoreListener.onLoadMore();
}
if(getItemViewType(position) == TYPE_LOAD) {
((ExploreRepositoriesAdapter.RepositoriesHolder) holder).bindData(reposList.get(position));
}
}
@Override
public int getItemViewType(int position) {
if(reposList.get(position).getFullName() != null) {
return TYPE_LOAD;
}
else {
return 1;
}
}
@Override
public int getItemCount() {
return reposList.size();
}
class RepositoriesHolder extends RecyclerView.ViewHolder {
private UserRepositories userRepositories;
private final ImageView image;
@ -62,9 +105,9 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepo
private CheckBox isRepoAdmin;
private final TextView repoStars;
private final TextView repoLastUpdated;
private final View spacerView;
private ReposSearchViewHolder(View itemView) {
RepositoriesHolder(View itemView) {
super(itemView);
repoName = itemView.findViewById(R.id.repoName);
orgName = itemView.findViewById(R.id.orgName);
@ -73,12 +116,11 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepo
image = itemView.findViewById(R.id.imageAvatar);
repoStars = itemView.findViewById(R.id.repoStars);
repoLastUpdated = itemView.findViewById(R.id.repoLastUpdated);
spacerView = itemView.findViewById(R.id.spacerView);
itemView.setOnClickListener(v -> {
Context context = v.getContext();
TinyDB tinyDb = TinyDB.getInstance(context);
Intent intent = new Intent(context, RepoDetailActivity.class);
intent.putExtra("repoFullName", userRepositories.getFullName());
@ -153,98 +195,107 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepo
});
}
}
@SuppressLint("SetTextI18n")
void bindData(UserRepositories userRepositories) {
this.userRepositories = userRepositories;
@NonNull
@Override
public ExploreRepositoriesAdapter.ReposSearchViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_repositories, parent, false);
return new ExploreRepositoriesAdapter.ReposSearchViewHolder(v);
}
@Override
public void onBindViewHolder(@NonNull final ExploreRepositoriesAdapter.ReposSearchViewHolder holder, int position) {
TinyDB tinyDb = TinyDB.getInstance(context);
UserRepositories currentItem = reposList.get(position);
int imgRadius = AppUtil.getPixelsFromDensity(context, 3);
Locale locale = context.getResources().getConfiguration().locale;
String timeFormat = tinyDb.getString("dateFormat");
holder.userRepositories = currentItem;
holder.orgName.setText(currentItem.getFullName().split("/")[0]);
holder.repoName.setText(currentItem.getFullName().split("/")[1]);
holder.repoStars.setText(currentItem.getStars_count());
orgName.setText(userRepositories.getFullName().split("/")[0]);
repoName.setText(userRepositories.getFullName().split("/")[1]);
repoStars.setText(userRepositories.getStars_count());
ColorGenerator generator = ColorGenerator.MATERIAL;
int color = generator.getColor(currentItem.getName());
String firstCharacter = String.valueOf(currentItem.getFullName().charAt(0));
int color = generator.getColor(userRepositories.getName());
String firstCharacter = String.valueOf(userRepositories.getFullName().charAt(0));
TextDrawable drawable = TextDrawable.builder().beginConfig().useFont(Typeface.DEFAULT).fontSize(18).toUpperCase().width(28).height(28).endConfig().buildRoundRect(firstCharacter, color, 3);
if(currentItem.getAvatar_url() != null) {
if(!currentItem.getAvatar_url().equals("")) {
PicassoService.getInstance(context).get().load(currentItem.getAvatar_url()).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(imgRadius, 0)).resize(120, 120).centerCrop().into(holder.image);
if(userRepositories.getAvatar_url() != null) {
if(!userRepositories.getAvatar_url().equals("")) {
PicassoService.getInstance(context).get().load(userRepositories.getAvatar_url()).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(imgRadius, 0)).resize(120, 120).centerCrop().into(image);
}
else {
holder.image.setImageDrawable(drawable);
image.setImageDrawable(drawable);
}
}
else {
holder.image.setImageDrawable(drawable);
image.setImageDrawable(drawable);
}
if(currentItem.getUpdated_at() != null) {
if(userRepositories.getUpdated_at() != null) {
switch(timeFormat) {
case "pretty": {
PrettyTime prettyTime = new PrettyTime(locale);
String createdTime = prettyTime.format(currentItem.getUpdated_at());
holder.repoLastUpdated.setText(context.getString(R.string.lastUpdatedAt, createdTime));
holder.repoLastUpdated.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(currentItem.getUpdated_at()), context));
String createdTime = prettyTime.format(userRepositories.getUpdated_at());
repoLastUpdated.setText(context.getString(R.string.lastUpdatedAt, createdTime));
repoLastUpdated.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(userRepositories.getUpdated_at()), context));
break;
}
case "normal": {
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd '" + context.getResources().getString(R.string.timeAtText) + "' HH:mm", locale);
String createdTime = formatter.format(currentItem.getUpdated_at());
holder.repoLastUpdated.setText(context.getString(R.string.lastUpdatedAt, createdTime));
String createdTime = formatter.format(userRepositories.getUpdated_at());
repoLastUpdated.setText(context.getString(R.string.lastUpdatedAt, createdTime));
break;
}
case "normal1": {
DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy '" + context.getResources().getString(R.string.timeAtText) + "' HH:mm", locale);
String createdTime = formatter.format(currentItem.getUpdated_at());
holder.repoLastUpdated.setText(context.getString(R.string.lastUpdatedAt, createdTime));
String createdTime = formatter.format(userRepositories.getUpdated_at());
repoLastUpdated.setText(context.getString(R.string.lastUpdatedAt, createdTime));
break;
}
}
}
else {
holder.repoLastUpdated.setVisibility(View.GONE);
repoLastUpdated.setVisibility(View.GONE);
}
if(!currentItem.getDescription().equals("")) {
holder.repoDescription.setText(currentItem.getDescription());
if(!userRepositories.getDescription().equals("")) {
repoDescription.setVisibility(View.VISIBLE);
repoDescription.setText(userRepositories.getDescription());
spacerView.setVisibility(View.GONE);
}
else {
holder.repoDescription.setText(context.getString(R.string.noDataDescription));
repoDescription.setVisibility(View.GONE);
spacerView.setVisibility(View.VISIBLE);
}
if(holder.isRepoAdmin == null) {
holder.isRepoAdmin = new CheckBox(context);
if(isRepoAdmin == null) {
isRepoAdmin = new CheckBox(context);
}
isRepoAdmin.setChecked(userRepositories.getPermissions().isAdmin());
}
holder.isRepoAdmin.setChecked(currentItem.getPermissions().isAdmin());
}
@Override
public int getItemCount() {
return reposList.size();
static class LoadHolder extends RecyclerView.ViewHolder {
LoadHolder(View itemView) {
super(itemView);
}
}
public void setMoreDataAvailable(boolean moreDataAvailable) {
isMoreDataAvailable = moreDataAvailable;
}
@SuppressLint("NotifyDataSetChanged")
public void notifyDataChanged() {
notifyDataSetChanged();
isLoading = false;
}
public interface OnLoadMoreListener {
void onLoadMore();
}
public void setLoadMoreListener(OnLoadMoreListener loadMoreListener) {
this.loadMoreListener = loadMoreListener;
}
public void updateList(List<UserRepositories> list) {
reposList = list;
notifyDataChanged();
}
}

View File

@ -0,0 +1,154 @@
package org.mian.gitnex.adapters;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import org.gitnex.tea4j.models.UserInfo;
import org.mian.gitnex.R;
import org.mian.gitnex.activities.ProfileActivity;
import org.mian.gitnex.clients.PicassoService;
import org.mian.gitnex.helpers.AppUtil;
import org.mian.gitnex.helpers.RoundedTransformation;
import java.util.List;
/**
* Author M M Arif
*/
public class ExploreUsersAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private final Context context;
private final int TYPE_LOAD = 0;
private List<UserInfo> usersList;
private OnLoadMoreListener loadMoreListener;
private boolean isLoading = false, isMoreDataAvailable = true;
public ExploreUsersAdapter(Context ctx, List<UserInfo> usersListMain) {
this.context = ctx;
this.usersList = usersListMain;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
LayoutInflater inflater = LayoutInflater.from(context);
if(viewType == TYPE_LOAD) {
return new ExploreUsersAdapter.UsersHolder(inflater.inflate(R.layout.list_explore_users, parent, false));
}
else {
return new ExploreUsersAdapter.LoadHolder(inflater.inflate(R.layout.row_load, parent, false));
}
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
if(position >= getItemCount() - 1 && isMoreDataAvailable && !isLoading && loadMoreListener != null) {
isLoading = true;
loadMoreListener.onLoadMore();
}
if(getItemViewType(position) == TYPE_LOAD) {
((ExploreUsersAdapter.UsersHolder) holder).bindData(usersList.get(position));
}
}
@Override
public int getItemViewType(int position) {
if(usersList.get(position).getUsername() != null) {
return TYPE_LOAD;
}
else {
return 1;
}
}
@Override
public int getItemCount() {
return usersList.size();
}
class UsersHolder extends RecyclerView.ViewHolder {
private UserInfo userInfo;
private final ImageView userAvatar;
private final TextView userFullName;
private final TextView userName;
UsersHolder(View itemView) {
super(itemView);
userAvatar = itemView.findViewById(R.id.userAvatar);
userFullName = itemView.findViewById(R.id.userFullName);
userName = itemView.findViewById(R.id.userName);
itemView.setOnClickListener(loginId -> {
Intent intent = new Intent(context, ProfileActivity.class);
intent.putExtra("username", userInfo.getLogin());
context.startActivity(intent);
});
itemView.setOnLongClickListener(loginId -> {
AppUtil.copyToClipboard(context, userInfo.getLogin(), context.getString(R.string.copyLoginIdToClipBoard, userInfo.getLogin()));
return true;
});
}
@SuppressLint("SetTextI18n")
void bindData(UserInfo userInfo) {
this.userInfo = userInfo;
int imgRadius = AppUtil.getPixelsFromDensity(context, 3);
userName.setText(userInfo.getUsername());
PicassoService.getInstance(context).get()
.load(userInfo.getAvatar())
.placeholder(R.drawable.loader_animated)
.transform(new RoundedTransformation(imgRadius, 0))
.resize(120, 120)
.centerCrop()
.into(userAvatar);
if(!userInfo.getFullname().equals("")) {
userFullName.setText(Html.fromHtml(userInfo.getFullname()));
userName.setText(context.getResources().getString(R.string.usernameWithAt, userInfo.getUsername()));
}
else {
userFullName.setText(userInfo.getUsername());
userName.setVisibility(View.GONE);
}
}
}
static class LoadHolder extends RecyclerView.ViewHolder {
LoadHolder(View itemView) {
super(itemView);
}
}
public void setMoreDataAvailable(boolean moreDataAvailable) {
isMoreDataAvailable = moreDataAvailable;
}
@SuppressLint("NotifyDataSetChanged")
public void notifyDataChanged() {
notifyDataSetChanged();
isLoading = false;
}
public interface OnLoadMoreListener {
void onLoadMore();
}
public void setLoadMoreListener(OnLoadMoreListener loadMoreListener) {
this.loadMoreListener = loadMoreListener;
}
public void updateList(List<UserInfo> list) {
usersList = list;
notifyDataChanged();
}
}

View File

@ -6,6 +6,8 @@ import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -113,6 +115,11 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<IssueCommentsAdap
dialog.show();
LinearLayout linearLayout = vw.findViewById(R.id.commentReactionButtons);
TextView loadReactions = new TextView(context);
loadReactions.setText(context.getString(R.string.genericWaitFor));
loadReactions.setGravity(Gravity.CENTER);
loadReactions.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 160));
linearLayout.addView(loadReactions);
Bundle bundle1 = new Bundle();
bundle1.putAll(bundle);
@ -126,7 +133,12 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<IssueCommentsAdap
dialog.dismiss();
});
Handler handler = new Handler();
handler.postDelayed(() -> {
linearLayout.removeView(loadReactions);
reactionSpinner.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 160));
linearLayout.addView(reactionSpinner);
}, 2500);
commentMenuEdit.setOnClickListener(v1 -> {
Bundle bundle = new Bundle();

View File

@ -1,5 +1,6 @@
package org.mian.gitnex.adapters;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.text.Html;
@ -22,21 +23,65 @@ import java.util.List;
* Author M M Arif
*/
public class MyProfileFollowersAdapter extends RecyclerView.Adapter<MyProfileFollowersAdapter.FollowersViewHolder> {
public class MyProfileFollowersAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private final List<UserInfo> followersList;
private final Context context;
private final int TYPE_LOAD = 0;
private List<UserInfo> followersList;
private OnLoadMoreListener loadMoreListener;
private boolean isLoading = false, isMoreDataAvailable = true;
class FollowersViewHolder extends RecyclerView.ViewHolder {
public MyProfileFollowersAdapter(List<UserInfo> dataList, Context ctx) {
this.context = ctx;
this.followersList = dataList;
}
private String userLoginId;
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
LayoutInflater inflater = LayoutInflater.from(context);
if(viewType == TYPE_LOAD) {
return new MyProfileFollowersAdapter.FollowersHolder(inflater.inflate(R.layout.list_profile_followers_following, parent, false));
}
else {
return new MyProfileFollowersAdapter.LoadHolder(inflater.inflate(R.layout.row_load, parent, false));
}
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
if(position >= getItemCount() - 1 && isMoreDataAvailable && !isLoading && loadMoreListener != null) {
isLoading = true;
loadMoreListener.onLoadMore();
}
if(getItemViewType(position) == TYPE_LOAD) {
((MyProfileFollowersAdapter.FollowersHolder) holder).bindData(followersList.get(position));
}
}
@Override
public int getItemViewType(int position) {
if(followersList.get(position).getUsername() != null) {
return TYPE_LOAD;
}
else {
return 1;
}
}
@Override
public int getItemCount() {
return followersList.size();
}
class FollowersHolder extends RecyclerView.ViewHolder {
private UserInfo userInfo;
private final ImageView userAvatar;
private final TextView userFullName;
private final TextView userName;
private FollowersViewHolder(View itemView) {
FollowersHolder(View itemView) {
super(itemView);
userAvatar = itemView.findViewById(R.id.userAvatar);
@ -45,56 +90,62 @@ public class MyProfileFollowersAdapter extends RecyclerView.Adapter<MyProfileFol
itemView.setOnClickListener(loginId -> {
Intent intent = new Intent(context, ProfileActivity.class);
intent.putExtra("username", userLoginId);
intent.putExtra("username", userInfo.getLogin());
context.startActivity(intent);
});
itemView.setOnLongClickListener(loginId -> {
AppUtil.copyToClipboard(context, userLoginId, context.getString(R.string.copyLoginIdToClipBoard, userLoginId));
AppUtil.copyToClipboard(context, userInfo.getLogin(), context.getString(R.string.copyLoginIdToClipBoard, userInfo.getLogin()));
return true;
});
}
}
public MyProfileFollowersAdapter(Context ctx, List<UserInfo> followersListMain) {
this.context = ctx;
this.followersList = followersListMain;
}
@NonNull
@Override
public MyProfileFollowersAdapter.FollowersViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_profile_followers_following, parent, false);
return new FollowersViewHolder(v);
}
@Override
public void onBindViewHolder(@NonNull MyProfileFollowersAdapter.FollowersViewHolder holder, int position) {
UserInfo currentItem = followersList.get(position);
@SuppressLint("SetTextI18n")
void bindData(UserInfo userInfo) {
this.userInfo = userInfo;
int imgRadius = AppUtil.getPixelsFromDensity(context, 3);
holder.userLoginId = currentItem.getLogin();
if(!currentItem.getFullname().equals("")) {
holder.userFullName.setText(Html.fromHtml(currentItem.getFullname()));
holder.userName.setText(context.getResources().getString(R.string.usernameWithAt, currentItem.getUsername()));
if(!userInfo.getFullname().equals("")) {
userFullName.setText(Html.fromHtml(userInfo.getFullname()));
userName.setText(context.getResources().getString(R.string.usernameWithAt, userInfo.getUsername()));
}
else {
holder.userFullName.setText(currentItem.getUsername());
holder.userName.setVisibility(View.GONE);
userFullName.setText(userInfo.getUsername());
userName.setVisibility(View.GONE);
}
PicassoService.getInstance(context).get().load(currentItem.getAvatar()).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(imgRadius, 0)).resize(120, 120).centerCrop().into(holder.userAvatar);
PicassoService.getInstance(context).get().load(userInfo.getAvatar()).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(imgRadius, 0)).resize(120, 120).centerCrop().into(userAvatar);
}
}
@Override
public int getItemCount() {
return followersList.size();
static class LoadHolder extends RecyclerView.ViewHolder {
LoadHolder(View itemView) {
super(itemView);
}
}
public void setMoreDataAvailable(boolean moreDataAvailable) {
isMoreDataAvailable = moreDataAvailable;
}
@SuppressLint("NotifyDataSetChanged")
public void notifyDataChanged() {
notifyDataSetChanged();
isLoading = false;
}
public interface OnLoadMoreListener {
void onLoadMore();
}
public void setLoadMoreListener(OnLoadMoreListener loadMoreListener) {
this.loadMoreListener = loadMoreListener;
}
public void updateList(List<UserInfo> list) {
followersList = list;
notifyDataChanged();
}
}

View File

@ -1,5 +1,6 @@
package org.mian.gitnex.adapters;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.text.Html;
@ -22,21 +23,65 @@ import java.util.List;
* Author M M Arif
*/
public class MyProfileFollowingAdapter extends RecyclerView.Adapter<MyProfileFollowingAdapter.FollowingViewHolder> {
public class MyProfileFollowingAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private final List<UserInfo> followingList;
private final Context context;
private final int TYPE_LOAD = 0;
private List<UserInfo> followingList;
private OnLoadMoreListener loadMoreListener;
private boolean isLoading = false, isMoreDataAvailable = true;
class FollowingViewHolder extends RecyclerView.ViewHolder {
public MyProfileFollowingAdapter(List<UserInfo> dataList, Context ctx) {
this.context = ctx;
this.followingList = dataList;
}
private String userLoginId;
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
LayoutInflater inflater = LayoutInflater.from(context);
if(viewType == TYPE_LOAD) {
return new MyProfileFollowingAdapter.FollowingHolder(inflater.inflate(R.layout.list_profile_followers_following, parent, false));
}
else {
return new MyProfileFollowingAdapter.LoadHolder(inflater.inflate(R.layout.row_load, parent, false));
}
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
if(position >= getItemCount() - 1 && isMoreDataAvailable && !isLoading && loadMoreListener != null) {
isLoading = true;
loadMoreListener.onLoadMore();
}
if(getItemViewType(position) == TYPE_LOAD) {
((MyProfileFollowingAdapter.FollowingHolder) holder).bindData(followingList.get(position));
}
}
@Override
public int getItemViewType(int position) {
if(followingList.get(position).getUsername() != null) {
return TYPE_LOAD;
}
else {
return 1;
}
}
@Override
public int getItemCount() {
return followingList.size();
}
class FollowingHolder extends RecyclerView.ViewHolder {
private UserInfo userInfo;
private final ImageView userAvatar;
private final TextView userFullName;
private final TextView userName;
private FollowingViewHolder(View itemView) {
FollowingHolder(View itemView) {
super(itemView);
userAvatar = itemView.findViewById(R.id.userAvatar);
@ -45,55 +90,60 @@ public class MyProfileFollowingAdapter extends RecyclerView.Adapter<MyProfileFol
itemView.setOnClickListener(loginId -> {
Intent intent = new Intent(context, ProfileActivity.class);
intent.putExtra("username", userLoginId);
intent.putExtra("username", userInfo.getLogin());
context.startActivity(intent);
});
itemView.setOnLongClickListener(loginId -> {
AppUtil.copyToClipboard(context, userLoginId, context.getString(R.string.copyLoginIdToClipBoard, userLoginId));
AppUtil.copyToClipboard(context, userInfo.getLogin(), context.getString(R.string.copyLoginIdToClipBoard, userInfo.getLogin()));
return true;
});
}
}
public MyProfileFollowingAdapter(Context ctx, List<UserInfo> followingListMain) {
this.context = ctx;
this.followingList = followingListMain;
}
@NonNull
@Override
public MyProfileFollowingAdapter.FollowingViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_profile_followers_following, parent, false);
return new FollowingViewHolder(v);
}
@Override
public void onBindViewHolder(@NonNull MyProfileFollowingAdapter.FollowingViewHolder holder, int position) {
UserInfo currentItem = followingList.get(position);
@SuppressLint("SetTextI18n")
void bindData(UserInfo userInfo) {
this.userInfo = userInfo;
int imgRadius = AppUtil.getPixelsFromDensity(context, 3);
holder.userLoginId = currentItem.getLogin();
if(!currentItem.getFullname().equals("")) {
holder.userFullName.setText(Html.fromHtml(currentItem.getFullname()));
holder.userName.setText(context.getResources().getString(R.string.usernameWithAt, currentItem.getUsername()));
if(!userInfo.getFullname().equals("")) {
userFullName.setText(Html.fromHtml(userInfo.getFullname()));
userName.setText(context.getResources().getString(R.string.usernameWithAt, userInfo.getUsername()));
}
else {
holder.userFullName.setText(currentItem.getUsername());
holder.userName.setVisibility(View.GONE);
userFullName.setText(userInfo.getUsername());
userName.setVisibility(View.GONE);
}
PicassoService.getInstance(context).get().load(currentItem.getAvatar()).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(imgRadius, 0)).resize(120, 120).centerCrop().into(holder.userAvatar);
PicassoService.getInstance(context).get().load(userInfo.getAvatar()).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(imgRadius, 0)).resize(120, 120).centerCrop().into(userAvatar);
}
}
@Override
public int getItemCount() {
return followingList.size();
static class LoadHolder extends RecyclerView.ViewHolder {
LoadHolder(View itemView) {
super(itemView);
}
}
public void setMoreDataAvailable(boolean moreDataAvailable) {
isMoreDataAvailable = moreDataAvailable;
}
@SuppressLint("NotifyDataSetChanged")
public void notifyDataChanged() {
notifyDataSetChanged();
isLoading = false;
}
public interface OnLoadMoreListener {
void onLoadMore();
}
public void setLoadMoreListener(OnLoadMoreListener loadMoreListener) {
this.loadMoreListener = loadMoreListener;
}
public void updateList(List<UserInfo> list) {
followingList = list;
notifyDataChanged();
}
}

View File

@ -60,6 +60,7 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
private CheckBox isRepoAdmin;
private final TextView repoStars;
private final TextView repoLastUpdated;
private final View spacerView;
private MyReposViewHolder(View itemView) {
@ -71,6 +72,7 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
image = itemView.findViewById(R.id.imageAvatar);
repoStars = itemView.findViewById(R.id.repoStars);
repoLastUpdated = itemView.findViewById(R.id.repoLastUpdated);
spacerView = itemView.findViewById(R.id.spacerView);
itemView.setOnClickListener(v -> {
@ -244,10 +246,13 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
}
if(!currentItem.getDescription().equals("")) {
holder.repoDescription.setVisibility(View.VISIBLE);
holder.repoDescription.setText(currentItem.getDescription());
holder.spacerView.setVisibility(View.GONE);
}
else {
holder.repoDescription.setText(context.getString(R.string.noDataDescription));
holder.repoDescription.setVisibility(View.GONE);
holder.spacerView.setVisibility(View.VISIBLE);
}
if(holder.isRepoAdmin == null) {

View File

@ -1,5 +1,6 @@
package org.mian.gitnex.adapters;
import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
@ -21,18 +22,21 @@ import java.util.List;
/**
* Author opyale
* Modified M M Arif
*/
public class NotificationsAdapter extends RecyclerView.Adapter<NotificationsAdapter.NotificationsViewHolder> {
public class NotificationsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private final Context context;
private final List<NotificationThread> notificationThreads;
private final int TYPE_LOAD = 0;
private List<NotificationThread> notificationThreads;
private final OnMoreClickedListener onMoreClickedListener;
private final OnNotificationClickedListener onNotificationClickedListener;
private OnLoadMoreListener loadMoreListener;
private boolean isLoading = false, isMoreDataAvailable = true;
private final TinyDB tinyDb;
public NotificationsAdapter(Context context, List<NotificationThread> notificationThreads, OnMoreClickedListener onMoreClickedListener, OnNotificationClickedListener onNotificationClickedListener) {
this.tinyDb = TinyDB.getInstance(context);
this.context = context;
this.notificationThreads = notificationThreads;
@ -40,7 +44,46 @@ public class NotificationsAdapter extends RecyclerView.Adapter<NotificationsAdap
this.onNotificationClickedListener = onNotificationClickedListener;
}
static class NotificationsViewHolder extends RecyclerView.ViewHolder {
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
LayoutInflater inflater = LayoutInflater.from(context);
if(viewType == TYPE_LOAD) {
return new NotificationsAdapter.NotificationsHolder(inflater.inflate(R.layout.list_notifications, parent, false));
}
else {
return new NotificationsAdapter.LoadHolder(inflater.inflate(R.layout.row_load, parent, false));
}
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
if(position >= getItemCount() - 1 && isMoreDataAvailable && !isLoading && loadMoreListener != null) {
isLoading = true;
loadMoreListener.onLoadMore();
}
if(getItemViewType(position) == TYPE_LOAD) {
((NotificationsAdapter.NotificationsHolder) holder).bindData(notificationThreads.get(position));
}
}
@Override
public int getItemViewType(int position) {
if(notificationThreads.get(position).getSubject() != null) {
return TYPE_LOAD;
}
else {
return 1;
}
}
@Override
public int getItemCount() {
return notificationThreads.size();
}
class NotificationsHolder extends RecyclerView.ViewHolder {
private final LinearLayout frame;
private final TextView subject;
@ -51,10 +94,9 @@ public class NotificationsAdapter extends RecyclerView.Adapter<NotificationsAdap
private final ImageView pinned;
private final ImageView more;
public NotificationsViewHolder(@NonNull View itemView) {
NotificationsHolder(View itemView) {
super(itemView);
frame = itemView.findViewById(R.id.frame);
subject = itemView.findViewById(R.id.subject);
repository = itemView.findViewById(R.id.repository);
@ -64,57 +106,42 @@ public class NotificationsAdapter extends RecyclerView.Adapter<NotificationsAdap
pinned = itemView.findViewById(R.id.pinned);
more = itemView.findViewById(R.id.more);
}
}
@NonNull
@Override
public NotificationsViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(context).inflate(R.layout.list_notifications, parent, false);
return new NotificationsAdapter.NotificationsViewHolder(v);
}
@Override
public void onBindViewHolder(@NonNull NotificationsViewHolder holder, int position) {
NotificationThread notificationThread = notificationThreads.get(position);
@SuppressLint("SetTextI18n")
void bindData(NotificationThread notificationThread) {
String url = notificationThread.getSubject().getUrl();
String subjectId = "<font color='" + ResourcesCompat.getColor(context.getResources(), R.color.lightGray, null) + "'>" + context.getResources()
.getString(R.string.hash) + url.substring(url.lastIndexOf("/") + 1) + "</font>";
String subjectId = "<font color='" + ResourcesCompat.getColor(context.getResources(), R.color.lightGray, null) + "'>" + context.getResources().getString(R.string.hash) + url.substring(url.lastIndexOf("/") + 1) + "</font>";
holder.subject.setText(HtmlCompat.fromHtml(subjectId + " " + notificationThread.getSubject().getTitle(), HtmlCompat.FROM_HTML_MODE_LEGACY));
holder.repository.setText(notificationThread.getRepository().getFullName());
subject.setText(HtmlCompat.fromHtml(subjectId + " " + notificationThread.getSubject().getTitle(), HtmlCompat.FROM_HTML_MODE_LEGACY));
repository.setText(notificationThread.getRepository().getFullName());
if(notificationThread.isPinned()) {
holder.pinned.setVisibility(View.VISIBLE);
} else {
holder.pinned.setVisibility(View.GONE);
pinned.setVisibility(View.VISIBLE);
}
else {
pinned.setVisibility(View.GONE);
}
switch(notificationThread.getSubject().getType()) {
case "Pull":
holder.typePr.setVisibility(View.VISIBLE);
holder.typeIssue.setVisibility(View.GONE);
holder.typeUnknown.setVisibility(View.GONE);
typePr.setVisibility(View.VISIBLE);
typeIssue.setVisibility(View.GONE);
typeUnknown.setVisibility(View.GONE);
break;
case "Issue":
holder.typePr.setVisibility(View.GONE);
holder.typeIssue.setVisibility(View.VISIBLE);
holder.typeUnknown.setVisibility(View.GONE);
typePr.setVisibility(View.GONE);
typeIssue.setVisibility(View.VISIBLE);
typeUnknown.setVisibility(View.GONE);
break;
default:
holder.typePr.setVisibility(View.GONE);
holder.typeIssue.setVisibility(View.GONE);
holder.typeUnknown.setVisibility(View.VISIBLE);
typePr.setVisibility(View.GONE);
typeIssue.setVisibility(View.GONE);
typeUnknown.setVisibility(View.VISIBLE);
break;
}
holder.frame.setOnClickListener(v -> {
frame.setOnClickListener(v -> {
onNotificationClickedListener.onNotificationClicked(notificationThread);
@ -130,29 +157,51 @@ public class NotificationsAdapter extends RecyclerView.Adapter<NotificationsAdap
if(count == 0) {
long id = repositoryData.insertRepository(currentActiveAccountId, repoOwner, repoName);
tinyDb.putLong("repositoryId", id);
} else {
}
else {
Repository data = repositoryData.getRepository(currentActiveAccountId, repoOwner, repoName);
tinyDb.putLong("repositoryId", data.getRepositoryId());
}
});
holder.more.setOnClickListener(v -> onMoreClickedListener.onMoreClicked(notificationThread));
more.setOnClickListener(v -> onMoreClickedListener.onMoreClicked(notificationThread));
}
}
@Override
public int getItemCount() {
static class LoadHolder extends RecyclerView.ViewHolder {
LoadHolder(View itemView) {
super(itemView);
}
}
return notificationThreads.size();
public void setMoreDataAvailable(boolean moreDataAvailable) {
isMoreDataAvailable = moreDataAvailable;
}
@SuppressLint("NotifyDataSetChanged")
public void notifyDataChanged() {
notifyDataSetChanged();
isLoading = false;
}
public interface OnLoadMoreListener {
void onLoadMore();
}
public void setLoadMoreListener(OnLoadMoreListener loadMoreListener) {
this.loadMoreListener = loadMoreListener;
}
public void updateList(List<NotificationThread> list) {
notificationThreads = list;
notifyDataChanged();
}
public interface OnNotificationClickedListener {
void onNotificationClicked(NotificationThread notificationThread);
}
public interface OnMoreClickedListener {
void onMoreClicked(NotificationThread notificationThread);
}
}

View File

@ -89,9 +89,12 @@ public class OrganizationsListAdapter extends RecyclerView.Adapter<Organizations
PicassoService.getInstance(context).get().load(currentItem.getAvatar_url()).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(imgRadius, 0)).resize(120, 120).centerCrop().into(holder.image);
if(!currentItem.getDescription().equals("")) {
holder.orgDescription.setVisibility(View.VISIBLE);
holder.orgDescription.setText(currentItem.getDescription());
}
else {
holder.orgDescription.setVisibility(View.GONE);
}
}
@Override

View File

@ -60,6 +60,7 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
private CheckBox isRepoAdmin;
private final TextView repoStars;
private final TextView repoLastUpdated;
private final View spacerView;
private ReposViewHolder(View itemView) {
@ -71,6 +72,7 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
image = itemView.findViewById(R.id.imageAvatar);
repoStars = itemView.findViewById(R.id.repoStars);
repoLastUpdated = itemView.findViewById(R.id.repoLastUpdated);
spacerView = itemView.findViewById(R.id.spacerView);
itemView.setOnClickListener(v -> {
@ -243,10 +245,13 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
}
if(!currentItem.getDescription().equals("")) {
holder.repoDescription.setVisibility(View.VISIBLE);
holder.repoDescription.setText(currentItem.getDescription());
holder.spacerView.setVisibility(View.GONE);
}
else {
holder.repoDescription.setText(context.getString(R.string.noDataDescription));
holder.repoDescription.setVisibility(View.GONE);
holder.spacerView.setVisibility(View.VISIBLE);
}
if(holder.isRepoAdmin == null) {

View File

@ -60,6 +60,7 @@ public class RepositoriesByOrgAdapter extends RecyclerView.Adapter<RepositoriesB
private CheckBox isRepoAdmin;
private final TextView repoStars;
private final TextView repoLastUpdated;
private final View spacerView;
private OrgReposViewHolder(View itemView) {
@ -71,6 +72,7 @@ public class RepositoriesByOrgAdapter extends RecyclerView.Adapter<RepositoriesB
image = itemView.findViewById(R.id.imageAvatar);
repoStars = itemView.findViewById(R.id.repoStars);
repoLastUpdated = itemView.findViewById(R.id.repoLastUpdated);
spacerView = itemView.findViewById(R.id.spacerView);
itemView.setOnClickListener(v -> {
@ -247,10 +249,13 @@ public class RepositoriesByOrgAdapter extends RecyclerView.Adapter<RepositoriesB
}
if(!currentItem.getDescription().equals("")) {
holder.repoDescription.setVisibility(View.VISIBLE);
holder.repoDescription.setText(currentItem.getDescription());
holder.spacerView.setVisibility(View.GONE);
}
else {
holder.repoDescription.setText(context.getString(R.string.noDataDescription));
holder.repoDescription.setVisibility(View.GONE);
holder.spacerView.setVisibility(View.VISIBLE);
}
if(holder.isRepoAdmin == null) {

View File

@ -60,6 +60,7 @@ public class StarredReposListAdapter extends RecyclerView.Adapter<StarredReposLi
private CheckBox isRepoAdmin;
private final TextView repoStars;
private final TextView repoLastUpdated;
private final View spacerView;
private StarredReposViewHolder(View itemView) {
@ -71,6 +72,7 @@ public class StarredReposListAdapter extends RecyclerView.Adapter<StarredReposLi
image = itemView.findViewById(R.id.imageAvatar);
repoStars = itemView.findViewById(R.id.repoStars);
repoLastUpdated = itemView.findViewById(R.id.repoLastUpdated);
spacerView = itemView.findViewById(R.id.spacerView);
itemView.setOnClickListener(v -> {
@ -248,10 +250,13 @@ public class StarredReposListAdapter extends RecyclerView.Adapter<StarredReposLi
}
if(!currentItem.getDescription().equals("")) {
holder.repoDescription.setVisibility(View.VISIBLE);
holder.repoDescription.setText(currentItem.getDescription());
holder.spacerView.setVisibility(View.GONE);
}
else {
holder.repoDescription.setText(context.getString(R.string.noDataDescription));
holder.repoDescription.setVisibility(View.GONE);
holder.spacerView.setVisibility(View.VISIBLE);
}
if(holder.isRepoAdmin == null) {

View File

@ -9,6 +9,8 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import org.mian.gitnex.databinding.BottomSheetIssuesFilterBinding;
import org.mian.gitnex.helpers.TinyDB;
import org.mian.gitnex.helpers.Version;
/**
* Author M M Arif
@ -23,6 +25,15 @@ public class BottomSheetIssuesFilterFragment extends BottomSheetDialogFragment {
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
BottomSheetIssuesFilterBinding bottomSheetIssuesFilterBinding = BottomSheetIssuesFilterBinding.inflate(inflater, container, false);
TinyDB tinyDb = TinyDB.getInstance(getContext());
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.14.0")) {
bottomSheetIssuesFilterBinding.filterByMilestone.setVisibility(View.VISIBLE);
bottomSheetIssuesFilterBinding.filterByMilestone.setOnClickListener(v1 -> {
bmListener.onButtonClicked("filterByMilestone");
dismiss();
});
}
bottomSheetIssuesFilterBinding.openIssues.setOnClickListener(v1 -> {
bmListener.onButtonClicked("openIssues");

View File

@ -5,6 +5,8 @@ import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -13,24 +15,19 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import com.google.gson.JsonElement;
import org.mian.gitnex.R;
import org.mian.gitnex.actions.IssueActions;
import org.mian.gitnex.actions.PullRequestActions;
import org.mian.gitnex.activities.EditIssueActivity;
import org.mian.gitnex.activities.FileDiffActivity;
import org.mian.gitnex.activities.MergePullRequestActivity;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.databinding.BottomSheetSingleIssueBinding;
import org.mian.gitnex.helpers.AlertDialogs;
import org.mian.gitnex.helpers.Authorization;
import org.mian.gitnex.helpers.TinyDB;
import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.helpers.Version;
import org.mian.gitnex.views.ReactionSpinner;
import java.util.Objects;
import retrofit2.Call;
import retrofit2.Callback;
/**
* Author M M Arif
@ -56,6 +53,7 @@ public class BottomSheetSingleIssueFragment extends BottomSheetDialogFragment {
TextView addRemoveAssignees = bottomSheetSingleIssueBinding.addRemoveAssignees;
TextView copyIssueUrl = bottomSheetSingleIssueBinding.copyIssueUrl;
TextView openFilesDiff = bottomSheetSingleIssueBinding.openFilesDiff;
TextView updatePullRequest = bottomSheetSingleIssueBinding.updatePullRequest;
TextView mergePullRequest = bottomSheetSingleIssueBinding.mergePullRequest;
TextView deletePullRequestBranch = bottomSheetSingleIssueBinding.deletePrHeadBranch;
TextView shareIssue = bottomSheetSingleIssueBinding.shareIssue;
@ -73,6 +71,12 @@ public class BottomSheetSingleIssueFragment extends BottomSheetDialogFragment {
bundle1.putString("repoName", parts[1]);
bundle1.putInt("issueId", Integer.parseInt(tinyDB.getString("issueNumber")));
TextView loadReactions = new TextView(ctx);
loadReactions.setText(Objects.requireNonNull(ctx).getString(R.string.genericWaitFor));
loadReactions.setGravity(Gravity.CENTER);
loadReactions.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 160));
linearLayout.addView(loadReactions);
ReactionSpinner reactionSpinner = new ReactionSpinner(ctx, bundle1);
reactionSpinner.setOnInteractedListener(() -> {
@ -80,10 +84,14 @@ public class BottomSheetSingleIssueFragment extends BottomSheetDialogFragment {
bmListener.onButtonClicked("onResume");
dismiss();
});
Handler handler = new Handler();
handler.postDelayed(() -> {
linearLayout.removeView(loadReactions);
reactionSpinner.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 160));
linearLayout.addView(reactionSpinner);
}, 2500);
if(tinyDB.getString("issueType").equalsIgnoreCase("Pull")) {
@ -92,10 +100,12 @@ public class BottomSheetSingleIssueFragment extends BottomSheetDialogFragment {
shareIssue.setText(R.string.sharePr);
if(tinyDB.getBoolean("prMerged") || tinyDB.getString("repoPrState").equals("closed")) {
updatePullRequest.setVisibility(View.GONE);
mergePullRequest.setVisibility(View.GONE);
deletePullRequestBranch.setVisibility(View.VISIBLE);
}
else {
updatePullRequest.setVisibility(View.VISIBLE);
mergePullRequest.setVisibility(View.VISIBLE);
deletePullRequestBranch.setVisibility(View.GONE);
}
@ -113,10 +123,21 @@ public class BottomSheetSingleIssueFragment extends BottomSheetDialogFragment {
}
else {
updatePullRequest.setVisibility(View.GONE);
mergePullRequest.setVisibility(View.GONE);
deletePullRequestBranch.setVisibility(View.GONE);
}
updatePullRequest.setOnClickListener(v -> {
if(new Version(tinyDB.getString("giteaVersion")).higherOrEqual("1.16.0")) {
AlertDialogs.selectPullUpdateStrategy(requireContext(), parts[0], parts[1], tinyDB.getString("issueNumber"));
}
else {
PullRequestActions.updatePr(requireContext(), parts[0], parts[1], tinyDB.getString("issueNumber"), null);
}
dismiss();
});
mergePullRequest.setOnClickListener(v13 -> {
startActivity(new Intent(ctx, MergePullRequestActivity.class));

View File

@ -0,0 +1,70 @@
package org.mian.gitnex.fragments;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.content.res.AppCompatResources;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import org.mian.gitnex.R;
import org.mian.gitnex.databinding.BottomSheetUserProfileBinding;
/**
* Template Author M M Arif
* @author qwerty287
*/
public class BottomSheetUserProfileFragment extends BottomSheetDialogFragment {
private final boolean following;
public BottomSheetUserProfileFragment(boolean following) {
this.following = following;
}
private BottomSheetUserProfileFragment.BottomSheetListener bmListener;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
BottomSheetUserProfileBinding bottomSheetUserProfileBinding = BottomSheetUserProfileBinding.inflate(inflater, container, false);
if(following) {
bottomSheetUserProfileBinding.followUnfollowUser.setText(R.string.unfollowUser);
Drawable drawable = AppCompatResources.getDrawable(requireContext(), R.drawable.ic_person_remove); assert drawable != null;
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
bottomSheetUserProfileBinding.followUnfollowUser.setCompoundDrawablesRelative(drawable, null, null, null);
}
bottomSheetUserProfileBinding.followUnfollowUser.setOnClickListener(v1 -> {
bmListener.onButtonClicked("follow");
dismiss();
});
return bottomSheetUserProfileBinding.getRoot();
}
public interface BottomSheetListener {
void onButtonClicked(String text);
}
@Override
public void onAttach(@NonNull Context context) {
super.onAttach(context);
try {
bmListener = (BottomSheetUserProfileFragment.BottomSheetListener) context;
}
catch (ClassCastException e) {
throw new ClassCastException(context.toString() + " must implement BottomSheetListener");
}
}
}

View File

@ -10,10 +10,10 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.ViewPager;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import androidx.viewpager2.widget.ViewPager2;
import com.google.android.material.tabs.TabLayout;
import com.google.android.material.tabs.TabLayoutMediator;
import org.mian.gitnex.R;
import org.mian.gitnex.activities.MainActivity;
import org.mian.gitnex.helpers.TinyDB;
@ -24,9 +24,6 @@ import org.mian.gitnex.helpers.TinyDB;
public class ExploreFragment extends Fragment {
private int tabsCount;
public ViewPager mViewPager;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
@ -36,101 +33,81 @@ public class ExploreFragment extends Fragment {
Context ctx = getContext();
TinyDB tinyDB = TinyDB.getInstance(ctx);
((MainActivity) requireActivity()).setActionBarTitle(getResources().getString(R.string.navExplore));
((MainActivity) requireActivity()).setActionBarTitle(getResources().getString(R.string.pageTitleExplore));
ViewPager2 viewPager = view.findViewById(R.id.containerExplore);
viewPager.setOffscreenPageLimit(1);
TabLayout tabLayout = view.findViewById(R.id.tabsExplore);
ViewGroup viewGroup = (ViewGroup) tabLayout.getChildAt(0);
tabsCount = viewGroup.getChildCount();
ViewGroup vg = (ViewGroup) tabLayout.getChildAt(0);
Typeface myTypeface;
switch(tinyDB.getInt("customFontId", -1)) {
case 0:
myTypeface = Typeface.createFromAsset(ctx.getAssets(), "fonts/roboto.ttf");
myTypeface = Typeface.createFromAsset(ctx != null ? ctx.getAssets() : null, "fonts/roboto.ttf");
break;
case 2:
myTypeface = Typeface.createFromAsset(ctx.getAssets(), "fonts/sourcecodeproregular.ttf");
myTypeface = Typeface.createFromAsset(ctx != null ? ctx.getAssets() : null, "fonts/sourcecodeproregular.ttf");
break;
default:
myTypeface = Typeface.createFromAsset(ctx.getAssets(), "fonts/manroperegular.ttf");
myTypeface = Typeface.createFromAsset(ctx != null ? ctx.getAssets() : null, "fonts/manroperegular.ttf");
break;
}
for(int j = 0; j < tabsCount; j++) {
viewPager.setAdapter(new ViewPagerAdapter(this));
ViewGroup vgTab = (ViewGroup) viewGroup.getChildAt(j);
String[] tabTitles = {getResources().getString(R.string.pageTitleRepositories), getResources().getString(R.string.pageTitleIssues), getResources().getString(R.string.pageTitleOrganizations), getResources().getString(R.string.pageTitleUsers)};
new TabLayoutMediator(tabLayout, viewPager, (tab, position) -> tab.setText(tabTitles[position])).attach();
for (int j = 0; j < tabTitles.length; j++) {
ViewGroup vgTab = (ViewGroup) vg.getChildAt(j);
int tabChildCount = vgTab.getChildCount();
for (int i = 0; i < tabChildCount; i++) {
View tabViewChild = vgTab.getChildAt(i);
if (tabViewChild instanceof TextView) {
((TextView) tabViewChild).setTypeface(myTypeface);
}
}
}
mViewPager = view.findViewById(R.id.containerExplore);
mViewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
tabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(mViewPager));
SectionsPagerAdapter mSectionsPagerAdapter = new SectionsPagerAdapter(getChildFragmentManager());
mViewPager.setAdapter(mSectionsPagerAdapter);
if(requireActivity().getIntent().getBooleanExtra("exploreOrgs", false)) {
mViewPager.setCurrentItem(2);
}
return view;
}
public class SectionsPagerAdapter extends FragmentPagerAdapter {
public static class ViewPagerAdapter extends FragmentStateAdapter {
SectionsPagerAdapter(FragmentManager fm) {
super(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
}
public ViewPagerAdapter(@NonNull ExploreFragment fa) { super(fa); }
@NonNull
@Override
public Fragment getItem(int position) {
public Fragment createFragment(int position) {
Fragment fragment = null;
switch(position) {
case 0: // Repositories
fragment = new ExploreRepositoriesFragment();
break;
case 1: // Issues
fragment = new ExploreIssuesFragment();
break;
case 2: // Organizations
fragment = new ExplorePublicOrganizationsFragment();
break;
case 3: // Users
fragment = new ExploreUsersFragment();
break;
}
assert fragment != null;
return fragment;
}
@Override
public int getCount() {
return tabsCount;
public int getItemCount() {
return 4;
}
}
}

View File

@ -2,6 +2,8 @@ package org.mian.gitnex.fragments;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@ -13,12 +15,13 @@ import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import org.gitnex.tea4j.models.Issues;
import org.mian.gitnex.R;
import org.mian.gitnex.adapters.ExploreIssuesAdapter;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.databinding.FragmentSearchIssuesBinding;
import org.mian.gitnex.helpers.AppUtil;
import org.mian.gitnex.helpers.Authorization;
import org.mian.gitnex.helpers.InfiniteScrollListener;
import org.mian.gitnex.helpers.Constants;
import org.mian.gitnex.helpers.SnackBar;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@ -33,30 +36,22 @@ import retrofit2.Response;
public class ExploreIssuesFragment extends Fragment {
private FragmentSearchIssuesBinding viewBinding;
private ExploreIssuesAdapter adapter;
private List<Issues> dataList;
Context ctx;
private Context context;
private int apiCallCurrentValue = 10;
private int pageCurrentIndex = 1;
private List<Issues> dataList;
private ExploreIssuesAdapter adapter;
private int pageSize;
private final String TAG = Constants.exploreIssues;
private final int resultLimit = Constants.resultLimitOldGiteaInstances; // search issues always return 10 records
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
viewBinding = FragmentSearchIssuesBinding.inflate(inflater, container, false);
setHasOptionsMenu(true);
ctx = getContext();
context = getContext();
dataList = new ArrayList<>();
adapter = new ExploreIssuesAdapter(dataList, ctx);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(ctx);
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(viewBinding.recyclerViewSearchIssues.getContext(), DividerItemDecoration.VERTICAL);
viewBinding.recyclerViewSearchIssues.addItemDecoration(dividerItemDecoration);
viewBinding.recyclerViewSearchIssues.setHasFixedSize(true);
viewBinding.recyclerViewSearchIssues.setLayoutManager(linearLayoutManager);
viewBinding.recyclerViewSearchIssues.setAdapter(adapter);
adapter = new ExploreIssuesAdapter(dataList, context);
viewBinding.searchKeyword.setOnEditorActionListener((v1, actionId, event) -> {
if(actionId == EditorInfo.IME_ACTION_SEND) {
@ -64,87 +59,111 @@ public class ExploreIssuesFragment extends Fragment {
InputMethodManager imm = (InputMethodManager) requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(viewBinding.searchKeyword.getWindowToken(), 0);
pageCurrentIndex = 1;
apiCallCurrentValue = 10;
viewBinding.progressBar.setVisibility(View.VISIBLE);
loadData(false, viewBinding.searchKeyword.getText().toString());
loadInitial(String.valueOf(viewBinding.searchKeyword.getText()), resultLimit);
adapter.setLoadMoreListener(() -> viewBinding.recyclerViewSearchIssues.post(() -> {
if(dataList.size() == resultLimit || pageSize == resultLimit) {
int page = (dataList.size() + resultLimit) / resultLimit;
loadMore(String.valueOf(viewBinding.searchKeyword.getText()), resultLimit, page);
}
}));
}
}
return false;
});
viewBinding.recyclerViewSearchIssues.addOnScrollListener(new InfiniteScrollListener(pageCurrentIndex, linearLayoutManager) {
@Override
public void onScrolledToEnd(int firstVisibleItemPosition) {
pageCurrentIndex++;
loadData(true, Objects.requireNonNull(viewBinding.searchKeyword.getText()).toString());
viewBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
viewBinding.pullToRefresh.setRefreshing(false);
loadInitial("", resultLimit);
adapter.notifyDataChanged();
}, 200));
adapter.setLoadMoreListener(() -> viewBinding.recyclerViewSearchIssues.post(() -> {
if(dataList.size() == resultLimit || pageSize == resultLimit) {
int page = (dataList.size() + resultLimit) / resultLimit;
loadMore(String.valueOf(viewBinding.searchKeyword.getText()), resultLimit, page);
}
});
}));
viewBinding.pullToRefresh.setOnRefreshListener(() -> {
pageCurrentIndex = 1;
apiCallCurrentValue = 10;
loadData(false, Objects.requireNonNull(viewBinding.searchKeyword.getText()).toString());
});
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(context, DividerItemDecoration.VERTICAL);
viewBinding.recyclerViewSearchIssues.setHasFixedSize(true);
viewBinding.recyclerViewSearchIssues.addItemDecoration(dividerItemDecoration);
viewBinding.recyclerViewSearchIssues.setLayoutManager(new LinearLayoutManager(context));
viewBinding.recyclerViewSearchIssues.setAdapter(adapter);
loadData(false, "");
loadInitial("", resultLimit);
return viewBinding.getRoot();
}
private void loadData(boolean append, String searchKeyword) {
viewBinding.noData.setVisibility(View.GONE);
int apiCallDefaultLimit = 10;
if(apiCallDefaultLimit > apiCallCurrentValue) {
return;
}
if(pageCurrentIndex == 1 || !append) {
dataList.clear();
adapter.notifyDataSetChanged();
viewBinding.pullToRefresh.setRefreshing(false);
viewBinding.progressBar.setVisibility(View.VISIBLE);
}
else {
viewBinding.loadingMoreView.setVisibility(View.VISIBLE);
}
Call<List<Issues>> call = RetrofitClient.getApiInterface(getContext())
.queryIssues(Authorization.get(getContext()), searchKeyword, "issues", "open", pageCurrentIndex);
private void loadInitial(String searchKeyword, int resultLimit) {
Call<List<Issues>> call = RetrofitClient
.getApiInterface(context).queryIssues(Authorization.get(getContext()), searchKeyword, "issues", "open", resultLimit, 1);
call.enqueue(new Callback<List<Issues>>() {
@Override
public void onResponse(@NonNull Call<List<Issues>> call, @NonNull Response<List<Issues>> response) {
if(response.code() == 200) {
assert response.body() != null;
apiCallCurrentValue = response.body().size();
if(!append) {
if(response.isSuccessful()) {
if(response.body() != null && response.body().size() > 0) {
dataList.clear();
}
dataList.addAll(response.body());
adapter.notifyDataSetChanged();
adapter.notifyDataChanged();
viewBinding.noData.setVisibility(View.GONE);
}
else {
dataList.clear();
adapter.notifyDataChanged();
viewBinding.noData.setVisibility(View.VISIBLE);
}
onCleanup();
viewBinding.progressBar.setVisibility(View.GONE);
}
else if(response.code() == 404) {
viewBinding.noData.setVisibility(View.VISIBLE);
viewBinding.progressBar.setVisibility(View.GONE);
}
else {
Log.e(TAG, String.valueOf(response.code()));
}
}
@Override
public void onFailure(@NonNull Call<List<Issues>> call, @NonNull Throwable t) {
Log.e("onFailure", Objects.requireNonNull(t.getMessage()));
onCleanup();
Log.e(TAG, t.toString());
}
});
}
private void onCleanup() {
AppUtil.setMultiVisibility(View.GONE, viewBinding.loadingMoreView, viewBinding.progressBar);
if(dataList.isEmpty()) {
viewBinding.noData.setVisibility(View.VISIBLE);
private void loadMore(String searchKeyword, int resultLimit, int page) {
viewBinding.progressBar.setVisibility(View.VISIBLE);
Call<List<Issues>> call = RetrofitClient.getApiInterface(context)
.queryIssues(Authorization.get(getContext()), searchKeyword, "issues", "open", resultLimit, page);
call.enqueue(new Callback<List<Issues>>() {
@Override
public void onResponse(@NonNull Call<List<Issues>> call, @NonNull Response<List<Issues>> response) {
if(response.isSuccessful()) {
assert response.body() != null;
List<Issues> result = response.body();
if(result.size() > 0) {
pageSize = result.size();
dataList.addAll(result);
}
else {
SnackBar.info(context, viewBinding.getRoot(), getString(R.string.noMoreData));
adapter.setMoreDataAvailable(false);
}
adapter.notifyDataChanged();
viewBinding.progressBar.setVisibility(View.GONE);
}
else {
Log.e(TAG, String.valueOf(response.code()));
}
}
@Override
public void onFailure(@NonNull Call<List<Issues>> call, @NonNull Throwable t) {
Log.e(TAG, t.toString());
}
});
}

View File

@ -22,7 +22,6 @@ import org.mian.gitnex.helpers.Authorization;
import org.mian.gitnex.helpers.Constants;
import org.mian.gitnex.helpers.SnackBar;
import org.mian.gitnex.helpers.TinyDB;
import org.mian.gitnex.helpers.Version;
import java.util.ArrayList;
import java.util.List;
import retrofit2.Call;
@ -41,7 +40,7 @@ public class ExplorePublicOrganizationsFragment extends Fragment {
private Context context;
private int pageSize;
private final String TAG = Constants.publicOrganizations;
private int resultLimit = Constants.resultLimitOldGiteaInstances;
private int resultLimit;
@Nullable
@Override
@ -54,10 +53,7 @@ public class ExplorePublicOrganizationsFragment extends Fragment {
final String loginUid = tinyDb.getString("loginUid");
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
// if gitea is 1.12 or higher use the new limit
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
resultLimit = Constants.resultLimitNewGiteaInstances;
}
resultLimit = Constants.getCurrentResultLimit(context);
fragmentPublicOrgBinding.addNewOrganization.setVisibility(View.GONE);
organizationsList = new ArrayList<>();
@ -126,7 +122,7 @@ public class ExplorePublicOrganizationsFragment extends Fragment {
private void loadMore(String token, int page, int resultLimit) {
fragmentPublicOrgBinding.progressLoadMore.setVisibility(View.VISIBLE);
fragmentPublicOrgBinding.progressBar.setVisibility(View.VISIBLE);
Call<List<Organization>> call = RetrofitClient.getApiInterface(context).getAllOrgs(token, page, resultLimit);
call.enqueue(new Callback<List<Organization>>() {
@Override
@ -144,7 +140,7 @@ public class ExplorePublicOrganizationsFragment extends Fragment {
}
}
adapter.notifyDataChanged();
fragmentPublicOrgBinding.progressLoadMore.setVisibility(View.GONE);
fragmentPublicOrgBinding.progressBar.setVisibility(View.GONE);
}
else {
Log.e(TAG, String.valueOf(response.code()));

View File

@ -6,6 +6,8 @@ import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
@ -26,12 +28,10 @@ import org.mian.gitnex.adapters.ExploreRepositoriesAdapter;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.databinding.CustomExploreRepositoriesDialogBinding;
import org.mian.gitnex.databinding.FragmentExploreRepoBinding;
import org.mian.gitnex.helpers.AppUtil;
import org.mian.gitnex.helpers.Authorization;
import org.mian.gitnex.helpers.Constants;
import org.mian.gitnex.helpers.InfiniteScrollListener;
import org.mian.gitnex.helpers.SnackBar;
import org.mian.gitnex.helpers.TinyDB;
import org.mian.gitnex.helpers.Version;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@ -42,19 +42,21 @@ import retrofit2.Response;
/**
* Template Author M M Arif
* Author 6543
* Modified M M Arif
*/
public class ExploreRepositoriesFragment extends Fragment {
private FragmentExploreRepoBinding viewBinding;
private Context ctx;
private Context context;
private TinyDB tinyDb;
private int pageCurrentIndex = 1;
private boolean repoTypeInclude = true;
private String sort = "updated";
private String order = "desc";
private int limit = 10;
private int pageSize;
private final boolean repoTypeInclude = true;
private final String sort = "updated";
private final String order = "desc";
private final String TAG = Constants.exploreRepositories;
private int resultLimit;
private List<UserRepositories> dataList;
private ExploreRepositoriesAdapter adapter;
@ -67,164 +69,130 @@ public class ExploreRepositoriesFragment extends Fragment {
viewBinding = FragmentExploreRepoBinding.inflate(inflater, container, false);
setHasOptionsMenu(true);
ctx = getContext();
context = getContext();
tinyDb = TinyDB.getInstance(getContext());
dataList = new ArrayList<>();
adapter = new ExploreRepositoriesAdapter(dataList, ctx);
adapter = new ExploreRepositoriesAdapter(dataList, context);
tinyDb.putBoolean("exploreRepoIncludeTopic", false);
tinyDb.putBoolean("exploreRepoIncludeDescription", false);
tinyDb.putBoolean("exploreRepoIncludeTemplate", false);
tinyDb.putBoolean("exploreRepoOnlyArchived", false);
// if gitea is 1.12 or higher use the new limit
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
limit = Constants.resultLimitNewGiteaInstances;
}
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(ctx);
viewBinding.recyclerViewReposSearch.setHasFixedSize(true);
viewBinding.recyclerViewReposSearch.setLayoutManager(linearLayoutManager);
viewBinding.recyclerViewReposSearch.setAdapter(adapter);
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(viewBinding.recyclerViewReposSearch.getContext(),
DividerItemDecoration.VERTICAL);
viewBinding.recyclerViewReposSearch.addItemDecoration(dividerItemDecoration);
resultLimit = Constants.getCurrentResultLimit(context);
viewBinding.searchKeyword.setOnEditorActionListener((v1, actionId, event) -> {
if(actionId == EditorInfo.IME_ACTION_SEND) {
if(!Objects.requireNonNull(viewBinding.searchKeyword.getText()).toString().equals("")) {
InputMethodManager imm = (InputMethodManager) requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(viewBinding.searchKeyword.getWindowToken(), 0);
// if gitea is 1.12 or higher use the new limit
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
limit = Constants.resultLimitNewGiteaInstances;
}
else {
limit = 10;
}
pageCurrentIndex = 1;
viewBinding.progressBar.setVisibility(View.VISIBLE);
loadData(false, viewBinding.searchKeyword.getText().toString(), tinyDb.getBoolean("exploreRepoIncludeTopic"), tinyDb.getBoolean("exploreRepoIncludeDescription"), tinyDb.getBoolean("exploreRepoIncludeTemplate"), tinyDb.getBoolean("exploreRepoOnlyArchived"));
loadInitial(String.valueOf(viewBinding.searchKeyword.getText()), tinyDb.getBoolean("exploreRepoIncludeTopic"), tinyDb.getBoolean("exploreRepoIncludeDescription"), tinyDb.getBoolean("exploreRepoIncludeTemplate"), tinyDb.getBoolean("exploreRepoOnlyArchived"), resultLimit);
adapter.setLoadMoreListener(() -> viewBinding.recyclerViewReposSearch.post(() -> {
if(dataList.size() == resultLimit || pageSize == resultLimit) {
int page = (dataList.size() + resultLimit) / resultLimit;
loadMore(String.valueOf(viewBinding.searchKeyword.getText()), tinyDb.getBoolean("exploreRepoIncludeTopic"), tinyDb.getBoolean("exploreRepoIncludeDescription"), tinyDb.getBoolean("exploreRepoIncludeTemplate"), tinyDb.getBoolean("exploreRepoOnlyArchived"), resultLimit, page);
}
}));
}
}
return false;
});
viewBinding.recyclerViewReposSearch.addOnScrollListener(new InfiniteScrollListener(pageCurrentIndex, linearLayoutManager) {
viewBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
viewBinding.pullToRefresh.setRefreshing(false);
loadInitial("", tinyDb.getBoolean("exploreRepoIncludeTopic"), tinyDb.getBoolean("exploreRepoIncludeDescription"), tinyDb.getBoolean("exploreRepoIncludeTemplate"), tinyDb.getBoolean("exploreRepoOnlyArchived"), resultLimit);
adapter.notifyDataChanged();
}, 200));
@Override
public void onScrolledToEnd(int firstVisibleItemPosition) {
pageCurrentIndex++;
loadData(true, Objects.requireNonNull(viewBinding.searchKeyword.getText()).toString(), tinyDb.getBoolean("exploreRepoIncludeTopic"), tinyDb.getBoolean("exploreRepoIncludeDescription"), tinyDb.getBoolean("exploreRepoIncludeTemplate"), tinyDb.getBoolean("exploreRepoOnlyArchived"));
adapter.setLoadMoreListener(() -> viewBinding.recyclerViewReposSearch.post(() -> {
if(dataList.size() == resultLimit || pageSize == resultLimit) {
int page = (dataList.size() + resultLimit) / resultLimit;
loadMore(String.valueOf(viewBinding.searchKeyword.getText()), tinyDb.getBoolean("exploreRepoIncludeTopic"), tinyDb.getBoolean("exploreRepoIncludeDescription"), tinyDb.getBoolean("exploreRepoIncludeTemplate"), tinyDb.getBoolean("exploreRepoOnlyArchived"), resultLimit, page);
}
});
}));
viewBinding.pullToRefresh.setOnRefreshListener(() -> {
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(context, DividerItemDecoration.VERTICAL);
viewBinding.recyclerViewReposSearch.setHasFixedSize(true);
viewBinding.recyclerViewReposSearch.addItemDecoration(dividerItemDecoration);
viewBinding.recyclerViewReposSearch.setLayoutManager(new LinearLayoutManager(context));
viewBinding.recyclerViewReposSearch.setAdapter(adapter);
pageCurrentIndex = 1;
// if gitea is 1.12 or higher use the new limit
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
limit = Constants.resultLimitNewGiteaInstances;
}
else {
limit = 10;
}
loadData(false, Objects.requireNonNull(viewBinding.searchKeyword.getText()).toString(), tinyDb.getBoolean("exploreRepoIncludeTopic"), tinyDb.getBoolean("exploreRepoIncludeDescription"), tinyDb.getBoolean("exploreRepoIncludeTemplate"), tinyDb.getBoolean("exploreRepoOnlyArchived"));
});
loadData(false, "", tinyDb.getBoolean("exploreRepoIncludeTopic"), tinyDb.getBoolean("exploreRepoIncludeDescription"), tinyDb.getBoolean("exploreRepoIncludeTemplate"), tinyDb.getBoolean("exploreRepoOnlyArchived"));
loadInitial("", tinyDb.getBoolean("exploreRepoIncludeTopic"), tinyDb.getBoolean("exploreRepoIncludeDescription"), tinyDb.getBoolean("exploreRepoIncludeTemplate"), tinyDb.getBoolean("exploreRepoOnlyArchived"), resultLimit);
return viewBinding.getRoot();
}
private void loadData(boolean append, String searchKeyword, boolean exploreRepoIncludeTopic, boolean exploreRepoIncludeDescription, boolean exploreRepoIncludeTemplate, boolean exploreRepoOnlyArchived) {
viewBinding.noData.setVisibility(View.GONE);
int apiCallDefaultLimit = 10;
// if gitea is 1.12 or higher use the new limit
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
apiCallDefaultLimit = Constants.resultLimitNewGiteaInstances;
}
if(apiCallDefaultLimit > limit) {
return;
}
if(pageCurrentIndex == 1 || !append) {
dataList.clear();
adapter.notifyDataSetChanged();
viewBinding.pullToRefresh.setRefreshing(false);
viewBinding.progressBar.setVisibility(View.VISIBLE);
}
else {
viewBinding.loadingMoreView.setVisibility(View.VISIBLE);
}
Call<ExploreRepositories> call = RetrofitClient.getApiInterface(ctx).queryRepos(Authorization.get(getContext()), searchKeyword, repoTypeInclude, sort, order, exploreRepoIncludeTopic, exploreRepoIncludeDescription, exploreRepoIncludeTemplate, exploreRepoOnlyArchived, limit, pageCurrentIndex);
private void loadInitial(String searchKeyword, boolean exploreRepoIncludeTopic, boolean exploreRepoIncludeDescription, boolean exploreRepoIncludeTemplate, boolean exploreRepoOnlyArchived, int resultLimit) {
Call<ExploreRepositories> call = RetrofitClient
.getApiInterface(context).queryRepos(Authorization.get(getContext()), searchKeyword, repoTypeInclude, sort, order, exploreRepoIncludeTopic, exploreRepoIncludeDescription, exploreRepoIncludeTemplate, exploreRepoOnlyArchived, resultLimit, 1);
call.enqueue(new Callback<ExploreRepositories>() {
@Override
public void onResponse(@NonNull Call<ExploreRepositories> call, @NonNull Response<ExploreRepositories> response) {
if(response.code() == 200) {
assert response.body() != null;
limit = response.body().getSearchedData().size();
if(!append) {
if(response.isSuccessful()) {
if(response.body() != null && response.body().getSearchedData().size() > 0) {
dataList.clear();
}
dataList.addAll(response.body().getSearchedData());
adapter.notifyDataSetChanged();
adapter.notifyDataChanged();
viewBinding.noData.setVisibility(View.GONE);
}
else {
dataList.clear();
adapter.notifyDataChanged();
viewBinding.noData.setVisibility(View.VISIBLE);
}
onCleanup();
viewBinding.progressBar.setVisibility(View.GONE);
}
else if(response.code() == 404) {
viewBinding.noData.setVisibility(View.VISIBLE);
viewBinding.progressBar.setVisibility(View.GONE);
}
else {
Log.e(TAG, String.valueOf(response.code()));
}
}
@Override
public void onFailure(@NonNull Call<ExploreRepositories> call, @NonNull Throwable t) {
Log.e("onFailure", Objects.requireNonNull(t.getMessage()));
onCleanup();
Log.e(TAG, t.toString());
}
});
}
private void onCleanup() {
private void loadMore(String searchKeyword, boolean exploreRepoIncludeTopic, boolean exploreRepoIncludeDescription, boolean exploreRepoIncludeTemplate, boolean exploreRepoOnlyArchived, int resultLimit, int page) {
AppUtil.setMultiVisibility(View.GONE, viewBinding.loadingMoreView, viewBinding.progressBar);
if(dataList.isEmpty()) {
viewBinding.noData.setVisibility(View.VISIBLE);
viewBinding.progressBar.setVisibility(View.VISIBLE);
Call<ExploreRepositories> call = RetrofitClient.getApiInterface(context)
.queryRepos(Authorization.get(getContext()), searchKeyword, repoTypeInclude, sort, order, exploreRepoIncludeTopic, exploreRepoIncludeDescription, exploreRepoIncludeTemplate, exploreRepoOnlyArchived, resultLimit, page);
call.enqueue(new Callback<ExploreRepositories>() {
@Override
public void onResponse(@NonNull Call<ExploreRepositories> call, @NonNull Response<ExploreRepositories> response) {
if(response.isSuccessful()) {
assert response.body() != null;
List<UserRepositories> result = response.body().getSearchedData();
if(result.size() > 0) {
pageSize = result.size();
dataList.addAll(result);
}
else {
SnackBar.info(context, viewBinding.getRoot(), getString(R.string.noMoreData));
adapter.setMoreDataAvailable(false);
}
adapter.notifyDataChanged();
viewBinding.progressBar.setVisibility(View.GONE);
}
else {
Log.e(TAG, String.valueOf(response.code()));
}
}
@Override
public void onFailure(@NonNull Call<ExploreRepositories> call, @NonNull Throwable t) {
Log.e(TAG, t.toString());
}
});
}
@ -235,7 +203,6 @@ public class ExploreRepositoriesFragment extends Fragment {
menu.clear();
inflater.inflate(R.menu.filter_menu, menu);
super.onCreateOptionsMenu(menu, inflater);
MenuItem filter = menu.findItem(R.id.filter);
filter.setOnMenuItemClickListener(filter_ -> {
@ -243,19 +210,17 @@ public class ExploreRepositoriesFragment extends Fragment {
showFilterOptions();
return false;
});
}
private void showFilterOptions() {
dialogFilterOptions = new Dialog(ctx, R.style.ThemeOverlay_MaterialComponents_Dialog_Alert);
dialogFilterOptions = new Dialog(context, R.style.ThemeOverlay_MaterialComponents_Dialog_Alert);
if (dialogFilterOptions.getWindow() != null) {
dialogFilterOptions.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
}
filterBinding = CustomExploreRepositoriesDialogBinding.inflate(LayoutInflater.from(ctx));
filterBinding = CustomExploreRepositoriesDialogBinding.inflate(LayoutInflater.from(context));
View view = filterBinding.getRoot();
dialogFilterOptions.setContentView(view);
@ -290,13 +255,10 @@ public class ExploreRepositoriesFragment extends Fragment {
@Override
public void onDetach() {
super.onDetach();
}
public interface OnFragmentInteractionListener {
void onFragmentInteraction(Uri uri);
}
}

View File

@ -0,0 +1,176 @@
package org.mian.gitnex.fragments;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import org.gitnex.tea4j.models.UserInfo;
import org.gitnex.tea4j.models.UserSearch;
import org.mian.gitnex.R;
import org.mian.gitnex.adapters.ExploreUsersAdapter;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.databinding.FragmentExploreUsersBinding;
import org.mian.gitnex.helpers.Authorization;
import org.mian.gitnex.helpers.Constants;
import org.mian.gitnex.helpers.SnackBar;
import org.mian.gitnex.helpers.TinyDB;
import org.mian.gitnex.helpers.Version;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
/**
* Author M M Arif
*/
public class ExploreUsersFragment extends Fragment {
private FragmentExploreUsersBinding viewBinding;
private Context context;
private List<UserInfo> usersList;
private ExploreUsersAdapter adapter;
private int pageSize;
private final String TAG = Constants.exploreUsers;
private int resultLimit;
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
viewBinding = FragmentExploreUsersBinding.inflate(inflater, container, false);
context = getContext();
resultLimit = Constants.getCurrentResultLimit(context);
usersList = new ArrayList<>();
adapter = new ExploreUsersAdapter(context, usersList);
viewBinding.searchKeyword.setOnEditorActionListener((v1, actionId, event) -> {
if(actionId == EditorInfo.IME_ACTION_SEND) {
if(!Objects.requireNonNull(viewBinding.searchKeyword.getText()).toString().equals("")) {
InputMethodManager imm = (InputMethodManager) requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(viewBinding.searchKeyword.getWindowToken(), 0);
viewBinding.progressBar.setVisibility(View.VISIBLE);
loadInitial(Authorization.get(context), String.valueOf(viewBinding.searchKeyword.getText()), resultLimit);
adapter.setLoadMoreListener(() -> viewBinding.recyclerViewExploreUsers.post(() -> {
if(usersList.size() == resultLimit || pageSize == resultLimit) {
int page = (usersList.size() + resultLimit) / resultLimit;
loadMore(Authorization.get(context), String.valueOf(viewBinding.searchKeyword.getText()), resultLimit, page);
}
}));
}
}
return false;
});
viewBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
viewBinding.pullToRefresh.setRefreshing(false);
loadInitial(Authorization.get(context), "", resultLimit);
adapter.notifyDataChanged();
}, 200));
adapter.setLoadMoreListener(() -> viewBinding.recyclerViewExploreUsers.post(() -> {
if(usersList.size() == resultLimit || pageSize == resultLimit) {
int page = (usersList.size() + resultLimit) / resultLimit;
loadMore(Authorization.get(context), "", resultLimit, page);
}
}));
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(context, DividerItemDecoration.VERTICAL);
viewBinding.recyclerViewExploreUsers.setHasFixedSize(true);
viewBinding.recyclerViewExploreUsers.addItemDecoration(dividerItemDecoration);
viewBinding.recyclerViewExploreUsers.setLayoutManager(new LinearLayoutManager(context));
viewBinding.recyclerViewExploreUsers.setAdapter(adapter);
loadInitial(Authorization.get(context), "", resultLimit);
return viewBinding.getRoot();
}
private void loadInitial(String token, String searchKeyword, int resultLimit) {
Call<UserSearch> call = RetrofitClient
.getApiInterface(context).getUserBySearch(token, searchKeyword, resultLimit, 1);
call.enqueue(new Callback<UserSearch>() {
@Override
public void onResponse(@NonNull Call<UserSearch> call, @NonNull Response<UserSearch> response) {
if(response.isSuccessful()) {
if(response.body() != null && response.body().getData().size() > 0) {
usersList.clear();
usersList.addAll(response.body().getData());
adapter.notifyDataChanged();
viewBinding.noData.setVisibility(View.GONE);
}
else {
usersList.clear();
adapter.notifyDataChanged();
viewBinding.noData.setVisibility(View.VISIBLE);
}
viewBinding.progressBar.setVisibility(View.GONE);
}
else if(response.code() == 404) {
viewBinding.noData.setVisibility(View.VISIBLE);
viewBinding.progressBar.setVisibility(View.GONE);
}
else {
Log.e(TAG, String.valueOf(response.code()));
}
}
@Override
public void onFailure(@NonNull Call<UserSearch> call, @NonNull Throwable t) {
Log.e(TAG, t.toString());
}
});
}
private void loadMore(String token, String searchKeyword, int resultLimit, int page) {
viewBinding.progressBar.setVisibility(View.VISIBLE);
Call<UserSearch> call = RetrofitClient.getApiInterface(context).getUserBySearch(token, searchKeyword, resultLimit, page);
call.enqueue(new Callback<UserSearch>() {
@Override
public void onResponse(@NonNull Call<UserSearch> call, @NonNull Response<UserSearch> response) {
if(response.isSuccessful()) {
assert response.body() != null;
List<UserInfo> result = response.body().getData();
if(result != null) {
if(result.size() > 0) {
pageSize = result.size();
usersList.addAll(result);
}
else {
SnackBar.info(context, viewBinding.getRoot(), getString(R.string.noMoreData));
adapter.setMoreDataAvailable(false);
}
}
adapter.notifyDataChanged();
viewBinding.progressBar.setVisibility(View.GONE);
}
else {
Log.e(TAG, String.valueOf(response.code()));
}
}
@Override
public void onFailure(@NonNull Call<UserSearch> call, @NonNull Throwable t) {
Log.e(TAG, t.toString());
}
});
}
}

View File

@ -11,6 +11,7 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
import androidx.activity.OnBackPressedCallback;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
@ -121,6 +122,24 @@ public class FilesFragment extends Fragment implements FilesAdapter.FilesAdapter
});
requireActivity().getOnBackPressedDispatcher().addCallback(getViewLifecycleOwner(), new OnBackPressedCallback(true) {
@Override
public void handleOnBackPressed() {
if(path.size() == 0 || RepoDetailActivity.mViewPager.getCurrentItem() != 1) {
requireActivity().finish();
return;
}
path.remove(path.size() - 1);
binding.breadcrumbsView.removeLastItem();
if(path.size() == 0) {
fetchDataAsync(Authorization.get(getContext()), repoOwner, repoName, ref);
} else {
fetchDataAsyncSub(Authorization.get(getContext()), repoOwner, repoName, path.toString(), ref);
}
}
});
((RepoDetailActivity) requireActivity()).setFragmentRefreshListenerFiles(repoBranch -> {
path.clear();

View File

@ -12,15 +12,11 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import org.gitnex.tea4j.models.Issues;
import org.mian.gitnex.R;
import org.mian.gitnex.activities.RepoDetailActivity;
@ -45,18 +41,16 @@ import retrofit2.Response;
public class IssuesFragment extends Fragment {
private FragmentIssuesBinding fragmentIssuesBinding;
private Context context;
private Menu menu;
private RecyclerView recyclerView;
private List<Issues> issuesList;
private IssuesAdapter adapter;
private Context context;
private int pageSize = Constants.issuesPageInit;
private ProgressBar mProgressBar;
private final String TAG = Constants.tagIssuesList;
private TextView noDataIssues;
private int resultLimit = Constants.resultLimitOldGiteaInstances;
private final String requestType = Constants.issuesRequestType;
private ProgressBar progressLoadMore;
@Nullable
@Override
@ -66,7 +60,7 @@ public class IssuesFragment extends Fragment {
setHasOptionsMenu(true);
context = getContext();
TinyDB tinyDb = TinyDB.getInstance(getContext());
TinyDB tinyDb = TinyDB.getInstance(context);
String repoFullName = tinyDb.getString("repoFullName");
String[] parts = repoFullName.split("/");
final String repoOwner = parts[0];
@ -74,39 +68,32 @@ public class IssuesFragment extends Fragment {
final String loginUid = tinyDb.getString("loginUid");
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
final SwipeRefreshLayout swipeRefresh = fragmentIssuesBinding.pullToRefresh;
// if gitea is 1.12 or higher use the new limit
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
resultLimit = Constants.resultLimitNewGiteaInstances;
}
recyclerView = fragmentIssuesBinding.recyclerView;
issuesList = new ArrayList<>();
progressLoadMore = fragmentIssuesBinding.progressLoadMore;
mProgressBar = fragmentIssuesBinding.progressBar;
noDataIssues = fragmentIssuesBinding.noDataIssues;
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
swipeRefresh.setRefreshing(false);
loadInitial(instanceToken, repoOwner, repoName, resultLimit, requestType, tinyDb.getString("repoIssuesState"));
fragmentIssuesBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
fragmentIssuesBinding.pullToRefresh.setRefreshing(false);
loadInitial(instanceToken, repoOwner, repoName, resultLimit, requestType, tinyDb.getString("repoIssuesState"), "");
adapter.notifyDataChanged();
}, 200));
adapter = new IssuesAdapter(getContext(), issuesList);
adapter.setLoadMoreListener(() -> recyclerView.post(() -> {
adapter = new IssuesAdapter(context, issuesList);
adapter.setLoadMoreListener(() -> fragmentIssuesBinding.recyclerView.post(() -> {
if(issuesList.size() == resultLimit || pageSize == resultLimit) {
int page = (issuesList.size() + resultLimit) / resultLimit;
loadMore(Authorization.get(getContext()), repoOwner, repoName, page, resultLimit, requestType, tinyDb.getString("repoIssuesState"));
loadMore(Authorization.get(context), repoOwner, repoName, page, resultLimit, requestType, tinyDb.getString("repoIssuesState"), "");
}
}));
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(), DividerItemDecoration.VERTICAL);
recyclerView.setHasFixedSize(true);
recyclerView.addItemDecoration(dividerItemDecoration);
recyclerView.setLayoutManager(new LinearLayoutManager(context));
recyclerView.setAdapter(adapter);
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(fragmentIssuesBinding.recyclerView.getContext(), DividerItemDecoration.VERTICAL);
fragmentIssuesBinding.recyclerView.setHasFixedSize(true);
fragmentIssuesBinding.recyclerView.addItemDecoration(dividerItemDecoration);
fragmentIssuesBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
fragmentIssuesBinding.recyclerView.setAdapter(adapter);
((RepoDetailActivity) requireActivity()).setFragmentRefreshListener(issueState -> {
@ -119,25 +106,47 @@ public class IssuesFragment extends Fragment {
issuesList.clear();
adapter = new IssuesAdapter(getContext(), issuesList);
adapter.setLoadMoreListener(() -> recyclerView.post(() -> {
adapter = new IssuesAdapter(context, issuesList);
adapter.setLoadMoreListener(() -> fragmentIssuesBinding.recyclerView.post(() -> {
if(issuesList.size() == resultLimit || pageSize == resultLimit) {
int page = (issuesList.size() + resultLimit) / resultLimit;
loadMore(Authorization.get(getContext()), repoOwner, repoName, page, resultLimit, requestType, tinyDb.getString("repoIssuesState"));
loadMore(Authorization.get(context), repoOwner, repoName, page, resultLimit, requestType, tinyDb.getString("repoIssuesState"), "");
}
}));
tinyDb.putString("repoIssuesState", issueState);
mProgressBar.setVisibility(View.VISIBLE);
noDataIssues.setVisibility(View.GONE);
fragmentIssuesBinding.progressBar.setVisibility(View.VISIBLE);
fragmentIssuesBinding.noDataIssues.setVisibility(View.GONE);
loadInitial(Authorization.get(getContext()), repoOwner, repoName, resultLimit, requestType, issueState);
recyclerView.setAdapter(adapter);
loadInitial(Authorization.get(context), repoOwner, repoName, resultLimit, requestType, issueState, "");
fragmentIssuesBinding.recyclerView.setAdapter(adapter);
});
loadInitial(Authorization.get(getContext()), repoOwner, repoName, resultLimit, requestType, tinyDb.getString("repoIssuesState"));
((RepoDetailActivity) requireActivity()).setFragmentRefreshListenerFilterIssuesByMilestone(filterIssueByMilestone -> {
issuesList.clear();
adapter = new IssuesAdapter(context, issuesList);
adapter.setLoadMoreListener(() -> fragmentIssuesBinding.recyclerView.post(() -> {
if(issuesList.size() == resultLimit || pageSize == resultLimit) {
int page = (issuesList.size() + resultLimit) / resultLimit;
loadMore(Authorization.get(context), repoOwner, repoName, page, resultLimit, requestType, tinyDb.getString("repoIssuesState"), tinyDb.getString("issueMilestoneFilterId"));
}
}));
tinyDb.putString("issueMilestoneFilterId", filterIssueByMilestone);
fragmentIssuesBinding.progressBar.setVisibility(View.VISIBLE);
fragmentIssuesBinding.noDataIssues.setVisibility(View.GONE);
loadInitial(Authorization.get(context), repoOwner, repoName, resultLimit, requestType, tinyDb.getString("repoIssuesState"), filterIssueByMilestone);
fragmentIssuesBinding.recyclerView.setAdapter(adapter);
});
loadInitial(Authorization.get(context), repoOwner, repoName, resultLimit, requestType, tinyDb.getString("repoIssuesState"), tinyDb.getString("issueMilestoneFilterId"));
return fragmentIssuesBinding.getRoot();
}
@ -146,7 +155,7 @@ public class IssuesFragment extends Fragment {
public void onResume() {
super.onResume();
TinyDB tinyDb = TinyDB.getInstance(getContext());
TinyDB tinyDb = TinyDB.getInstance(context);
String repoFullName = tinyDb.getString("repoFullName");
String[] parts = repoFullName.split("/");
@ -154,14 +163,14 @@ public class IssuesFragment extends Fragment {
final String repoName = parts[1];
if(tinyDb.getBoolean("resumeIssues")) {
loadInitial(Authorization.get(getContext()), repoOwner, repoName, resultLimit, requestType, tinyDb.getString("repoIssuesState"));
loadInitial(Authorization.get(context), repoOwner, repoName, resultLimit, requestType, tinyDb.getString("repoIssuesState"), tinyDb.getString("issueMilestoneFilterId"));
tinyDb.putBoolean("resumeIssues", false);
}
}
private void loadInitial(String token, String repoOwner, String repoName, int resultLimit, String requestType, String issueState) {
private void loadInitial(String token, String repoOwner, String repoName, int resultLimit, String requestType, String issueState, String filterByMilestone) {
Call<List<Issues>> call = RetrofitClient.getApiInterface(context).getIssues(token, repoOwner, repoName, 1, resultLimit, requestType, issueState);
Call<List<Issues>> call = RetrofitClient.getApiInterface(context).getIssues(token, repoOwner, repoName, 1, resultLimit, requestType, issueState, filterByMilestone);
call.enqueue(new Callback<List<Issues>>() {
@Override
@ -173,18 +182,18 @@ public class IssuesFragment extends Fragment {
issuesList.clear();
issuesList.addAll(response.body());
adapter.notifyDataChanged();
noDataIssues.setVisibility(View.GONE);
fragmentIssuesBinding.noDataIssues.setVisibility(View.GONE);
}
else {
issuesList.clear();
adapter.notifyDataChanged();
noDataIssues.setVisibility(View.VISIBLE);
fragmentIssuesBinding.noDataIssues.setVisibility(View.VISIBLE);
}
mProgressBar.setVisibility(View.GONE);
fragmentIssuesBinding.progressBar.setVisibility(View.GONE);
}
else if(response.code() == 404) {
noDataIssues.setVisibility(View.VISIBLE);
mProgressBar.setVisibility(View.GONE);
fragmentIssuesBinding.noDataIssues.setVisibility(View.VISIBLE);
fragmentIssuesBinding.progressBar.setVisibility(View.GONE);
}
else {
Log.e(TAG, String.valueOf(response.code()));
@ -198,11 +207,11 @@ public class IssuesFragment extends Fragment {
});
}
private void loadMore(String token, String repoOwner, String repoName, int page, int resultLimit, String requestType, String issueState) {
private void loadMore(String token, String repoOwner, String repoName, int page, int resultLimit, String requestType, String issueState, String filterByMilestone) {
progressLoadMore.setVisibility(View.VISIBLE);
fragmentIssuesBinding.progressBar.setVisibility(View.VISIBLE);
Call<List<Issues>> call = RetrofitClient.getApiInterface(context).getIssues(token, repoOwner, repoName, page, resultLimit, requestType, issueState);
Call<List<Issues>> call = RetrofitClient.getApiInterface(context).getIssues(token, repoOwner, repoName, page, resultLimit, requestType, issueState, filterByMilestone);
call.enqueue(new Callback<List<Issues>>() {
@ -220,7 +229,7 @@ public class IssuesFragment extends Fragment {
adapter.setMoreDataAvailable(false);
}
adapter.notifyDataChanged();
progressLoadMore.setVisibility(View.GONE);
fragmentIssuesBinding.progressBar.setVisibility(View.GONE);
}
else {
Log.e(TAG, String.valueOf(response.code()));
@ -278,7 +287,7 @@ public class IssuesFragment extends Fragment {
if(d == null || d.getTitle() == null || d.getBody() == null) {
continue;
}
if(d.getTitle().toLowerCase().contains(text) || d.getBody().toLowerCase().contains(text)) {
if(d.getTitle().toLowerCase().contains(text) || d.getBody().toLowerCase().contains(text) || String.valueOf(d.getNumber()).startsWith(text)) {
arr.add(d);
}
}

View File

@ -1,25 +1,30 @@
package org.mian.gitnex.fragments;
import android.net.Uri;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import org.gitnex.tea4j.models.UserInfo;
import org.mian.gitnex.R;
import org.mian.gitnex.adapters.MyProfileFollowersAdapter;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.databinding.FragmentProfileFollowersFollowingBinding;
import org.mian.gitnex.helpers.Authorization;
import org.mian.gitnex.viewmodels.ProfileFollowersViewModel;
import org.mian.gitnex.helpers.Constants;
import org.mian.gitnex.helpers.SnackBar;
import java.util.ArrayList;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
/**
* Author M M Arif
@ -27,106 +32,119 @@ import org.mian.gitnex.viewmodels.ProfileFollowersViewModel;
public class MyProfileFollowersFragment extends Fragment {
private ProgressBar mProgressBar;
private FragmentProfileFollowersFollowingBinding viewBinding;
private Context context;
private List<UserInfo> dataList;
private MyProfileFollowersAdapter adapter;
private RecyclerView mRecyclerView;
private TextView noDataFollowers;
private static String repoNameF = "param2";
private static String repoOwnerF = "param1";
private String repoName;
private String repoOwner;
private OnFragmentInteractionListener mListener;
public MyProfileFollowersFragment() {
}
public static MyProfileFollowersFragment newInstance(String param1, String param2) {
MyProfileFollowersFragment fragment = new MyProfileFollowersFragment();
Bundle args = new Bundle();
args.putString(repoOwnerF, param1);
args.putString(repoNameF, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
repoName = getArguments().getString(repoNameF);
repoOwner = getArguments().getString(repoOwnerF);
}
}
private int pageSize;
private final String TAG = Constants.tagFollowers;
private int resultLimit;
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
FragmentProfileFollowersFollowingBinding fragmentProfileFollowersFollowingBinding = FragmentProfileFollowersFollowingBinding.inflate(inflater, container, false);
viewBinding = FragmentProfileFollowersFollowingBinding.inflate(inflater, container, false);
context = getContext();
final SwipeRefreshLayout swipeRefresh = fragmentProfileFollowersFollowingBinding.pullToRefresh;
noDataFollowers = fragmentProfileFollowersFollowingBinding.noData;
mRecyclerView = fragmentProfileFollowersFollowingBinding.recyclerView;
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(), DividerItemDecoration.VERTICAL);
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
mRecyclerView.addItemDecoration(dividerItemDecoration);
mProgressBar = fragmentProfileFollowersFollowingBinding.progressBar;
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
swipeRefresh.setRefreshing(false);
ProfileFollowersViewModel.loadFollowersList(Authorization.get(getContext()), getContext());
dataList = new ArrayList<>();
adapter = new MyProfileFollowersAdapter(dataList, context);
resultLimit = Constants.getCurrentResultLimit(context);
viewBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
viewBinding.pullToRefresh.setRefreshing(false);
loadInitial(resultLimit);
adapter.notifyDataChanged();
}, 200));
fetchDataAsync(Authorization.get(getContext()));
adapter.setLoadMoreListener(() -> viewBinding.recyclerView.post(() -> {
if(dataList.size() == resultLimit || pageSize == resultLimit) {
int page = (dataList.size() + resultLimit) / resultLimit;
loadMore(resultLimit, page);
}
}));
return fragmentProfileFollowersFollowingBinding.getRoot();
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(context, DividerItemDecoration.VERTICAL);
viewBinding.recyclerView.setHasFixedSize(true);
viewBinding.recyclerView.addItemDecoration(dividerItemDecoration);
viewBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
viewBinding.recyclerView.setAdapter(adapter);
loadInitial(resultLimit);
return viewBinding.getRoot();
}
private void fetchDataAsync(String instanceToken) {
private void loadInitial(int resultLimit) {
ProfileFollowersViewModel pfModel = new ViewModelProvider(this).get(ProfileFollowersViewModel.class);
pfModel.getFollowersList(instanceToken, getContext()).observe(getViewLifecycleOwner(), pfListMain -> {
adapter = new MyProfileFollowersAdapter(getContext(), pfListMain);
if(adapter.getItemCount() > 0) {
mRecyclerView.setAdapter(adapter);
noDataFollowers.setVisibility(View.GONE);
Call<List<UserInfo>> call = RetrofitClient
.getApiInterface(context)
.getFollowers(Authorization.get(getContext()), 1, resultLimit);
call.enqueue(new Callback<List<UserInfo>>() {
@Override
public void onResponse(@NonNull Call<List<UserInfo>> call, @NonNull Response<List<UserInfo>> response) {
if(response.isSuccessful()) {
if(response.body() != null && response.body().size() > 0) {
dataList.clear();
dataList.addAll(response.body());
adapter.notifyDataChanged();
viewBinding.noData.setVisibility(View.GONE);
}
else {
adapter.notifyDataSetChanged();
mRecyclerView.setAdapter(adapter);
noDataFollowers.setVisibility(View.VISIBLE);
dataList.clear();
adapter.notifyDataChanged();
viewBinding.noData.setVisibility(View.VISIBLE);
}
mProgressBar.setVisibility(View.GONE);
});
viewBinding.progressBar.setVisibility(View.GONE);
}
public void onButtonPressed(Uri uri) {
if (mListener != null) {
mListener.onFragmentInteraction(uri);
else if(response.code() == 404) {
viewBinding.noData.setVisibility(View.VISIBLE);
viewBinding.progressBar.setVisibility(View.GONE);
}
else {
Log.e(TAG, String.valueOf(response.code()));
}
}
@Override
public void onDetach() {
super.onDetach();
mListener = null;
public void onFailure(@NonNull Call<List<UserInfo>> call, @NonNull Throwable t) {
Log.e(TAG, t.toString());
}
});
}
public interface OnFragmentInteractionListener {
void onFragmentInteraction(Uri uri);
private void loadMore(int resultLimit, int page) {
viewBinding.progressBar.setVisibility(View.VISIBLE);
Call<List<UserInfo>> call = RetrofitClient.getApiInterface(context)
.getFollowers(Authorization.get(getContext()), page, resultLimit);
call.enqueue(new Callback<List<UserInfo>>() {
@Override
public void onResponse(@NonNull Call<List<UserInfo>> call, @NonNull Response<List<UserInfo>> response) {
if(response.isSuccessful()) {
assert response.body() != null;
List<UserInfo> result = response.body();
if(result.size() > 0) {
pageSize = result.size();
dataList.addAll(result);
}
else {
SnackBar.info(context, viewBinding.getRoot(), getString(R.string.noMoreData));
adapter.setMoreDataAvailable(false);
}
adapter.notifyDataChanged();
viewBinding.progressBar.setVisibility(View.GONE);
}
else {
Log.e(TAG, String.valueOf(response.code()));
}
}
@Override
public void onFailure(@NonNull Call<List<UserInfo>> call, @NonNull Throwable t) {
Log.e(TAG, t.toString());
}
});
}
}

View File

@ -1,26 +1,30 @@
package org.mian.gitnex.fragments;
import android.net.Uri;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import org.gitnex.tea4j.models.UserInfo;
import org.mian.gitnex.R;
import org.mian.gitnex.adapters.MyProfileFollowingAdapter;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.databinding.FragmentProfileFollowersFollowingBinding;
import org.mian.gitnex.helpers.Authorization;
import org.mian.gitnex.helpers.TinyDB;
import org.mian.gitnex.viewmodels.ProfileFollowingViewModel;
import org.mian.gitnex.helpers.Constants;
import org.mian.gitnex.helpers.SnackBar;
import java.util.ArrayList;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
/**
* Author M M Arif
@ -28,108 +32,118 @@ import org.mian.gitnex.viewmodels.ProfileFollowingViewModel;
public class MyProfileFollowingFragment extends Fragment {
private ProgressBar mProgressBar;
private FragmentProfileFollowersFollowingBinding viewBinding;
private Context context;
private List<UserInfo> dataList;
private MyProfileFollowingAdapter adapter;
private RecyclerView mRecyclerView;
private TextView noDataFollowing;
private static final String repoNameF = "param2";
private static final String repoOwnerF = "param1";
private String repoName;
private String repoOwner;
private OnFragmentInteractionListener mListener;
public MyProfileFollowingFragment() {
}
public static MyProfileFollowingFragment newInstance(String param1, String param2) {
MyProfileFollowingFragment fragment = new MyProfileFollowingFragment();
Bundle args = new Bundle();
args.putString(repoOwnerF, param1);
args.putString(repoNameF, param2);
fragment.setArguments(args);
return fragment;
}
private int pageSize;
private final String TAG = Constants.tagFollowing;
private int resultLimit;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
repoName = getArguments().getString(repoNameF);
repoOwner = getArguments().getString(repoOwnerF);
}
}
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
viewBinding = FragmentProfileFollowersFollowingBinding.inflate(inflater, container, false);
context = getContext();
FragmentProfileFollowersFollowingBinding fragmentProfileFollowersFollowingBinding = FragmentProfileFollowersFollowingBinding.inflate(inflater, container, false);
TinyDB tinyDb = TinyDB.getInstance(getContext());
final SwipeRefreshLayout swipeRefresh = fragmentProfileFollowersFollowingBinding.pullToRefresh;
noDataFollowing = fragmentProfileFollowersFollowingBinding.noData;
mRecyclerView = fragmentProfileFollowersFollowingBinding.recyclerView;
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(), DividerItemDecoration.VERTICAL);
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
mRecyclerView.addItemDecoration(dividerItemDecoration);
mProgressBar = fragmentProfileFollowersFollowingBinding.progressBar;
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
swipeRefresh.setRefreshing(false);
ProfileFollowingViewModel.loadFollowingList(Authorization.get(getContext()), getContext());
dataList = new ArrayList<>();
adapter = new MyProfileFollowingAdapter(dataList, context);
resultLimit = Constants.getCurrentResultLimit(context);
viewBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
viewBinding.pullToRefresh.setRefreshing(false);
loadInitial(resultLimit);
adapter.notifyDataChanged();
}, 200));
fetchDataAsync(Authorization.get(getContext()));
adapter.setLoadMoreListener(() -> viewBinding.recyclerView.post(() -> {
if(dataList.size() == resultLimit || pageSize == resultLimit) {
int page = (dataList.size() + resultLimit) / resultLimit;
loadMore(resultLimit, page);
}
}));
return fragmentProfileFollowersFollowingBinding.getRoot();
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(context, DividerItemDecoration.VERTICAL);
viewBinding.recyclerView.setHasFixedSize(true);
viewBinding.recyclerView.addItemDecoration(dividerItemDecoration);
viewBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
viewBinding.recyclerView.setAdapter(adapter);
loadInitial(resultLimit);
return viewBinding.getRoot();
}
private void fetchDataAsync(String instanceToken) {
private void loadInitial(int resultLimit) {
ProfileFollowingViewModel pfModel = new ViewModelProvider(this).get(ProfileFollowingViewModel.class);
pfModel.getFollowingList(instanceToken, getContext()).observe(getViewLifecycleOwner(), pfListMain -> {
adapter = new MyProfileFollowingAdapter(getContext(), pfListMain);
if(adapter.getItemCount() > 0) {
mRecyclerView.setAdapter(adapter);
noDataFollowing.setVisibility(View.GONE);
Call<List<UserInfo>> call = RetrofitClient
.getApiInterface(context)
.getFollowing(Authorization.get(getContext()), 1, resultLimit);
call.enqueue(new Callback<List<UserInfo>>() {
@Override
public void onResponse(@NonNull Call<List<UserInfo>> call, @NonNull Response<List<UserInfo>> response) {
if(response.isSuccessful()) {
if(response.body() != null && response.body().size() > 0) {
dataList.clear();
dataList.addAll(response.body());
adapter.notifyDataChanged();
viewBinding.noData.setVisibility(View.GONE);
}
else {
adapter.notifyDataSetChanged();
mRecyclerView.setAdapter(adapter);
noDataFollowing.setVisibility(View.VISIBLE);
dataList.clear();
adapter.notifyDataChanged();
viewBinding.noData.setVisibility(View.VISIBLE);
}
mProgressBar.setVisibility(View.GONE);
});
viewBinding.progressBar.setVisibility(View.GONE);
}
public void onButtonPressed(Uri uri) {
if (mListener != null) {
mListener.onFragmentInteraction(uri);
else if(response.code() == 404) {
viewBinding.noData.setVisibility(View.VISIBLE);
viewBinding.progressBar.setVisibility(View.GONE);
}
else {
Log.e(TAG, String.valueOf(response.code()));
}
}
@Override
public void onDetach() {
super.onDetach();
mListener = null;
public void onFailure(@NonNull Call<List<UserInfo>> call, @NonNull Throwable t) {
Log.e(TAG, t.toString());
}
});
}
public interface OnFragmentInteractionListener {
void onFragmentInteraction(Uri uri);
private void loadMore(int resultLimit, int page) {
viewBinding.progressBar.setVisibility(View.VISIBLE);
Call<List<UserInfo>> call = RetrofitClient.getApiInterface(context)
.getFollowing(Authorization.get(getContext()), page, resultLimit);
call.enqueue(new Callback<List<UserInfo>>() {
@Override
public void onResponse(@NonNull Call<List<UserInfo>> call, @NonNull Response<List<UserInfo>> response) {
if(response.isSuccessful()) {
assert response.body() != null;
List<UserInfo> result = response.body();
if(result.size() > 0) {
pageSize = result.size();
dataList.addAll(result);
}
else {
SnackBar.info(context, viewBinding.getRoot(), getString(R.string.noMoreData));
adapter.setMoreDataAvailable(false);
}
adapter.notifyDataChanged();
viewBinding.progressBar.setVisibility(View.GONE);
}
else {
Log.e(TAG, String.valueOf(response.code()));
}
}
@Override
public void onFailure(@NonNull Call<List<UserInfo>> call, @NonNull Throwable t) {
Log.e(TAG, t.toString());
}
});
}
}

View File

@ -170,10 +170,10 @@ public class MyProfileFragment extends Fragment {
switch (position) {
case 0: // followers
return MyProfileFollowersFragment.newInstance("repoOwner", "repoName");
return new MyProfileFollowersFragment();
case 1: // following
return MyProfileFollowingFragment.newInstance("repoOwner", "repoName");
return new MyProfileFollowingFragment();
case 2: // emails
return MyProfileEmailsFragment.newInstance("repoOwner", "repoName");
@ -215,5 +215,4 @@ public class MyProfileFragment extends Fragment {
return super.onOptionsItemSelected(item);
}
}
}

View File

@ -4,6 +4,8 @@ import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
@ -11,16 +13,12 @@ import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
import org.apache.commons.lang3.StringUtils;
import org.gitnex.tea4j.models.NotificationThread;
import org.mian.gitnex.R;
@ -31,7 +29,7 @@ import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.databinding.FragmentNotificationsBinding;
import org.mian.gitnex.helpers.AppUtil;
import org.mian.gitnex.helpers.Constants;
import org.mian.gitnex.helpers.InfiniteScrollListener;
import org.mian.gitnex.helpers.SnackBar;
import org.mian.gitnex.helpers.TinyDB;
import org.mian.gitnex.helpers.Toasty;
import java.io.IOException;
@ -44,28 +42,26 @@ import retrofit2.Response;
/**
* Author opyale
* Modified M M Arif
*/
public class NotificationsFragment extends Fragment implements NotificationsAdapter.OnNotificationClickedListener, NotificationsAdapter.OnMoreClickedListener, BottomSheetNotificationsFragment.OnOptionSelectedListener {
private FragmentNotificationsBinding viewBinding;
private List<NotificationThread> notificationThreads;
private NotificationsAdapter notificationsAdapter;
private NotificationsActions notificationsActions;
private ExtendedFloatingActionButton markAllAsRead;
private ProgressBar progressBar;
private ProgressBar loadingMoreView;
private TextView noDataNotifications;
private SwipeRefreshLayout pullToRefresh;
private Activity activity;
private Context context;
private TinyDB tinyDB;
private Menu menu;
private int pageCurrentIndex = 1;
private int pageResultLimit;
private int resultLimit;
private int pageSize;
private String currentFilterMode = "unread";
private final String TAG = Constants.tagNotifications;
private String instanceToken;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
@ -77,189 +73,200 @@ public class NotificationsFragment extends Fragment implements NotificationsAdap
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
FragmentNotificationsBinding fragmentNotificationsBinding = FragmentNotificationsBinding.inflate(inflater, container, false);
viewBinding = FragmentNotificationsBinding.inflate(inflater, container, false);
setHasOptionsMenu(true);
activity = requireActivity();
context = getContext();
tinyDB = TinyDB.getInstance(context);
pageResultLimit = Constants.getCurrentResultLimit(context);
tinyDB.putString("notificationsFilterState", currentFilterMode);
String loginUid = tinyDB.getString("loginUid");
instanceToken = "token " + tinyDB.getString(loginUid + "-token");
markAllAsRead = fragmentNotificationsBinding.markAllAsRead;
noDataNotifications = fragmentNotificationsBinding.noDataNotifications;
loadingMoreView = fragmentNotificationsBinding.loadingMoreView;
progressBar = fragmentNotificationsBinding.progressBar;
resultLimit = Constants.getCurrentResultLimit(context);
tinyDB.putString("notificationsFilterState", currentFilterMode);
notificationThreads = new ArrayList<>();
notificationsActions = new NotificationsActions(context);
notificationsAdapter = new NotificationsAdapter(context, notificationThreads, this, this);
RecyclerView recyclerView = fragmentNotificationsBinding.notifications;
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(), DividerItemDecoration.VERTICAL);
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(viewBinding.notifications.getContext(), DividerItemDecoration.VERTICAL);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(linearLayoutManager);
recyclerView.setAdapter(notificationsAdapter);
recyclerView.addItemDecoration(dividerItemDecoration);
recyclerView.addOnScrollListener(new InfiniteScrollListener(pageResultLimit, linearLayoutManager) {
viewBinding.notifications.setHasFixedSize(true);
viewBinding.notifications.setLayoutManager(linearLayoutManager);
viewBinding.notifications.setAdapter(notificationsAdapter);
viewBinding.notifications.addItemDecoration(dividerItemDecoration);
@Override
public void onScrolledToEnd(int firstVisibleItemPosition) {
pageCurrentIndex++;
loadNotifications(true);
viewBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
viewBinding.pullToRefresh.setRefreshing(false);
loadInitial(resultLimit);
notificationsAdapter.notifyDataChanged();
}, 200));
notificationsAdapter.setLoadMoreListener(() -> viewBinding.notifications.post(() -> {
if(notificationThreads.size() == resultLimit || pageSize == resultLimit) {
int page = (notificationThreads.size() + resultLimit) / resultLimit;
loadMore(resultLimit, page);
}
});
}));
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
viewBinding.notifications.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
if(currentFilterMode.equalsIgnoreCase("unread")) {
if(dy > 0 && markAllAsRead.isShown()) {
markAllAsRead.setVisibility(View.GONE);
} else if(dy < 0) {
markAllAsRead.setVisibility(View.VISIBLE);
if(dy > 0 && viewBinding.markAllAsRead.isShown()) {
viewBinding.markAllAsRead.setVisibility(View.GONE);
}
else if(dy < 0) {
viewBinding.markAllAsRead.setVisibility(View.VISIBLE);
}
}
}
@Override
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
}
});
markAllAsRead.setOnClickListener(v1 -> {
viewBinding.markAllAsRead.setOnClickListener(v1 -> {
Thread thread = new Thread(() -> {
try {
if(notificationsActions.setAllNotificationsRead(new Date())) {
activity.runOnUiThread(() -> {
Toasty.success(context, getString(R.string.markedNotificationsAsRead));
loadNotifications(true);
loadInitial(resultLimit);
});
}
}
catch(IOException e) {
activity.runOnUiThread(() -> Toasty.error(context, getString(R.string.genericError)));
Log.e("onError", e.toString());
}
});
thread.start();
});
pullToRefresh = fragmentNotificationsBinding.pullToRefresh;
pullToRefresh.setOnRefreshListener(() -> {
pageCurrentIndex = 1;
loadNotifications(false);
viewBinding.pullToRefresh.setOnRefreshListener(() -> {
loadInitial(resultLimit);
});
loadNotifications(false);
return fragmentNotificationsBinding.getRoot();
loadInitial(resultLimit);
return viewBinding.getRoot();
}
private void loadNotifications(boolean append) {
noDataNotifications.setVisibility(View.GONE);
if(pageCurrentIndex == 1 || !append) {
private void loadInitial(int resultLimit) {
notificationThreads.clear();
notificationsAdapter.notifyDataSetChanged();
pullToRefresh.setRefreshing(false);
progressBar.setVisibility(View.VISIBLE);
} else {
loadingMoreView.setVisibility(View.VISIBLE);
}
String loginUid = tinyDB.getString("loginUid");
String instanceToken = "token " + tinyDB.getString(loginUid + "-token");
notificationsAdapter.notifyDataChanged();
viewBinding.progressBar.setVisibility(View.VISIBLE);
notificationThreads.clear();
String[] filter = tinyDB.getString("notificationsFilterState").equals("read") ?
new String[]{"pinned", "read"} :
new String[]{"pinned", "unread"};
viewBinding.pullToRefresh.setRefreshing(false);
Call<List<NotificationThread>> call = RetrofitClient
.getApiInterface(context)
.getNotificationThreads(instanceToken, false, filter,
Constants.defaultOldestTimestamp, "",
pageCurrentIndex, pageResultLimit);
1, resultLimit);
call.enqueue(new Callback<List<NotificationThread>>() {
@Override
public void onResponse(@NonNull Call<List<NotificationThread>> call, @NonNull Response<List<NotificationThread>> response) {
if(response.code() == 200) {
assert response.body() != null;
if(!append) {
notificationThreads.clear();
}
if(response.isSuccessful()) {
if(response.body() != null && response.body().size() > 0) {
notificationThreads.addAll(response.body());
notificationsAdapter.notifyDataSetChanged();
} else {
Log.e("onError", String.valueOf(response.code()));
notificationsAdapter.notifyDataChanged();
viewBinding.noDataNotifications.setVisibility(View.GONE);
}
else {
notificationsAdapter.notifyDataChanged();
viewBinding.noDataNotifications.setVisibility(View.VISIBLE);
}
viewBinding.progressBar.setVisibility(View.GONE);
}
else if(response.code() == 404) {
viewBinding.noDataNotifications.setVisibility(View.VISIBLE);
viewBinding.progressBar.setVisibility(View.GONE);
}
else {
notificationsAdapter.notifyDataChanged();
Log.e(TAG, String.valueOf(response.code()));
}
onCleanup();
}
@Override
public void onFailure(@NonNull Call<List<NotificationThread>> call, @NonNull Throwable t) {
Log.e("onError", t.toString());
Log.e(TAG, t.toString());
onCleanup();
}
});
}
private void loadMore(int resultLimit, int page) {
String[] filter = tinyDB.getString("notificationsFilterState").equals("read") ?
new String[]{"pinned", "read"} :
new String[]{"pinned", "unread"};
viewBinding.progressBar.setVisibility(View.VISIBLE);
Call<List<NotificationThread>> call = RetrofitClient.getApiInterface(context)
.getNotificationThreads(instanceToken, false, filter,
Constants.defaultOldestTimestamp, "",
page, resultLimit);
call.enqueue(new Callback<List<NotificationThread>>() {
@Override
public void onResponse(@NonNull Call<List<NotificationThread>> call, @NonNull Response<List<NotificationThread>> response) {
if(response.code() == 200) {
assert response.body() != null;
List<NotificationThread> result = response.body();
if(result.size() > 0) {
pageSize = result.size();
notificationThreads.addAll(result);
}
else {
SnackBar.info(context, viewBinding.getRoot(), getString(R.string.noMoreData));
notificationsAdapter.setMoreDataAvailable(false);
}
notificationsAdapter.notifyDataChanged();
viewBinding.progressBar.setVisibility(View.GONE);
}
else {
Log.e(TAG, String.valueOf(response.code()));
}
onCleanup();
}
@Override
public void onFailure(@NonNull Call<List<NotificationThread>> call, @NonNull Throwable t) {
Log.e(TAG, t.toString());
onCleanup();
}
});
}
private void onCleanup() {
AppUtil.setMultiVisibility(View.GONE, loadingMoreView, progressBar);
pullToRefresh.setRefreshing(false);
AppUtil.setMultiVisibility(View.GONE, viewBinding.progressBar, viewBinding.progressBar);
viewBinding.pullToRefresh.setRefreshing(false);
if(currentFilterMode.equalsIgnoreCase("unread")) {
if(notificationThreads.isEmpty()) {
noDataNotifications.setVisibility(View.VISIBLE);
markAllAsRead.setVisibility(View.GONE);
viewBinding.noDataNotifications.setVisibility(View.VISIBLE);
viewBinding.markAllAsRead.setVisibility(View.GONE);
}
else {
markAllAsRead.setVisibility(View.VISIBLE);
viewBinding.markAllAsRead.setVisibility(View.VISIBLE);
}
}
});
}
private void changeFilterMode() {
@ -271,11 +278,10 @@ public class NotificationsFragment extends Fragment implements NotificationsAdap
menu.getItem(0).setIcon(filterIcon);
if(currentFilterMode.equalsIgnoreCase("read")) {
markAllAsRead.setVisibility(View.GONE);
} else {
markAllAsRead.setVisibility(View.VISIBLE);
viewBinding.markAllAsRead.setVisibility(View.GONE);
}
else {
viewBinding.markAllAsRead.setVisibility(View.VISIBLE);
}
}
@ -283,14 +289,11 @@ public class NotificationsFragment extends Fragment implements NotificationsAdap
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
this.menu = menu;
inflater.inflate(R.menu.filter_menu_notifications, menu);
currentFilterMode = tinyDB.getString("notificationsFilterState");
changeFilterMode();
super.onCreateOptionsMenu(menu, inflater);
}
@Override
@ -302,37 +305,25 @@ public class NotificationsFragment extends Fragment implements NotificationsAdap
bottomSheetNotificationsFilterFragment.show(getChildFragmentManager(), "notificationsFilterBottomSheet");
bottomSheetNotificationsFilterFragment.setOnDismissedListener(() -> {
pageCurrentIndex = 1;
currentFilterMode = tinyDB.getString("notificationsFilterState");
changeFilterMode();
loadNotifications(false);
loadInitial(resultLimit);
});
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
public void onNotificationClicked(NotificationThread notificationThread) {
Thread thread = new Thread(() -> {
try {
if(notificationThread.isUnread()) {
notificationsActions.setNotificationStatus(notificationThread, NotificationsActions.NotificationStatus.READ);
activity.runOnUiThread(() -> loadNotifications(false));
activity.runOnUiThread(() -> loadInitial(resultLimit));
}
} catch(IOException ignored) {}
});
thread.start();
@ -340,32 +331,25 @@ public class NotificationsFragment extends Fragment implements NotificationsAdap
if(StringUtils.containsAny(notificationThread.getSubject().getType().toLowerCase(), "pull", "issue")) {
Intent intent = new Intent(context, IssueDetailActivity.class);
intent.putExtra("openedFromLink", "true");
String issueUrl = notificationThread.getSubject().getUrl();
tinyDB.putString("issueNumber", issueUrl.substring(issueUrl.lastIndexOf("/") + 1));
tinyDB.putString("issueType", notificationThread.getSubject().getType());
tinyDB.putString("repoFullName", notificationThread.getRepository().getFullName());
startActivity(intent);
}
}
@Override
public void onMoreClicked(NotificationThread notificationThread) {
BottomSheetNotificationsFragment bottomSheetNotificationsFragment = new BottomSheetNotificationsFragment();
bottomSheetNotificationsFragment.onAttach(context, notificationThread, this);
bottomSheetNotificationsFragment.show(getChildFragmentManager(), "notificationsBottomSheet");
}
@Override
public void onSelected() {
pageCurrentIndex = 1;
loadNotifications(false);
loadInitial(resultLimit);
}
}

View File

@ -19,6 +19,7 @@ import org.mian.gitnex.clients.PicassoService;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.databinding.FragmentOrganizationInfoBinding;
import org.mian.gitnex.helpers.Authorization;
import org.mian.gitnex.helpers.Markdown;
import org.mian.gitnex.helpers.RoundedTransformation;
import retrofit2.Call;
import retrofit2.Callback;
@ -112,7 +113,7 @@ public class OrganizationInfoFragment extends Fragment {
.centerCrop().into(orgAvatar);
if(!orgInfo.getDescription().isEmpty()) {
orgDescInfo.setText(orgInfo.getDescription());
Markdown.render(ctx, orgInfo.getDescription(), orgDescInfo);
}
else {
orgDescInfo.setText(getString(R.string.noDataDescription));

View File

@ -12,14 +12,11 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import org.gitnex.tea4j.models.PullRequests;
import org.mian.gitnex.R;
@ -31,7 +28,6 @@ import org.mian.gitnex.helpers.Authorization;
import org.mian.gitnex.helpers.Constants;
import org.mian.gitnex.helpers.TinyDB;
import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.helpers.Version;
import java.util.ArrayList;
import java.util.List;
import retrofit2.Call;
@ -44,24 +40,21 @@ import retrofit2.Response;
public class PullRequestsFragment extends Fragment {
private FragmentPullRequestsBinding fragmentPullRequestsBinding;
private Menu menu;
private ProgressBar mProgressBar;
private RecyclerView recyclerView;
private List<PullRequests> prList;
private PullRequestsAdapter adapter;
private String TAG = Constants.tagPullRequestsList;
private final String TAG = Constants.tagPullRequestsList;
private Context context;
private int pageSize = Constants.prPageInit;
private TextView noData;
private int resultLimit = Constants.resultLimitOldGiteaInstances;
private ProgressBar progressLoadMore;
private int resultLimit;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
FragmentPullRequestsBinding fragmentPullRequestsBinding = FragmentPullRequestsBinding.inflate(inflater, container, false);
fragmentPullRequestsBinding = FragmentPullRequestsBinding.inflate(inflater, container, false);
setHasOptionsMenu(true);
context = getContext();
@ -75,43 +68,30 @@ public class PullRequestsFragment extends Fragment {
final SwipeRefreshLayout swipeRefresh = fragmentPullRequestsBinding.pullToRefresh;
// if gitea is 1.12 or higher use the new limit
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
resultLimit = Constants.resultLimitNewGiteaInstances;
}
recyclerView = fragmentPullRequestsBinding.recyclerView;
resultLimit = Constants.getCurrentResultLimit(context);
prList = new ArrayList<>();
progressLoadMore = fragmentPullRequestsBinding.progressLoadMore;
mProgressBar = fragmentPullRequestsBinding.progressBar;
noData = fragmentPullRequestsBinding.noData;
swipeRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
swipeRefresh.setRefreshing(false);
loadInitial(instanceToken, repoOwner, repoName, pageSize, tinyDb.getString("repoPrState"), resultLimit);
adapter.notifyDataChanged();
}, 200));
adapter = new PullRequestsAdapter(getContext(), prList);
adapter.setLoadMoreListener(() -> recyclerView.post(() -> {
adapter.setLoadMoreListener(() -> fragmentPullRequestsBinding.recyclerView.post(() -> {
if(prList.size() == resultLimit || pageSize == resultLimit) {
int page = (prList.size() + resultLimit) / resultLimit;
loadMore(Authorization.get(getContext()), repoOwner, repoName, page, tinyDb.getString("repoPrState"), resultLimit);
}
}));
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(), DividerItemDecoration.VERTICAL);
recyclerView.setHasFixedSize(true);
recyclerView.addItemDecoration(dividerItemDecoration);
recyclerView.setLayoutManager(new LinearLayoutManager(context));
recyclerView.setAdapter(adapter);
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(fragmentPullRequestsBinding.recyclerView.getContext(), DividerItemDecoration.VERTICAL);
fragmentPullRequestsBinding.recyclerView.setHasFixedSize(true);
fragmentPullRequestsBinding.recyclerView.addItemDecoration(dividerItemDecoration);
fragmentPullRequestsBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
fragmentPullRequestsBinding.recyclerView.setAdapter(adapter);
((RepoDetailActivity) requireActivity()).setFragmentRefreshListenerPr(prState -> {
@ -125,31 +105,27 @@ public class PullRequestsFragment extends Fragment {
prList.clear();
adapter = new PullRequestsAdapter(context, prList);
adapter.setLoadMoreListener(() -> recyclerView.post(() -> {
adapter.setLoadMoreListener(() -> fragmentPullRequestsBinding.recyclerView.post(() -> {
if(prList.size() == resultLimit || pageSize == resultLimit) {
int page = (prList.size() + resultLimit) / resultLimit;
loadMore(Authorization.get(getContext()), repoOwner, repoName, page, tinyDb.getString("repoPrState"), resultLimit);
}
}));
tinyDb.putString("repoPrState", prState);
mProgressBar.setVisibility(View.VISIBLE);
noData.setVisibility(View.GONE);
fragmentPullRequestsBinding.progressBar.setVisibility(View.VISIBLE);
fragmentPullRequestsBinding.noData.setVisibility(View.GONE);
loadInitial(Authorization.get(context), repoOwner, repoName, pageSize, prState, resultLimit);
recyclerView.setAdapter(adapter);
fragmentPullRequestsBinding.recyclerView.setAdapter(adapter);
});
loadInitial(Authorization.get(getContext()), repoOwner, repoName, pageSize, tinyDb.getString("repoPrState"), resultLimit);
return fragmentPullRequestsBinding.getRoot();
}
@Override
@ -164,13 +140,10 @@ public class PullRequestsFragment extends Fragment {
final String repoName = parts[1];
if(tinyDb.getBoolean("resumePullRequests")) {
loadInitial(Authorization.get(getContext()), repoOwner, repoName, pageSize, tinyDb.getString("repoPrState"), resultLimit);
tinyDb.putBoolean("resumePullRequests", false);
tinyDb.putBoolean("prMerged", false);
}
}
private void loadInitial(String token, String repoOwner, String repoName, int page, String prState, int resultLimit) {
@ -186,38 +159,26 @@ public class PullRequestsFragment extends Fragment {
assert response.body() != null;
if(response.body().size() > 0) {
prList.clear();
prList.addAll(response.body());
adapter.notifyDataChanged();
noData.setVisibility(View.GONE);
fragmentPullRequestsBinding.noData.setVisibility(View.GONE);
}
else {
prList.clear();
adapter.notifyDataChanged();
noData.setVisibility(View.VISIBLE);
fragmentPullRequestsBinding.noData.setVisibility(View.VISIBLE);
}
mProgressBar.setVisibility(View.GONE);
fragmentPullRequestsBinding.progressBar.setVisibility(View.GONE);
}
else if(response.code() == 404) {
noData.setVisibility(View.VISIBLE);
mProgressBar.setVisibility(View.GONE);
fragmentPullRequestsBinding.noData.setVisibility(View.VISIBLE);
fragmentPullRequestsBinding.progressBar.setVisibility(View.GONE);
}
else {
Log.i(TAG, String.valueOf(response.code()));
}
Log.i(TAG, String.valueOf(response.code()));
}
@Override
@ -225,14 +186,12 @@ public class PullRequestsFragment extends Fragment {
Log.e(TAG, t.toString());
}
});
}
private void loadMore(String token, String repoOwner, String repoName, int page, String prState, int resultLimit) {
progressLoadMore.setVisibility(View.VISIBLE);
fragmentPullRequestsBinding.progressBar.setVisibility(View.VISIBLE);
Call<List<PullRequests>> call = RetrofitClient.getApiInterface(context).getPullRequests(token, repoOwner, repoName, page, prState, resultLimit);
@ -245,42 +204,30 @@ public class PullRequestsFragment extends Fragment {
//remove loading view
prList.remove(prList.size() - 1);
List<PullRequests> result = response.body();
assert result != null;
if(result.size() > 0) {
pageSize = result.size();
prList.addAll(result);
}
else {
Toasty.info(context, getString(R.string.noMoreData));
adapter.setMoreDataAvailable(false);
}
adapter.notifyDataChanged();
progressLoadMore.setVisibility(View.GONE);
fragmentPullRequestsBinding.progressBar.setVisibility(View.GONE);
}
else {
Log.e(TAG, String.valueOf(response.code()));
}
}
@Override
public void onFailure(@NonNull Call<List<PullRequests>> call, @NonNull Throwable t) {
Log.e(TAG, t.toString());
}
});
}
@ -309,20 +256,15 @@ public class PullRequestsFragment extends Fragment {
@Override
public boolean onQueryTextSubmit(String query) {
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
filter(newText);
return false;
}
});
}
private void filter(String text) {
@ -333,12 +275,10 @@ public class PullRequestsFragment extends Fragment {
if(d == null || d.getTitle() == null || d.getBody() == null) {
continue;
}
if(d.getTitle().toLowerCase().contains(text) || d.getBody().toLowerCase().contains(text)) {
if(d.getTitle().toLowerCase().contains(text) || d.getBody().toLowerCase().contains(text) || String.valueOf(d.getNumber()).startsWith(text)) {
arr.add(d);
}
}
adapter.updateList(arr);
}
}

View File

@ -18,7 +18,6 @@ import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import org.gitnex.tea4j.models.IssueComments;
import org.gitnex.tea4j.models.Releases;
import org.mian.gitnex.adapters.ReleasesAdapter;
import org.mian.gitnex.databinding.FragmentReleasesBinding;

View File

@ -42,7 +42,6 @@ public class RepoInfoFragment extends Fragment {
private LinearLayout pageContent;
private static final String repoNameF = "param2";
private static final String repoOwnerF = "param1";
private Locale locale;
private FragmentRepoInfoBinding binding;
@ -77,7 +76,7 @@ public class RepoInfoFragment extends Fragment {
binding = FragmentRepoInfoBinding.inflate(inflater, container, false);
TinyDB tinyDb = TinyDB.getInstance(getContext());
ctx = getContext();
locale = getResources().getConfiguration().locale;
Locale locale = getResources().getConfiguration().locale;
pageContent = binding.repoInfoLayout;
pageContent.setVisibility(View.GONE);
@ -198,7 +197,7 @@ public class RepoInfoFragment extends Fragment {
binding.repoMetaName.setText(repoInfo.getName());
if(!repoInfo.getDescription().isEmpty()) {
binding.repoMetaDescription.setText(repoInfo.getDescription());
Markdown.render(ctx, repoInfo.getDescription(), binding.repoMetaDescription);
}
else {
binding.repoMetaDescription.setText(getString(R.string.noDataDescription));

View File

@ -149,6 +149,7 @@ public class DetailFragment extends Fragment {
break;
}
}
binding.progressBar.setVisibility(View.GONE);
}
@Override

View File

@ -25,9 +25,7 @@ import org.mian.gitnex.helpers.AlertDialogs;
import org.mian.gitnex.helpers.Authorization;
import org.mian.gitnex.helpers.Constants;
import org.mian.gitnex.helpers.SnackBar;
import org.mian.gitnex.helpers.TinyDB;
import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.helpers.Version;
import java.util.ArrayList;
import java.util.List;
import retrofit2.Call;
@ -47,7 +45,7 @@ public class FollowersFragment extends Fragment {
private FollowersAdapter adapter;
private int pageSize;
private int resultLimit = Constants.resultLimitOldGiteaInstances;
private int resultLimit;
private static final String usernameBundle = "";
private String username;
@ -78,13 +76,7 @@ public class FollowersFragment extends Fragment {
setHasOptionsMenu(true);
context = getContext();
TinyDB tinyDb = TinyDB.getInstance(context);
// if gitea is 1.12 or higher use the new limit
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
resultLimit = Constants.resultLimitNewGiteaInstances;
}
resultLimit = Constants.getCurrentResultLimit(context);
usersList = new ArrayList<>();
fragmentProfileFollowersFollowingBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
@ -172,7 +164,7 @@ public class FollowersFragment extends Fragment {
private void loadMore(String token, String username, int page, int resultLimit) {
fragmentProfileFollowersFollowingBinding.progressLoadMore.setVisibility(View.VISIBLE);
fragmentProfileFollowersFollowingBinding.progressBar.setVisibility(View.VISIBLE);
Call<List<UserInfo>> call = RetrofitClient
.getApiInterface(context)
@ -198,7 +190,7 @@ public class FollowersFragment extends Fragment {
adapter.setMoreDataAvailable(false);
}
adapter.notifyDataChanged();
fragmentProfileFollowersFollowingBinding.progressLoadMore.setVisibility(View.GONE);
fragmentProfileFollowersFollowingBinding.progressBar.setVisibility(View.GONE);
break;
case 401:

View File

@ -18,7 +18,6 @@ import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import org.gitnex.tea4j.models.UserInfo;
import org.mian.gitnex.R;
import org.mian.gitnex.adapters.profile.FollowersAdapter;
import org.mian.gitnex.adapters.profile.FollowingAdapter;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.databinding.FragmentProfileFollowersFollowingBinding;
@ -26,9 +25,7 @@ import org.mian.gitnex.helpers.AlertDialogs;
import org.mian.gitnex.helpers.Authorization;
import org.mian.gitnex.helpers.Constants;
import org.mian.gitnex.helpers.SnackBar;
import org.mian.gitnex.helpers.TinyDB;
import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.helpers.Version;
import java.util.ArrayList;
import java.util.List;
import retrofit2.Call;
@ -48,7 +45,7 @@ public class FollowingFragment extends Fragment {
private FollowingAdapter adapter;
private int pageSize;
private int resultLimit = Constants.resultLimitOldGiteaInstances;
private int resultLimit;
private static final String usernameBundle = "";
private String username;
@ -79,13 +76,7 @@ public class FollowingFragment extends Fragment {
setHasOptionsMenu(true);
context = getContext();
TinyDB tinyDb = TinyDB.getInstance(context);
// if gitea is 1.12 or higher use the new limit
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
resultLimit = Constants.resultLimitNewGiteaInstances;
}
resultLimit = Constants.getCurrentResultLimit(context);
usersList = new ArrayList<>();
fragmentProfileFollowersFollowingBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
@ -173,7 +164,7 @@ public class FollowingFragment extends Fragment {
private void loadMore(String token, String username, int page, int resultLimit) {
fragmentProfileFollowersFollowingBinding.progressLoadMore.setVisibility(View.VISIBLE);
fragmentProfileFollowersFollowingBinding.progressBar.setVisibility(View.VISIBLE);
Call<List<UserInfo>> call = RetrofitClient
.getApiInterface(context)
@ -199,7 +190,7 @@ public class FollowingFragment extends Fragment {
adapter.setMoreDataAvailable(false);
}
adapter.notifyDataChanged();
fragmentProfileFollowersFollowingBinding.progressLoadMore.setVisibility(View.GONE);
fragmentProfileFollowersFollowingBinding.progressBar.setVisibility(View.GONE);
break;
case 401:

View File

@ -25,9 +25,7 @@ import org.mian.gitnex.helpers.AlertDialogs;
import org.mian.gitnex.helpers.Authorization;
import org.mian.gitnex.helpers.Constants;
import org.mian.gitnex.helpers.SnackBar;
import org.mian.gitnex.helpers.TinyDB;
import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.helpers.Version;
import java.util.ArrayList;
import java.util.List;
import retrofit2.Call;
@ -47,7 +45,7 @@ public class OrganizationsFragment extends Fragment {
private OrganizationsAdapter adapter;
private int pageSize;
private int resultLimit = Constants.resultLimitOldGiteaInstances;
private int resultLimit;
private static final String usernameBundle = "";
private String username;
@ -78,13 +76,7 @@ public class OrganizationsFragment extends Fragment {
setHasOptionsMenu(true);
context = getContext();
TinyDB tinyDb = TinyDB.getInstance(context);
// if gitea is 1.12 or higher use the new limit
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
resultLimit = Constants.resultLimitNewGiteaInstances;
}
resultLimit = Constants.getCurrentResultLimit(context);
organizationsList = new ArrayList<>();
fragmentOrganizationsBinding.addNewOrganization.setVisibility(View.GONE);
@ -174,7 +166,7 @@ public class OrganizationsFragment extends Fragment {
private void loadMore(String token, String username, int page, int resultLimit) {
fragmentOrganizationsBinding.progressLoadMore.setVisibility(View.VISIBLE);
fragmentOrganizationsBinding.progressBar.setVisibility(View.VISIBLE);
Call<List<UserOrganizations>> call = RetrofitClient
.getApiInterface(context)
@ -200,7 +192,7 @@ public class OrganizationsFragment extends Fragment {
adapter.setMoreDataAvailable(false);
}
adapter.notifyDataChanged();
fragmentOrganizationsBinding.progressLoadMore.setVisibility(View.GONE);
fragmentOrganizationsBinding.progressBar.setVisibility(View.GONE);
break;
case 401:

View File

@ -25,9 +25,7 @@ import org.mian.gitnex.helpers.AlertDialogs;
import org.mian.gitnex.helpers.Authorization;
import org.mian.gitnex.helpers.Constants;
import org.mian.gitnex.helpers.SnackBar;
import org.mian.gitnex.helpers.TinyDB;
import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.helpers.Version;
import java.util.ArrayList;
import java.util.List;
import retrofit2.Call;
@ -47,7 +45,7 @@ public class RepositoriesFragment extends Fragment {
private RepositoriesAdapter adapter;
private int pageSize;
private int resultLimit = Constants.resultLimitOldGiteaInstances;
private int resultLimit;
private static final String usernameBundle = "";
private String username;
@ -78,13 +76,7 @@ public class RepositoriesFragment extends Fragment {
setHasOptionsMenu(true);
context = getContext();
TinyDB tinyDb = TinyDB.getInstance(context);
// if gitea is 1.12 or higher use the new limit
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
resultLimit = Constants.resultLimitNewGiteaInstances;
}
resultLimit = Constants.getCurrentResultLimit(context);
reposList = new ArrayList<>();
fragmentRepositoriesBinding.addNewRepo.setVisibility(View.GONE);
@ -173,7 +165,7 @@ public class RepositoriesFragment extends Fragment {
private void loadMore(String token, String username, int page, int resultLimit) {
fragmentRepositoriesBinding.progressLoadMore.setVisibility(View.VISIBLE);
fragmentRepositoriesBinding.progressBar.setVisibility(View.VISIBLE);
Call<List<UserRepositories>> call = RetrofitClient.getApiInterface(context).getUserProfileRepositories(token, username, page, resultLimit);
@ -197,7 +189,7 @@ public class RepositoriesFragment extends Fragment {
adapter.setMoreDataAvailable(false);
}
adapter.notifyDataChanged();
fragmentRepositoriesBinding.progressLoadMore.setVisibility(View.GONE);
fragmentRepositoriesBinding.progressBar.setVisibility(View.GONE);
break;
case 401:

View File

@ -25,9 +25,7 @@ import org.mian.gitnex.helpers.AlertDialogs;
import org.mian.gitnex.helpers.Authorization;
import org.mian.gitnex.helpers.Constants;
import org.mian.gitnex.helpers.SnackBar;
import org.mian.gitnex.helpers.TinyDB;
import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.helpers.Version;
import java.util.ArrayList;
import java.util.List;
import retrofit2.Call;
@ -47,7 +45,7 @@ public class StarredRepositoriesFragment extends Fragment {
private StarredRepositoriesAdapter adapter;
private int pageSize;
private int resultLimit = Constants.resultLimitOldGiteaInstances;
private int resultLimit;
private static final String usernameBundle = "";
private String username;
@ -77,13 +75,8 @@ public class StarredRepositoriesFragment extends Fragment {
fragmentRepositoriesBinding = org.mian.gitnex.databinding.FragmentRepositoriesBinding.inflate(inflater, container, false);
setHasOptionsMenu(true);
context = getContext();
TinyDB tinyDb = TinyDB.getInstance(context);
// if gitea is 1.12 or higher use the new limit
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
resultLimit = Constants.resultLimitNewGiteaInstances;
}
resultLimit = Constants.getCurrentResultLimit(context);
reposList = new ArrayList<>();
fragmentRepositoriesBinding.addNewRepo.setVisibility(View.GONE);
@ -173,7 +166,7 @@ public class StarredRepositoriesFragment extends Fragment {
private void loadMore(String token, String username, int page, int resultLimit) {
fragmentRepositoriesBinding.progressLoadMore.setVisibility(View.VISIBLE);
fragmentRepositoriesBinding.progressBar.setVisibility(View.VISIBLE);
Call<List<UserRepositories>> call = RetrofitClient
.getApiInterface(context)
@ -199,7 +192,7 @@ public class StarredRepositoriesFragment extends Fragment {
adapter.setMoreDataAvailable(false);
}
adapter.notifyDataChanged();
fragmentRepositoriesBinding.progressLoadMore.setVisibility(View.GONE);
fragmentRepositoriesBinding.progressBar.setVisibility(View.GONE);
break;
case 401:

View File

@ -1,10 +1,15 @@
package org.mian.gitnex.helpers;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.widget.Button;
import androidx.appcompat.app.AlertDialog;
import org.mian.gitnex.R;
import org.mian.gitnex.actions.CollaboratorActions;
import org.mian.gitnex.actions.PullRequestActions;
import org.mian.gitnex.actions.TeamActions;
import org.mian.gitnex.activities.CreateLabelActivity;
import org.mian.gitnex.activities.LoginActivity;
@ -112,4 +117,27 @@ public class AlertDialogs {
}
public static void selectPullUpdateStrategy(Context context, String repoOwner, String repo, String issueNumber) {
Dialog dialog = new Dialog(context, R.style.ThemeOverlay_MaterialComponents_Dialog_Alert);
if (dialog.getWindow() != null) {
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
}
dialog.setContentView(R.layout.custom_pr_update_strategy_dialog);
Button mergeBtn = dialog.findViewById(R.id.updatePullMerge);
Button rebaseBtn = dialog.findViewById(R.id.updatePullRebase);
Button cancelBtn = dialog.findViewById(R.id.cancelPullUpdate);
mergeBtn.setOnClickListener((v) -> {
PullRequestActions.updatePr(context, repoOwner, repo, issueNumber, false);
dialog.dismiss();
});
rebaseBtn.setOnClickListener((v) -> {
PullRequestActions.updatePr(context, repoOwner, repo, issueNumber, true);
dialog.dismiss();
});
cancelBtn.setOnClickListener((v) -> dialog.dismiss());
dialog.show();
}
}

View File

@ -14,15 +14,13 @@ public class Constants {
public static final String defaultOldestTimestamp = "1970-01-01T00:00:00+00:00";
public static int getCurrentResultLimit(Context context) {
Version version = new Version(TinyDB.getInstance(context).getString("giteaVersion"));
return version.higherOrEqual("1.12") ? resultLimitNewGiteaInstances : resultLimitOldGiteaInstances;
}
// tags
public static final String tagMilestonesFragment = "MilestonesFragment";
public static final String tagPullRequestsList = "PullRequestsListFragment";
public static final String tagPullRequestsList = "PullRequestFragment";
public static final String tagIssuesList = "IssuesListFragment";
public static final String tagMilestonesAdapter = "MilestonesAdapter";
public static final String draftsApi = "DraftsApi";
@ -30,6 +28,12 @@ public class Constants {
public static final String tagDraftsBottomSheet = "BottomSheetDraftsFragment";
public static final String userAccountsApi = "UserAccountsApi";
public static final String publicOrganizations = "PublicOrganizations";
public static final String exploreUsers = "ExploreUsers";
public static final String exploreIssues = "ExploreIssues";
public static final String exploreRepositories = "ExploreRepositories";
public static final String tagNotifications = "TagNotifications";
public static final String tagFollowers = "TagFollowers";
public static final String tagFollowing = "TagFollowing";
// issues variables
public static final int issuesPageInit = 1;

View File

@ -1,92 +0,0 @@
/*
* Copyright (C) 2016 Piotr Wittchen
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mian.gitnex.helpers;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
/**
* InfiniteScrollListener, which can be added to RecyclerView with addOnScrollListener
* to detect moment when RecyclerView was scrolled to the end.
*/
public abstract class InfiniteScrollListener extends RecyclerView.OnScrollListener {
private final int maxItemsPerRequest;
private final LinearLayoutManager layoutManager;
/**
* Initializes InfiniteScrollListener, which can be added
* to RecyclerView with addOnScrollListener method
*
* @param maxItemsPerRequest Max items to be loaded in a single request.
* @param layoutManager LinearLayoutManager created in the Activity.
*/
public InfiniteScrollListener(int maxItemsPerRequest, LinearLayoutManager layoutManager) {
assert maxItemsPerRequest > 0;
assert layoutManager != null;
this.maxItemsPerRequest = maxItemsPerRequest;
this.layoutManager = layoutManager;
}
/**
* Callback method to be invoked when the RecyclerView has been scrolled
*
* @param recyclerView The RecyclerView which scrolled.
* @param dx The amount of horizontal scroll.
* @param dy The amount of vertical scroll.
*/
@Override public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
if (canLoadMoreItems()) {
onScrolledToEnd(layoutManager.findFirstVisibleItemPosition());
}
}
/**
* Refreshes RecyclerView by setting new adapter,
* calling invalidate method and scrolling to given position
*
* @param view RecyclerView to be refreshed
* @param adapter adapter with new list of items to be loaded
* @param position position to which RecyclerView will be scrolled
*/
protected void refreshView(RecyclerView view, RecyclerView.Adapter adapter, int position) {
view.setAdapter(adapter);
view.invalidate();
view.scrollToPosition(position);
}
/**
* Checks if more items can be loaded to the RecyclerView
*
* @return boolean Returns true if can load more items or false if not.
*/
protected boolean canLoadMoreItems() {
final int visibleItemsCount = layoutManager.getChildCount();
final int totalItemsCount = layoutManager.getItemCount();
final int pastVisibleItemsCount = layoutManager.findFirstVisibleItemPosition();
final boolean lastItemShown = visibleItemsCount + pastVisibleItemsCount >= totalItemsCount;
return lastItemShown && totalItemsCount >= maxItemsPerRequest;
}
/**
* Callback method to be invoked when the RecyclerView has been scrolled to the end
*
* @param firstVisibleItemPosition Id of the first visible item on the list.
*/
public abstract void onScrolledToEnd(final int firstVisibleItemPosition);
}

View File

@ -1,59 +0,0 @@
package org.mian.gitnex.viewmodels;
import android.content.Context;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import org.gitnex.tea4j.models.UserInfo;
import org.mian.gitnex.clients.RetrofitClient;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
/**
* Author M M Arif
*/
public class ProfileFollowersViewModel extends ViewModel {
private static MutableLiveData<List<UserInfo>> followersList;
public LiveData<List<UserInfo>> getFollowersList(String token, Context ctx) {
followersList = new MutableLiveData<>();
loadFollowersList(token, ctx);
return followersList;
}
public static void loadFollowersList(String token, Context ctx) {
Call<List<UserInfo>> call = RetrofitClient
.getApiInterface(ctx)
.getFollowers(token, 1, 50);
call.enqueue(new Callback<List<UserInfo>>() {
@Override
public void onResponse(@NonNull Call<List<UserInfo>> call, @NonNull Response<List<UserInfo>> response) {
if (response.isSuccessful()) {
followersList.postValue(response.body());
} else {
Log.i("onResponse", String.valueOf(response.code()));
}
}
@Override
public void onFailure(@NonNull Call<List<UserInfo>> call, @NonNull Throwable t) {
Log.i("onFailure", t.toString());
}
});
}
}

View File

@ -1,59 +0,0 @@
package org.mian.gitnex.viewmodels;
import android.content.Context;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import org.gitnex.tea4j.models.UserInfo;
import org.mian.gitnex.clients.RetrofitClient;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
/**
* Author M M Arif
*/
public class ProfileFollowingViewModel extends ViewModel {
private static MutableLiveData<List<UserInfo>> followingList;
public LiveData<List<UserInfo>> getFollowingList(String token, Context ctx) {
followingList = new MutableLiveData<>();
loadFollowingList(token, ctx);
return followingList;
}
public static void loadFollowingList(String token, Context ctx) {
Call<List<UserInfo>> call = RetrofitClient
.getApiInterface(ctx)
.getFollowing(token, 1, 50);
call.enqueue(new Callback<List<UserInfo>>() {
@Override
public void onResponse(@NonNull Call<List<UserInfo>> call, @NonNull Response<List<UserInfo>> response) {
if (response.isSuccessful()) {
followingList.postValue(response.body());
} else {
Log.i("onResponse", String.valueOf(response.code()));
}
}
@Override
public void onFailure(@NonNull Call<List<UserInfo>> call, @NonNull Throwable t) {
Log.i("onFailure", t.toString());
}
});
}
}

View File

@ -0,0 +1,27 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M16,21v-2a4,4 0,0 0,-4 -4H5a4,4 0,0 0,-4 4v2"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/iconsColor"
android:strokeLineCap="round"/>
<path
android:pathData="M8.5,7m-4,0a4,4 0,1 1,8 0a4,4 0,1 1,-8 0"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/iconsColor"
android:strokeLineCap="round"/>
<path
android:pathData="M23,11L17,11"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/iconsColor"
android:strokeLineCap="round"/>
</vector>

View File

@ -0,0 +1,27 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M23,4l0,6l-6,0"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/iconsColor"
android:strokeLineCap="round"/>
<path
android:pathData="M1,20l0,-6l6,0"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/iconsColor"
android:strokeLineCap="round"/>
<path
android:pathData="M3.51,9a9,9 0,0 1,14.85 -3.36L23,10M1,14l4.64,4.36A9,9 0,0 0,20.49 15"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/iconsColor"
android:strokeLineCap="round"/>
</vector>

View File

@ -122,7 +122,7 @@
android:id="@+id/explore"
android:layout_width="match_parent"
android:layout_height="60dp"
android:text="@string/navExplore"
android:text="@string/pageTitleExplore"
android:textColor="@color/btnTextColor"
android:textSize="16sp"
android:layout_marginTop="8dp" />

View File

@ -18,6 +18,22 @@
android:orientation="vertical"
android:layout_height="wrap_content">
<TextView
android:id="@+id/filterByMilestone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/newIssueMilestoneTitle"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:visibility="gone"
app:drawableStartCompat="@drawable/ic_milestone" />
<TextView
android:id="@+id/openIssues"
android:layout_width="match_parent"

View File

@ -58,6 +58,21 @@
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_pull_request" />
<TextView
android:id="@+id/updatePullRequest"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/updatePullRequestText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_update" />
<TextView
android:id="@+id/deletePrHeadBranch"
android:layout_width="match_parent"

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="6dp"
android:paddingBottom="12dp"
android:background="?attr/primaryBackgroundColor">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/followUnfollowUser"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
android:drawablePadding="24dp"
android:padding="12dp"
android:text="@string/userFollow"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableStartCompat="@drawable/ic_person_add" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>

View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_custom_dialog">
<TextView
android:id="@+id/selectStrategy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="20sp"
android:text="@string/selectUpdateStrategy"
android:textColor="?attr/primaryTextColor"
android:padding="16dp"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/dividerTop"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dividerColor"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/selectStrategy" />
<Button
android:id="@+id/updatePullMerge"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_margin="16dp"
android:textColor="@color/colorWhite"
android:text="@string/updateStrategyMerge"
app:layout_constraintEnd_toStartOf="@id/updatePullRebase"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/selectStrategy" />
<Button
android:id="@+id/updatePullRebase"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_margin="16dp"
android:textColor="@color/colorWhite"
android:text="@string/updateStrategyRebase"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/updatePullMerge"
app:layout_constraintTop_toBottomOf="@id/selectStrategy" />
<View
android:id="@+id/dividerBottom"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="16dp"
android:background="?attr/dividerColor"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/updatePullMerge" />
<Button
android:id="@+id/cancelPullUpdate"
android:layout_width="wrap_content"
android:layout_height="60dp"
style="?android:attr/button"
android:layout_alignParentStart="true"
android:text="@string/cancelButton"
android:textColor="@color/colorWhite"
android:layout_margin="16dp"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/dividerBottom"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"
android:minWidth="360dp"
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
app:indicatorColor="?attr/progressIndicatorColor" />
</LinearLayout>

View File

@ -16,40 +16,20 @@
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabsExplore"
app:tabMode="auto"
app:tabTextAppearance="@style/customTabLayout"
android:layout_width="match_parent"
android:background="?attr/primaryBackgroundColor"
app:tabMode="scrollable"
app:tabTextColor="?attr/primaryTextColor"
android:background="?attr/primaryBackgroundColor"
app:tabIndicatorColor="?attr/pagerTabIndicatorColor"
android:layout_height="wrap_content">
<com.google.android.material.tabs.TabItem
android:id="@+id/tabExploreRepositories"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pageTitleRepositories" />
<com.google.android.material.tabs.TabItem
android:id="@+id/tabExploreIssues"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pageTitleIssues" />
<com.google.android.material.tabs.TabItem
android:id="@+id/tabExplorePublicOrganizations"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pageTitleOrganizations" />
</com.google.android.material.tabs.TabLayout>
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager.widget.ViewPager
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/containerExplore"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -6,15 +6,6 @@
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical">
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/loadingMoreView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:indeterminate="true"
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
app:indicatorColor="?attr/progressIndicatorColor" />
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progressBar"
android:layout_width="match_parent"

View File

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical">
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
app:indicatorColor="?attr/progressIndicatorColor" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/searchKeywordLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:boxBackgroundColor="?attr/inputBackgroundColor"
android:textColorHint="?attr/hintColor"
app:hintTextColor="?attr/hintColor"
app:boxStrokeErrorColor="@color/darkRed"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
app:startIconDrawable="@drawable/ic_search"
app:startIconTint="?attr/iconsColor"
app:endIconMode="clear_text"
app:endIconTint="?attr/iconsColor"
android:hint="@string/exploreUsers">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/searchKeyword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?attr/inputTextColor"
android:textColorHighlight="?attr/hintColor"
android:textColorHint="?attr/hintColor"
android:imeOptions="actionSend"
android:inputType="text"
android:textSize="16sp" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
<TextView
android:id="@+id/noData"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="15dp"
android:gravity="center"
android:text="@string/noDataFound"
android:textColor="?attr/primaryTextColor"
android:textSize="20sp"
android:visibility="gone" />
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/pullToRefresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerViewExploreUsers"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/primaryBackgroundColor"
android:scrollbars="vertical" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</LinearLayout>

View File

@ -21,22 +21,13 @@
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progress_bar"
android:id="@+id/progressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
app:indicatorColor="?attr/progressIndicatorColor" />
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progressLoadMore"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:indeterminate="true"
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
app:indicatorColor="?attr/progressIndicatorColor" />
<TextView
android:id="@+id/noDataIssues"
android:layout_width="match_parent"

View File

@ -21,7 +21,7 @@
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progress_bar"
android:id="@+id/progressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"

View File

@ -16,19 +16,12 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/notifications"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:background="?attr/primaryBackgroundColor"
android:scrollbars="vertical" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/loadingMoreView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:indeterminate="true"
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
app:indicatorColor="?attr/progressIndicatorColor" />
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progressBar"
android:layout_width="match_parent"

View File

@ -66,6 +66,7 @@
android:paddingRight="15dp">
<ImageView
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/websiteText"
@ -108,6 +109,7 @@
android:paddingRight="15dp">
<ImageView
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/locationText"

View File

@ -20,22 +20,13 @@
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progress_bar"
android:id="@+id/progressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
app:indicatorColor="?attr/progressIndicatorColor" />
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progressLoadMore"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:indeterminate="true"
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
app:indicatorColor="?attr/progressIndicatorColor" />
<TextView
android:id="@+id/noDataOrg"
android:layout_width="match_parent"

View File

@ -1,19 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/profileFrame"
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay"
app:elevation="0dp">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="200dp"
android:gravity="top"
android:orientation="vertical">
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:id="@+id/userAvatarBackground"
@ -89,14 +93,7 @@
</LinearLayout>
</RelativeLayout>
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay"
app:elevation="0dp">
</FrameLayout>
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabs"
@ -136,4 +133,4 @@
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -13,6 +13,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
app:indicatorColor="?attr/progressIndicatorColor" />
<RelativeLayout
android:id="@+id/profileFrame"
android:layout_width="match_parent"
@ -79,6 +87,7 @@
android:paddingRight="15dp">
<ImageView
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/generalImgContentText"
@ -118,6 +127,7 @@
android:paddingRight="15dp">
<ImageView
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/generalImgContentText"
@ -157,6 +167,7 @@
android:paddingRight="15dp">
<ImageView
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/generalImgContentText"

View File

@ -26,15 +26,6 @@
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
app:indicatorColor="?attr/progressIndicatorColor" />
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progressLoadMore"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:indeterminate="true"
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
app:indicatorColor="?attr/progressIndicatorColor" />
<TextView
android:id="@+id/noData"
android:layout_width="match_parent"

View File

@ -21,22 +21,13 @@
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progress_bar"
android:id="@+id/progressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
app:indicatorColor="?attr/progressIndicatorColor" />
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progressLoadMore"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:indeterminate="true"
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
app:indicatorColor="?attr/progressIndicatorColor" />
<TextView
android:id="@+id/noData"
android:layout_width="match_parent"

View File

@ -215,6 +215,7 @@
android:paddingRight="15dp">
<ImageView
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/repoWatchersInMenu"
@ -255,6 +256,7 @@
android:paddingRight="15dp">
<ImageView
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/infoTabRepoCreatedAt"
@ -295,6 +297,7 @@
android:paddingRight="15dp">
<ImageView
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/websiteText"

View File

@ -22,22 +22,13 @@
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progress_bar"
android:id="@+id/progressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
app:indicatorColor="?attr/progressIndicatorColor" />
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progressLoadMore"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:indeterminate="true"
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
app:indicatorColor="?attr/progressIndicatorColor" />
<TextView
android:id="@+id/noData"
android:layout_width="match_parent"

View File

@ -6,15 +6,6 @@
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical">
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/loadingMoreView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:indeterminate="true"
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
app:indicatorColor="?attr/progressIndicatorColor" />
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progressBar"
android:layout_width="match_parent"
@ -45,7 +36,7 @@
app:startIconTint="?attr/iconsColor"
app:endIconMode="clear_text"
app:endIconTint="?attr/iconsColor"
android:hint="@string/navSearchIssuesPulls">
android:hint="@string/exploreIssues">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/searchKeyword"

View File

@ -22,7 +22,7 @@
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progress_bar"
android:id="@+id/progressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"

View File

@ -21,7 +21,7 @@
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progress_bar"
android:id="@+id/progressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"

View File

@ -18,7 +18,7 @@
android:paddingRight="8dp"
android:paddingBottom="3dp"
android:textColor="?attr/primaryTextColor"
android:textSize="15sp"
android:textSize="14sp"
tools:text="👍" />
</androidx.cardview.widget.CardView>

View File

@ -16,7 +16,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="?attr/primaryTextColor"
android:textSize="20sp"
android:textSize="18sp"
tools:text="👍" />
</androidx.cardview.widget.CardView>

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:padding="16dp">
<ImageView
android:id="@+id/userAvatar"
android:layout_width="@dimen/list_avatar_size"
android:layout_height="@dimen/list_avatar_size"
android:layout_marginEnd="10dp"
android:contentDescription="@string/generalImgContentText"
android:src="@drawable/ic_android" />
<LinearLayout
android:id="@+id/userInfoSection"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/userFullName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/userName"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/userName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/userName"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>

View File

@ -13,7 +13,6 @@
android:id="@+id/orgInfoFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:gravity="center_vertical"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
@ -43,6 +42,8 @@
android:layout_height="wrap_content"
android:text="@string/noDataDescription"
android:textColor="?attr/primaryTextColor"
android:visibility="gone"
android:layout_marginTop="8dp"
android:textSize="15sp" />
</LinearLayout>

View File

@ -61,8 +61,15 @@
android:layout_marginBottom="8dp"
android:textColor="?attr/primaryTextColor"
android:textSize="15sp"
android:visibility="gone"
android:text="@string/noDataDescription" />
<View
android:id="@+id/spacerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="8dp" />
<LinearLayout
android:id="@+id/repoInfoFrame"
android:layout_width="match_parent"

View File

@ -32,7 +32,7 @@
<item android:id="@+id/nav_explore"
android:icon="@drawable/ic_search"
android:title="@string/navExplore" />
android:title="@string/pageTitleExplore" />
<item android:id="@+id/nav_comments_draft"
android:icon="@drawable/ic_drafts"

View File

@ -10,9 +10,7 @@
<string name="navAbout">عن التطبيق</string>
<string name="navRate">GitNex معدل</string>
<string name="navLogout">الخروج</string>
<string name="navExplore">استكشف</string>
<string name="navAdministration">Administration</string>
<string name="navSearchIssuesPulls">Search Issues</string>
<!-- menu items -->
<!-- page titles -->
<string name="pageTitleAbout">عن التطبيق</string>
@ -39,6 +37,7 @@
<string name="pageTitleAdministration">Gitea Administration</string>
<string name="pageTitleUserAccounts">Manage Accounts</string>
<string name="pageTitleNewPullRequest">New Pull Request</string>
<string name="pageTitleUsers">Users</string>
<!-- page titles -->
<string name="repoName">Demo repo</string>
<string name="repoFullName">Repo with ORG</string>
@ -155,6 +154,7 @@
<string name="milestoneNoDescription">No description</string>
<string name="milestoneIssueStatusOpen">%1$d Open</string>
<string name="milestoneIssueStatusClosed">%1$d Closed</string>
<string name="selectMilestone">Select Milestone</string>
<string name="newIssueSelectAssigneesListTitle">Select Assignees</string>
<string name="newIssueSelectLabelsListTitle">Select Labels</string>
<string name="newIssueTitle">العنوان</string>
@ -431,7 +431,10 @@
<string name="isClosed">Closed</string>
<string name="genericServerResponseError">We cannot reach the server at the moment, please check your server status and try again</string>
<string name="genericCopyUrl">Copy URL</string>
<string name="genericWaitFor">Hold on ☕</string>
<!-- generic copy -->
<string name="exploreUsers">Explore users</string>
<string name="exploreIssues">Explore issues</string>
<string name="exploreTextBoxHint">Explore repositories</string>
<string name="starRepository">Star Repository</string>
<string name="unStarRepository">Unstar Repository</string>
@ -442,7 +445,7 @@
<string name="watchRepositorySuccess">تمت إضافة المستودع إلى قائمة المراقبة</string>
<string name="unWatchRepositorySuccess">تمت إزالة المستودع مِن قائمة المراقبة</string>
<string name="titleDrafts">Drafts</string>
<string name="versionUnsupportedOld">Unsupported old version(%1$s) of Gitea detected. Please update to latest stable version. If you continue, the app may not function properly</string>
<string name="versionUnsupportedOld">Unsupported old version(%1$s) of Gitea detected. Please update to latest stable version. If you continue, some features may not work.</string>
<string name="versionUnsupportedNew">New Gitea version detected! Please UPDATE GitNex!</string>
<string name="versionUnknown">No Gitea detected!</string>
<string name="versionAlertDialogHeader">Unsupported Version of Gitea</string>
@ -460,6 +463,7 @@
<string name="fileDiffViewHeader">%1$s Files Changed</string>
<string name="fileDiffViewHeaderSingle">%1$s File Changed</string>
<string name="openFileDiffText">Files Changed</string>
<string name="updatePullRequestText">Update Pull Request</string>
<string name="mergePullRequestText">Merge Pull Request</string>
<string name="deletePrHeadBranch">Delete head branch</string>
<string name="deleteBranchSuccess">Branch deleted successfully</string>
@ -550,7 +554,7 @@
<string name="switchAccountSuccess">Switched to account : %1$s@%2$s</string>
<!-- Notifications -->
<string name="pageTitleNotifications">Notifications</string>
<string name="noDataNotifications">No notifications found</string>
<string name="noDataNotifications">All caught up 🚀</string>
<string name="notificationsPollingHeaderText">Notifications Polling Delay</string>
<string name="pollingDelaySelectedText">%d Minutes</string>
<string name="pollingDelayDialogHeaderText">Select Polling Delay</string>
@ -631,4 +635,15 @@
<string name="fileViewerNotificationChannelDescription">Indicates the progress of ongoing downloads</string>
<string name="lastUpdatedAt">Updated %s</string>
<string name="joined">Joined</string>
<string name="userFollow">Follow</string>
<string name="unfollowUser">Unfollow</string>
<string name="unfollowedUser">Unfollowed @%s</string>
<string name="nowFollowUser">You now follow @%s</string>
<string name="unfollowingFailed">Couldn\'t unfollow user</string>
<string name="followingFailed">Couldn\'t follow user</string>
<string name="updatePrConflict">The pull request conflicts with the base branch. Please resolve the conflicts and try again.</string>
<string name="updatePrSuccess">Pull Request updated successfully</string>
<string name="updateStrategyMerge">Merge</string>
<string name="updateStrategyRebase">Rebase</string>
<string name="selectUpdateStrategy">Select Update Strategy</string>
</resources>

View File

@ -10,9 +10,7 @@
<string name="navAbout">O aplikaci</string>
<string name="navRate">Ohodnotit GitNex</string>
<string name="navLogout">Odhlásit se</string>
<string name="navExplore">Prozkoumat</string>
<string name="navAdministration">Administrace</string>
<string name="navSearchIssuesPulls">Search Issues</string>
<!-- menu items -->
<!-- page titles -->
<string name="pageTitleAbout">O aplikaci</string>
@ -39,6 +37,7 @@
<string name="pageTitleAdministration">Administrace Gitea</string>
<string name="pageTitleUserAccounts">Správa účtů</string>
<string name="pageTitleNewPullRequest">New Pull Request</string>
<string name="pageTitleUsers">Users</string>
<!-- page titles -->
<string name="repoName">Demo repozitář</string>
<string name="repoFullName">Repo with ORG</string>
@ -152,6 +151,7 @@
<string name="milestoneNoDescription">Bez popisu</string>
<string name="milestoneIssueStatusOpen">%1$d otevřených</string>
<string name="milestoneIssueStatusClosed">%1$d zavřených</string>
<string name="selectMilestone">Select Milestone</string>
<string name="newIssueSelectAssigneesListTitle">Vybrat pověřenou osobu</string>
<string name="newIssueSelectLabelsListTitle">Vybrat popisek</string>
<string name="newIssueTitle">Název</string>
@ -428,7 +428,10 @@
<string name="isClosed">Closed</string>
<string name="genericServerResponseError">We cannot reach the server at the moment, please check your server status and try again</string>
<string name="genericCopyUrl">Copy URL</string>
<string name="genericWaitFor">Hold on ☕</string>
<!-- generic copy -->
<string name="exploreUsers">Explore users</string>
<string name="exploreIssues">Explore issues</string>
<string name="exploreTextBoxHint">Explore repositories</string>
<string name="starRepository">Star Repository</string>
<string name="unStarRepository">Unstar Repository</string>
@ -439,7 +442,7 @@
<string name="watchRepositorySuccess">Repository added to watch list</string>
<string name="unWatchRepositorySuccess">Repository removed from watch list</string>
<string name="titleDrafts">Drafts</string>
<string name="versionUnsupportedOld">Unsupported old version(%1$s) of Gitea detected. Please update to latest stable version. If you continue, the app may not function properly</string>
<string name="versionUnsupportedOld">Unsupported old version(%1$s) of Gitea detected. Please update to latest stable version. If you continue, some features may not work.</string>
<string name="versionUnsupportedNew">New Gitea version detected! Please UPDATE GitNex!</string>
<string name="versionUnknown">No Gitea detected!</string>
<string name="versionAlertDialogHeader">Unsupported Version of Gitea</string>
@ -457,6 +460,7 @@
<string name="fileDiffViewHeader">%1$s Files Changed</string>
<string name="fileDiffViewHeaderSingle">%1$s File Changed</string>
<string name="openFileDiffText">Files Changed</string>
<string name="updatePullRequestText">Update Pull Request</string>
<string name="mergePullRequestText">Merge Pull Request</string>
<string name="deletePrHeadBranch">Delete head branch</string>
<string name="deleteBranchSuccess">Branch deleted successfully</string>
@ -547,7 +551,7 @@
<string name="switchAccountSuccess">Switched to account : %1$s@%2$s</string>
<!-- Notifications -->
<string name="pageTitleNotifications">Notifications</string>
<string name="noDataNotifications">No notifications found</string>
<string name="noDataNotifications">All caught up 🚀</string>
<string name="notificationsPollingHeaderText">Notifications Polling Delay</string>
<string name="pollingDelaySelectedText">%d Minutes</string>
<string name="pollingDelayDialogHeaderText">Select Polling Delay</string>
@ -628,4 +632,15 @@
<string name="fileViewerNotificationChannelDescription">Indicates the progress of ongoing downloads</string>
<string name="lastUpdatedAt">Updated %s</string>
<string name="joined">Joined</string>
<string name="userFollow">Follow</string>
<string name="unfollowUser">Unfollow</string>
<string name="unfollowedUser">Unfollowed @%s</string>
<string name="nowFollowUser">You now follow @%s</string>
<string name="unfollowingFailed">Couldn\'t unfollow user</string>
<string name="followingFailed">Couldn\'t follow user</string>
<string name="updatePrConflict">The pull request conflicts with the base branch. Please resolve the conflicts and try again.</string>
<string name="updatePrSuccess">Pull Request updated successfully</string>
<string name="updateStrategyMerge">Merge</string>
<string name="updateStrategyRebase">Rebase</string>
<string name="selectUpdateStrategy">Select Update Strategy</string>
</resources>

View File

@ -10,9 +10,7 @@
<string name="navAbout">Über</string>
<string name="navRate">Bewerte GitNex</string>
<string name="navLogout">Ausloggen</string>
<string name="navExplore">Erkunden</string>
<string name="navAdministration">Administration</string>
<string name="navSearchIssuesPulls">Issues Suche</string>
<!-- menu items -->
<!-- page titles -->
<string name="pageTitleAbout">Über</string>
@ -39,6 +37,7 @@
<string name="pageTitleAdministration">Gitea-Administration</string>
<string name="pageTitleUserAccounts">Konten verwalten</string>
<string name="pageTitleNewPullRequest">Neuer Pull-Request</string>
<string name="pageTitleUsers">Benutzer</string>
<!-- page titles -->
<string name="repoName">Demo Repo</string>
<string name="repoFullName">Repo mit ORG</string>
@ -111,10 +110,10 @@
<string name="tabPullRequests">Pull Requests</string>
<string name="noDataIssueTab">Keine Issues gefunden!</string>
<string name="infoTabRepoSize">Größe</string>
<string name="infoTabRepoDefaultBranch">Standard Branch</string>
<string name="infoTabRepoSshUrl">SSH Link</string>
<string name="infoTabRepoDefaultBranch">Standard-Branch</string>
<string name="infoTabRepoSshUrl">SSH-URL</string>
<string name="infoTabRepoCloneUrl">Klon-URL</string>
<string name="infoTabRepoRepoUrl">Repository Link</string>
<string name="infoTabRepoRepoUrl">Repo-URL</string>
<string name="infoTabRepoForksCount">Anzahl an Forks</string>
<string name="infoTabRepoCreatedAt">Erstellt</string>
<string name="infoTabRepoUpdatedAt">Letzte Aktualisierung</string>
@ -139,7 +138,7 @@
<string name="noDataReleasesTab">Kein Release gefunden!</string>
<string name="releasePublishedBy">Veröffentlicht von @%1$s</string>
<string name="noReleaseBodyContent">Veröffentlichungshinweise werden vom Herausgeber nicht zur Verfügung gestellt.</string>
<string name="noDataCollaboratorTab">Kein Zuständiger gefunden!</string>
<string name="noDataCollaboratorTab">Keine Mitarbeiter gefunden</string>
<string name="newMilestoneTitle">Titel</string>
<string name="newMilestoneDescription">Beschreibung</string>
<string name="newMilestoneDueDate">Fälligkeitsdatum</string>
@ -152,6 +151,7 @@
<string name="milestoneNoDescription">Keine Beschreibung</string>
<string name="milestoneIssueStatusOpen">%1$d offen</string>
<string name="milestoneIssueStatusClosed">%1$d geschlossen</string>
<string name="selectMilestone">Meilensteine auswählen</string>
<string name="newIssueSelectAssigneesListTitle">Wählen Sie Zuständige aus</string>
<string name="newIssueSelectLabelsListTitle">Label auswählen</string>
<string name="newIssueTitle">Titel</string>
@ -197,10 +197,10 @@
<string name="themeSelectionHeaderText">Design</string>
<string name="settingsCounterBadges">Zähler für Tabs</string>
<string name="settingsFileViewerSourceCodeHeaderText">Quellcode-Design</string>
<string name="cacheSizeDataDialogHeader">Daten-Cache Größe</string>
<string name="cacheSizeDataSelectionHeaderText">Daten-Cache Größe</string>
<string name="cacheSizeImagesDialogHeader">Bilder-Cache Größe</string>
<string name="cacheSizeImagesSelectionHeaderText">Bilder-Cache Größe</string>
<string name="cacheSizeDataDialogHeader">Größe des Daten-Caches</string>
<string name="cacheSizeDataSelectionHeaderText">Größe des Daten-Caches</string>
<string name="cacheSizeImagesDialogHeader">Größe des Bilder-Caches</string>
<string name="cacheSizeImagesSelectionHeaderText">Größe des Bilder-Caches</string>
<string name="clearCacheSelectionHeaderText">Cache löschen</string>
<string name="clearCacheDialogHeader">Cache löschen?</string>
<string name="clearCacheDialogMessage">Dadurch werden alle Cache-Daten einschließlich Dateien und Bilder gelöscht.\n\nMit dem Löschen fortfahren?</string>
@ -220,7 +220,7 @@
<string name="createLabel">Label erstellen</string>
<string name="menuTitleText">Repo-Menü</string>
<string name="labelName">Beschriftung</string>
<string name="labelColor">Label Farbe</string>
<string name="labelColor">Farbe des Labels</string>
<string name="labelEmptyError">Name des Namens ist leer.</string>
<string name="labelNameError">Label Name ist ungültig.</string>
<string name="labelCreated">Label wurde erfolgreich erstellt!</string>
@ -268,7 +268,7 @@
<string name="newTeamDesc">Beschreibung des Teams</string>
<string name="newTeamPermission">Berechtigung</string>
<string name="newTeamAccessControls">Zugriffsrechte</string>
<string name="newTeamPermissionRead">Mitglieder können Team Repositorys einsehen und klonen.</string>
<string name="newTeamPermissionRead">Mitglieder können Team-Repositorys einsehen und klonen</string>
<string name="newTeamPermissionWrite">Mitglieder können auf Team-Repositories lesen und schreiben.</string>
<string name="newTeamPermissionAdmin">Mitglieder können auf Team-Repositories lesen, schreiben und Teilnehmer hinzufügen.</string>
<string name="teamNameEmpty">Bitte geben Sie den Teamnamen ein.</string>
@ -326,7 +326,7 @@
<!-- admin -->
<string name="adminCreateNewUser">Neuen Benutzer erstellen</string>
<string name="adminUsers">Systembenutzer</string>
<string name="userRoleAdmin">Administrator</string>
<string name="userRoleAdmin">Admin</string>
<string name="adminCron">Cron-Jobs</string>
<string name="adminCronScheduleHeader">Termin planen</string>
<string name="adminCronNextRunHeader">Nächster Durchlauf</string>
@ -365,7 +365,7 @@
<string name="loginOTP">OTP-Code (optional)</string>
<string name="otpMessage">Gib den Otp-Code ein, wenn 2FA eingeschaltet ist</string>
<string name="openWebRepo">Öffne mit Browser</string>
<string name="repoStargazersInMenu">Favorisierer</string>
<string name="repoStargazersInMenu">Favorisiert von</string>
<string name="repoWatchersInMenu">Beobachter</string>
<string name="noDataWebsite">Keine Webseite gefunden</string>
<string name="noDataDescription">Keine Beschreibung gefunden</string>
@ -428,7 +428,10 @@
<string name="isClosed">Geschlossen</string>
<string name="genericServerResponseError">Wir können den Server im Moment nicht erreichen. Bitte überprüfen Sie Ihren Serverstatus und versuchen Sie es erneut</string>
<string name="genericCopyUrl">Link kopieren</string>
<string name="genericWaitFor">Laden ... ☕</string>
<!-- generic copy -->
<string name="exploreUsers">Benutzer erkunden</string>
<string name="exploreIssues">Issues erkunden</string>
<string name="exploreTextBoxHint">Repositories entdecken</string>
<string name="starRepository">Repository favorisieren</string>
<string name="unStarRepository">Repository nicht mehr favorisieren</string>
@ -439,7 +442,7 @@
<string name="watchRepositorySuccess">Repository zur Merkliste hinzugefügt</string>
<string name="unWatchRepositorySuccess">Repository von der Merkliste entfernt</string>
<string name="titleDrafts">Entwürfe</string>
<string name="versionUnsupportedOld">Nicht unterstützte alte Version(%1$s) von Gitea erkannt. Bitte aktualisieren Sie auf die neueste stabile Version. Wenn Sie fortfahren, funktioniert die App möglicherweise nicht ordnungsgemäß</string>
<string name="versionUnsupportedOld">Nicht unterstützte alte Version(%1$s) von Gitea erkannt. Bitte aktualisieren Sie auf die neueste stabile Version. Wenn Sie fortfahren, funktioniert die App möglicherweise nicht ordnungsgemäß.</string>
<string name="versionUnsupportedNew">Neue Gitea-Version erkannt! Bitte UPDATE GitNex!</string>
<string name="versionUnknown">Keine Gitea erkannt!</string>
<string name="versionAlertDialogHeader">Nicht unterstützte Version von Gitea</string>
@ -450,15 +453,16 @@
<string name="prDeletedFork">Gelöschter Fork</string>
<string name="noDataPullRequests">Keine Pull-Requests gefunden</string>
<string name="prCreator">Ersteller:\u0020</string>
<string name="editPrText">Bearbeite Pull-Request</string>
<string name="editPrText">Pull-Request bearbeiten</string>
<string name="copyPrUrlText">Pull-Request URL kopieren</string>
<string name="editPrNavHeader">Bearbeite Pull-Request #%1$s</string>
<string name="editPrSuccessMessage">Pull-Request aktualisiert</string>
<string name="fileDiffViewHeader">%1$s Dateien geändert</string>
<string name="fileDiffViewHeaderSingle">%1$s Dateien geändert</string>
<string name="openFileDiffText">Diff Anzeigen</string>
<string name="openFileDiffText">Diff anzeigen</string>
<string name="updatePullRequestText">Pull Request aktualisieren</string>
<string name="mergePullRequestText">Pull-Request zusammenführen</string>
<string name="deletePrHeadBranch">Ziel-Branch löschen</string>
<string name="deletePrHeadBranch">Quell-Branch löschen</string>
<string name="deleteBranchSuccess">Branch erfolgreich gelöscht</string>
<string name="deleteBranchError">Branch konnte nicht gelöscht werden</string>
<string name="deleteBranchErrorNotFound">Branch existiert nicht</string>
@ -547,7 +551,7 @@
<string name="switchAccountSuccess">Auf Konto umgeschaltet: %1$s@%2$s</string>
<!-- Notifications -->
<string name="pageTitleNotifications">Benachrichtigungen</string>
<string name="noDataNotifications">Keine Benachrichtigungen gefunden</string>
<string name="noDataNotifications">Keine Nachrichten 🚀</string>
<string name="notificationsPollingHeaderText">Benachrichtigungsverzögerung</string>
<string name="pollingDelaySelectedText">%d Minuten</string>
<string name="pollingDelayDialogHeaderText">Abfrageverzögerung auswählen</string>
@ -588,7 +592,7 @@
<string name="repoDeletionSuccess">Repository erfolgreich gelöscht</string>
<string name="repoSettingsTransferOwnership">Besitz übertragen</string>
<string name="repoSettingsTransferOwnershipHint">Dieses Repository an einen Benutzer oder eine Organisation übertragen, für die Sie Admin Rechte haben</string>
<string name="repoSettingsTransferOwnershipDescription">Dinge, die vor der Übertragung bekannt sind:\n\n- Du verlierst den Zugriff auf das Projekt, wenn es an einen Benutzer übertragen wird.\n- Du behälst den Zugriff auf das Projekt, wenn es an eine Organisation übertragen wird, die du (mit-)besitzt.\n\nGeben den Repository-Namen als Bestätigung ein</string>
<string name="repoSettingsTransferOwnershipDescription">Dinge, die vor der Übertragung bekannt sein sollten:\n\n- Du verlierst den Zugriff auf das Projekt, wenn es an einen Benutzer übertragen wird.\n- Du behälst den Zugriff auf das Projekt, wenn es an eine Organisation übertragen wird, die du (mit-)besitzt.\n\nGib den Repository-Namen als Bestätigung ein</string>
<string name="repoTransferText">Übertragung durchführen</string>
<string name="repoTransferOwnerText">Neuer Besitzer</string>
<string name="repoTransferSuccess">Repository erfolgreich übertragen</string>
@ -628,4 +632,15 @@
<string name="fileViewerNotificationChannelDescription">Zeigt den Fortschritt laufender Downloads an</string>
<string name="lastUpdatedAt">Aktualisiert %s</string>
<string name="joined">Beigetreten</string>
<string name="userFollow">Folgen</string>
<string name="unfollowUser">Nicht mehr folgen</string>
<string name="unfollowedUser">Du folgst @%s nicht mehr</string>
<string name="nowFollowUser">Du folgst @%s</string>
<string name="unfollowingFailed">Benutzer konnte nicht entfolgt werden</string>
<string name="followingFailed">Nutzer konnte nicht gefolgt werden</string>
<string name="updatePrConflict">Der Pull Request enthält Konflikte. Bitte behebe diese und versuche es erneut.</string>
<string name="updatePrSuccess">Pull Request erfolgreich aktualisiert</string>
<string name="updateStrategyMerge">Merge</string>
<string name="updateStrategyRebase">Rebase</string>
<string name="selectUpdateStrategy">Update-Strategie auswählen</string>
</resources>

View File

@ -10,9 +10,7 @@
<string name="navAbout">Sobre</string>
<string name="navRate">Valorar GitNex</string>
<string name="navLogout">Cerrar sesión</string>
<string name="navExplore">Explorar</string>
<string name="navAdministration">Administración</string>
<string name="navSearchIssuesPulls">Buscar incidencias</string>
<!-- menu items -->
<!-- page titles -->
<string name="pageTitleAbout">Sobre</string>
@ -39,6 +37,7 @@
<string name="pageTitleAdministration">Administración de Gitea</string>
<string name="pageTitleUserAccounts">Gestionar Cuentas</string>
<string name="pageTitleNewPullRequest">Nuevo pull request</string>
<string name="pageTitleUsers">Users</string>
<!-- page titles -->
<string name="repoName">Repo Demo</string>
<string name="repoFullName">Repo con ORG</string>
@ -152,6 +151,7 @@
<string name="milestoneNoDescription">Sin descripción</string>
<string name="milestoneIssueStatusOpen">%1$d abiertos</string>
<string name="milestoneIssueStatusClosed">%1$d cerrados</string>
<string name="selectMilestone">Select Milestone</string>
<string name="newIssueSelectAssigneesListTitle">Selecciona personas asignadas</string>
<string name="newIssueSelectLabelsListTitle">Selecciona etiquetas</string>
<string name="newIssueTitle">Título</string>
@ -428,7 +428,10 @@
<string name="isClosed">Cerrado</string>
<string name="genericServerResponseError">Por el momento no se puede contactar con el servidor. Por favor, compruebe el statús del servidor y intentalo de nuevo</string>
<string name="genericCopyUrl">Copiar URL</string>
<string name="genericWaitFor">Hold on ☕</string>
<!-- generic copy -->
<string name="exploreUsers">Explore users</string>
<string name="exploreIssues">Explore issues</string>
<string name="exploreTextBoxHint">Explorar repositorios</string>
<string name="starRepository">Destacar repositorio</string>
<string name="unStarRepository">Eliminar de favoritos</string>
@ -439,7 +442,7 @@
<string name="watchRepositorySuccess">Añadido a la lista de los repositorios seguidos</string>
<string name="unWatchRepositorySuccess">Eliminado de la lista de los repositorios seguidos</string>
<string name="titleDrafts">Borradores</string>
<string name="versionUnsupportedOld">Se ha reconocido una versión (%1$s) de Gitea no compatible. Por favor actualice su instancia a la versión más reciente. Si usted continua, es posible que la app no funcione correctamente</string>
<string name="versionUnsupportedOld">Unsupported old version(%1$s) of Gitea detected. Please update to latest stable version. If you continue, some features may not work.</string>
<string name="versionUnsupportedNew">Se ha reconocido una nueva version de Gitea! Por favor, ACTUALICE GitNex!</string>
<string name="versionUnknown">Gitea no reconocida!</string>
<string name="versionAlertDialogHeader">Versión de Gitea no compatible</string>
@ -457,6 +460,7 @@
<string name="fileDiffViewHeader">%1$s archivos modificados</string>
<string name="fileDiffViewHeaderSingle">%1$s archivo modificado</string>
<string name="openFileDiffText">Archivos modificados</string>
<string name="updatePullRequestText">Update Pull Request</string>
<string name="mergePullRequestText">Fusionar pull request</string>
<string name="deletePrHeadBranch">Eliminar la rama principal</string>
<string name="deleteBranchSuccess">Rama eliminada con éxito</string>
@ -547,7 +551,7 @@
<string name="switchAccountSuccess">Cambio de la cuenta: %1$s@%2$s</string>
<!-- Notifications -->
<string name="pageTitleNotifications">Notificaciones</string>
<string name="noDataNotifications">No se han encontrado notificaciones</string>
<string name="noDataNotifications">All caught up 🚀</string>
<string name="notificationsPollingHeaderText">Retraso de notificaciones</string>
<string name="pollingDelaySelectedText">%d minutos</string>
<string name="pollingDelayDialogHeaderText">Seleccionar cantidad del retraso</string>
@ -628,4 +632,15 @@
<string name="fileViewerNotificationChannelDescription">Indica el progreso de las descargas en curso</string>
<string name="lastUpdatedAt">Actualizado %s</string>
<string name="joined">Joined</string>
<string name="userFollow">Follow</string>
<string name="unfollowUser">Unfollow</string>
<string name="unfollowedUser">Unfollowed @%s</string>
<string name="nowFollowUser">You now follow @%s</string>
<string name="unfollowingFailed">Couldn\'t unfollow user</string>
<string name="followingFailed">Couldn\'t follow user</string>
<string name="updatePrConflict">The pull request conflicts with the base branch. Please resolve the conflicts and try again.</string>
<string name="updatePrSuccess">Pull Request updated successfully</string>
<string name="updateStrategyMerge">Merge</string>
<string name="updateStrategyRebase">Rebase</string>
<string name="selectUpdateStrategy">Select Update Strategy</string>
</resources>

View File

@ -10,9 +10,7 @@
<string name="navAbout">درباره ما</string>
<string name="navRate">به GitNex امتیاز دهید</string>
<string name="navLogout">خروج از حساب کاربری</string>
<string name="navExplore">گشت‌و‌گذار</string>
<string name="navAdministration">مدیریت</string>
<string name="navSearchIssuesPulls">جستجوی مسائل</string>
<!-- menu items -->
<!-- page titles -->
<string name="pageTitleAbout">درباره ما</string>
@ -39,6 +37,7 @@
<string name="pageTitleAdministration">مدیریت Gitea</string>
<string name="pageTitleUserAccounts">مدیریت حساب‌ها</string>
<string name="pageTitleNewPullRequest">ایجاد درخواست ادغام جدید</string>
<string name="pageTitleUsers">Users</string>
<!-- page titles -->
<string name="repoName">مخزن پیش نمایشی</string>
<string name="repoFullName">مخزن با ORG</string>
@ -155,6 +154,7 @@
<string name="milestoneNoDescription">بدون توضیح</string>
<string name="milestoneIssueStatusOpen">%1$d باز</string>
<string name="milestoneIssueStatusClosed">%1$d بسته شده</string>
<string name="selectMilestone">Select Milestone</string>
<string name="newIssueSelectAssigneesListTitle">Select Assignees</string>
<string name="newIssueSelectLabelsListTitle">برچسب‌ها را انتخاب کنید</string>
<string name="newIssueTitle">عنوان</string>
@ -431,7 +431,10 @@
<string name="isClosed">بسته</string>
<string name="genericServerResponseError">We cannot reach the server at the moment, please check your server status and try again</string>
<string name="genericCopyUrl">روگیری نشانی</string>
<string name="genericWaitFor">Hold on ☕</string>
<!-- generic copy -->
<string name="exploreUsers">Explore users</string>
<string name="exploreIssues">Explore issues</string>
<string name="exploreTextBoxHint">کشف مخزن‌ها</string>
<string name="starRepository">Star Repository</string>
<string name="unStarRepository">Unstar Repository</string>
@ -442,7 +445,7 @@
<string name="watchRepositorySuccess">Repository added to watch list</string>
<string name="unWatchRepositorySuccess">Repository removed from watch list</string>
<string name="titleDrafts">پیش نویس‌ها</string>
<string name="versionUnsupportedOld">Unsupported old version(%1$s) of Gitea detected. Please update to latest stable version. If you continue, the app may not function properly</string>
<string name="versionUnsupportedOld">Unsupported old version(%1$s) of Gitea detected. Please update to latest stable version. If you continue, some features may not work.</string>
<string name="versionUnsupportedNew">New Gitea version detected! Please UPDATE GitNex!</string>
<string name="versionUnknown">هیچ Gitea تشخیص داده نشد!</string>
<string name="versionAlertDialogHeader">نگارش پشتیبانی نشده Gitea</string>
@ -460,6 +463,7 @@
<string name="fileDiffViewHeader">%1$s پرونده تغییر یافت</string>
<string name="fileDiffViewHeaderSingle">%1$s پرونده تغییر یافت</string>
<string name="openFileDiffText">پرونده‌های تغییر یافته</string>
<string name="updatePullRequestText">Update Pull Request</string>
<string name="mergePullRequestText">Merge Pull Request</string>
<string name="deletePrHeadBranch">Delete head branch</string>
<string name="deleteBranchSuccess">Branch deleted successfully</string>
@ -550,7 +554,7 @@
<string name="switchAccountSuccess">Switched to account : %1$s@%2$s</string>
<!-- Notifications -->
<string name="pageTitleNotifications">آگاهی‌ها</string>
<string name="noDataNotifications">هیچ آگاهی یافت نشد</string>
<string name="noDataNotifications">All caught up 🚀</string>
<string name="notificationsPollingHeaderText">Notifications Polling Delay</string>
<string name="pollingDelaySelectedText">%d دقیقه</string>
<string name="pollingDelayDialogHeaderText">Select Polling Delay</string>
@ -631,4 +635,15 @@
<string name="fileViewerNotificationChannelDescription">Indicates the progress of ongoing downloads</string>
<string name="lastUpdatedAt">Updated %s</string>
<string name="joined">Joined</string>
<string name="userFollow">Follow</string>
<string name="unfollowUser">Unfollow</string>
<string name="unfollowedUser">Unfollowed @%s</string>
<string name="nowFollowUser">You now follow @%s</string>
<string name="unfollowingFailed">Couldn\'t unfollow user</string>
<string name="followingFailed">Couldn\'t follow user</string>
<string name="updatePrConflict">The pull request conflicts with the base branch. Please resolve the conflicts and try again.</string>
<string name="updatePrSuccess">Pull Request updated successfully</string>
<string name="updateStrategyMerge">Merge</string>
<string name="updateStrategyRebase">Rebase</string>
<string name="selectUpdateStrategy">Select Update Strategy</string>
</resources>

View File

@ -10,9 +10,7 @@
<string name="navAbout">Tietoja</string>
<string name="navRate">Anna palautetta</string>
<string name="navLogout">Kirjaudu ulos</string>
<string name="navExplore">Explore</string>
<string name="navAdministration">Administration</string>
<string name="navSearchIssuesPulls">Search Issues</string>
<!-- menu items -->
<!-- page titles -->
<string name="pageTitleAbout">Tietoja</string>
@ -39,6 +37,7 @@
<string name="pageTitleAdministration">Gitea Administration</string>
<string name="pageTitleUserAccounts">Manage Accounts</string>
<string name="pageTitleNewPullRequest">New Pull Request</string>
<string name="pageTitleUsers">Users</string>
<!-- page titles -->
<string name="repoName">Demo repo</string>
<string name="repoFullName">Repo with ORG</string>
@ -152,6 +151,7 @@
<string name="milestoneNoDescription">No description</string>
<string name="milestoneIssueStatusOpen">%1$d Open</string>
<string name="milestoneIssueStatusClosed">%1$d Closed</string>
<string name="selectMilestone">Select Milestone</string>
<string name="newIssueSelectAssigneesListTitle">Select Assignees</string>
<string name="newIssueSelectLabelsListTitle">Select Labels</string>
<string name="newIssueTitle">Title</string>
@ -428,7 +428,10 @@
<string name="isClosed">Closed</string>
<string name="genericServerResponseError">We cannot reach the server at the moment, please check your server status and try again</string>
<string name="genericCopyUrl">Copy URL</string>
<string name="genericWaitFor">Hold on ☕</string>
<!-- generic copy -->
<string name="exploreUsers">Explore users</string>
<string name="exploreIssues">Explore issues</string>
<string name="exploreTextBoxHint">Explore repositories</string>
<string name="starRepository">Star Repository</string>
<string name="unStarRepository">Unstar Repository</string>
@ -439,7 +442,7 @@
<string name="watchRepositorySuccess">Repository added to watch list</string>
<string name="unWatchRepositorySuccess">Repository removed from watch list</string>
<string name="titleDrafts">Drafts</string>
<string name="versionUnsupportedOld">Unsupported old version(%1$s) of Gitea detected. Please update to latest stable version. If you continue, the app may not function properly</string>
<string name="versionUnsupportedOld">Unsupported old version(%1$s) of Gitea detected. Please update to latest stable version. If you continue, some features may not work.</string>
<string name="versionUnsupportedNew">New Gitea version detected! Please UPDATE GitNex!</string>
<string name="versionUnknown">No Gitea detected!</string>
<string name="versionAlertDialogHeader">Unsupported Version of Gitea</string>
@ -457,6 +460,7 @@
<string name="fileDiffViewHeader">%1$s Files Changed</string>
<string name="fileDiffViewHeaderSingle">%1$s File Changed</string>
<string name="openFileDiffText">Files Changed</string>
<string name="updatePullRequestText">Update Pull Request</string>
<string name="mergePullRequestText">Merge Pull Request</string>
<string name="deletePrHeadBranch">Delete head branch</string>
<string name="deleteBranchSuccess">Branch deleted successfully</string>
@ -547,7 +551,7 @@
<string name="switchAccountSuccess">Switched to account : %1$s@%2$s</string>
<!-- Notifications -->
<string name="pageTitleNotifications">Notifications</string>
<string name="noDataNotifications">No notifications found</string>
<string name="noDataNotifications">All caught up 🚀</string>
<string name="notificationsPollingHeaderText">Notifications Polling Delay</string>
<string name="pollingDelaySelectedText">%d Minutes</string>
<string name="pollingDelayDialogHeaderText">Select Polling Delay</string>
@ -628,4 +632,15 @@
<string name="fileViewerNotificationChannelDescription">Indicates the progress of ongoing downloads</string>
<string name="lastUpdatedAt">Updated %s</string>
<string name="joined">Joined</string>
<string name="userFollow">Follow</string>
<string name="unfollowUser">Unfollow</string>
<string name="unfollowedUser">Unfollowed @%s</string>
<string name="nowFollowUser">You now follow @%s</string>
<string name="unfollowingFailed">Couldn\'t unfollow user</string>
<string name="followingFailed">Couldn\'t follow user</string>
<string name="updatePrConflict">The pull request conflicts with the base branch. Please resolve the conflicts and try again.</string>
<string name="updatePrSuccess">Pull Request updated successfully</string>
<string name="updateStrategyMerge">Merge</string>
<string name="updateStrategyRebase">Rebase</string>
<string name="selectUpdateStrategy">Select Update Strategy</string>
</resources>

View File

@ -10,9 +10,7 @@
<string name="navAbout">À propos</string>
<string name="navRate">Noter GitNex</string>
<string name="navLogout">Déconnexion</string>
<string name="navExplore">Explorer</string>
<string name="navAdministration">Administration</string>
<string name="navSearchIssuesPulls">Rechercher des tickets</string>
<!-- menu items -->
<!-- page titles -->
<string name="pageTitleAbout">À propos</string>
@ -39,6 +37,7 @@
<string name="pageTitleAdministration">Administration de Gitea</string>
<string name="pageTitleUserAccounts">Gestion des comptes</string>
<string name="pageTitleNewPullRequest">Nouvelle demande de tirage</string>
<string name="pageTitleUsers">Utilisateurs</string>
<!-- page titles -->
<string name="repoName">Dépôt de démonstration</string>
<string name="repoFullName">Nom complet du dépôt</string>
@ -152,6 +151,7 @@
<string name="milestoneNoDescription">Pas de description</string>
<string name="milestoneIssueStatusOpen">%1$d ouvert</string>
<string name="milestoneIssueStatusClosed">%1$d fermé</string>
<string name="selectMilestone">Sélectionner un jalon</string>
<string name="newIssueSelectAssigneesListTitle">Assignés</string>
<string name="newIssueSelectLabelsListTitle">Sélectionner des étiquettes</string>
<string name="newIssueTitle">Titre</string>
@ -428,7 +428,10 @@
<string name="isClosed">Fermé</string>
<string name="genericServerResponseError">Impossible de se connecter au serveur pour le moment, veuillez vérifier son statut puis réessayer</string>
<string name="genericCopyUrl">Copier lURL</string>
<string name="genericWaitFor">Attendez un instant ☕</string>
<!-- generic copy -->
<string name="exploreUsers">Voir les utilisateurs</string>
<string name="exploreIssues">Voir les tickets</string>
<string name="exploreTextBoxHint">Explorer les dépôts</string>
<string name="starRepository">Ajouter aux favoris</string>
<string name="unStarRepository">Retirer des favoris</string>
@ -439,7 +442,7 @@
<string name="watchRepositorySuccess">Vous suivez ce dépôt</string>
<string name="unWatchRepositorySuccess">Vous ne suivez plus ce dépôt</string>
<string name="titleDrafts">Brouillons</string>
<string name="versionUnsupportedOld">Ancienne version de Gitea détectée (%1$s). Faire la mise à jour vers la dernière version stable est fortement recommandé.</string>
<string name="versionUnsupportedOld">Version périmée de Gitea (%1$s) détectée. Veuillez mettre à jour vers la dernière version stable. Si vous continuez, lapplication peut ne pas fonctionner correctement.</string>
<string name="versionUnsupportedNew">Nouvelle version de Gitea détectée ! Veuillez mettre à jour GitNex !</string>
<string name="versionUnknown">Aucun serveur Gitea détecté !</string>
<string name="versionAlertDialogHeader">Version de Gitea non prise en charge</string>
@ -457,6 +460,7 @@
<string name="fileDiffViewHeader">%1$s fichiers modifiés</string>
<string name="fileDiffViewHeaderSingle">%1$s fichier modifié</string>
<string name="openFileDiffText">Fichiers modifiés</string>
<string name="updatePullRequestText">Mettre à jour la demande de tirage</string>
<string name="mergePullRequestText">Fusionner la demande de tirage</string>
<string name="deletePrHeadBranch">Supprimer la branche courante</string>
<string name="deleteBranchSuccess">Branche supprimée</string>
@ -547,7 +551,7 @@
<string name="switchAccountSuccess">Passé au compte : %1$s@%2$s</string>
<!-- Notifications -->
<string name="pageTitleNotifications">Notifications</string>
<string name="noDataNotifications">Aucune notification</string>
<string name="noDataNotifications">Cest parti 🚀</string>
<string name="notificationsPollingHeaderText">Période de scrutation</string>
<string name="pollingDelaySelectedText">%d minutes</string>
<string name="pollingDelayDialogHeaderText">Période de scrutation</string>
@ -628,4 +632,15 @@
<string name="fileViewerNotificationChannelDescription">Indique la progression des téléchargements</string>
<string name="lastUpdatedAt">%s mis à jour</string>
<string name="joined">Inscrit</string>
<string name="userFollow">Suivre</string>
<string name="unfollowUser">Ne plus suivre</string>
<string name="unfollowedUser">Vous ne suivez plus %s</string>
<string name="nowFollowUser">Vous suivez @%s</string>
<string name="unfollowingFailed">Impossible de ne plus suivre lutilisateur</string>
<string name="followingFailed">Impossible de suivre lutilisateur</string>
<string name="updatePrConflict">La requête de tirage est en conflit avec la branche principale. Veuillez résoudre ce conflit, puis réessayez.</string>
<string name="updatePrSuccess">Requête de tirage créée</string>
<string name="updateStrategyMerge">Fusionner</string>
<string name="updateStrategyRebase">Rebaser</string>
<string name="selectUpdateStrategy">Stratégie de mise à jour</string>
</resources>

View File

@ -10,9 +10,7 @@
<string name="navAbout">Info su</string>
<string name="navRate">Valuta GitNex</string>
<string name="navLogout">Esci</string>
<string name="navExplore">Esplora</string>
<string name="navAdministration">Amministrazione</string>
<string name="navSearchIssuesPulls">Cerca segnalazioni</string>
<!-- menu items -->
<!-- page titles -->
<string name="pageTitleAbout">Info su</string>
@ -39,6 +37,7 @@
<string name="pageTitleAdministration">Amministrazione Gitea</string>
<string name="pageTitleUserAccounts">Gestione Account</string>
<string name="pageTitleNewPullRequest">Nuova Pull Request</string>
<string name="pageTitleUsers">Users</string>
<!-- page titles -->
<string name="repoName">Demo repo</string>
<string name="repoFullName">Repo con ORG</string>
@ -153,6 +152,7 @@ URL è richiesto</string>
<string name="milestoneNoDescription">Nessuna descrizione</string>
<string name="milestoneIssueStatusOpen">%1$d Aperto</string>
<string name="milestoneIssueStatusClosed">%1$d Chiuso</string>
<string name="selectMilestone">Select Milestone</string>
<string name="newIssueSelectAssigneesListTitle">Seleziona Assegnatari</string>
<string name="newIssueSelectLabelsListTitle">Seleziona labels</string>
<string name="newIssueTitle">Titolo</string>
@ -430,7 +430,10 @@ autorizzazione</string>
<string name="isClosed">Chiuso</string>
<string name="genericServerResponseError">Al momento non possiamo raggiungere il server, controlla lo stato del tuo server e riprova</string>
<string name="genericCopyUrl">Copia l\'URL</string>
<string name="genericWaitFor">Hold on ☕</string>
<!-- generic copy -->
<string name="exploreUsers">Explore users</string>
<string name="exploreIssues">Explore issues</string>
<string name="exploreTextBoxHint">Esplora i repository</string>
<string name="starRepository">Repository star</string>
<string name="unStarRepository">Unstar Repository</string>
@ -441,7 +444,7 @@ autorizzazione</string>
<string name="watchRepositorySuccess">Repository aggiunto alla watch list</string>
<string name="unWatchRepositorySuccess">Repository rimosso dalla watchlist</string>
<string name="titleDrafts">Bozze</string>
<string name="versionUnsupportedOld">Unsupported old version(%1$s) of Gitea detected. Please update to latest stable version. If you continue, the app may not function properly</string>
<string name="versionUnsupportedOld">Unsupported old version(%1$s) of Gitea detected. Please update to latest stable version. If you continue, some features may not work.</string>
<string name="versionUnsupportedNew">Nuova versione di Gitea rilevata! Si prega di AGGIORNARE GitNex!</string>
<string name="versionUnknown">Nessun Gitea rilevato!</string>
<string name="versionAlertDialogHeader">Versione non supportata di Gitea</string>
@ -459,6 +462,7 @@ autorizzazione</string>
<string name="fileDiffViewHeader">%1$s File modificati</string>
<string name="fileDiffViewHeaderSingle">%1$s File modificati</string>
<string name="openFileDiffText">File modificati</string>
<string name="updatePullRequestText">Update Pull Request</string>
<string name="mergePullRequestText">Unisci Pull Request</string>
<string name="deletePrHeadBranch">Delete head branch</string>
<string name="deleteBranchSuccess">Branch deleted successfully</string>
@ -549,7 +553,7 @@ autorizzazione</string>
<string name="switchAccountSuccess">Switched to account : %1$s@%2$s</string>
<!-- Notifications -->
<string name="pageTitleNotifications">Notifiche</string>
<string name="noDataNotifications">Nessuna notifica trovata</string>
<string name="noDataNotifications">All caught up 🚀</string>
<string name="notificationsPollingHeaderText">Intervallo di ricerca notifiche</string>
<string name="pollingDelaySelectedText">%d Minuti</string>
<string name="pollingDelayDialogHeaderText">Seleziona l\'intervallo per la ricerca</string>
@ -630,4 +634,15 @@ autorizzazione</string>
<string name="fileViewerNotificationChannelDescription">Indicates the progress of ongoing downloads</string>
<string name="lastUpdatedAt">Updated %s</string>
<string name="joined">Joined</string>
<string name="userFollow">Follow</string>
<string name="unfollowUser">Unfollow</string>
<string name="unfollowedUser">Unfollowed @%s</string>
<string name="nowFollowUser">You now follow @%s</string>
<string name="unfollowingFailed">Couldn\'t unfollow user</string>
<string name="followingFailed">Couldn\'t follow user</string>
<string name="updatePrConflict">The pull request conflicts with the base branch. Please resolve the conflicts and try again.</string>
<string name="updatePrSuccess">Pull Request updated successfully</string>
<string name="updateStrategyMerge">Merge</string>
<string name="updateStrategyRebase">Rebase</string>
<string name="selectUpdateStrategy">Select Update Strategy</string>
</resources>

View File

@ -10,9 +10,7 @@
<string name="navAbout">Par</string>
<string name="navRate">Rate GitNex</string>
<string name="navLogout">Logout</string>
<string name="navExplore">Izpētīt</string>
<string name="navAdministration">Administration</string>
<string name="navSearchIssuesPulls">Search Issues</string>
<!-- menu items -->
<!-- page titles -->
<string name="pageTitleAbout">Par</string>
@ -39,6 +37,7 @@
<string name="pageTitleAdministration">Gitea Administration</string>
<string name="pageTitleUserAccounts">Manage Accounts</string>
<string name="pageTitleNewPullRequest">New Pull Request</string>
<string name="pageTitleUsers">Users</string>
<!-- page titles -->
<string name="repoName">Demo repo</string>
<string name="repoFullName">Repo with ORG</string>
@ -152,6 +151,7 @@
<string name="milestoneNoDescription">No description</string>
<string name="milestoneIssueStatusOpen">%1$d Open</string>
<string name="milestoneIssueStatusClosed">%1$d Closed</string>
<string name="selectMilestone">Select Milestone</string>
<string name="newIssueSelectAssigneesListTitle">Select Assignees</string>
<string name="newIssueSelectLabelsListTitle">Select Labels</string>
<string name="newIssueTitle">Title</string>
@ -428,7 +428,10 @@
<string name="isClosed">Closed</string>
<string name="genericServerResponseError">We cannot reach the server at the moment, please check your server status and try again</string>
<string name="genericCopyUrl">Copy URL</string>
<string name="genericWaitFor">Hold on ☕</string>
<!-- generic copy -->
<string name="exploreUsers">Explore users</string>
<string name="exploreIssues">Explore issues</string>
<string name="exploreTextBoxHint">Explore repositories</string>
<string name="starRepository">Star Repository</string>
<string name="unStarRepository">Unstar Repository</string>
@ -439,7 +442,7 @@
<string name="watchRepositorySuccess">Repository added to watch list</string>
<string name="unWatchRepositorySuccess">Repository removed from watch list</string>
<string name="titleDrafts">Drafts</string>
<string name="versionUnsupportedOld">Unsupported old version(%1$s) of Gitea detected. Please update to latest stable version. If you continue, the app may not function properly</string>
<string name="versionUnsupportedOld">Unsupported old version(%1$s) of Gitea detected. Please update to latest stable version. If you continue, some features may not work.</string>
<string name="versionUnsupportedNew">New Gitea version detected! Please UPDATE GitNex!</string>
<string name="versionUnknown">No Gitea detected!</string>
<string name="versionAlertDialogHeader">Unsupported Version of Gitea</string>
@ -457,6 +460,7 @@
<string name="fileDiffViewHeader">%1$s Files Changed</string>
<string name="fileDiffViewHeaderSingle">%1$s File Changed</string>
<string name="openFileDiffText">Files Changed</string>
<string name="updatePullRequestText">Update Pull Request</string>
<string name="mergePullRequestText">Merge Pull Request</string>
<string name="deletePrHeadBranch">Delete head branch</string>
<string name="deleteBranchSuccess">Branch deleted successfully</string>
@ -547,7 +551,7 @@
<string name="switchAccountSuccess">Switched to account : %1$s@%2$s</string>
<!-- Notifications -->
<string name="pageTitleNotifications">Notifications</string>
<string name="noDataNotifications">No notifications found</string>
<string name="noDataNotifications">All caught up 🚀</string>
<string name="notificationsPollingHeaderText">Notifications Polling Delay</string>
<string name="pollingDelaySelectedText">%d Minutes</string>
<string name="pollingDelayDialogHeaderText">Select Polling Delay</string>
@ -628,4 +632,15 @@
<string name="fileViewerNotificationChannelDescription">Indicates the progress of ongoing downloads</string>
<string name="lastUpdatedAt">Updated %s</string>
<string name="joined">Joined</string>
<string name="userFollow">Follow</string>
<string name="unfollowUser">Unfollow</string>
<string name="unfollowedUser">Unfollowed @%s</string>
<string name="nowFollowUser">You now follow @%s</string>
<string name="unfollowingFailed">Couldn\'t unfollow user</string>
<string name="followingFailed">Couldn\'t follow user</string>
<string name="updatePrConflict">The pull request conflicts with the base branch. Please resolve the conflicts and try again.</string>
<string name="updatePrSuccess">Pull Request updated successfully</string>
<string name="updateStrategyMerge">Merge</string>
<string name="updateStrategyRebase">Rebase</string>
<string name="selectUpdateStrategy">Select Update Strategy</string>
</resources>

View File

@ -10,9 +10,7 @@
<string name="navAbout">O programie</string>
<string name="navRate">Oceń GitNex</string>
<string name="navLogout">Wyloguj się</string>
<string name="navExplore">Przeglądaj</string>
<string name="navAdministration">Administracja</string>
<string name="navSearchIssuesPulls">Wyszukaj problemy</string>
<!-- menu items -->
<!-- page titles -->
<string name="pageTitleAbout">O programie</string>
@ -39,6 +37,7 @@
<string name="pageTitleAdministration">Administracja Gitea</string>
<string name="pageTitleUserAccounts">Zarządzaj Kontami</string>
<string name="pageTitleNewPullRequest">Nowy Pull Request</string>
<string name="pageTitleUsers">Users</string>
<!-- page titles -->
<string name="repoName">Repozytorium demo</string>
<string name="repoFullName">Repozytorium z ORG</string>
@ -152,6 +151,7 @@
<string name="milestoneNoDescription">Brak opisu</string>
<string name="milestoneIssueStatusOpen">%1$d Open</string>
<string name="milestoneIssueStatusClosed">%1$d Closed</string>
<string name="selectMilestone">Select Milestone</string>
<string name="newIssueSelectAssigneesListTitle">Wybierz przypisane osoby</string>
<string name="newIssueSelectLabelsListTitle">Wybierz etykiety</string>
<string name="newIssueTitle">Tytuł</string>
@ -428,7 +428,10 @@
<string name="isClosed">Closed</string>
<string name="genericServerResponseError">We cannot reach the server at the moment, please check your server status and try again</string>
<string name="genericCopyUrl">Kopiuj adres URL</string>
<string name="genericWaitFor">Hold on ☕</string>
<!-- generic copy -->
<string name="exploreUsers">Explore users</string>
<string name="exploreIssues">Explore issues</string>
<string name="exploreTextBoxHint">Przeglądaj repozytoria</string>
<string name="starRepository">Ogwiazdkuj repozytorium</string>
<string name="unStarRepository">Odgwiazdkuj repozytorium</string>
@ -439,7 +442,7 @@
<string name="watchRepositorySuccess">Repozytorium dodane do listy obserwowanych</string>
<string name="unWatchRepositorySuccess">Repozytorium usunięte z listy obserwacyjnej</string>
<string name="titleDrafts">Drafts</string>
<string name="versionUnsupportedOld">Unsupported old version(%1$s) of Gitea detected. Please update to latest stable version. If you continue, the app may not function properly</string>
<string name="versionUnsupportedOld">Unsupported old version(%1$s) of Gitea detected. Please update to latest stable version. If you continue, some features may not work.</string>
<string name="versionUnsupportedNew">Wykryto nową wersję Gitea! Proszę ZAKTUALIZOWAĆ GitNex!</string>
<string name="versionUnknown">No Gitea detected!</string>
<string name="versionAlertDialogHeader">Nieobsługiwana wersja Gitea</string>
@ -457,6 +460,7 @@
<string name="fileDiffViewHeader">%1$s Plików zmienionych</string>
<string name="fileDiffViewHeaderSingle">%1$s Plik zmieniony</string>
<string name="openFileDiffText">Pliki zmienione</string>
<string name="updatePullRequestText">Update Pull Request</string>
<string name="mergePullRequestText">Scal Pull Request</string>
<string name="deletePrHeadBranch">Delete head branch</string>
<string name="deleteBranchSuccess">Branch deleted successfully</string>
@ -547,7 +551,7 @@
<string name="switchAccountSuccess">Switched to account : %1$s@%2$s</string>
<!-- Notifications -->
<string name="pageTitleNotifications">Powiadomienia</string>
<string name="noDataNotifications">Brak powiadomień</string>
<string name="noDataNotifications">All caught up 🚀</string>
<string name="notificationsPollingHeaderText">Notifications Polling Delay</string>
<string name="pollingDelaySelectedText">%d Minut(y)</string>
<string name="pollingDelayDialogHeaderText">Select Polling Delay</string>
@ -628,4 +632,15 @@
<string name="fileViewerNotificationChannelDescription">Indicates the progress of ongoing downloads</string>
<string name="lastUpdatedAt">Zaktualizowano %s</string>
<string name="joined">Joined</string>
<string name="userFollow">Follow</string>
<string name="unfollowUser">Unfollow</string>
<string name="unfollowedUser">Unfollowed @%s</string>
<string name="nowFollowUser">You now follow @%s</string>
<string name="unfollowingFailed">Couldn\'t unfollow user</string>
<string name="followingFailed">Couldn\'t follow user</string>
<string name="updatePrConflict">The pull request conflicts with the base branch. Please resolve the conflicts and try again.</string>
<string name="updatePrSuccess">Pull Request updated successfully</string>
<string name="updateStrategyMerge">Merge</string>
<string name="updateStrategyRebase">Rebase</string>
<string name="selectUpdateStrategy">Select Update Strategy</string>
</resources>

View File

@ -10,9 +10,7 @@
<string name="navAbout">Sobre</string>
<string name="navRate">Avalie o GitNex</string>
<string name="navLogout">Sair</string>
<string name="navExplore">Explorar</string>
<string name="navAdministration">Administração</string>
<string name="navSearchIssuesPulls">Pesquisar incidentes</string>
<!-- menu items -->
<!-- page titles -->
<string name="pageTitleAbout">Sobre</string>
@ -39,6 +37,7 @@
<string name="pageTitleAdministration">Administração de Gitea</string>
<string name="pageTitleUserAccounts">Gerenciar contas</string>
<string name="pageTitleNewPullRequest">Novo Pull Request</string>
<string name="pageTitleUsers">Users</string>
<!-- page titles -->
<string name="repoName">Repo demo</string>
<string name="repoFullName">Repo com ORG</string>
@ -152,6 +151,7 @@
<string name="milestoneNoDescription">Sem descrição</string>
<string name="milestoneIssueStatusOpen">%1$d Aberto</string>
<string name="milestoneIssueStatusClosed">%1$d Fechado</string>
<string name="selectMilestone">Select Milestone</string>
<string name="newIssueSelectAssigneesListTitle">Selecionar designados</string>
<string name="newIssueSelectLabelsListTitle">Selecionar marcadores</string>
<string name="newIssueTitle">Título</string>
@ -428,7 +428,10 @@
<string name="isClosed">Fechado</string>
<string name="genericServerResponseError">Não conseguimos encontrar o servidor no momento, por favor, verifique o status do seu servidor e tente novamente</string>
<string name="genericCopyUrl">Copiar URL</string>
<string name="genericWaitFor">Hold on ☕</string>
<!-- generic copy -->
<string name="exploreUsers">Explore users</string>
<string name="exploreIssues">Explore issues</string>
<string name="exploreTextBoxHint">Explorar repositórios</string>
<string name="starRepository">Favoritar repositório</string>
<string name="unStarRepository">Desfavoritar repositório</string>
@ -439,7 +442,7 @@
<string name="watchRepositorySuccess">Repositório adicionado à lista de observação</string>
<string name="unWatchRepositorySuccess">Repositório removido da lista de observação</string>
<string name="titleDrafts">Rascunhos</string>
<string name="versionUnsupportedOld">Foi detectada uma versão(%1$s) de Gitea desatualizada e sem suporte. Por favor, atualize para a versão mais recente. Se você continuar, o aplicativo pode não funcionar corretamente</string>
<string name="versionUnsupportedOld">Unsupported old version(%1$s) of Gitea detected. Please update to latest stable version. If you continue, some features may not work.</string>
<string name="versionUnsupportedNew">Nova versão do Gitea detectada! Por favor, ATUALIZE o GitNex!</string>
<string name="versionUnknown">Gitea não detectado!</string>
<string name="versionAlertDialogHeader">Versão do Gitea não suportada</string>
@ -457,6 +460,7 @@
<string name="fileDiffViewHeader">%1$s Arquivos Alterados</string>
<string name="fileDiffViewHeaderSingle">%1$s Arquivo Alterado</string>
<string name="openFileDiffText">Arquivos alterados</string>
<string name="updatePullRequestText">Update Pull Request</string>
<string name="mergePullRequestText">Aplicar merge do Pull Request</string>
<string name="deletePrHeadBranch">Delete head branch</string>
<string name="deleteBranchSuccess">Branch deleted successfully</string>
@ -547,7 +551,7 @@
<string name="switchAccountSuccess">Alterado para a conta : %1$s@%2$s</string>
<!-- Notifications -->
<string name="pageTitleNotifications">Notificações</string>
<string name="noDataNotifications">Sem notificações</string>
<string name="noDataNotifications">All caught up 🚀</string>
<string name="notificationsPollingHeaderText">Atraso da Enquete das Notificações</string>
<string name="pollingDelaySelectedText">%d Minutos</string>
<string name="pollingDelayDialogHeaderText">Selecionar atraso da votação</string>
@ -628,4 +632,15 @@
<string name="fileViewerNotificationChannelDescription">Indicates the progress of ongoing downloads</string>
<string name="lastUpdatedAt">Updated %s</string>
<string name="joined">Joined</string>
<string name="userFollow">Follow</string>
<string name="unfollowUser">Unfollow</string>
<string name="unfollowedUser">Unfollowed @%s</string>
<string name="nowFollowUser">You now follow @%s</string>
<string name="unfollowingFailed">Couldn\'t unfollow user</string>
<string name="followingFailed">Couldn\'t follow user</string>
<string name="updatePrConflict">The pull request conflicts with the base branch. Please resolve the conflicts and try again.</string>
<string name="updatePrSuccess">Pull Request updated successfully</string>
<string name="updateStrategyMerge">Merge</string>
<string name="updateStrategyRebase">Rebase</string>
<string name="selectUpdateStrategy">Select Update Strategy</string>
</resources>

Some files were not shown because too many files have changed in this diff Show More