1
0
mirror of https://codeberg.org/gitnex/GitNex.git synced 2025-10-05 15:52:46 +02:00

Frontport 10.0.1 bugs and improvements (#1527)

Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1527
Co-authored-by: M M Arif <mmarif@swatian.com>
Co-committed-by: M M Arif <mmarif@swatian.com>
This commit is contained in:
M M Arif
2025-09-06 12:49:22 +02:00
committed by M M Arif
parent feb70f7c40
commit e26b81533b
7 changed files with 232 additions and 137 deletions

View File

@@ -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.

View File

@@ -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') {

View File

@@ -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();

View File

@@ -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 {

View File

@@ -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<RecyclerViewRenderer> rvRendererPool;
static {
rendererPool =
Pool.from(
new Allocator<Renderer>() {
@Override
public Renderer allocate(Slot slot) {
return new Renderer(slot);
}
Config<Renderer> 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<Renderer>() {
rvRendererPool =
Pool.from(
new Allocator<RecyclerViewRenderer>() {
@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<RecyclerViewRenderer> configRv = new Config<>();
configRv.setBackgroundExpirationEnabled(true);
configRv.setPreciseLeakDetectionEnabled(true);
configRv.setSize(MAX_OBJECT_POOL_SIZE);
configRv.setAllocator(
new Allocator<RecyclerViewRenderer>() {
@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) {

View File

@@ -195,24 +195,29 @@
</LinearLayout>
<LinearLayout
<!-- Counter Badge Frame -->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/counterBadgeFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen24dp"
android:paddingStart="@dimen/dimen16dp"
android:paddingEnd="@dimen/dimen16dp"
android:orientation="horizontal">
android:paddingEnd="@dimen/dimen16dp">
<TextView
android:id="@+id/tvCounterBadgeHeader"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.90"
android:text="@string/settingsCounterBadges"
android:textColor="?attr/primaryTextColor"
android:layout_marginTop="@dimen/dimen4dp"
android:textSize="@dimen/dimen16sp" />
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" />
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switchCounterBadge"
@@ -220,141 +225,187 @@
android:layout_height="wrap_content"
android:contentDescription="@string/settingsCounterBadges"
style="@style/m3SwitchStyle"
android:layout_weight="0.10" />
app:layout_constraintStart_toEndOf="@id/tvCounterBadgeHeader"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tvCounterBadgeHeader"
app:layout_constraintBottom_toBottomOf="@id/tvCounterBadgeHeader" />
</LinearLayout>
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guidelineCounter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.85" />
<LinearLayout
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- Labels in List Frame -->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/labelsInListFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen24dp"
android:paddingStart="@dimen/dimen16dp"
android:paddingEnd="@dimen/dimen16dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tvLabelsInListHeader"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.90"
android:text="@string/settingsLabelsInListHeader"
android:textColor="?attr/primaryTextColor"
android:layout_marginTop="@dimen/dimen4dp"
android:textSize="@dimen/dimen16sp" />
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switchLabelsInListBadge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/settingsLabelsInListHeader"
style="@style/m3SwitchStyle"
android:layout_weight="0.10" />
</LinearLayout>
android:paddingEnd="@dimen/dimen16dp">
<TextView
android:layout_width="wrap_content"
android:id="@+id/tvLabelsInListHeader"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/settingsLabelsInListHeader"
android:textColor="?attr/primaryTextColor"
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/guidelineLabels"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginEnd="@dimen/dimen12dp" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen4dp"
android:text="@string/settingsLabelsInListHint"
android:textColor="?attr/hintColor"
android:textSize="@dimen/dimen12sp" />
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" />
</LinearLayout>
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switchLabelsInListBadge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/settingsLabelsInListHeader"
style="@style/m3SwitchStyle"
app:layout_constraintStart_toEndOf="@id/tvLabelsInListHeader"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tvLabelsInListHeader"
app:layout_constraintBottom_toBottomOf="@id/tvLabelsInListHeader" />
<LinearLayout
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guidelineLabels"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.85" />
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- Hide Email/Lang in Profile Frame -->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/hideEmailLangInProfileFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen24dp"
android:paddingStart="@dimen/dimen16dp"
android:paddingEnd="@dimen/dimen16dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tvHideEmailLangInProfileHeader"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.90"
android:text="@string/hideEmailLangInProfileHeader"
android:textColor="?attr/primaryTextColor"
android:layout_marginTop="@dimen/dimen4dp"
android:textSize="@dimen/dimen16sp" />
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switchHideEmailLangInProfile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/hideEmailLangInProfileHeader"
style="@style/m3SwitchStyle"
android:layout_weight="0.10" />
</LinearLayout>
android:paddingEnd="@dimen/dimen16dp">
<TextView
android:layout_width="wrap_content"
android:id="@+id/tvHideEmailLangInProfileHeader"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/hideEmailLangInProfileHeader"
android:textColor="?attr/primaryTextColor"
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/guidelineProfile"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginEnd="@dimen/dimen12dp" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen4dp"
android:text="@string/hideEmailLangInProfileHint"
android:textColor="?attr/hintColor"
android:textSize="@dimen/dimen12sp" />
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" />
</LinearLayout>
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switchHideEmailLangInProfile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/hideEmailLangInProfileHeader"
style="@style/m3SwitchStyle"
app:layout_constraintStart_toEndOf="@id/tvHideEmailLangInProfileHeader"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tvHideEmailLangInProfileHeader"
app:layout_constraintBottom_toBottomOf="@id/tvHideEmailLangInProfileHeader" />
<LinearLayout
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guidelineProfile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.85" />
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- Hide Email in Nav Drawer Frame -->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/hideEmailNavDrawerFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen24dp"
android:paddingStart="@dimen/dimen16dp"
android:paddingEnd="@dimen/dimen16dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tvHideEmailNavDrawerHeader"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.90"
android:text="@string/hideEmailNavDrawerHeader"
android:textColor="?attr/primaryTextColor"
android:layout_marginTop="@dimen/dimen4dp"
android:textSize="@dimen/dimen16sp" />
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switchHideEmailNavDrawer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/hideEmailNavDrawerHeader"
style="@style/m3SwitchStyle"
android:layout_weight="0.10" />
</LinearLayout>
android:paddingEnd="@dimen/dimen16dp">
<TextView
android:layout_width="wrap_content"
android:id="@+id/tvHideEmailNavDrawerHeader"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/hideEmailNavDrawerHeader"
android:textColor="?attr/primaryTextColor"
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/guidelineEmail"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginEnd="@dimen/dimen12dp" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen4dp"
android:text="@string/hideEmailNavDrawerHint"
android:textColor="?attr/hintColor"
android:textSize="@dimen/dimen12sp" />
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" />
</LinearLayout>
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switchHideEmailNavDrawer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/hideEmailNavDrawerHeader"
style="@style/m3SwitchStyle"
app:layout_constraintStart_toEndOf="@id/tvHideEmailNavDrawerHeader"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tvHideEmailNavDrawerHeader"
app:layout_constraintBottom_toBottomOf="@id/tvHideEmailNavDrawerHeader" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guidelineEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.85" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id="@+id/langFrame"

View File

@@ -315,7 +315,7 @@
<string name="teamPermissionNone">• Members of this team do not have any permissions.</string>
<string name="teamPermissionRead">• Members of this team can view team repositories.</string>
<string name="teamPermissionWrite">• Members of this team can view and push to team repositories.</string>
<string name="teamPermissionAdmin">Members of this team can push to and from team repositories and add collaborators.</string>
<string name="teamPermissionAdmin">Team members can push to and pull from team repositories and add collaborators to them.</string>
<string name="teamPermissionOwner">• Members of this team have owner permissions.</string>
<string name="teamShowAll">show all</string>
<string name="orgMember">Org members</string>
@@ -339,7 +339,7 @@
<string name="newTeamAccessControls">Access Controls</string>
<string name="newTeamPermissionRead">Members can view and clone team repositories</string>
<string name="newTeamPermissionWrite">Members can read and push to team repositories</string>
<string name="newTeamPermissionAdmin">Members can pull and push to team repositories and add collaborators to them</string>
<string name="newTeamPermissionAdmin">Members can pull from and push to team repositories and add collaborators to them</string>
<string name="newTeamPermissionValues" translatable="false">%1$s%2$s,\u0020</string>
<string name="newTeamPermissionValuesFinal" translatable="false">%1$s%2$s,\u0020</string>
<string name="teamNameEmpty">Please enter team name</string>
@@ -638,7 +638,7 @@
<string name="deleteBranchAfterMerge">Delete branch after merge</string>
<string name="mergeNoteText">Merge may fail if you are not authorized to merge this Pull Request.</string>
<string name="mergeInfoDisabledMessage">Disabled Merge button means that there are conflicts OR other things to fix before Merge</string>
<string name="deleteBranchForkInfo">This branch belong to a forked repository</string>
<string name="deleteBranchForkInfo">This branch belongs to a forked repository</string>
<string name="mergeCommentText">Merge comment</string>
<string name="mergePRSuccessMsg">Pull Request was merged successfully</string>
<string name="mergePR404ErrorMsg">Pull Request is not available for merge</string>
@@ -818,7 +818,7 @@
<string name="accountDoesNotExist">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.</string>
<string name="launchApp">Go to App</string>
<string name="noActionText">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.</string>
<string name="noActionText">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.</string>
<string name="biometricAuthTitle">Biometric Authentication</string>
<string name="biometricAuthSubTitle">Unlock using your biometric credentials</string>
@@ -864,7 +864,7 @@
<string name="tagDeleted">Tag deleted</string>
<string name="tagDeleteError">A tag attached to a release cannot be deleted directly</string>
<string name="useCustomTabs">Use Custom Tabs</string>
<string name="browserOpenFailed">No application found to open this link. SSH URLs and URLs with another prefix the http:// or https:// are not supported by most browser</string>
<string name="browserOpenFailed">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</string>
<string name="notLoggedIn">%s \u25CF not logged in</string>
<string name="followSystem">Follow system (Light/Dark)</string>