diff --git a/README.md b/README.md index d3203f5a..e396e0e0 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,6 @@ GitNex is licensed under the GPLv3 License. Please refer to the LICENSE file for Please make sure that you are on the latest stable release or later, for the best experience. -Check the version [compatibility page](https://codeberg.org/gitnex/GitNex/wiki/Compatibility), which lists all the supported versions along with their compatibility ratios. - ## Build from source Option 1 - Download the source code, open it in Android Studio, and build it there. diff --git a/app/build.gradle b/app/build.gradle index 59484fa3..e2a6cdc0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -117,7 +117,7 @@ dependencies { coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.1.5" implementation 'androidx.biometric:biometric:1.1.0' //noinspection GradleDependency - implementation 'com.github.chrisvest:stormpot:3.2' + implementation 'com.github.chrisvest:stormpot:2.4.2' implementation 'androidx.browser:browser:1.8.0' implementation 'com.google.android.flexbox:flexbox:3.0.0' implementation('org.codeberg.gitnex:tea4j-autodeploy:fa90c7d20a') { diff --git a/app/src/main/java/org/mian/gitnex/clients/GlideHttpClient.java b/app/src/main/java/org/mian/gitnex/clients/GlideHttpClient.java index 1f3f7b18..2c5956f2 100644 --- a/app/src/main/java/org/mian/gitnex/clients/GlideHttpClient.java +++ b/app/src/main/java/org/mian/gitnex/clients/GlideHttpClient.java @@ -6,7 +6,9 @@ import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLContext; import javax.net.ssl.X509TrustManager; import okhttp3.OkHttpClient; +import okhttp3.Request; import org.gitnex.tea4j.v2.auth.ApiKeyAuth; +import org.mian.gitnex.helpers.AppUtil; import org.mian.gitnex.helpers.ssl.MemorizingTrustManager; /** @@ -30,6 +32,24 @@ public class GlideHttpClient { .hostnameVerifier( memorizingTrustManager.wrapHostnameVerifier( HttpsURLConnection.getDefaultHostnameVerifier())) + .addInterceptor( + chain -> { + Request originalRequest = chain.request(); + Request modifiedRequest = + originalRequest + .newBuilder() + .header( + "User-Agent", + "GitNex/" + + AppUtil.getAppVersion( + context) + + " (Android " + + android.os.Build.VERSION + .RELEASE + + ")") + .build(); + return chain.proceed(modifiedRequest); + }) .addInterceptor(auth); return builder.build(); diff --git a/app/src/main/java/org/mian/gitnex/clients/RetrofitClient.java b/app/src/main/java/org/mian/gitnex/clients/RetrofitClient.java index 16d7113a..a13b71a9 100644 --- a/app/src/main/java/org/mian/gitnex/clients/RetrofitClient.java +++ b/app/src/main/java/org/mian/gitnex/clients/RetrofitClient.java @@ -80,6 +80,23 @@ public class RetrofitClient { memorizingTrustManager.wrapHostnameVerifier( HttpsURLConnection.getDefaultHostnameVerifier())); + okHttpClient.addInterceptor( + chain -> { + Request originalRequest = chain.request(); + Request modifiedRequest = + originalRequest + .newBuilder() + .header( + "User-Agent", + "GitNex/" + + AppUtil.getAppVersion(context) + + " (Android " + + android.os.Build.VERSION.RELEASE + + ")") + .build(); + return chain.proceed(modifiedRequest); + }); + if (cacheFile != null) { int cacheSize = CACHE_SIZE_MB; try { diff --git a/app/src/main/java/org/mian/gitnex/helpers/Markdown.java b/app/src/main/java/org/mian/gitnex/helpers/Markdown.java index c8b50b6d..f6fdd824 100644 --- a/app/src/main/java/org/mian/gitnex/helpers/Markdown.java +++ b/app/src/main/java/org/mian/gitnex/helpers/Markdown.java @@ -66,6 +66,8 @@ import org.mian.gitnex.helpers.contexts.IssueContext; import org.mian.gitnex.helpers.contexts.RepositoryContext; import org.mian.gitnex.helpers.markdown.AlertPlugin; import stormpot.Allocator; +import stormpot.BlazePool; +import stormpot.Config; import stormpot.Pool; import stormpot.Poolable; import stormpot.Slot; @@ -94,37 +96,44 @@ public class Markdown { private static final Pool rvRendererPool; static { - rendererPool = - Pool.from( - new Allocator() { - @Override - public Renderer allocate(Slot slot) { - return new Renderer(slot); - } + Config config = new Config<>(); - @Override - public void deallocate(Renderer poolable) {} - }) - .setSize(MAX_OBJECT_POOL_SIZE) - .setBackgroundExpirationEnabled(true) - .setPreciseLeakDetectionEnabled(true) - .build(); + config.setBackgroundExpirationEnabled(true); + config.setPreciseLeakDetectionEnabled(true); + config.setSize(MAX_OBJECT_POOL_SIZE); + config.setAllocator( + new Allocator() { - rvRendererPool = - Pool.from( - new Allocator() { - @Override - public RecyclerViewRenderer allocate(Slot slot) { - return new RecyclerViewRenderer(slot); - } + @Override + public Renderer allocate(Slot slot) { + return new Renderer(slot); + } - @Override - public void deallocate(RecyclerViewRenderer poolable) {} - }) - .setSize(MAX_OBJECT_POOL_SIZE) - .setBackgroundExpirationEnabled(true) - .setPreciseLeakDetectionEnabled(true) - .build(); + @Override + public void deallocate(Renderer poolable) {} + }); + + rendererPool = new BlazePool<>(config); + + Config configRv = new Config<>(); + + configRv.setBackgroundExpirationEnabled(true); + configRv.setPreciseLeakDetectionEnabled(true); + configRv.setSize(MAX_OBJECT_POOL_SIZE); + configRv.setAllocator( + new Allocator() { + + @Override + public RecyclerViewRenderer allocate(Slot slot) { + + return new RecyclerViewRenderer(slot); + } + + @Override + public void deallocate(RecyclerViewRenderer poolable) {} + }); + + rvRendererPool = new BlazePool<>(configRv); } public static void render(Context context, String markdown, TextView textView) { diff --git a/app/src/main/res/layout/bottom_sheet_settings_appearance.xml b/app/src/main/res/layout/bottom_sheet_settings_appearance.xml index 2910c94e..bfe84d04 100644 --- a/app/src/main/res/layout/bottom_sheet_settings_appearance.xml +++ b/app/src/main/res/layout/bottom_sheet_settings_appearance.xml @@ -195,24 +195,29 @@ - + + android:paddingEnd="@dimen/dimen16dp"> + android:layout_marginTop="@dimen/dimen8dp" + android:textSize="@dimen/dimen16sp" + android:singleLine="false" + android:ellipsize="none" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toStartOf="@id/guidelineCounter" + app:layout_constraintTop_toTopOf="parent" + android:layout_marginEnd="@dimen/dimen12dp" /> + app:layout_constraintStart_toEndOf="@id/tvCounterBadgeHeader" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="@id/tvCounterBadgeHeader" + app:layout_constraintBottom_toBottomOf="@id/tvCounterBadgeHeader" /> - + - + + + - - - - - - - - + android:paddingEnd="@dimen/dimen16dp"> + + + android:textSize="@dimen/dimen12sp" + android:layout_marginEnd="@dimen/dimen12dp" + app:layout_constraintStart_toStartOf="@id/tvLabelsInListHeader" + app:layout_constraintTop_toBottomOf="@id/tvLabelsInListHeader" + app:layout_constraintEnd_toStartOf="@id/guidelineLabels" /> - + - + + + + + - - - - - - - - + android:paddingEnd="@dimen/dimen16dp"> + + + android:textSize="@dimen/dimen12sp" + android:layout_marginEnd="@dimen/dimen12dp" + app:layout_constraintStart_toStartOf="@id/tvHideEmailLangInProfileHeader" + app:layout_constraintTop_toBottomOf="@id/tvHideEmailLangInProfileHeader" + app:layout_constraintEnd_toStartOf="@id/guidelineProfile" /> - + - + + + + + - - - - - - - - + android:paddingEnd="@dimen/dimen16dp"> + + + android:textSize="@dimen/dimen12sp" + android:layout_marginEnd="@dimen/dimen12dp" + app:layout_constraintStart_toStartOf="@id/tvHideEmailNavDrawerHeader" + app:layout_constraintTop_toBottomOf="@id/tvHideEmailNavDrawerHeader" + app:layout_constraintEnd_toStartOf="@id/guidelineEmail" /> - + + + + + • Members of this team do not have any permissions. • Members of this team can view team repositories. • Members of this team can view and push to team repositories. - • Members of this team can push to and from team repositories and add collaborators. + • Team members can push to and pull from team repositories and add collaborators to them. • Members of this team have owner permissions. show all Org members @@ -339,7 +339,7 @@ Access Controls Members can view and clone team repositories Members can read and push to team repositories - Members can pull and push to team repositories and add collaborators to them + Members can pull from and push to team repositories and add collaborators to them %1$s%2$s,\u0020 %1$s%2$s,\u0020 Please enter team name @@ -638,7 +638,7 @@ Delete branch after merge Merge may fail if you are not authorized to merge this Pull Request. Disabled Merge button means that there are conflicts OR other things to fix before Merge - This branch belong to a forked repository + This branch belongs to a forked repository Merge comment Pull Request was merged successfully Pull Request is not available for merge @@ -818,7 +818,7 @@ It seems that the account for URI %1$s does not exist in the app. You can add one by tapping on the Add New Account button. Go to App - GitNex cannot handle the requested resource. You can open an issue at the project repository as an improvement, providing details of the work. Just launch a default screen for now from the buttons below; it can be changed from settings. + GitNex cannot handle the requested resource. You can open an issue in the project repository for improvement, providing details of the work. Launch the default screen from the buttons below; it can be changed in settings. Biometric Authentication Unlock using your biometric credentials @@ -864,7 +864,7 @@ Tag deleted A tag attached to a release cannot be deleted directly Use Custom Tabs - No application found to open this link. SSH URLs and URLs with another prefix the http:// or https:// are not supported by most browser + No application was found to open this link. SSH URLs and URLs with prefixes other than http:// or https:// are not supported by most browsers %s \u25CF not logged in Follow system (Light/Dark)