Android Open Source - napping-player Video Group Adapter






From Project

Back to project page napping-player.

License

The source code is released under:

GNU General Public License

If you think the Android project napping-player 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

// Copyright (C) 2013 Werner Robitza
///*  www  .  j  a va  2 s . c  o m*/
// This file is part of NappingPlayer.
//
// NappingPlayer is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. 
//
// NappingPlayer is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with NappingPlayer.  If not, see <http://www.gnu.org/licenses/>.
//
// NappingPlayer was written at the University of Vienna by Werner Robitza.

package at.ac.univie.nappingplayer.grouping;

import java.util.List;

import android.content.Context;
import android.graphics.Color;
import android.view.View;
import android.view.ViewGroup;
import android.view.LayoutInflater;
import android.widget.ArrayAdapter;
import android.widget.TextView;

/**
 * Adapter that lists the groups in the action bar
 * @author werner
 *
 */
public class VideoGroupAdapter extends ArrayAdapter<VideoGroup> {
  private Context mContext;
  private int mResourceId;
  private List<VideoGroup> mVideoGroups;
  
  public VideoGroupAdapter(Context context, int textViewResourceId,List<VideoGroup> objects) {
    super(context, textViewResourceId, objects);
    this.mVideoGroups = objects;
    this.mContext = context;
    this.mResourceId = textViewResourceId;
  }
  
  @Override
  public View getView (int position, View convertView, ViewGroup parent) {
    View v = super.getView(position, convertView, parent);
    v.setBackgroundColor(Color.parseColor(mVideoGroups.get(position).getColor()));
    return v;
  }
  
  @Override
  public View getDropDownView (int position, View convertView, ViewGroup parent) {
    View v = super.getView(position, convertView, parent);
    // v.setBackgroundColor(Color.parseColor(VideoGroup.getColorForId(position)));
    v.setBackgroundColor(Color.parseColor(mVideoGroups.get(position).getColor()));
    return v;
  }
  
  
}




Java Source Code List

at.ac.univie.nappingplayer.CreditsActivity.java
at.ac.univie.nappingplayer.DataExplorerActivity.java
at.ac.univie.nappingplayer.NappingActivity.java
at.ac.univie.nappingplayer.PreferencesActivity.java
at.ac.univie.nappingplayer.StartActivity.java
at.ac.univie.nappingplayer.StartVideoListener.java
at.ac.univie.nappingplayer.VideoPlaylist.java
at.ac.univie.nappingplayer.ViewActivity.java
at.ac.univie.nappingplayer.grouping.SelectVideoListener.java
at.ac.univie.nappingplayer.grouping.VideoGroupAdapter.java
at.ac.univie.nappingplayer.grouping.VideoGroup.java
at.ac.univie.nappingplayer.util.Configuration.java
at.ac.univie.nappingplayer.util.IOUtil.java
at.ac.univie.nappingplayer.views.DataExplorerAdapter.java
at.ac.univie.nappingplayer.views.DataExplorerChild.java
at.ac.univie.nappingplayer.views.DataExplorerGroup.java
at.ac.univie.nappingplayer.views.VideoButtonView.java