Show capabilities after check

pull/147/head
M66B 6 years ago
parent 56cc9043de
commit cba389c103

@ -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<EntityFolder> 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<EntityFolder> folders;
boolean idle;
boolean move;
boolean uidplus;
}
}

@ -463,6 +463,28 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btnCheck" />
<TextView
android:id="@+id/tvMove"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_no_move"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvIdle" />
<TextView
android:id="@+id/tvUidPlus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_no_uidplus"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvMove" />
<TextView
android:id="@+id/tvDrafts"
android:layout_width="wrap_content"
@ -549,7 +571,7 @@
android:layout_marginTop="12dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/barrier_folders"
app:layout_constraintTop_toBottomOf="@id/tvIdle" />
app:layout_constraintTop_toBottomOf="@id/tvUidPlus" />
<TextView
android:id="@+id/tvDraftsRemark"

@ -242,6 +242,8 @@
<string name="title_no_inbox">Inbox not found</string>
<string name="title_no_primary_drafts">No primary account or no drafts folder</string>
<string name="title_no_idle">This provider does not support push messages. This will delay reception of new messages and increase battery usage.</string>
<string name="title_no_move">This provider does not support MOVE</string>
<string name="title_no_uidplus">This provider does not support UIDPLUS</string>
<string name="title_no_sync">Synchronization errors since %1$s</string>
<string name="title_drafts_required">A drafts folder is required to send messages</string>
<string name="title_account_delete">Delete this account permanently?</string>

Loading…
Cancel
Save