Search in sources :

Example 1 with MoreContentListFooterUtil

use of de.danoeh.antennapod.core.util.gui.MoreContentListFooterUtil in project AntennaPod by AntennaPod.

the class ItemlistFragment method setupFooterView.

private void setupFooterView() {
    if (getListView() == null || feed == null) {
        Log.e(TAG, "Unable to setup listview: recyclerView = null or feed = null");
        return;
    }
    if (feed.isPaged() && feed.getNextPageLink() != null) {
        ListView lv = getListView();
        LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View header = inflater.inflate(R.layout.more_content_list_footer, lv, false);
        lv.addFooterView(header);
        listFooter = new MoreContentListFooterUtil(header);
        listFooter.setClickListener(() -> {
            if (feed != null) {
                try {
                    DBTasks.loadNextPageOfFeed(getActivity(), feed, false);
                } catch (DownloadRequestException e) {
                    e.printStackTrace();
                    DownloadRequestErrorDialogCreator.newRequestErrorDialog(getActivity(), e.getMessage());
                }
            }
        });
    }
}
Also used : ListView(android.widget.ListView) LayoutInflater(android.view.LayoutInflater) DownloadRequestException(de.danoeh.antennapod.core.storage.DownloadRequestException) SearchView(android.support.v7.widget.SearchView) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) ListView(android.widget.ListView) IconTextView(com.joanzapata.iconify.widget.IconTextView) MoreContentListFooterUtil(de.danoeh.antennapod.core.util.gui.MoreContentListFooterUtil)

Aggregations

SearchView (android.support.v7.widget.SearchView)1 LayoutInflater (android.view.LayoutInflater)1 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 ImageView (android.widget.ImageView)1 ListView (android.widget.ListView)1 TextView (android.widget.TextView)1 IconTextView (com.joanzapata.iconify.widget.IconTextView)1 DownloadRequestException (de.danoeh.antennapod.core.storage.DownloadRequestException)1 MoreContentListFooterUtil (de.danoeh.antennapod.core.util.gui.MoreContentListFooterUtil)1