From a38f274aa2fb0ba2b6b08777ade525ec5357bf45 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 14 Sep 2018 09:09:58 +0000 Subject: [PATCH] Added support hint --- .../eu/faircode/email/FragmentMessages.java | 13 +++++ app/src/main/res/layout/fragment_messages.xml | 48 +++++++++++++++++-- app/src/main/res/values/strings.xml | 1 + 3 files changed, 58 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 37222302..ab192605 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -64,11 +64,13 @@ import androidx.recyclerview.widget.RecyclerView; public class FragmentMessages extends FragmentEx { private ViewGroup view; private TextView tvSupport; + private ImageButton ibHintSupport; private ImageButton ibHintActions; private RecyclerView rvMessage; private TextView tvNoEmail; private ProgressBar pbWait; private Group grpSupport; + private Group grpHintSupport; private Group grpHintActions; private Group grpReady; private FloatingActionButton fab; @@ -116,11 +118,13 @@ public class FragmentMessages extends FragmentEx { // Get controls tvSupport = view.findViewById(R.id.tvSupport); + ibHintSupport = view.findViewById(R.id.ibHintSupport); ibHintActions = view.findViewById(R.id.ibHintActions); rvMessage = view.findViewById(R.id.rvFolder); tvNoEmail = view.findViewById(R.id.tvNoEmail); pbWait = view.findViewById(R.id.pbWait); grpSupport = view.findViewById(R.id.grpSupport); + grpHintSupport = view.findViewById(R.id.grpHintSupport); grpHintActions = view.findViewById(R.id.grpHintActions); grpReady = view.findViewById(R.id.grpReady); fab = view.findViewById(R.id.fab); @@ -146,6 +150,14 @@ public class FragmentMessages extends FragmentEx { } }); + ibHintSupport.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + prefs.edit().putBoolean("app_support", true).apply(); + grpHintSupport.setVisibility(View.GONE); + } + }); + rvMessage.setHasFixedSize(false); LinearLayoutManager llm = new LinearLayoutManager(getContext()); rvMessage.setLayoutManager(llm); @@ -381,6 +393,7 @@ public class FragmentMessages extends FragmentEx { super.onActivityCreated(savedInstanceState); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); + grpHintSupport.setVisibility(prefs.getBoolean("app_support", false) ? View.GONE : View.VISIBLE); grpHintActions.setVisibility(prefs.getBoolean("message_actions", false) ? View.GONE : View.VISIBLE); final DB db = DB.getInstance(getContext()); diff --git a/app/src/main/res/layout/fragment_messages.xml b/app/src/main/res/layout/fragment_messages.xml index 19661d47..cc11b75e 100644 --- a/app/src/main/res/layout/fragment_messages.xml +++ b/app/src/main/res/layout/fragment_messages.xml @@ -42,6 +42,40 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tvSupport" /> + + + + + + + app:layout_constraintTop_toBottomOf="@id/vSeparatorHintSupport" /> + app:layout_constraintTop_toBottomOf="@id/vSeparatorHintActions" /> + + + app:constraint_referenced_ids="tvHintActions,ibHintActions,vSeparatorHintActions" /> Closing Long press for options + If you have a question or a problem, please use the support menu to get help Swipe left to trash; swipe right to archive (if available); long press to mark read/unread or to add/remove star Open link