Merge branch 'main' into revamp-issues-list

# Conflicts:
#	app/src/main/res/values-v23/themes.xml
#	app/src/main/res/values/colors.xml
#	app/src/main/res/values/themes.xml
This commit is contained in:
M M Arif
2022-08-12 07:40:21 +05:00
13 changed files with 82 additions and 89 deletions

View File

@@ -2,7 +2,6 @@ package org.mian.gitnex.activities;
import android.app.KeyguardManager;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
@@ -82,61 +81,53 @@ public class SettingsSecurityActivity extends BaseActivity {
// biometric switcher
switchBiometric.setOnCheckedChangeListener((buttonView, isChecked) -> {
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if(isChecked) {
if(isChecked) {
BiometricManager biometricManager = BiometricManager.from(ctx);
KeyguardManager keyguardManager = (KeyguardManager) ctx.getSystemService(Context.KEYGUARD_SERVICE);
BiometricManager biometricManager = BiometricManager.from(ctx);
KeyguardManager keyguardManager = (KeyguardManager) ctx.getSystemService(Context.KEYGUARD_SERVICE);
if (!keyguardManager.isDeviceSecure()) {
if (!keyguardManager.isDeviceSecure()) {
switch(biometricManager.canAuthenticate(BIOMETRIC_STRONG | DEVICE_CREDENTIAL)) {
switch(biometricManager.canAuthenticate(BIOMETRIC_STRONG | DEVICE_CREDENTIAL)) {
case BiometricManager.BIOMETRIC_SUCCESS:
case BiometricManager.BIOMETRIC_SUCCESS:
tinyDB.putBoolean("biometricStatus", true);
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
break;
case BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE:
case BiometricManager.BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED:
case BiometricManager.BIOMETRIC_ERROR_UNSUPPORTED:
case BiometricManager.BIOMETRIC_STATUS_UNKNOWN:
tinyDB.putBoolean("biometricStatus", true);
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
break;
case BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE:
case BiometricManager.BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED:
case BiometricManager.BIOMETRIC_ERROR_UNSUPPORTED:
case BiometricManager.BIOMETRIC_STATUS_UNKNOWN:
tinyDB.putBoolean("biometricStatus", false);
switchBiometric.setChecked(false);
Toasty.error(appCtx, getResources().getString(R.string.biometricNotSupported));
break;
case BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE:
tinyDB.putBoolean("biometricStatus", false);
switchBiometric.setChecked(false);
Toasty.error(appCtx, getResources().getString(R.string.biometricNotSupported));
break;
case BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE:
tinyDB.putBoolean("biometricStatus", false);
switchBiometric.setChecked(false);
Toasty.error(appCtx, getResources().getString(R.string.biometricNotAvailable));
break;
case BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED:
tinyDB.putBoolean("biometricStatus", false);
switchBiometric.setChecked(false);
Toasty.error(appCtx, getResources().getString(R.string.biometricNotAvailable));
break;
case BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED:
tinyDB.putBoolean("biometricStatus", false);
switchBiometric.setChecked(false);
Toasty.info(appCtx, getResources().getString(R.string.enrollBiometric));
break;
}
}
else {
tinyDB.putBoolean("biometricStatus", true);
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
tinyDB.putBoolean("biometricStatus", false);
switchBiometric.setChecked(false);
Toasty.info(appCtx, getResources().getString(R.string.enrollBiometric));
break;
}
}
else {
tinyDB.putBoolean("biometricStatus", false);
tinyDB.putBoolean("biometricStatus", true);
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
}
}
else {
tinyDB.putBoolean("biometricStatus", false);
Toasty.warning(appCtx, getResources().getString(R.string.biometricNotSupported));
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
}
});

View File

@@ -12,9 +12,8 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.gitnex.tea4j.v2.models.NotificationCount;
import org.mian.gitnex.R;
import org.mian.gitnex.activities.AddNewAccountActivity;
@@ -66,18 +65,19 @@ public class UserAccountsAdapter extends RecyclerView.Adapter<UserAccountsAdapte
deleteAccount.setOnClickListener(itemDelete -> {
new AlertDialog.Builder(context)
.setIcon(AppCompatResources.getDrawable(context, R.drawable.ic_delete))
MaterialAlertDialogBuilder materialAlertDialogBuilder = new MaterialAlertDialogBuilder(context)
.setTitle(context.getResources().getString(R.string.removeAccountPopupTitle))
.setMessage(context.getResources().getString(R.string.removeAccountPopupMessage))
.setNeutralButton(context.getResources().getString(R.string.cancelButton), null)
.setPositiveButton(context.getResources().getString(R.string.removeButton), (dialog, which) -> {
updateLayoutByPosition(getBindingAdapterPosition());
UserAccountsApi userAccountsApi = BaseApi.getInstance(context, UserAccountsApi.class);
assert userAccountsApi != null;
userAccountsApi.deleteAccount(Integer.parseInt(String.valueOf(accountId)));
}).setNeutralButton(context.getResources().getString(R.string.cancelButton), null)
.show();
});
materialAlertDialogBuilder.create().show();
});
itemView.setOnClickListener(switchAccount -> {

View File

@@ -14,7 +14,6 @@ import android.view.inputmethod.EditorInfo;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import org.gitnex.tea4j.v2.models.User;
import org.mian.gitnex.R;
@@ -92,9 +91,7 @@ public class FollowersFragment extends Fragment {
}
}));
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(context, DividerItemDecoration.VERTICAL);
fragmentProfileFollowersFollowingBinding.recyclerView.setHasFixedSize(true);
fragmentProfileFollowersFollowingBinding.recyclerView.addItemDecoration(dividerItemDecoration);
fragmentProfileFollowersFollowingBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
fragmentProfileFollowersFollowingBinding.recyclerView.setAdapter(adapter);

