Search in sources :

Example 6 with Podcast

use of de.danoeh.antennapod.adapter.itunes.ItunesAdapter.Podcast in project AntennaPod by AntennaPod.

the class FyydSearchFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View root = inflater.inflate(R.layout.fragment_itunes_search, container, false);
    gridView = (GridView) root.findViewById(R.id.gridView);
    adapter = new ItunesAdapter(getActivity(), new ArrayList<>());
    gridView.setAdapter(adapter);
    //Show information about the podcast when the list item is clicked
    gridView.setOnItemClickListener((parent, view1, position, id) -> {
        Podcast podcast = searchResults.get(position);
        Intent intent = new Intent(getActivity(), OnlineFeedViewActivity.class);
        intent.putExtra(OnlineFeedViewActivity.ARG_FEEDURL, podcast.feedUrl);
        intent.putExtra(OnlineFeedViewActivity.ARG_TITLE, podcast.title);
        startActivity(intent);
    });
    progressBar = (ProgressBar) root.findViewById(R.id.progressBar);
    txtvError = (TextView) root.findViewById(R.id.txtvError);
    butRetry = (Button) root.findViewById(R.id.butRetry);
    txtvEmpty = (TextView) root.findViewById(android.R.id.empty);
    return root;
}
Also used : ItunesAdapter(de.danoeh.antennapod.adapter.itunes.ItunesAdapter) ArrayList(java.util.ArrayList) Podcast(de.danoeh.antennapod.adapter.itunes.ItunesAdapter.Podcast) Intent(android.content.Intent) GridView(android.widget.GridView) SearchView(android.support.v7.widget.SearchView) View(android.view.View) TextView(android.widget.TextView)

Aggregations

Podcast (de.danoeh.antennapod.adapter.itunes.ItunesAdapter.Podcast)6 Intent (android.content.Intent)4 SearchView (android.support.v7.widget.SearchView)4 View (android.view.View)4 GridView (android.widget.GridView)4 TextView (android.widget.TextView)4 ItunesAdapter (de.danoeh.antennapod.adapter.itunes.ItunesAdapter)4 ArrayList (java.util.ArrayList)4 Bundle (android.os.Bundle)3 Fragment (android.support.v4.app.Fragment)3 MenuItemCompat (android.support.v4.view.MenuItemCompat)3 Log (android.util.Log)3 LayoutInflater (android.view.LayoutInflater)3 Menu (android.view.Menu)3 MenuInflater (android.view.MenuInflater)3 MenuItem (android.view.MenuItem)3 ViewGroup (android.view.ViewGroup)3 Button (android.widget.Button)3 ProgressBar (android.widget.ProgressBar)3 MaterialDialog (com.afollestad.materialdialogs.MaterialDialog)3