Added hint about action bar

This commit is contained in:
M66B 2020-03-01 15:45:05 +01:00
parent 2b2916b558
commit 4b761d2235
4 changed files with 55 additions and 2 deletions

View File

@ -385,6 +385,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private ImageButton ibUndo;
private ImageButton ibMore;
private TextView tvSignedData;
private ImageButton ibActionBarHint;
private Group grpActionBarHint;
private TextView tvBody;
private View wvBody;
@ -571,6 +573,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibUndo = vsBody.findViewById(R.id.ibUndo);
ibMore = vsBody.findViewById(R.id.ibMore);
tvSignedData = vsBody.findViewById(R.id.tvSignedData);
ibActionBarHint = vsBody.findViewById(R.id.ibActionBarHint);
grpActionBarHint = vsBody.findViewById(R.id.grpActionBarHint);
tvBody = vsBody.findViewById(R.id.tvBody);
wvBody = vsBody.findViewById(R.id.wvBody);
@ -648,6 +652,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibVerify.setOnClickListener(this);
ibUndo.setOnClickListener(this);
ibMore.setOnClickListener(this);
ibActionBarHint.setOnClickListener(this);
ibDownloading.setOnClickListener(this);
@ -716,6 +721,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibVerify.setOnClickListener(null);
ibUndo.setOnClickListener(null);
ibMore.setOnClickListener(null);
ibActionBarHint.setOnClickListener(null);
ibDownloading.setOnClickListener(null);
@ -1144,6 +1150,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibUndo.setVisibility(View.GONE);
ibMore.setVisibility(View.GONE);
tvSignedData.setVisibility(View.GONE);
grpActionBarHint.setVisibility(View.GONE);
tvBody.setVisibility(View.GONE);
wvBody.setVisibility(View.GONE);
@ -1298,6 +1305,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibUndo.setVisibility(EntityFolder.OUTBOX.equals(message.folderType) ? View.VISIBLE : View.GONE);
ibMore.setVisibility(EntityFolder.OUTBOX.equals(message.folderType) ? View.GONE : View.VISIBLE);
tvSignedData.setVisibility(View.GONE);
grpActionBarHint.setVisibility(View.GONE);
// Addresses
ibExpanderAddress.setImageLevel(show_addresses ? 0 /* less */ : 1 /* more */);
@ -1872,6 +1880,10 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
boolean signed_data = args.getBoolean("signed_data");
tvSignedData.setVisibility(signed_data ? View.VISIBLE : View.GONE);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean message_bar_removed = prefs.getBoolean("message_bar_removed", true);
grpActionBarHint.setVisibility(message_bar_removed ? View.GONE : View.VISIBLE);
}
@Override
@ -2337,6 +2349,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
case R.id.ibMore:
onActionMore(message);
break;
case R.id.ibActionBarHint:
onActionBarHint();
break;
case R.id.ibDownloading:
Helper.viewFAQ(context, 15);
@ -3199,6 +3214,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
popupMenu.show();
}
private void onActionBarHint() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
prefs.edit().putBoolean("message_bar_removed", true).apply();
grpActionBarHint.setVisibility(View.GONE);
}
private class TouchHandler extends ArrowKeyMovementMethod {
private TupleMessageEx message;

View File

@ -249,6 +249,7 @@ public class ApplicationEx extends Application {
editor.remove("first");
} else if (version < 999) {
editor.remove("actionbar");
editor.putBoolean("message_bar_removed", false);
}
if (BuildConfig.DEBUG && false) {

View File

@ -152,5 +152,36 @@
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ibVerify" />
app:layout_constraintTop_toBottomOf="@id/ibFull" />
<ImageButton
android:id="@+id/ibActionBarHint"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_no_format"
app:layout_constraintBottom_toBottomOf="@+id/tvActionBarHint"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/tvActionBarHint"
app:srcCompat="@drawable/baseline_close_24" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvActionBarHint"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginTop="6dp"
android:layout_marginEnd="6dp"
android:text="@string/title_message_bar_hint"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/ibActionBarHint"
app:layout_constraintTop_toBottomOf="@id/tvSignedData" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpActionBarHint"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="ibActionBarHint,tvActionBarHint" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -734,7 +734,7 @@
<string name="title_ask_help">Help improve FairEmail</string>
<string name="title_ask_reporting">Send error reports?</string>
<string name="title_reporting_why">Error reporting will help improve FairEmail</string>
<string name="title_reply_hint">You can reply to all, forward, etc via the double arrow action menu just below the message header</string>
<string name="title_message_bar_hint">The actions for archiving and trashing messages were merged in the bottom action bar and all answer actions have been made available via the answer button</string>
<string name="title_ask_review">Please review FairEmail</string>
<string name="title_ask_review_rationale">