// Path: app/src/main/java/com/koma/filemanager/data/model/AudioFile.java
// public class AudioFile extends BaseFile {
//     private long mAlbumId;
//     private String mDisplayName;
// 
//     public AudioFile() {
//         super("", "", 0, null);
//         mDisplayName = "";
//     }
// 
//     public AudioFile(String fileName, String parent, long fileSize, Date fileModifiedTime, String displayName) {
//         super(fileName, parent, fileSize, fileModifiedTime);
//         mDisplayName = displayName;
//     }
// 
//     public void setDisplayName(String displayName) {
//         mDisplayName = displayName;
//     }
// 
//     public String getDisplayTime() {
//         return mDisplayName;
//     }
// 
//     public long getAlbumId() {
//         return mAlbumId;
//     }
// 
//     public void setAlbumId(long albumId) {
//         mAlbumId = albumId;
//     }
// }
// 
// Path: app/src/main/java/com/koma/filemanager/helper/MeidaHelper.java
// public class MeidaHelper {
//     private static final String TAG = "MediaHelper";
//     public static Uri getAlbumArtUri(long albumId) {
//         return ContentUris.withAppendedId(Uri.parse("content://media/external/audio/albumart"), albumId);
//     }
// 
// }
// 
// Path: app/src/main/java/com/koma/filemanager/util/FileUtils.java
// public class FileUtils {
//     // 直接使用系统内置API进行转换
//     public static String formatFileSize(long size) {
//         return Formatter.formatFileSize(FileManagerApplication.getContext(), size);
//     }
// 
//     public static String formatFileModifiedTime(Date filetime) {
//         SimpleDateFormat df = new SimpleDateFormat(android.text.format.DateFormat.getBestDateTimePattern(Locale.getDefault(),
//                 Constants.FILE_MODIFIED_TIME_FORMAT));
//         return df.format(filetime);
//     }
// }
// 
// Path: app/src/main/java/com/koma/filemanager/util/LogUtils.java
// public class LogUtils {
//     private static final boolean IS_DEBUG = true;
//     private static final String TAG = "FileManager";
// 
//     public static void i(String tag, String msg) {
//         if (IS_DEBUG) {
//             Log.i(TAG, buildString(tag, msg));
//         }
//     }
// 
//     public static void e(String tag, String msg) {
//         if (IS_DEBUG) {
//             Log.e(TAG, buildString(tag, msg));
//         }
//     }
// 
//     private static String buildString(String tag, String msg) {
//         StringBuilder sb = new StringBuilder(tag);
//         sb.append("----");
//         sb.append(msg);
//         return sb.toString();
//     }
// }


import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.koma.filemanager.R;
import com.koma.filemanager.data.model.AudioFile;
import com.koma.filemanager.helper.MeidaHelper;
import com.koma.filemanager.util.FileUtils;
import com.koma.filemanager.util.LogUtils;
import java.util.ArrayList;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
package com.koma.filemanager.audio;





/**
 * Created by koma on 11/24/16.
 */

public class AudioAdapter extends RecyclerView.Adapter<AudioAdapter.AudioViewHolder> {
    private static final String TAG = "AudioAdapter";
    private ArrayList<AudioFile> mData;
    private Context mContext;

    public AudioAdapter(Context context, ArrayList<AudioFile> data) {
        mContext = context;
        mData = data;
    }

    public void setData(ArrayList<AudioFile> data) {
        if (mData != null) {
            mData.clear();
        } else {
            mData = new ArrayList<>();
        }
        mData.addAll(data);
        notifyDataSetChanged();
    }

