Search in sources :

Example 16 with MainActivity

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

Example 17 with MainActivity

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;
        }
    });
}
Also used : SearchView(android.support.v7.widget.SearchView) MenuItem(android.view.MenuItem) 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