Android Open Source - AndFileTranser Browse File Adapter






From Project

Back to project page AndFileTranser.

License

The source code is released under:

GNU General Public License

If you think the Android project AndFileTranser 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.client;
//  w  w w. j  a  v  a  2s .c  om
import java.io.File;
import java.util.ArrayList;
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 BrowseFileAdapter extends BaseAdapter
{
  private Context mContext;
  /** ?????????????? **/
  public ArrayList<Boolean> mIsFileList = new ArrayList<Boolean>();
  /** ?????? **/
  public ArrayList<String> mFilesList = new ArrayList<String>();

  public BrowseFileAdapter(Context context, ArrayList<Boolean> mIsFileList, ArrayList<String> mFilesList) {
    this.mContext = context;
    this.mFilesList = mFilesList;
    this.mIsFileList = mIsFileList;
  }

  @Override
  public int getCount() {
    return mFilesList.size();
  }

  @Override
  public Object getItem(int arg0) {
    return null;
  }

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

  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    View view = LayoutInflater.from(mContext).inflate(R.layout.showfile_item, null);
    TextView textView = (TextView) view.findViewById(R.id.tv);
    String txt = mFilesList.get(position);
    txt = txt.substring(txt.lastIndexOf(File.separator));
    textView.setText(txt);
    ImageView iv = (ImageView) view.findViewById(R.id.iv);
    if (mIsFileList.get(position)) {
      iv.setBackgroundResource(R.drawable.icon);
    }
    return view;
  }
}




Java Source Code List

com.client.BrowseFileAdapter.java
com.client.MainActivity.java
com.client.SendFileAdapter.java
com.client.ShowFileActivity.java
com.client.UpdateInfo.java
com.server.AcceptFileAdapter.java
com.server.MainActivity.java
com.server.ServerThread.java
com.server.Server.java
com.server.UpdateInfo.java