Browse Source

Ask for support

main
M66B 6 years ago
parent
commit
255cb1ad07
4 changed files with 49 additions and 3 deletions
  1. +18
    -2
      app/src/main/java/eu/faircode/email/FragmentMessages.java
  2. +1
    -0
      app/src/main/res/layout/fragment_folders.xml
  3. +29
    -1
      app/src/main/res/layout/fragment_messages.xml
  4. +1
    -0
      app/src/main/res/values/strings.xml

+ 18
- 2
app/src/main/java/eu/faircode/email/FragmentMessages.java View File

@ -63,10 +63,12 @@ import androidx.recyclerview.widget.RecyclerView;
public class FragmentMessages extends FragmentEx { public class FragmentMessages extends FragmentEx {
private ViewGroup view; private ViewGroup view;
private TextView tvSupport;
private ImageButton ibHintActions; private ImageButton ibHintActions;
private RecyclerView rvMessage; private RecyclerView rvMessage;
private TextView tvNoEmail; private TextView tvNoEmail;
private ProgressBar pbWait; private ProgressBar pbWait;
private Group grpSupport;
private Group grpHintActions; private Group grpHintActions;
private Group grpReady; private Group grpReady;
private FloatingActionButton fab; private FloatingActionButton fab;
@ -110,17 +112,30 @@ public class FragmentMessages extends FragmentEx {
setHasOptionsMenu(true); setHasOptionsMenu(true);
// Get controls // Get controls
tvSupport = view.findViewById(R.id.tvSupport);
ibHintActions = view.findViewById(R.id.ibHintActions); ibHintActions = view.findViewById(R.id.ibHintActions);
rvMessage = view.findViewById(R.id.rvFolder); rvMessage = view.findViewById(R.id.rvFolder);
tvNoEmail = view.findViewById(R.id.tvNoEmail); tvNoEmail = view.findViewById(R.id.tvNoEmail);
pbWait = view.findViewById(R.id.pbWait); pbWait = view.findViewById(R.id.pbWait);
grpReady = view.findViewById(R.id.grpReady);
grpSupport = view.findViewById(R.id.grpSupport);
grpHintActions = view.findViewById(R.id.grpHintActions); grpHintActions = view.findViewById(R.id.grpHintActions);
grpReady = view.findViewById(R.id.grpReady);
fab = view.findViewById(R.id.fab); fab = view.findViewById(R.id.fab);
// Wire controls
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
// Wire controls
tvSupport.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, new FragmentPro()).addToBackStack("pro");
fragmentTransaction.commit();
}
});
ibHintActions.setOnClickListener(new View.OnClickListener() { ibHintActions.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
@ -363,6 +378,7 @@ public class FragmentMessages extends FragmentEx {
super.onActivityCreated(savedInstanceState); super.onActivityCreated(savedInstanceState);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
grpSupport.setVisibility(prefs.getBoolean("pro", false) ? View.GONE : View.VISIBLE);
grpHintActions.setVisibility(prefs.getBoolean("message_actions", false) ? View.GONE : View.VISIBLE); grpHintActions.setVisibility(prefs.getBoolean("message_actions", false) ? View.GONE : View.VISIBLE);
final DB db = DB.getInstance(getContext()); final DB db = DB.getInstance(getContext());


+ 1
- 0
app/src/main/res/layout/fragment_folders.xml View File

@ -16,6 +16,7 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:minHeight="33dp" android:minHeight="33dp"
android:text="@string/title_hint_folder_actions" android:text="@string/title_hint_folder_actions"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toStartOf="@+id/ibHintActions" app:layout_constraintEnd_toStartOf="@+id/ibHintActions"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"


+ 29
- 1
app/src/main/res/layout/fragment_messages.xml View File

@ -21,6 +21,27 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvSupport"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="6dp"
android:text="@string/title_pro_support"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?attr/colorWarning"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/vSeparatorSupport"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/colorSeparator"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSupport" />
<TextView <TextView
android:id="@+id/tvHintActions" android:id="@+id/tvHintActions"
android:layout_width="0dp" android:layout_width="0dp"
@ -31,10 +52,11 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:minHeight="33dp" android:minHeight="33dp"
android:text="@string/title_hint_message_actions" android:text="@string/title_hint_message_actions"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toStartOf="@+id/ibHintActions" app:layout_constraintEnd_toStartOf="@+id/ibHintActions"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@id/vSeparatorSupport" />
<ImageButton <ImageButton
android:id="@+id/ibHintActions" android:id="@+id/ibHintActions"
@ -76,6 +98,12 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpSupport"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="tvSupport,vSeparatorSupport" />
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
android:id="@+id/grpHintActions" android:id="@+id/grpHintActions"
android:layout_width="0dp" android:layout_width="0dp"


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

@ -232,6 +232,7 @@
<string name="title_pro_activated">All pro features are activated</string> <string name="title_pro_activated">All pro features are activated</string>
<string name="title_pro_valid">All pro features activated</string> <string name="title_pro_valid">All pro features activated</string>
<string name="title_pro_invalid">Invalid response</string> <string name="title_pro_invalid">Invalid response</string>
<string name="title_pro_support">FairEmail needs your help. Tap to purchase pro features to keep the project going.</string>
<string name="title_log">Log</string> <string name="title_log">Log</string>
<string name="title_debug_info">Debug info</string> <string name="title_debug_info">Debug info</string>


Loading…
Cancel
Save