View File

@@ -14,7 +14,6 @@ import android.view.inputmethod.EditorInfo;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import org.gitnex.tea4j.v2.models.User;
import org.mian.gitnex.R;
@@ -92,9 +91,7 @@ public class FollowingFragment extends Fragment {
}
}));
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(context, DividerItemDecoration.VERTICAL);
fragmentProfileFollowersFollowingBinding.recyclerView.setHasFixedSize(true);
fragmentProfileFollowersFollowingBinding.recyclerView.addItemDecoration(dividerItemDecoration);
fragmentProfileFollowersFollowingBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
fragmentProfileFollowersFollowingBinding.recyclerView.setAdapter(adapter);

View File

@@ -1,6 +1,5 @@
package org.mian.gitnex.helpers.ssl;
import android.app.AlertDialog;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
@@ -10,6 +9,7 @@ import android.content.SharedPreferences;
import android.util.Base64;
import android.util.SparseArray;
import androidx.core.app.NotificationCompat;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.mian.gitnex.R;
import org.mian.gitnex.activities.BaseActivity;
import java.io.ByteArrayInputStream;
@@ -562,15 +562,15 @@ public class MemorizingTrustManager implements X509TrustManager {
final int myId = createDecisionId(choice);
((BaseActivity) context).runOnUiThread(() -> {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(titleId);
builder.setMessage(message);
builder.setPositiveButton(R.string.mtmDecisionAlways, (dialog, which) -> interactResult(myId, MTMDecision.DECISION_ALWAYS));
builder.setNeutralButton(R.string.mtmDecisionAbort, (dialog, which) -> interactResult(myId, MTMDecision.DECISION_ABORT));
builder.setOnCancelListener(dialog -> interactResult(myId, MTMDecision.DECISION_ABORT));
MaterialAlertDialogBuilder materialAlertDialogBuilder = new MaterialAlertDialogBuilder(context)
.setTitle(titleId)
.setMessage(message)
.setPositiveButton(R.string.mtmDecisionAlways, (dialog, which) -> interactResult(myId, MTMDecision.DECISION_ALWAYS))
.setNeutralButton(R.string.mtmDecisionAbort, (dialog, which) -> interactResult(myId, MTMDecision.DECISION_ABORT))
.setOnCancelListener(dialog -> interactResult(myId, MTMDecision.DECISION_ABORT));
builder.create().show();
materialAlertDialogBuilder.create().show();
});
try {

View File

@@ -93,10 +93,10 @@
app:strokeColor="?attr/colorPrimary">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/dimen16dp">
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/dimen16dp">
<LinearLayout
android:layout_width="match_parent"

View File

@@ -4,18 +4,24 @@
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/pullToRefresh"
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="match_parent"
android:padding="@dimen/dimen8dp">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/pullToRefresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical" />
android:layout_height="wrap_content">
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</FrameLayout>
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progress_bar"

View File

@@ -4,26 +4,30 @@
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/pullToRefresh"
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="match_parent"
android:padding="@dimen/dimen8dp">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/pullToRefresh"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical" />
android:layout_height="wrap_content">
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</FrameLayout>
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"
android:paddingStart="@dimen/dimen16dp"
android:paddingEnd="@dimen/dimen16dp"
style="@style/Widget.Material3.LinearProgressIndicator"
app:indicatorColor="?attr/progressIndicatorColor" />

View File

@@ -21,7 +21,6 @@
android:foreground="?android:attr/selectableItemBackground"
android:background="?attr/materialCardBackgroundColor"
android:padding="@dimen/dimen12dp"
android:orientation="vertical">
<LinearLayout

View File

@@ -6,10 +6,8 @@
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="@dimen/dimen12dp"
android:paddingEnd="@dimen/dimen12dp"
android:paddingBottom="@dimen/dimen4dp"
android:paddingTop="@dimen/dimen4dp"
android:paddingBottom="@dimen/dimen4dp"
tools:ignore="UseCompoundDrawables">
<com.google.android.material.card.MaterialCardView
@@ -22,6 +20,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/materialCardBackgroundColor"
android:padding="@dimen/dimen12dp"
android:orientation="horizontal">

View File

@@ -4,10 +4,8 @@
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:gravity="center_vertical"
android:paddingStart="@dimen/dimen12dp"
android:paddingEnd="@dimen/dimen12dp"
android:paddingBottom="@dimen/dimen4dp"
android:paddingTop="@dimen/dimen4dp">
android:paddingTop="@dimen/dimen4dp"
android:paddingBottom="@dimen/dimen4dp">
<com.google.android.material.card.MaterialCardView
android:id="@+id/card"
@@ -19,6 +17,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/materialCardBackgroundColor"
android:foreground="?android:attr/selectableItemBackground"
android:padding="@dimen/dimen12dp"
android:orientation="horizontal">

View File

@@ -12,6 +12,7 @@
<string name="navLogout">Se déconnecter</string>
<string name="navAdministration">Administration</string>
<string name="navMyIssues">Mes tickets</string>
<string name="navMostVisited">Dépôts les plus visités</string>
<!-- menu items -->
<!-- page titles -->
<string name="pageTitleNewRepo">Nouveau dépôt</string>

View File

@@ -28,7 +28,7 @@
<color name="dividerColorDark">#1d1d1d</color>
<color name="lightYellow">#efd34a</color>
<color name="warningColor">#dbb109</color>
<color name="colorSecondaryContainer">#1e2221</color>
<color name="colorSecondaryContainer">#1f2926</color>
<color name="cardBackground">#1e2221</color>
<color name="lightThemeDiffRemovedColor">#FCEDED</color>