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_SUBJECT = "subject";
static final String EXTRA_RECEIVED = "received"; 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:"; static final String JSOUP_PREFIX = "jsoup:";
private static final long SEND_DELAY = 5000L; // milliseconds private static final long SEND_DELAY = 5000L; // milliseconds
private static final int MAX_NOTES_LENGTH = 512; // characters 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, tvAutomation.setText(getString(R.string.title_rule_automation_hint,
EntityRule.ACTION_AUTOMATION, EntityRule.ACTION_AUTOMATION,
TextUtils.join(", ", new String[]{ TextUtils.join(",", EntityRule.EXTRA_ALL)));
EntityRule.EXTRA_RULE,
EntityRule.EXTRA_SENDER,
EntityRule.EXTRA_NAME,
EntityRule.EXTRA_SUBJECT,
EntityRule.EXTRA_RECEIVED,
})));
btnColorNotes.setOnClickListener(new View.OnClickListener() { btnColorNotes.setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -827,14 +821,10 @@ public class FragmentRule extends FragmentBase {
} }
}); });
tvUrlHint.setText(getString(R.string.title_rule_url_hint, List<String> extras = new ArrayList<>();
TextUtils.join(", ", new String[]{ for (String extra : EntityRule.EXTRA_ALL)
"$" + EntityRule.EXTRA_RULE + "$", extras.add("$" + extra + "$");
"$" + EntityRule.EXTRA_SENDER + "$", tvUrlHint.setText(getString(R.string.title_rule_url_hint, TextUtils.join(", ", extras)));
"$" + EntityRule.EXTRA_NAME + "$",
"$" + EntityRule.EXTRA_SUBJECT + "$",
"$" + EntityRule.EXTRA_RECEIVED + "$",
})));
bottom_navigation.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() { bottom_navigation.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override @Override

Loading…
Cancel
Save