Android Open Source - haavi Episode Detail Fragment






From Project

Back to project page haavi.

License

The source code is released under:

MIT License

If you think the Android project haavi listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.ilkkalaukkanen.haavi;
//from   www .  jav  a2 s. com
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

/**
 * A fragment representing a single Episode detail screen. This fragment is either contained in a {@link
 * EpisodeListActivity} in two-pane mode (on tablets) or a {@link EpisodeDetailActivity} on handsets.
 */
public class EpisodeDetailFragment extends Fragment {
    /**
     * The fragment argument representing the item ID that this fragment represents.
     */
    public static final String ARG_ITEM_ID          = "item_id";
    public static final String ARG_ITEM_TITLE       = "item_title";
    public static final String ARG_ITEM_DESCRIPTION = "item_description";
    public static final String ARG_ITEM_URL         = "item_url";
    private String title;
    private String description;
    private String url;


    /**
     * Mandatory empty constructor for the fragment manager to instantiate the fragment (e.g. upon screen orientation
     * changes).
     */
    public EpisodeDetailFragment() {
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        final Bundle arguments = getArguments();
        if (arguments.containsKey(ARG_ITEM_ID)) {
            // Load the dummy title specified by the fragment
            // arguments. In a real-world scenario, use a Loader
            // to load title from a title provider.
            //mItem = DummyContent.ITEM_MAP.get(getArguments().getString(ARG_ITEM_ID));
        }
        if (arguments.containsKey(ARG_ITEM_TITLE)) {
            title = arguments.getString(ARG_ITEM_TITLE);
        }
        if (arguments.containsKey(ARG_ITEM_DESCRIPTION)) {
            description = arguments.getString(ARG_ITEM_DESCRIPTION);
        }
        if (arguments.containsKey(ARG_ITEM_URL)) {
            url = arguments.getString(ARG_ITEM_URL);
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_episode_detail, container, false);
        assert rootView != null;

        // display item
        ((TextView) rootView.findViewById(R.id.episode_title)).setText(title);
        ((TextView) rootView.findViewById(R.id.episode_description)).setText(description);

        return rootView;
    }
}




Java Source Code List

com.ilkkalaukkanen.haavi.EpisodeDetailActivity.java
com.ilkkalaukkanen.haavi.EpisodeDetailFragment.java
com.ilkkalaukkanen.haavi.EpisodeListActivity.java
com.ilkkalaukkanen.haavi.EpisodeListFragment.java
com.ilkkalaukkanen.haavi.FeedDownloader.java
com.ilkkalaukkanen.haavi.PlaybackControlFragment.java
com.ilkkalaukkanen.haavi.PlayerService.java
com.ilkkalaukkanen.haavi.http.HttpClientProvider.java
com.ilkkalaukkanen.haavi.http.HttpModule.java
com.ilkkalaukkanen.haavi.model.Podcast.java
rx.android.Events.java
rx.android.Properties.java