mirror of https://github.com/M66B/FairEmail.git
Expressions: experiment
This commit is contained in:
parent
55779ac915
commit
441812c561
|
@ -495,6 +495,9 @@ public class EntityRule {
|
||||||
// Expression
|
// Expression
|
||||||
Expression expression = getExpression(this, message, headers, context);
|
Expression expression = getExpression(this, message, headers, context);
|
||||||
if (expression != null) {
|
if (expression != null) {
|
||||||
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
boolean experiments = prefs.getBoolean("experiments", false);
|
||||||
|
if (experiments) {
|
||||||
if (needsHeaders(expression) && headers == null && message.headers == null)
|
if (needsHeaders(expression) && headers == null && message.headers == null)
|
||||||
throw new IllegalArgumentException(context.getString(R.string.title_rule_no_headers));
|
throw new IllegalArgumentException(context.getString(R.string.title_rule_no_headers));
|
||||||
|
|
||||||
|
@ -504,6 +507,7 @@ public class EntityRule {
|
||||||
if (!Boolean.TRUE.equals(result))
|
if (!Boolean.TRUE.equals(result))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Safeguard
|
// Safeguard
|
||||||
if (jsender == null &&
|
if (jsender == null &&
|
||||||
|
|
|
@ -25,6 +25,7 @@ import android.app.Dialog;
|
||||||
import android.app.TimePickerDialog;
|
import android.app.TimePickerDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.media.RingtoneManager;
|
import android.media.RingtoneManager;
|
||||||
|
@ -64,6 +65,7 @@ import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
import androidx.constraintlayout.widget.Group;
|
import androidx.constraintlayout.widget.Group;
|
||||||
import androidx.fragment.app.DialogFragment;
|
import androidx.fragment.app.DialogFragment;
|
||||||
import androidx.lifecycle.Lifecycle;
|
import androidx.lifecycle.Lifecycle;
|
||||||
|
import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
@ -1428,11 +1430,13 @@ public class FragmentRule extends FragmentBase {
|
||||||
showActionParameters(action.type);
|
showActionParameters(action.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||||
|
boolean experiments = prefs.getBoolean("experiments", false);
|
||||||
|
grpExpression.setVisibility(experiments ? View.VISIBLE : View.GONE);
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
Log.e(ex);
|
Log.e(ex);
|
||||||
} finally {
|
} finally {
|
||||||
grpReady.setVisibility(View.VISIBLE);
|
grpReady.setVisibility(View.VISIBLE);
|
||||||
grpExpression.setVisibility(BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
|
|
||||||
grpAge.setVisibility(cbDaily.isChecked() ? View.VISIBLE : View.GONE);
|
grpAge.setVisibility(cbDaily.isChecked() ? View.VISIBLE : View.GONE);
|
||||||
if (id < 0)
|
if (id < 0)
|
||||||
bottom_navigation.getMenu().removeItem(R.id.action_delete);
|
bottom_navigation.getMenu().removeItem(R.id.action_delete);
|
||||||
|
|
Loading…
Reference in New Issue