use of de.danoeh.antennapod.activity.MainActivity in project AntennaPod by AntennaPod.
the class AllEpisodesFragment method onFragmentLoaded.
private void onFragmentLoaded() {
if (listAdapter == null) {
MainActivity mainActivity = (MainActivity) getActivity();
listAdapter = new AllEpisodesRecycleAdapter(mainActivity, itemAccess, new DefaultActionButtonCallback(mainActivity), showOnlyNewEpisodes());
listAdapter.setHasStableIds(true);
recyclerView.setAdapter(listAdapter);
}
listAdapter.notifyDataSetChanged();
restoreScrollPosition();
getActivity().supportInvalidateOptionsMenu();
updateShowOnlyEpisodesListViewState();
}
use of de.danoeh.antennapod.activity.MainActivity in project AntennaPod by AntennaPod.
the class CompletedDownloadsFragment method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch(item.getItemId()) {
case R.id.episode_actions:
EpisodesApplyActionFragment fragment = EpisodesApplyActionFragment.newInstance(items, EpisodesApplyActionFragment.ACTION_REMOVE);
((MainActivity) getActivity()).loadChildFragment(fragment);
return true;
default:
return false;
}
}
use of de.danoeh.antennapod.activity.MainActivity in project AntennaPod by AntennaPod.
the class TagListFragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
getListView().setOnItemClickListener((parent, view1, position, id) -> {
GpodnetTag tag = (GpodnetTag) getListAdapter().getItem(position);
MainActivity activity = (MainActivity) getActivity();
activity.loadChildFragment(TagFragment.newInstance(tag));
});
startLoadTask();
}
use of de.danoeh.antennapod.activity.MainActivity in project AntennaPod by AntennaPod.
the class TagListFragment 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 SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String s) {
Activity activity = getActivity();
if (activity != null) {
sv.clearFocus();
((MainActivity) activity).loadChildFragment(SearchListFragment.newInstance(s));
}
return true;
}
@Override
public boolean onQueryTextChange(String s) {
return false;
}
});
}
use of de.danoeh.antennapod.activity.MainActivity in project AntennaPod by AntennaPod.
the class SubscriptionFragment method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
subscriptionAdapter = new SubscriptionsAdapter((MainActivity) getActivity(), itemAccess);
subscriptionGridLayout.setAdapter(subscriptionAdapter);
loadSubscriptions();
subscriptionGridLayout.setOnItemClickListener(subscriptionAdapter);
if (getActivity() instanceof MainActivity) {
((MainActivity) getActivity()).getSupportActionBar().setTitle(R.string.subscriptions_label);
}
EventDistributor.getInstance().register(contentUpdate);
}
Aggregations