Search in sources :

Example 6 with MainActivity

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();
}
Also used : DefaultActionButtonCallback(de.danoeh.antennapod.adapter.DefaultActionButtonCallback) AllEpisodesRecycleAdapter(de.danoeh.antennapod.adapter.AllEpisodesRecycleAdapter) MainActivity(de.danoeh.antennapod.activity.MainActivity)

Example 7 with MainActivity

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;
    }
}
Also used : EpisodesApplyActionFragment(de.danoeh.antennapod.dialog.EpisodesApplyActionFragment) MainActivity(de.danoeh.antennapod.activity.MainActivity)

Example 8 with MainActivity

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();
}
Also used : GpodnetTag(de.danoeh.antennapod.core.gpoddernet.model.GpodnetTag) MainActivity(de.danoeh.antennapod.activity.MainActivity)

Example 9 with MainActivity

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;
        }
    });
}
Also used : SearchView(android.support.v7.widget.SearchView) MainActivity(de.danoeh.antennapod.activity.MainActivity) Activity(android.app.Activity) MenuItem(android.view.MenuItem)

Example 10 with MainActivity

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);
}
Also used : SubscriptionsAdapter(de.danoeh.antennapod.adapter.SubscriptionsAdapter) MainActivity(de.danoeh.antennapod.activity.MainActivity)

Aggregations

MainActivity (de.danoeh.antennapod.activity.MainActivity)17 DialogInterface (android.content.DialogInterface)3 View (android.view.View)3 ImageView (android.widget.ImageView)3 TextView (android.widget.TextView)3 DefaultActionButtonCallback (de.danoeh.antennapod.adapter.DefaultActionButtonCallback)3 ConfirmationDialog (de.danoeh.antennapod.core.dialog.ConfirmationDialog)3 Intent (android.content.Intent)2 SearchView (android.support.v7.widget.SearchView)2 MenuItem (android.view.MenuItem)2 Feed (de.danoeh.antennapod.core.feed.Feed)2 EpisodesApplyActionFragment (de.danoeh.antennapod.dialog.EpisodesApplyActionFragment)2 Activity (android.app.Activity)1 Uri (android.net.Uri)1 Bundle (android.os.Bundle)1 NonNull (android.support.annotation.NonNull)1 Fragment (android.support.v4.app.Fragment)1 WebView (android.webkit.WebView)1 WebViewClient (android.webkit.WebViewClient)1 Button (android.widget.Button)1