package kimiko.japonais.app.fragment;

import kimiko.japonais.app.R;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SearchView;

public abstract class SearchFragment extends Fragment {
	protected ListView listView;
	protected ListAdapter adapter;
	protected SearchView searchView;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.search_fragment, container, false);
		setHasOptionsMenu(true);
		
		this.listView = (ListView) view.findViewById(R.id.mots);
		return view;
	}

	@Override
	public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
		super.onCreateOptionsMenu(menu, inflater);
		this.searchView = (SearchView) menu.findItem(R.id.menu_rechercher).getActionView();
	}
	
	public abstract void chercher(String entree);

}
