1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-26 09:47:13 +00:00

Added account/identity support button

This commit is contained in:
M66B 2019-09-09 16:44:06 +02:00
parent d7e9c3dd9d
commit 1b8711c048
7 changed files with 83 additions and 10 deletions

2
FAQ.md
View file

@ -21,6 +21,8 @@ For authorizing:
* Microsoft Exchange: see [question 8](#user-content-faq8)
* Yahoo!: see [question 88](#user-content-faq88)
Please see [here](#user-content-faq22) for common error messages.
## Known problems
* ~~A [bug in Android 5.1 and 6](https://issuetracker.google.com/issues/37054851) causes apps to sometimes show a wrong time format. Toggling the Android setting *Use 24-hour format* might temporarily solve the issue. A workaround was added.~~

View file

@ -129,6 +129,7 @@ public class FragmentAccount extends FragmentBase {
private ContentLoadingProgressBar pbSave;
private TextView tvError;
private Button btnHelp;
private Button btnSupport;
private TextView tvInstructions;
private ContentLoadingProgressBar pbWait;
@ -222,6 +223,7 @@ public class FragmentAccount extends FragmentBase {
tvError = view.findViewById(R.id.tvError);
btnHelp = view.findViewById(R.id.btnHelp);
btnSupport = view.findViewById(R.id.btnSupport);
tvInstructions = view.findViewById(R.id.tvInstructions);
pbWait = view.findViewById(R.id.pbWait);
@ -398,6 +400,13 @@ public class FragmentAccount extends FragmentBase {
}
});
btnSupport.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Helper.view(getContext(), Uri.parse(Helper.FAQ_URI + "#user-content-authorizing-accounts"), false);
}
});
adapter = new ArrayAdapter<>(getContext(), R.layout.spinner_item1, android.R.id.text1, new ArrayList<EntityFolder>());
adapter.setDropDownViewResource(R.layout.spinner_item1_dropdown);
@ -436,6 +445,7 @@ public class FragmentAccount extends FragmentBase {
tvError.setVisibility(View.GONE);
btnHelp.setVisibility(View.GONE);
btnSupport.setVisibility(View.GONE);
tvInstructions.setVisibility(View.GONE);
tvInstructions.setMovementMethod(LinkMovementMethod.getInstance());
@ -512,6 +522,7 @@ public class FragmentAccount extends FragmentBase {
grpFolders.setVisibility(View.GONE);
tvError.setVisibility(View.GONE);
btnHelp.setVisibility(View.GONE);
btnSupport.setVisibility(View.GONE);
tvInstructions.setVisibility(View.GONE);
}
@ -750,6 +761,7 @@ public class FragmentAccount extends FragmentBase {
pbSave.setVisibility(View.VISIBLE);
tvError.setVisibility(View.GONE);
btnHelp.setVisibility(View.GONE);
btnSupport.setVisibility(View.GONE);
tvInstructions.setVisibility(View.GONE);
}
@ -1123,6 +1135,8 @@ public class FragmentAccount extends FragmentBase {
btnHelp.setVisibility(View.VISIBLE);
}
btnSupport.setVisibility(View.VISIBLE);
if (provider != null && provider.documentation != null) {
tvInstructions.setText(HtmlHelper.fromHtml(provider.documentation.toString()));
tvInstructions.setVisibility(View.VISIBLE);
@ -1133,10 +1147,8 @@ public class FragmentAccount extends FragmentBase {
public void run() {
if (provider != null && provider.documentation != null)
scroll.smoothScrollTo(0, tvInstructions.getBottom());
else if (provider != null && provider.link != null)
scroll.smoothScrollTo(0, btnHelp.getBottom());
else
scroll.smoothScrollTo(0, tvError.getBottom());
scroll.smoothScrollTo(0, btnSupport.getBottom());
}
});
}

View file

@ -120,6 +120,7 @@ public class FragmentIdentity extends FragmentBase {
private ContentLoadingProgressBar pbSave;
private TextView tvError;
private Button btnHelp;
private Button btnSupport;
private TextView tvInstructions;
private ContentLoadingProgressBar pbWait;
@ -201,6 +202,7 @@ public class FragmentIdentity extends FragmentBase {
pbSave = view.findViewById(R.id.pbSave);
tvError = view.findViewById(R.id.tvError);
btnHelp = view.findViewById(R.id.btnHelp);
btnSupport = view.findViewById(R.id.btnSupport);
tvInstructions = view.findViewById(R.id.tvInstructions);
tvInstructions.setMovementMethod(LinkMovementMethod.getInstance());
@ -218,6 +220,7 @@ public class FragmentIdentity extends FragmentBase {
if (position == 0) {
tvError.setVisibility(View.GONE);
btnHelp.setVisibility(View.GONE);
btnSupport.setVisibility(View.GONE);
tvInstructions.setVisibility(View.GONE);
grpAdvanced.setVisibility(View.GONE);
}
@ -432,6 +435,13 @@ public class FragmentIdentity extends FragmentBase {
}
});
btnSupport.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Helper.view(getContext(), Uri.parse(Helper.FAQ_URI + "#user-content-authorizing-accounts"), false);
}
});
// Initialize
Helper.setViewsEnabled(view, false);
btnAutoConfig.setEnabled(false);
@ -447,6 +457,7 @@ public class FragmentIdentity extends FragmentBase {
pbSave.setVisibility(View.GONE);
tvError.setVisibility(View.GONE);
btnHelp.setVisibility(View.GONE);
btnSupport.setVisibility(View.GONE);
tvInstructions.setVisibility(View.GONE);
grpAuthorize.setVisibility(View.GONE);
@ -546,6 +557,7 @@ public class FragmentIdentity extends FragmentBase {
pbSave.setVisibility(View.VISIBLE);
tvError.setVisibility(View.GONE);
btnHelp.setVisibility(View.GONE);
btnSupport.setVisibility(View.GONE);
tvInstructions.setVisibility(View.GONE);
}
@ -817,6 +829,8 @@ public class FragmentIdentity extends FragmentBase {
btnHelp.setVisibility(View.VISIBLE);
}
btnSupport.setVisibility(View.VISIBLE);
if (provider != null && provider.documentation != null) {
tvInstructions.setText(HtmlHelper.fromHtml(provider.documentation.toString()));
tvInstructions.setVisibility(View.VISIBLE);
@ -827,10 +841,8 @@ public class FragmentIdentity extends FragmentBase {
public void run() {
if (provider != null && provider.documentation != null)
scroll.smoothScrollTo(0, tvInstructions.getBottom());
else if (provider != null && provider.link != null)
scroll.smoothScrollTo(0, btnHelp.getBottom());
else
scroll.smoothScrollTo(0, tvError.getBottom());
scroll.smoothScrollTo(0, btnSupport.getBottom());
}
});
}

