Browse Source

Added support hint

main
M66B 6 years ago
parent
commit
a38f274aa2
3 changed files with 58 additions and 4 deletions
  1. +13
    -0
      app/src/main/java/eu/faircode/email/FragmentMessages.java
  2. +44
    -4
      app/src/main/res/layout/fragment_messages.xml
  3. +1
    -0
      app/src/main/res/values/strings.xml

+ 13
- 0
app/src/main/java/eu/faircode/email/FragmentMessages.java View File

@ -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());


+ 44
- 4
app/src/main/res/layout/fragment_messages.xml View File

@ -42,6 +42,40 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSupport" />
<TextView
android:id="@+id/tvHintSupport"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:layout_marginStart="6dp"
android:layout_marginTop="6dp"
android:gravity="center_vertical"
android:minHeight="33dp"
android:text="@string/title_hint_support"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toStartOf="@+id/ibHintSupport"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparatorSupport" />
<ImageButton
android:id="@+id/ibHintSupport"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/baseline_close_24"
app:layout_constraintBottom_toBottomOf="@id/tvHintSupport"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tvHintSupport" />
<View
android:id="@+id/vSeparatorHintSupport"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="6dp"
android:background="?attr/colorSeparator"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ibHintSupport" />
<TextView
android:id="@+id/tvHintActions"
android:layout_width="0dp"
@ -56,7 +90,7 @@
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toStartOf="@+id/ibHintActions"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparatorSupport" />
app:layout_constraintTop_toBottomOf="@id/vSeparatorHintSupport" />
<ImageButton
android:id="@+id/ibHintActions"
@ -68,7 +102,7 @@
app:layout_constraintTop_toTopOf="@id/tvHintActions" />
<View
android:id="@+id/vSeparator"
android:id="@+id/vSeparatorHintActions"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="6dp"
@ -85,7 +119,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparator" />
app:layout_constraintTop_toBottomOf="@id/vSeparatorHintActions" />
<ProgressBar
android:id="@+id/pbWait"
@ -104,11 +138,17 @@
android:layout_height="0dp"
app:constraint_referenced_ids="tvSupport,vSeparatorSupport" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpHintSupport"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="tvHintSupport,ibHintSupport,vSeparatorHintSupport" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpHintActions"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="tvHintActions,ibHintActions,vSeparator" />
app:constraint_referenced_ids="tvHintActions,ibHintActions,vSeparatorHintActions" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpReady"


+ 1
- 0
app/src/main/res/values/strings.xml View File

@ -226,6 +226,7 @@
<string name="title_legend_closing">Closing</string>
<string name="title_hint_folder_actions">Long press for options</string>
<string name="title_hint_support">If you have a question or a problem, please use the support menu to get help</string>
<string name="title_hint_message_actions">Swipe left to trash; swipe right to archive (if available); long press to mark read/unread or to add/remove star</string>
<string name="title_open_link">Open link</string>


Loading…
Cancel
Save