Added hint

This commit is contained in:
M66B 2020-03-03 12:54:11 +01:00
parent bfe295f339
commit 940552919e
4 changed files with 48 additions and 0 deletions

View File

@ -390,6 +390,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private ImageButton ibMore;
private TextView tvSignedData;
private TextView tvCrossHint;
private ImageButton ibAnswerHint;
private TextView tvAnswerHint;
private TextView tvBody;
private View wvBody;
@ -577,6 +579,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibMore = vsBody.findViewById(R.id.ibMore);
tvSignedData = vsBody.findViewById(R.id.tvSignedData);
tvCrossHint = vsBody.findViewById(R.id.tvCrossHint);
ibAnswerHint = vsBody.findViewById(R.id.ibAnswerHint);
tvAnswerHint = vsBody.findViewById(R.id.tvAnswerHint);
tvBody = vsBody.findViewById(R.id.tvBody);
wvBody = vsBody.findViewById(R.id.wvBody);
@ -657,6 +661,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibJunk.setOnClickListener(this);
ibRemove.setOnClickListener(this);
ibMore.setOnClickListener(this);
ibAnswerHint.setOnClickListener(this);
ibDownloading.setOnClickListener(this);
@ -728,6 +733,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibJunk.setOnClickListener(null);
ibRemove.setOnClickListener(null);
ibMore.setOnClickListener(null);
ibAnswerHint.setOnClickListener(null);
ibDownloading.setOnClickListener(null);
@ -1160,6 +1166,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibMore.setVisibility(View.GONE);
tvSignedData.setVisibility(View.GONE);
tvCrossHint.setVisibility(View.GONE);
ibAnswerHint.setVisibility(View.GONE);
tvAnswerHint.setVisibility(View.GONE);
tvBody.setVisibility(View.GONE);
wvBody.setVisibility(View.GONE);
@ -1304,6 +1312,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean cross_hint = prefs.getBoolean("cross_hint", true);
boolean answer_hint = prefs.getBoolean("answer_hint", false);
boolean normal = context.getResources().getConfiguration()
.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_NORMAL);
@ -1321,6 +1330,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibJunk.setVisibility(View.GONE);
ibRemove.setVisibility(normal || message.folderReadOnly ? View.GONE : View.VISIBLE);
tvCrossHint.setVisibility(!normal && cross_hint ? View.VISIBLE : View.GONE);
ibAnswerHint.setVisibility(answer_hint ? View.VISIBLE : View.GONE);
tvAnswerHint.setVisibility(answer_hint ? View.VISIBLE : View.GONE);
if (normal)
onActionRemove(message, true);
@ -2328,6 +2339,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
case R.id.ibMore:
onActionMore(message);
break;
case R.id.ibAnswerHint:
onActionAnswerHint();
break;
case R.id.ibDownloading:
Helper.viewFAQ(context, 15);
@ -3327,6 +3341,13 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
popupMenu.show();
}
private void onActionAnswerHint() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
prefs.edit().putBoolean("answer_hint", false).apply();
ibAnswerHint.setVisibility(View.GONE);
tvAnswerHint.setVisibility(View.GONE);
}
private class TouchHandler extends ArrowKeyMovementMethod {
private TupleMessageEx message;

View File

@ -247,6 +247,8 @@ public class ApplicationEx extends Application {
if (!prefs.contains("poll_interval"))
editor.putInt("poll_interval", 0);
editor.remove("first");
} else if (version < 1003) {
editor.putBoolean("answer_hint", true);
}
if (BuildConfig.DEBUG && false) {

View File

@ -211,4 +211,28 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@id/ibRemove"
app:layout_constraintTop_toBottomOf="@id/tvSignedData" />
<ImageButton
android:id="@+id/ibAnswerHint"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_legend_close_hint"
app:layout_constraintBottom_toBottomOf="@id/tvAnswerHint"
app:layout_constraintEnd_toStartOf="@+id/tvAnswerHint"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/tvAnswerHint"
app:srcCompat="@drawable/baseline_close_24" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvAnswerHint"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:text="@string/title_answer_hint"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/ibAnswerHint"
app:layout_constraintTop_toBottomOf="@id/tvCrossHint" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -735,6 +735,7 @@
<string name="title_ask_reporting">Send error reports?</string>
<string name="title_reporting_why">Error reporting will help improve FairEmail</string>
<string name="title_message_bar_hint">Tap the cross icon to archive, delete or report a message as spam and to remove this notice</string>
<string name="title_answer_hint">Reply to all, forwarding, etc. have been moved to the reply button at the bottom</string>
<string name="title_ask_review">Please review FairEmail</string>
<string name="title_ask_review_rationale">