From 3d38ea79ca99d6cccfcb82234c5c6e217f0c3eb4 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 16 Apr 2022 17:59:31 +0200 Subject: [PATCH] Fixed debug mode scroll --- .../java/eu/faircode/email/FragmentOptionsMisc.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java index 5d8f6bad65..62d830a44f 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java @@ -125,6 +125,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc private SwitchCompat swCleanupAttachments; private Button btnCleanup; private TextView tvLastCleanup; + + private CardView cardAdvanced; private SwitchCompat swProtocol; private SwitchCompat swLogInfo; private SwitchCompat swDebug; @@ -292,6 +294,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc swCleanupAttachments = view.findViewById(R.id.swCleanupAttachments); btnCleanup = view.findViewById(R.id.btnCleanup); tvLastCleanup = view.findViewById(R.id.tvLastCleanup); + + cardAdvanced = view.findViewById(R.id.cardAdvanced); swProtocol = view.findViewById(R.id.swProtocol); swLogInfo = view.findViewById(R.id.swLogInfo); swDebug = view.findViewById(R.id.swDebug); @@ -719,7 +723,11 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc view.post(new Runnable() { @Override public void run() { - view.scrollTo(0, swDebug.getTop()); + try { + view.scrollTo(0, cardAdvanced.getTop() + swDebug.getTop()); + } catch (Throwable ex) { + Log.e(ex); + } } }); }