use of de.danoeh.antennapod.activity.MainActivity in project AntennaPod by AntennaPod.
the class ItemlistFragment method onListItemClick.
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
if (adapter == null) {
return;
}
position -= l.getHeaderViewsCount();
MainActivity activity = (MainActivity) getActivity();
long[] ids = FeedItemUtil.getIds(feed.getItems());
activity.loadChildFragment(ItemFragment.newInstance(ids, position));
activity.getSupportActionBar().setTitle(feed.getTitle());
}
use of de.danoeh.antennapod.activity.MainActivity in project AntennaPod by AntennaPod.
the class PodcastListFragment method onCreateOptionsMenu.
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
inflater.inflate(R.menu.gpodder_podcasts, menu);
MenuItem searchItem = menu.findItem(R.id.action_search);
final SearchView sv = (SearchView) MenuItemCompat.getActionView(searchItem);
MenuItemUtils.adjustTextColor(getActivity(), sv);
sv.setQueryHint(getString(R.string.gpodnet_search_hint));
sv.setOnQueryTextListener(new android.support.v7.widget.SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String s) {
sv.clearFocus();
MainActivity activity = (MainActivity) getActivity();
if (activity != null) {
activity.loadChildFragment(SearchListFragment.newInstance(s));
}
return true;
}
@Override
public boolean onQueryTextChange(String s) {
return false;
}
});
}
Aggregations