mirror of https://github.com/M66B/FairEmail.git
Added rule help
This commit is contained in:
parent
a601d51966
commit
289f22e9e9
|
@ -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());
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/menu_help"
|
||||
android:icon="@drawable/baseline_help_24"
|
||||
android:title=""
|
||||
app:showAsAction="always" />
|
||||
</menu>
|
Loading…
Reference in New Issue