Refactoring

pull/214/head
M66B 1 year ago
parent 8e14238467
commit d8add231f2

@ -142,6 +142,10 @@ public class EntityRule {
static final String EXTRA_SUBJECT = "subject";
static final String EXTRA_RECEIVED = "received";
static final String[] EXTRA_ALL = new String[]{
EXTRA_RULE, EXTRA_SENDER, EXTRA_NAME, EXTRA_SUBJECT, EXTRA_RECEIVED
};
static final String JSOUP_PREFIX = "jsoup:";
private static final long SEND_DELAY = 5000L; // milliseconds
private static final int MAX_NOTES_LENGTH = 512; // characters

@ -804,13 +804,7 @@ public class FragmentRule extends FragmentBase {
tvAutomation.setText(getString(R.string.title_rule_automation_hint,
EntityRule.ACTION_AUTOMATION,
TextUtils.join(", ", new String[]{
EntityRule.EXTRA_RULE,
EntityRule.EXTRA_SENDER,
EntityRule.EXTRA_NAME,
EntityRule.EXTRA_SUBJECT,
EntityRule.EXTRA_RECEIVED,
})));
TextUtils.join(",", EntityRule.EXTRA_ALL)));
btnColorNotes.setOnClickListener(new View.OnClickListener() {
@Override
@ -827,14 +821,10 @@ public class FragmentRule extends FragmentBase {
}
});
tvUrlHint.setText(getString(R.string.title_rule_url_hint,
TextUtils.join(", ", new String[]{
"$" + EntityRule.EXTRA_RULE + "$",
"$" + EntityRule.EXTRA_SENDER + "$",
"$" + EntityRule.EXTRA_NAME + "$",
"$" + EntityRule.EXTRA_SUBJECT + "$",
"$" + EntityRule.EXTRA_RECEIVED + "$",
})));
List<String> extras = new ArrayList<>();
for (String extra : EntityRule.EXTRA_ALL)
extras.add("$" + extra + "$");
tvUrlHint.setText(getString(R.string.title_rule_url_hint, TextUtils.join(", ", extras)));
bottom_navigation.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override

Loading…
Cancel
Save