Android Open Source - Android-Multiple-file-Selector-Dialog Custom List






From Project

Back to project page Android-Multiple-file-Selector-Dialog.

License

The source code is released under:

MIT License

If you think the Android project Android-Multiple-file-Selector-Dialog 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 paul.arian.fileselector;
//from  w  w w . ja va  2 s  .  c  om
/**
 * Created by Paul on 3/7/14.
 */
import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.squareup.picasso.Picasso;

import java.io.File;

public class CustomList extends ArrayAdapter<String>{
    private final Activity context;
    private final String[] web;
    String ParentFolder;
    public CustomList(Activity context, String[] web,String path) {
        super(context, R.layout.list_single, web);
        this.context = context;
        this.web = web;
        ParentFolder = path;
    }
    @Override
    public View getView(int position, View view, ViewGroup parent) {
        LayoutInflater inflater = context.getLayoutInflater();
        View rowView= inflater.inflate(R.layout.list_single, null, true);
        TextView txtTitle = (TextView) rowView.findViewById(R.id.txt);
        ImageView imageView = (ImageView) rowView.findViewById(R.id.img);
        txtTitle.setText(web[position]);
        Picasso.with(context).load(
                new File(
                        ParentFolder+"/"+web[position]
                )).placeholder(R.drawable.document).resize(50, 50).into(imageView);
        return rowView;
    }
}




Java Source Code List

paul.arian.fileselector.CheckableRelativeLayout.java
paul.arian.fileselector.CustomListSingleOnly.java
paul.arian.fileselector.CustomList.java
paul.arian.fileselector.FileSelectionActivity.java
paul.arian.fileselector.FolderSelectionActivity.java