|
|
@@ -1,14 +1,19 @@
|
|
|
package com.ynstkz.shitu.android.adapter;
|
|
|
|
|
|
import android.content.Context;
|
|
|
+import android.content.Intent;
|
|
|
import android.text.TextUtils;
|
|
|
+import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
import android.widget.ImageView;
|
|
|
+import android.widget.LinearLayout;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
import com.common.library.adapter.CCAdapterHolder;
|
|
|
import com.common.library.adapter.CCListAdapter;
|
|
|
import com.ynstkz.shitu.android.R;
|
|
|
+import com.ynstkz.shitu.android.activity.CourseDetailActivity;
|
|
|
+import com.ynstkz.shitu.android.bean.CourseItemBean;
|
|
|
import com.ynstkz.shitu.android.bean.OrgItemBean;
|
|
|
|
|
|
import java.util.List;
|
|
|
@@ -40,6 +45,7 @@ public class OrgListAdapter extends CCListAdapter<OrgItemBean> {
|
|
|
MaterialRatingBar rb_score;
|
|
|
TextView tv_regaddress;
|
|
|
TextView tvViewCount;
|
|
|
+ LinearLayout llCourseMain;
|
|
|
|
|
|
@Override
|
|
|
public int getResource() {
|
|
|
@@ -53,6 +59,7 @@ public class OrgListAdapter extends CCListAdapter<OrgItemBean> {
|
|
|
rb_score = convertView.findViewById(R.id.rb_score);
|
|
|
tv_regaddress = convertView.findViewById(R.id.tv_regaddress);
|
|
|
tvViewCount = convertView.findViewById(R.id.tv_view_count);
|
|
|
+ llCourseMain = convertView.findViewById(R.id.ll_course_main);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -66,6 +73,36 @@ public class OrgListAdapter extends CCListAdapter<OrgItemBean> {
|
|
|
} else {
|
|
|
tv_regaddress.setVisibility(View.GONE);
|
|
|
}
|
|
|
+
|
|
|
+ //课程信息
|
|
|
+ if (content.getCourseList() != null && content.getCourseList().size() > 0) {
|
|
|
+ llCourseMain.setVisibility(View.VISIBLE);
|
|
|
+ llCourseMain.removeAllViews();
|
|
|
+ for (int j = 0; j < content.getCourseList().size(); j++) {
|
|
|
+ View courseView = LayoutInflater.from(context).inflate(R.layout.item_org_course_list, null);
|
|
|
+ TextView tvCourseTitle = courseView.findViewById(R.id.tv_course_title);
|
|
|
+ TextView tvCoursePrice = courseView.findViewById(R.id.tv_course_price);
|
|
|
+ TextView tvCourseMarketprice = courseView.findViewById(R.id.tv_course_marketprice);
|
|
|
+
|
|
|
+ final CourseItemBean courseItemBean = content.getCourseList().get(j);
|
|
|
+ tvCourseTitle.setText(courseItemBean.getTitle());
|
|
|
+ tvCoursePrice.setText("¥" + courseItemBean.getPrice());
|
|
|
+ tvCourseMarketprice.setText("¥" + courseItemBean.getMarketPrice());
|
|
|
+
|
|
|
+ //课程详情
|
|
|
+ courseView.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View view) {
|
|
|
+ Intent intent = new Intent(context, CourseDetailActivity.class);
|
|
|
+ intent.putExtra("courseId", courseItemBean.getCourseId());
|
|
|
+ context.startActivity(intent);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ llCourseMain.addView(courseView);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ llCourseMain.setVisibility(View.GONE);
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
}
|