|
@@ -4,25 +4,34 @@ import android.content.Intent;
|
|
|
import android.os.Bundle;
|
|
|
import android.support.annotation.Nullable;
|
|
|
import android.support.v4.view.ViewPager;
|
|
|
+import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
import android.widget.AdapterView;
|
|
|
+import android.widget.GridView;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.LinearLayout;
|
|
|
import android.widget.ListView;
|
|
|
import android.widget.RelativeLayout;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
+import com.bumptech.glide.Glide;
|
|
|
import com.common.library.okhttp.callback.Callback;
|
|
|
+import com.common.library.utils.DateUtil;
|
|
|
import com.google.gson.Gson;
|
|
|
import com.ynstkz.shitu.android.R;
|
|
|
import com.ynstkz.shitu.android.adapter.OrgCourseListAdapter;
|
|
|
+import com.ynstkz.shitu.android.adapter.OrgDetailCommentPicAdapter;
|
|
|
import com.ynstkz.shitu.android.base.BaseBean;
|
|
|
import com.ynstkz.shitu.android.base.TitleBarActivity;
|
|
|
import com.ynstkz.shitu.android.bean.CourseItemBean;
|
|
|
+import com.ynstkz.shitu.android.bean.EvaluateListBean;
|
|
|
import com.ynstkz.shitu.android.bean.OrgDetailBean;
|
|
|
import com.ynstkz.shitu.android.data.RequestGroup;
|
|
|
import com.ynstkz.shitu.android.view.ListViewForScrollView;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
import butterknife.Bind;
|
|
|
import me.zhanghai.android.materialratingbar.MaterialRatingBar;
|
|
|
import okhttp3.Call;
|
|
@@ -67,6 +76,8 @@ public class OrgDetailActivity extends TitleBarActivity {
|
|
|
ImageView ivCollect;
|
|
|
@Bind(R.id.iv_share)
|
|
|
ImageView ivShare;
|
|
|
+ @Bind(R.id.ll_comment_main)
|
|
|
+ LinearLayout llCommentMain;
|
|
|
|
|
|
private int memberId;
|
|
|
private OrgDetailBean.DataBean dataBean;
|
|
@@ -135,7 +146,7 @@ public class OrgDetailActivity extends TitleBarActivity {
|
|
|
ivCollect.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
|
- collectOrg(memberId+"");
|
|
|
+ collectOrg(memberId + "");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -195,13 +206,45 @@ public class OrgDetailActivity extends TitleBarActivity {
|
|
|
lvCourse.setAdapter(orgCourseListAdapter);
|
|
|
orgCourseListAdapter.notifyDataSetChanged();
|
|
|
}
|
|
|
+
|
|
|
+ //评论列表
|
|
|
+ List<EvaluateListBean> evaluateList = dataBean.getEvaluateList();
|
|
|
+ if(evaluateList != null && evaluateList.size() > 0){
|
|
|
+ llCommentMain.setVisibility(View.VISIBLE);
|
|
|
+ llCommentMain.removeAllViews();
|
|
|
+ for(int i=0; i<evaluateList.size(); i++){
|
|
|
+ EvaluateListBean evaluateListBean = evaluateList.get(i);
|
|
|
+ View view = LayoutInflater.from(this).inflate(R.layout.item_orgdetail_comment, null);
|
|
|
+ ImageView ivHeadPic = view.findViewById(R.id.iv_headPic);
|
|
|
+ TextView tvUsername = view.findViewById(R.id.tv_username);
|
|
|
+ TextView tvTime = view.findViewById(R.id.tv_time);
|
|
|
+ MaterialRatingBar rbScore = view.findViewById(R.id.rb_score);
|
|
|
+ TextView tvCommentContent = view.findViewById(R.id.tv_comment_content);
|
|
|
+ GridView gvCommentPic = view.findViewById(R.id.gv_comment_pic);
|
|
|
+
|
|
|
+ Glide.with(this).load(evaluateListBean.getHeadPic()).into(ivHeadPic);
|
|
|
+ tvUsername.setText(evaluateListBean.getUserName());
|
|
|
+ tvTime.setText(DateUtil.format(new Date(evaluateListBean.getCreateTime()),DateUtil.DATE_TIME_FORMAT_YYYY年MM月DD日));
|
|
|
+ rbScore.setProgress(evaluateListBean.getScore());
|
|
|
+ tvCommentContent.setText(evaluateListBean.getContent());
|
|
|
+
|
|
|
+ OrgDetailCommentPicAdapter orgDetailCommentPicAdapter = new OrgDetailCommentPicAdapter(OrgDetailActivity.this, evaluateListBean.getEvaluatePicList());
|
|
|
+ gvCommentPic.setAdapter(orgDetailCommentPicAdapter);
|
|
|
+ orgDetailCommentPicAdapter.notifyDataSetChanged();
|
|
|
+
|
|
|
+ llCommentMain.addView(view);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ llCommentMain.setVisibility(View.GONE);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 收藏
|
|
|
+ *
|
|
|
* @param memberId
|
|
|
*/
|
|
|
- private void collectOrg(String memberId){
|
|
|
+ private void collectOrg(String memberId) {
|
|
|
|
|
|
RequestGroup.sumintCollect(memberId, new Callback() {
|
|
|
@Override
|
|
@@ -216,9 +259,9 @@ public class OrgDetailActivity extends TitleBarActivity {
|
|
|
|
|
|
@Override
|
|
|
public void onResponse(Object response, int id) {
|
|
|
- BaseBean baseBean = (BaseBean)response;
|
|
|
- if(baseBean != null){
|
|
|
- if("200".equals(baseBean.getCode())){
|
|
|
+ BaseBean baseBean = (BaseBean) response;
|
|
|
+ if (baseBean != null) {
|
|
|
+ if ("200".equals(baseBean.getCode())) {
|
|
|
|
|
|
}
|
|
|
showToast(baseBean.getMsg());
|