From cba389c103587d3de852bfb5cf9e62491ea6dd47 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 10 Feb 2019 08:21:16 +0000 Subject: [PATCH] Show capabilities after check --- .../eu/faircode/email/FragmentAccount.java | 19 ++++++++++++++- app/src/main/res/layout/fragment_account.xml | 24 ++++++++++++++++++- app/src/main/res/values/strings.xml | 2 ++ 3 files changed, 43 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentAccount.java b/app/src/main/java/eu/faircode/email/FragmentAccount.java index 4a1b27d4a3..3283bac662 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAccount.java +++ b/app/src/main/java/eu/faircode/email/FragmentAccount.java @@ -118,6 +118,8 @@ public class FragmentAccount extends FragmentBase { private Button btnCheck; private ContentLoadingProgressBar pbCheck; private TextView tvIdle; + private TextView tvMove; + private TextView tvUidPlus; private ArrayAdapter adapter; private Spinner spDrafts; @@ -194,6 +196,8 @@ public class FragmentAccount extends FragmentBase { pbCheck = view.findViewById(R.id.pbCheck); tvIdle = view.findViewById(R.id.tvIdle); + tvMove = view.findViewById(R.id.tvMove); + tvUidPlus = view.findViewById(R.id.tvUidPlus); spDrafts = view.findViewById(R.id.spDrafts); spSent = view.findViewById(R.id.spSent); @@ -231,6 +235,8 @@ public class FragmentAccount extends FragmentBase { btnCheck.setVisibility(position > 0 ? View.VISIBLE : View.GONE); tvIdle.setVisibility(View.GONE); + tvMove.setVisibility(View.GONE); + tvUidPlus.setVisibility(View.GONE); Object tag = adapterView.getTag(); if (tag != null && (Integer) tag == position) @@ -463,6 +469,8 @@ public class FragmentAccount extends FragmentBase { btnAdvanced.setVisibility(View.GONE); tvIdle.setVisibility(View.GONE); + tvMove.setVisibility(View.GONE); + tvUidPlus.setVisibility(View.GONE); btnCheck.setVisibility(View.GONE); pbCheck.setVisibility(View.GONE); @@ -541,6 +549,8 @@ public class FragmentAccount extends FragmentBase { Helper.setViewsEnabled(view, false); pbCheck.setVisibility(View.VISIBLE); tvIdle.setVisibility(View.GONE); + tvMove.setVisibility(View.GONE); + tvUidPlus.setVisibility(View.GONE); grpFolders.setVisibility(View.GONE); tvError.setVisibility(View.GONE); } @@ -604,8 +614,11 @@ public class FragmentAccount extends FragmentBase { throw ex; } - if (istore instanceof IMAPStore) + if (istore instanceof IMAPStore) { result.idle = ((IMAPStore) istore).hasCapability("IDLE"); + result.move = ((IMAPStore) istore).hasCapability("MOVE"); + result.uidplus = ((IMAPStore) istore).hasCapability("UIDPLUS"); + } boolean inbox = false; boolean archive = false; @@ -706,6 +719,8 @@ public class FragmentAccount extends FragmentBase { boolean pop = args.getBoolean("pop"); tvIdle.setVisibility(result.idle || pop ? View.GONE : View.VISIBLE); + tvMove.setVisibility(result.move || pop ? View.GONE : View.VISIBLE); + tvUidPlus.setVisibility(result.uidplus || pop ? View.GONE : View.VISIBLE); if (pop) { grpFolders.setVisibility(View.GONE); @@ -1503,5 +1518,7 @@ public class FragmentAccount extends FragmentBase { EntityAccount account; List folders; boolean idle; + boolean move; + boolean uidplus; } } diff --git a/app/src/main/res/layout/fragment_account.xml b/app/src/main/res/layout/fragment_account.xml index 3b9a8a5490..773403bd5a 100644 --- a/app/src/main/res/layout/fragment_account.xml +++ b/app/src/main/res/layout/fragment_account.xml @@ -463,6 +463,28 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/btnCheck" /> + + + + + app:layout_constraintTop_toBottomOf="@id/tvUidPlus" /> Inbox not found No primary account or no drafts folder This provider does not support push messages. This will delay reception of new messages and increase battery usage. + This provider does not support MOVE + This provider does not support UIDPLUS Synchronization errors since %1$s A drafts folder is required to send messages Delete this account permanently?