    @Override
    public AudioViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(mContext).inflate(R.layout.item_view, null);
        return new AudioViewHolder(view);
    }


    @Override
    public int getItemCount() {
        return mData == null ? 0 : mData.size();
    }

    @Override
    public void onBindViewHolder(AudioViewHolder holder, int position) {
// Path: app/src/main/java/com/koma/filemanager/data/model/AudioFile.java
// public class AudioFile extends BaseFile {
//     private long mAlbumId;
//     private String mDisplayName;
// 
//     public AudioFile() {
//         super("", "", 0, null);
//         mDisplayName = "";
//     }
// 
//     public AudioFile(String fileName, String parent, long fileSize, Date fileModifiedTime, String displayName) {
//         super(fileName, parent, fileSize, fileModifiedTime);
//         mDisplayName = displayName;
//     }
// 
//     public void setDisplayName(String displayName) {
//         mDisplayName = displayName;
//     }
// 
//     public String getDisplayTime() {
//         return mDisplayName;
//     }
// 
//     public long getAlbumId() {
//         return mAlbumId;
//     }
// 
//     public void setAlbumId(long albumId) {
//         mAlbumId = albumId;
//     }
// }
// 
// Path: app/src/main/java/com/koma/filemanager/helper/MeidaHelper.java
// public class MeidaHelper {
//     private static final String TAG = "MediaHelper";
//     public static Uri getAlbumArtUri(long albumId) {
//         return ContentUris.withAppendedId(Uri.parse("content://media/external/audio/albumart"), albumId);
//     }
// 
// }
// 
// Path: app/src/main/java/com/koma/filemanager/util/FileUtils.java
// public class FileUtils {
//     // 直接使用系统内置API进行转换
//     public static String formatFileSize(long size) {
//         return Formatter.formatFileSize(FileManagerApplication.getContext(), size);
//     }
// 
//     public static String formatFileModifiedTime(Date filetime) {
//         SimpleDateFormat df = new SimpleDateFormat(android.text.format.DateFormat.getBestDateTimePattern(Locale.getDefault(),
//                 Constants.FILE_MODIFIED_TIME_FORMAT));
//         return df.format(filetime);
//     }
// }
// 
// Path: app/src/main/java/com/koma/filemanager/util/LogUtils.java
// public class LogUtils {
//     private static final boolean IS_DEBUG = true;
//     private static final String TAG = "FileManager";
// 
//     public static void i(String tag, String msg) {
//         if (IS_DEBUG) {
//             Log.i(TAG, buildString(tag, msg));
//         }
//     }
// 
//     public static void e(String tag, String msg) {
//         if (IS_DEBUG) {
//             Log.e(TAG, buildString(tag, msg));
//         }
//     }
// 
//     private static String buildString(String tag, String msg) {
//         StringBuilder sb = new StringBuilder(tag);
//         sb.append("----");
//         sb.append(msg);
//         return sb.toString();
//     }
// }


// Path: app/src/main/java/com/koma/filemanager/audio/AudioAdapter.java
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.koma.filemanager.R;
import com.koma.filemanager.data.model.AudioFile;
import com.koma.filemanager.helper.MeidaHelper;
import com.koma.filemanager.util.FileUtils;
import com.koma.filemanager.util.LogUtils;
import java.util.ArrayList;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

package com.koma.filemanager.audio;





/**
 * Created by koma on 11/24/16.
 */

public class AudioAdapter extends RecyclerView.Adapter<AudioAdapter.AudioViewHolder> {
    private static final String TAG = "AudioAdapter";
    private ArrayList<AudioFile> mData;
    private Context mContext;

    public AudioAdapter(Context context, ArrayList<AudioFile> data) {
        mContext = context;
        mData = data;
    }

    public void setData(ArrayList<AudioFile> data) {
        if (mData != null) {
            mData.clear();
        } else {
            mData = new ArrayList<>();
        }
        mData.addAll(data);
        notifyDataSetChanged();
    }

    @Override
    public AudioViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(mContext).inflate(R.layout.item_view, null);
        return new AudioViewHolder(view);
    }


    @Override
    public int getItemCount() {
        return mData == null ? 0 : mData.size();
    }

    @Override
    public void onBindViewHolder(AudioViewHolder holder, int position) {
        Glide.with(mContext).load(MeidaHelper.getAlbumArtUri(mData.get(position).getAlbumId()))