| | |
| | | package cn.flightfeather.thirdapp.adapter; |
| | | |
| | | import android.app.Activity; |
| | | import android.app.DatePickerDialog; |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.os.Environment; |
| | | import android.support.v7.widget.RecyclerView; |
| | |
| | | |
| | | public class ProblemPromiseListAdapter extends RecyclerView.Adapter<ProblemPromiseListAdapter.ProblemPromiseListHolder>{ |
| | | private List<ProblemlistVo> problemlistVoList; |
| | | private Context context; |
| | | private Activity activity; |
| | | private LayoutInflater layoutInflater; |
| | | private ProblemlistVo problemlistVoCurrent; |
| | | private MediafileDao mediafileDao; |
| | |
| | | private AllBoolean allBoolean; |
| | | |
| | | |
| | | public ProblemPromiseListAdapter(List<ProblemlistVo> problemlistVoList, Context context, CommonApplication application,PromiseActivity promiseActivity,List<Mediafile> signMediaFileList, AllBoolean allBoolean) { |
| | | public ProblemPromiseListAdapter(List<ProblemlistVo> problemlistVoList, Activity activity, CommonApplication application, PromiseActivity promiseActivity, List<Mediafile> signMediaFileList, AllBoolean allBoolean) { |
| | | this.problemlistVoList = problemlistVoList; |
| | | this.context = context; |
| | | layoutInflater = LayoutInflater.from(context); |
| | | this.activity = activity; |
| | | layoutInflater = LayoutInflater.from(activity); |
| | | mediafileDao = application.getDaoSession().getMediafileDao(); |
| | | this.application =application; |
| | | this.promiseActivity = promiseActivity; |
| | |
| | | private void setImage(Mediafile mediafile,ImageView imageView){ |
| | | File file = new File(Environment.getExternalStorageDirectory(), (mediafile.getPath() + mediafile.getDescription())); |
| | | if (file.exists()){ |
| | | SetImageTask task1 = new SetImageTask(file,imageView); |
| | | SetImageTask task1 = new SetImageTask(file, imageView, activity); |
| | | task1.execute(); |
| | | }else { |
| | | DownloadAndSetImageTask task2 = new DownloadAndSetImageTask(mediafile,imageView,context); |
| | | DownloadAndSetImageTask task2 = new DownloadAndSetImageTask(mediafile,imageView, activity); |
| | | task2.execute(); |
| | | } |
| | | } |