diff --git a/app/src/main/java/eu/faircode/email/FragmentRule.java b/app/src/main/java/eu/faircode/email/FragmentRule.java index 3389a27231..869c2c5ea5 100644 --- a/app/src/main/java/eu/faircode/email/FragmentRule.java +++ b/app/src/main/java/eu/faircode/email/FragmentRule.java @@ -25,6 +25,7 @@ import android.app.Dialog; import android.app.TimePickerDialog; import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.database.Cursor; import android.graphics.Color; import android.media.RingtoneManager; @@ -64,6 +65,7 @@ import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.Group; import androidx.fragment.app.DialogFragment; import androidx.lifecycle.Lifecycle; +import androidx.preference.PreferenceManager; import com.google.android.material.bottomnavigation.BottomNavigationView; import com.google.android.material.snackbar.Snackbar; @@ -84,6 +86,7 @@ public class FragmentRule extends FragmentBase { private ScrollView scroll; private ConstraintLayout content; + private TextView tvPro; private TextView tvFolder; private EditText etName; private AutoCompleteTextView etGroup; @@ -300,6 +303,7 @@ public class FragmentRule extends FragmentBase { scroll = view.findViewById(R.id.scroll); content = view.findViewById(R.id.content); + tvPro = view.findViewById(R.id.tvPro); tvFolder = view.findViewById(R.id.tvFolder); etName = view.findViewById(R.id.etName); etGroup = view.findViewById(R.id.etGroup); @@ -429,6 +433,11 @@ public class FragmentRule extends FragmentBase { grpUrl = view.findViewById(R.id.grpUrl); grpSummarize = view.findViewById(R.id.grpSummarize); + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); + boolean pro = prefs.getBoolean("pro", false); + + tvPro.setVisibility(pro && !BuildConfig.DEBUG ? View.GONE : View.VISIBLE); + adapterGroup = new ArrayAdapter<>(getContext(), R.layout.spinner_item1_dropdown, android.R.id.text1); etGroup.setThreshold(1); etGroup.setAdapter(adapterGroup); diff --git a/app/src/main/res/layout/fragment_rule.xml b/app/src/main/res/layout/fragment_rule.xml index 74cc7b7279..2773888f8a 100644 --- a/app/src/main/res/layout/fragment_rule.xml +++ b/app/src/main/res/layout/fragment_rule.xml @@ -30,14 +30,27 @@ android:focusable="true" android:focusableInTouchMode="true"> + + + app:layout_constraintTop_toBottomOf="@id/tvPro" />