/* * The contents of this file are subject to the OpenMRS Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://license.openmrs.org * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * Copyright (C) OpenMRS, LLC. All Rights Reserved. */ package org.openmrs.mobile.activities.patientdashboard; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import org.openmrs.mobile.R; import org.openmrs.mobile.activities.ACBaseActivity; import org.openmrs.mobile.activities.ACBaseFragment; public class PatientDashboardFragment extends ACBaseFragment<PatientDashboardContract.PatientDashboardMainPresenter> implements PatientDashboardContract.ViewPatientMain { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); } @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.patient_dashboard_menu, menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); switch (id) { case R.id.actionDelete: ((ACBaseActivity) this.getActivity()).showDeletePatientDialog(); break; default: // Do nothing break; } return super.onOptionsItemSelected(item); } public static PatientDashboardFragment newInstance() { return new PatientDashboardFragment(); } }