Android Open Source - Android-Project-Manager Voice Note Grid View Adapter






From Project

Back to project page Android-Project-Manager.

License

The source code is released under:

GNU General Public License

If you think the Android project Android-Project-Manager 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.vaquerosisd.adapters;
/*  w w w .jav  a 2 s .c  o  m*/
import java.util.ArrayList;

import com.vaquerosisd.projectmanager.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class VoiceNoteGridViewAdapter extends BaseAdapter {
  private Context context;
  int layoutResourceId;
  private ArrayList<String> files;
  
  public VoiceNoteGridViewAdapter(Context context,int layoutResourceId, ArrayList<String> files){
    this.context = context;
    this.layoutResourceId = layoutResourceId;
    this.files = files;
  }
  
  @Override
  public int getCount() {
    return files.size();
  }

  @Override
  public Object getItem(int position) {
    return files.get(position);
  }

  @Override
  public long getItemId(int position) {
    return 0;
  }

  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    View row = convertView;
    RecordHolder holder = null;
    if(row == null) {
      LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
       row = inflater.inflate(layoutResourceId, parent, false);
       
       holder = new RecordHolder();
       holder.txtTitle = (TextView) row.findViewById(R.id.gridView_Text);
         holder.imageItem = (ImageView) row.findViewById(R.id.gridView_Image);
         row.setTag(holder);
    } else {
      holder = (RecordHolder) row.getTag();
    }
      holder.txtTitle.setText(files.get(position));
      return row;
  }
  
  static class RecordHolder {
    TextView txtTitle;
    ImageView imageItem;
   }

}




Java Source Code List

com.vaquerosisd.adapters.ProjectListViewAdapter.java
com.vaquerosisd.adapters.TaskListViewAdapter.java
com.vaquerosisd.adapters.VideoNoteGridViewAdapter.java
com.vaquerosisd.adapters.VoiceNoteGridViewAdapter.java
com.vaquerosisd.database.DatabaseHelper.java
com.vaquerosisd.database.ProjectOperations.java
com.vaquerosisd.dialog.CustomStatus.java
com.vaquerosisd.dialog.DatePickerFragment.java
com.vaquerosisd.dialog.DeleteDialog.java
com.vaquerosisd.dialog.DeletePhotoDialog.java
com.vaquerosisd.dialog.DeleteTaskDialog.java
com.vaquerosisd.dialog.EditProject.java
com.vaquerosisd.fragments.TaskDescriptionFragment.java
com.vaquerosisd.fragments.VideoNotesFragment.java
com.vaquerosisd.fragments.VoiceNotesFragment.java
com.vaquerosisd.object.JsonWrapper.java
com.vaquerosisd.object.PhotoRef.java
com.vaquerosisd.object.Project.java
com.vaquerosisd.object.Task.java
com.vaquerosisd.object.User.java
com.vaquerosisd.object.WebServiceManager.java
com.vaquerosisd.projectmanager.About.java
com.vaquerosisd.projectmanager.ContentTask.java
com.vaquerosisd.projectmanager.Login.java
com.vaquerosisd.projectmanager.MainActivity.java
com.vaquerosisd.projectmanager.NewAccount.java
com.vaquerosisd.projectmanager.NewProject.java
com.vaquerosisd.projectmanager.NewTask.java
com.vaquerosisd.projectmanager.OnSwipeListener.java
com.vaquerosisd.projectmanager.PhotoManager.java
com.vaquerosisd.projectmanager.ProjectList.java
com.vaquerosisd.projectmanager.TaskList.java
com.vaquerosisd.projectmanager.WebserviceCallback.java
com.vaquerosisd.utils.FileOperations.java
com.vaquerosisd.utils.OnSwipeListener.java
com.vaquerosisd.utils.SpinnerUtil.java
com.vaquerosisd.utils.TabListener.java