From cb490245bc93b5bcf4d29823b227725e45309aad Mon Sep 17 00:00:00 2001 From: thebounaryforever <411747165@qq.com> Date: Fri, 29 Sep 2017 09:45:44 +0800 Subject: [PATCH 1/2] commit --- .../java/com/haoyu/app/activity/WSTeachingDiscussActivity.java | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/com/haoyu/app/activity/WSTeachingDiscussActivity.java b/app/src/main/java/com/haoyu/app/activity/WSTeachingDiscussActivity.java index 834d16f..8d21960 100644 --- a/app/src/main/java/com/haoyu/app/activity/WSTeachingDiscussActivity.java +++ b/app/src/main/java/com/haoyu/app/activity/WSTeachingDiscussActivity.java @@ -294,6 +294,7 @@ private boolean commitPost(String mainCount, String childCount, String activityI Map map = new HashMap<>(); map.put("activity.attributeMap[main_post_num].attrValue", mainCount); map.put("activity.attributeMap[sub_post_num].attrValue", childCount); + map.put("_method", "put"); String json = OkHttpClientManager.postAsString(context, url, map); Gson gson = new GsonBuilder().create(); BaseResponseResult result = gson.fromJson(json, BaseResponseResult.class); From 07394ac811547012985caab5bc38809652d99580 Mon Sep 17 00:00:00 2001 From: thebounaryforever <411747165@qq.com> Date: Sat, 30 Sep 2017 11:02:53 +0800 Subject: [PATCH 2/2] commit --- .../haoyu/app/adapter/CorrectmarkAdapter.java | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/com/haoyu/app/adapter/CorrectmarkAdapter.java b/app/src/main/java/com/haoyu/app/adapter/CorrectmarkAdapter.java index 52b4900..ae3bb1c 100644 --- a/app/src/main/java/com/haoyu/app/adapter/CorrectmarkAdapter.java +++ b/app/src/main/java/com/haoyu/app/adapter/CorrectmarkAdapter.java @@ -21,6 +21,7 @@ import com.haoyu.app.entity.MEvaluateItemSubmissions; import com.haoyu.app.entity.MEvaluateSubmission; import com.haoyu.app.gdei.student.R; +import com.haoyu.app.utils.Common; import com.haoyu.app.utils.Constants; import com.haoyu.app.utils.OkHttpClientManager; import com.haoyu.app.view.FullyLinearLayoutManager; @@ -251,23 +252,14 @@ public FileAdapter(List mDatas) { @Override public void onBindHoder(RecyclerHolder holder, MFileInfo mFileInfo, int position) { TextView mFileName = holder.obtainView(R.id.file_name); - ImageView mFileType = holder.obtainView(R.id.file_img); + ImageView iv_img = holder.obtainView(R.id.file_img); if (mFileInfosList.size() > 0) { final MFileInfo fileInfos = mFileInfosList.get(position); mFileName.setText(fileInfos.getFileName()); - String type = fileInfos.getUrl(); - if (type.endsWith(".doc") || type.endsWith(".docx")) { - mFileType.setImageResource(R.drawable.resources_doc); - } else if (type.endsWith(".xls") || type.endsWith(".xlsx")) { - mFileType.setImageResource(R.drawable.resources_xls); - } else if (type.endsWith(".ppt") || holder.equals(".pptx")) { - mFileType.setImageResource(R.drawable.resources_ppt); - } else if (type.endsWith("pdf")) { - mFileType.setImageResource(R.drawable.resources_ppt); - } else { - mFileType.setImageResource(R.drawable.resources_unknown); - } - mFileType.setOnClickListener(new View.OnClickListener() { + String url = fileInfos.getUrl(); + Common.setFileType(url, iv_img); + + iv_img.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) {