Debug: moved ciphers button to connection settings

pull/208/head
M66B 3 years ago
parent 0248a7eb18
commit 528d60fae8

@ -20,6 +20,7 @@ package eu.faircode.email;
*/ */
import android.content.Context; import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
@ -50,6 +51,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.SwitchCompat; import androidx.appcompat.widget.SwitchCompat;
import androidx.cardview.widget.CardView; import androidx.cardview.widget.CardView;
import androidx.constraintlayout.widget.Group; import androidx.constraintlayout.widget.Group;
@ -79,6 +81,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
private TextView tvNetworkMetered; private TextView tvNetworkMetered;
private TextView tvNetworkRoaming; private TextView tvNetworkRoaming;
private CardView cardDebug; private CardView cardDebug;
private Button btnCiphers;
private TextView tvNetworkInfo; private TextView tvNetworkInfo;
private Group grpValidated; private Group grpValidated;
@ -125,6 +128,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
tvNetworkRoaming = view.findViewById(R.id.tvNetworkRoaming); tvNetworkRoaming = view.findViewById(R.id.tvNetworkRoaming);
cardDebug = view.findViewById(R.id.cardDebug); cardDebug = view.findViewById(R.id.cardDebug);
btnCiphers = view.findViewById(R.id.btnCiphers);
tvNetworkInfo = view.findViewById(R.id.tvNetworkInfo); tvNetworkInfo = view.findViewById(R.id.tvNetworkInfo);
grpValidated = view.findViewById(R.id.grpValidated); grpValidated = view.findViewById(R.id.grpValidated);
@ -302,6 +306,23 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
} }
}); });
btnCiphers.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new AlertDialog.Builder(getContext())
.setIcon(R.drawable.twotone_info_24)
.setTitle(R.string.title_advanced_ciphers)
.setMessage(Log.getCiphers())
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// Do nothing
}
})
.show();
}
});
// Initialize // Initialize
FragmentDialogTheme.setBackground(getContext(), view, false); FragmentDialogTheme.setBackground(getContext(), view, false);
tvNetworkMetered.setVisibility(View.GONE); tvNetworkMetered.setVisibility(View.GONE);

@ -192,7 +192,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private Button btnGC; private Button btnGC;
private Button btnCharsets; private Button btnCharsets;
private Button btnFontMap; private Button btnFontMap;
private Button btnCiphers;
private Button btnFiles; private Button btnFiles;
private Button btnUris; private Button btnUris;
private Button btnAllPermissions; private Button btnAllPermissions;
@ -367,7 +366,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
btnGC = view.findViewById(R.id.btnGC); btnGC = view.findViewById(R.id.btnGC);
btnCharsets = view.findViewById(R.id.btnCharsets); btnCharsets = view.findViewById(R.id.btnCharsets);
btnFontMap = view.findViewById(R.id.btnFontMap); btnFontMap = view.findViewById(R.id.btnFontMap);
btnCiphers = view.findViewById(R.id.btnCiphers);
btnFiles = view.findViewById(R.id.btnFiles); btnFiles = view.findViewById(R.id.btnFiles);
btnUris = view.findViewById(R.id.btnUris); btnUris = view.findViewById(R.id.btnUris);
btnAllPermissions = view.findViewById(R.id.btnAllPermissions); btnAllPermissions = view.findViewById(R.id.btnAllPermissions);
@ -1297,23 +1295,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
} }
}); });
btnCiphers.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new AlertDialog.Builder(getContext())
.setIcon(R.drawable.twotone_info_24)
.setTitle(R.string.title_advanced_ciphers)
.setMessage(Log.getCiphers())
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// Do nothing
}
})
.show();
}
});
final String title = getString(R.string.title_advanced_files, Helper.humanReadableByteCount(MIN_FILE_SIZE)); final String title = getString(R.string.title_advanced_files, Helper.humanReadableByteCount(MIN_FILE_SIZE));
btnFiles.setText(title); btnFiles.setText(title);

@ -552,6 +552,16 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/btnCiphers"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_ciphers"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvCaptionDebug" />
<eu.faircode.email.FixedTextView <eu.faircode.email.FixedTextView
android:id="@+id/tvNetworkInfo" android:id="@+id/tvNetworkInfo"
android:layout_width="0dp" android:layout_width="0dp"
@ -565,7 +575,7 @@
android:textSize="12sp" android:textSize="12sp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvCaptionDebug" /> app:layout_constraintTop_toBottomOf="@id/btnCiphers" />
</eu.faircode.email.ConstraintLayoutEx> </eu.faircode.email.ConstraintLayoutEx>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
</eu.faircode.email.ConstraintLayoutEx> </eu.faircode.email.ConstraintLayoutEx>

@ -1623,16 +1623,6 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnCharsets" /> app:layout_constraintTop_toBottomOf="@id/btnCharsets" />
<Button
android:id="@+id/btnCiphers"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_ciphers"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnFontMap" />
<Button <Button
android:id="@+id/btnFiles" android:id="@+id/btnFiles"
style="?android:attr/buttonStyleSmall" style="?android:attr/buttonStyleSmall"
@ -1641,7 +1631,7 @@
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:text="@string/title_advanced_files" android:text="@string/title_advanced_files"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnCiphers" /> app:layout_constraintTop_toBottomOf="@id/btnFontMap" />
<Button <Button
android:id="@+id/btnUris" android:id="@+id/btnUris"

Loading…
Cancel
Save