Search in sources :

Example 1 with ChaptersListAdapter

use of de.danoeh.antennapod.adapter.ChaptersListAdapter in project AntennaPod by AntennaPod.

the class ChaptersFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    // add padding
    final ListView lv = getListView();
    lv.setClipToPadding(false);
    final int vertPadding = getResources().getDimensionPixelSize(R.dimen.list_vertical_padding);
    lv.setPadding(0, vertPadding, 0, vertPadding);
    adapter = new ChaptersListAdapter(getActivity(), 0, pos -> {
        if (controller == null) {
            Log.d(TAG, "controller is null");
            return;
        }
        Chapter chapter = (Chapter) getListAdapter().getItem(pos);
        controller.seekToChapter(chapter);
    });
    setListAdapter(adapter);
}
Also used : PlaybackController(de.danoeh.antennapod.core.util.playback.PlaybackController) Bundle(android.os.Bundle) ListFragment(android.support.v4.app.ListFragment) R(de.danoeh.antennapod.R) View(android.view.View) Chapter(de.danoeh.antennapod.core.feed.Chapter) ListView(android.widget.ListView) ChaptersListAdapter(de.danoeh.antennapod.adapter.ChaptersListAdapter) Playable(de.danoeh.antennapod.core.util.playback.Playable) Log(android.util.Log) MediaplayerInfoContentFragment(de.danoeh.antennapod.activity.MediaplayerInfoActivity.MediaplayerInfoContentFragment) ListView(android.widget.ListView) ChaptersListAdapter(de.danoeh.antennapod.adapter.ChaptersListAdapter) Chapter(de.danoeh.antennapod.core.feed.Chapter)

Aggregations

Bundle (android.os.Bundle)1 ListFragment (android.support.v4.app.ListFragment)1 Log (android.util.Log)1 View (android.view.View)1 ListView (android.widget.ListView)1 R (de.danoeh.antennapod.R)1 MediaplayerInfoContentFragment (de.danoeh.antennapod.activity.MediaplayerInfoActivity.MediaplayerInfoContentFragment)1 ChaptersListAdapter (de.danoeh.antennapod.adapter.ChaptersListAdapter)1 Chapter (de.danoeh.antennapod.core.feed.Chapter)1 Playable (de.danoeh.antennapod.core.util.playback.Playable)1 PlaybackController (de.danoeh.antennapod.core.util.playback.PlaybackController)1