hide search and option menu when showing contact list

This commit is contained in:
tobiasKaminsky 2017-04-18 10:55:46 +02:00
parent 54f8d3091c
commit 33544f65e7
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -38,6 +38,7 @@ import android.support.v7.app.AlertDialog;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
@ -94,6 +95,7 @@ public class ContactListFragment extends FileFragment {
public View onCreateView(final LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.contactlist_fragment, null);
setHasOptionsMenu(true);
ArrayList<VCard> vCards = new ArrayList<>();
checkedVCards = new HashSet<>();
@ -165,6 +167,14 @@ public class ContactListFragment extends FileFragment {
return view;
}
@Override
public void onPrepareOptionsMenu(Menu menu) {
menu.findItem(R.id.action_search).setVisible(false);
menu.findItem(R.id.action_sync_account).setVisible(false);
menu.findItem(R.id.action_sort).setVisible(false);
menu.findItem(R.id.action_switch_view).setVisible(false);
}
static class ContactItemViewHolder extends RecyclerView.ViewHolder {
private ImageView badge;
private CheckedTextView name;