View file

@ -73,6 +73,7 @@ public class FragmentQuickSetup extends FragmentBase {
private TextView tvError;
private Button btnHelp;
private Button btnSupport;
private TextView tvInstructions;
private TextView tvImap;
@ -102,6 +103,7 @@ public class FragmentQuickSetup extends FragmentBase {
tvError = view.findViewById(R.id.tvError);
btnHelp = view.findViewById(R.id.btnHelp);
btnSupport = view.findViewById(R.id.btnSupport);
tvInstructions = view.findViewById(R.id.tvInstructions);
tvImap = view.findViewById(R.id.tvImap);
@ -147,11 +149,19 @@ public class FragmentQuickSetup extends FragmentBase {
}
});
btnSupport.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Helper.view(getContext(), Uri.parse(Helper.FAQ_URI + "#user-content-authorizing-accounts"), false);
}
});
// Initialize
pbCheck.setVisibility(View.GONE);
pbSave.setVisibility(View.GONE);
tvError.setVisibility(View.GONE);
btnHelp.setVisibility(View.GONE);
btnSupport.setVisibility(View.GONE);
tvInstructions.setVisibility(View.GONE);
tvInstructions.setMovementMethod(LinkMovementMethod.getInstance());
grpSetup.setVisibility(View.GONE);
@ -207,6 +217,7 @@ public class FragmentQuickSetup extends FragmentBase {
pbSave.setVisibility(check ? View.GONE : View.VISIBLE);
tvError.setVisibility(View.GONE);
btnHelp.setVisibility(View.GONE);
btnSupport.setVisibility(View.GONE);
tvInstructions.setVisibility(View.GONE);
grpSetup.setVisibility(check ? View.GONE : View.VISIBLE);
}
@ -440,6 +451,8 @@ public class FragmentQuickSetup extends FragmentBase {
btnHelp.setVisibility(View.VISIBLE);
}
btnSupport.setVisibility(View.VISIBLE);
if (args.containsKey("documentation")) {
tvInstructions.setText(HtmlHelper.fromHtml(args.getString("documentation")));
tvInstructions.setVisibility(View.VISIBLE);
@ -450,10 +463,8 @@ public class FragmentQuickSetup extends FragmentBase {
public void run() {
if (args.containsKey("documentation"))
scroll.smoothScrollTo(0, tvInstructions.getBottom());
else if (args.containsKey("link"))
scroll.smoothScrollTo(0, btnHelp.getBottom());
else if (tvError.getVisibility() == View.VISIBLE)
scroll.smoothScrollTo(0, tvError.getBottom());
else
scroll.smoothScrollTo(0, btnSupport.getBottom());
}
});

View file

@ -758,6 +758,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvError" />
<Button
android:id="@+id/btnSupport"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:backgroundTint="?attr/colorAccent"
android:text="@string/menu_faq"
android:textColor="@android:color/black"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvError" />
<TextView
android:id="@+id/tvInstructions"
android:layout_width="wrap_content"

View file

@ -651,6 +651,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvError" />
<Button
android:id="@+id/btnSupport"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:backgroundTint="?attr/colorAccent"
android:text="@string/menu_faq"
android:textColor="@android:color/black"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvError" />
<TextView
android:id="@+id/tvInstructions"
android:layout_width="wrap_content"

View file

@ -122,6 +122,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvError" />
<Button
android:id="@+id/btnSupport"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:backgroundTint="?attr/colorAccent"
android:text="@string/menu_faq"
android:textColor="@android:color/black"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvError" />
<TextView
android:id="@+id/tvInstructions"
android:layout_width="wrap_content"