Android Open Source - MightyV Show Array Adapter






From Project

Back to project page MightyV.

License

The source code is released under:

Apache License

If you think the Android project MightyV 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.indivisible.mightyv.util;
/*  www . j a  va2  s . c o  m*/
import java.util.List;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import com.indivisible.mightyv.R;
import com.indivisible.mightyv.data.Show;

public class ShowArrayAdapter
        extends ArrayAdapter<Show>
{

    //// data

    private String TAG;
    private final Context context;
    private final List<Show> shows;


    //// constructor

    public ShowArrayAdapter(Context context, List<Show> shows)
    {
        super(context, R.layout.show_row_simple, shows);

        this.TAG = this.getClass().getSimpleName();
        this.context = context;
        this.shows = shows;
    }


    //// override methods

    @Override
    public View getView(int position, View convertView, ViewGroup parent)
    {
        //if (MyLog.debug) MyLog.d(TAG, "Creating Adapter View...");

        LayoutInflater inflater = (LayoutInflater) context
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);

        View rowShowSimple = inflater.inflate(R.layout.show_row_simple, parent, false);

        TextView showTitle = (TextView) rowShowSimple
                .findViewById(R.id.row_showsimple_text_title);
        TextView showStatus = (TextView) rowShowSimple
                .findViewById(R.id.row_showsimple_text_status);
        TextView showYears = (TextView) rowShowSimple
                .findViewById(R.id.row_showsimple_text_years);
        TextView showCountry = (TextView) rowShowSimple
                .findViewById(R.id.row_showsimple_text_country);
        //ImageView iconStatus = (ImageView) rowShowSimple.findViewById(R.id.row_showsimple_icon_status);

        showTitle.setText(shows.get(position).getTitle());
        showStatus.setText(shows.get(position).getStatus());
        showYears.setText(shows.get(position).getYearsString());
        showCountry.setText(shows.get(position).getCountry());

        //TODO assign iconStatus here based on show status

        return rowShowSimple;
    }


}




Java Source Code List

com.indivisible.mightyv.activities.ShowAddActivity.java
com.indivisible.mightyv.activities.ShowSearchActivity.java
com.indivisible.mightyv.activities.testing.TestEpisodes.java
com.indivisible.mightyv.activities.testing.TestMenu.java
com.indivisible.mightyv.activities.testing.TestSearch.java
com.indivisible.mightyv.activities.testing.TestShows.java
com.indivisible.mightyv.data.DBMediaOpenHelper.java
com.indivisible.mightyv.data.EpisodeDataSource.java
com.indivisible.mightyv.data.Episode.java
com.indivisible.mightyv.data.ShowDataSource.java
com.indivisible.mightyv.data.Show.java
com.indivisible.mightyv.dialogs.SearchShowEntryDialog.java
com.indivisible.mightyv.dialogs.SearchShowResultsDialog.java
com.indivisible.mightyv.dialogs.SelectShowDialog.java
com.indivisible.mightyv.fragments.EpisodeListFragment.java
com.indivisible.mightyv.fragments.ShowAddButtonsFragment.java
com.indivisible.mightyv.fragments.ShowListFragment.java
com.indivisible.mightyv.fragments.ShowRageSearchFragment.java
com.indivisible.mightyv.util.Convert.java
com.indivisible.mightyv.util.EpisodeArrayAdapter.java
com.indivisible.mightyv.util.MyLog.java
com.indivisible.mightyv.util.ShowArrayAdapter.java
com.tvrage.api.EpisodeListXMLParser.java
com.tvrage.api.SearchXMLParser.java
com.tvrage.api.XMLParser.java