diff --git a/app/src/main/java/eu/faircode/email/FragmentRule.java b/app/src/main/java/eu/faircode/email/FragmentRule.java index e99c8e9a56..1acba32104 100644 --- a/app/src/main/java/eu/faircode/email/FragmentRule.java +++ b/app/src/main/java/eu/faircode/email/FragmentRule.java @@ -32,6 +32,8 @@ import android.provider.ContactsContract; import android.text.TextUtils; import android.text.format.DateFormat; import android.view.LayoutInflater; +import android.view.Menu; +import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; @@ -181,6 +183,7 @@ public class FragmentRule extends FragmentBase { @Nullable public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { setSubtitle(R.string.title_rule_caption); + setHasOptionsMenu(true); view = (ViewGroup) inflater.inflate(R.layout.fragment_rule, container, false); @@ -508,6 +511,28 @@ public class FragmentRule extends FragmentBase { }.execute(this, args, "rule:accounts"); } + @Override + public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { + inflater.inflate(R.menu.menu_rule, menu); + super.onCreateOptionsMenu(menu, inflater); + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case R.id.menu_help: + onMenuHelp(); + return true; + + default: + return super.onOptionsItemSelected(item); + } + } + + private void onMenuHelp() { + Helper.viewFAQ(getContext(), 71); + } + @Override public void onSaveInstanceState(Bundle outState) { outState.putInt("fair:start", spScheduleDayStart.getSelectedItemPosition()); diff --git a/app/src/main/res/menu/menu_rule.xml b/app/src/main/res/menu/menu_rule.xml new file mode 100644 index 0000000000..7b7f4e3e54 --- /dev/null +++ b/app/src/main/res/menu/menu_rule.xml @@ -0,0 +1,9 @@ + +