Android Open Source - MP3QuranForAndriod Player Playlist Item Adapter






From Project

Back to project page MP3QuranForAndriod.

License

The source code is released under:

You Can use all this project files for free only if you plan to create any islamic application ... This project is for any Islamic purpose....

If you think the Android project MP3QuranForAndriod 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.mos7af.mp3quran;
//w  w w. ja v a  2  s  .  co m
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import android.app.Activity;
import android.content.Context;
import android.os.Environment;
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 PlayerPlaylistItemAdapter extends BaseAdapter {
    
    private Activity activity;
    private ArrayList<HashMap<String, String>> surasList;
    private static LayoutInflater inflater=null;
    public ImageLoader imageLoader; 
    
    public PlayerPlaylistItemAdapter(Activity _source) {
        activity = _source;
        inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        imageLoader=new ImageLoader(activity.getApplicationContext());
    }
    public void SetData(ArrayList<HashMap<String, String>> _sura)
    {
      surasList = _sura;
    }

    public int getCount() {
        return surasList.size();
    }

    public Object getItem(int position) {
        return position;
    }

    public long getItemId(int position) {
        return position;
    }
    
    public View getView(int position, View convertView, ViewGroup parent) 
    {
        View vi=convertView;
       // if(convertView==null)
            vi = inflater.inflate(R.layout.ly_player_playlist_item, null);

        TextView title = (TextView)vi.findViewById(R.id.songTitle); 
        TextView artist = (TextView)vi.findViewById(R.id.artist); 
        ImageView thumb_image=(ImageView)vi.findViewById(R.id.address_book_item_call); 
        ImageView pin_icon=(ImageView)vi.findViewById(R.id.pin_icon); 
        
        HashMap<String, String> sura = new HashMap<String, String>();
        sura = surasList.get(position);
        
        title.setText(sura.get("suraNameAr")+" - "+sura.get("suraNameEn"));
        artist.setText(sura.get("reciterNameAr")+" - "+sura.get("reciterNameEn"));
        imageLoader.DisplayImage(sura.get("reciterImage"), thumb_image);
        
      String localPath = Environment.getExternalStorageDirectory()+"/MP3Quran/"+sura.get("reciterId");
    File file = new File(localPath,sura.get("suraId")+ ".mp3" );
    if (!file.exists()) {
      pin_icon.setVisibility(ImageView.INVISIBLE);
    }
        return vi;
    }
}




Java Source Code List

com.mos7af.mp3quran.DatabaseHandler.java
com.mos7af.mp3quran.FileCache.java
com.mos7af.mp3quran.IconContextMenu.java
com.mos7af.mp3quran.ImageLoader.java
com.mos7af.mp3quran.MP3Quran.java
com.mos7af.mp3quran.MemoryCache.java
com.mos7af.mp3quran.PlayListSurasActivity.java
com.mos7af.mp3quran.PlayerActivity.java
com.mos7af.mp3quran.PlayerPlayListActivity.java
com.mos7af.mp3quran.PlayerPlaylistItemAdapter.java
com.mos7af.mp3quran.PlaylistActivity.java
com.mos7af.mp3quran.PlaylistItemAdapter.java
com.mos7af.mp3quran.ReciterItemAdapter.java
com.mos7af.mp3quran.RecitersActivity.java
com.mos7af.mp3quran.SuraItemAdapter.java
com.mos7af.mp3quran.SurasActivity.java
com.mos7af.mp3quran.SuraslistManager.java
com.mos7af.mp3quran.Utilities.java
com.mos7af.mp3quran.Utils.java
com.mos7af.mp3quran.XMLParser.java