Explorar el Código

绘制课程详情接口

316044749 hace 7 años
padre
commit
5e29e06a3f

+ 4 - 0
app/src/main/AndroidManifest.xml

@@ -123,6 +123,10 @@
         <activity android:name=".activity.OrgDetailActivity"
             android:screenOrientation="portrait"/>
 
+        <!--课程详情-->
+        <activity android:name=".activity.CourseDetailActivity"
+            android:screenOrientation="portrait"/>
+
         <!--定位服务-->
         <meta-data android:name="com.amap.api.v2.apikey" android:value="45fb5d8b52ba4f9f214bfb4fdaf81a72"/>
         <service android:name="com.amap.api.location.APSService"/>

+ 26 - 0
app/src/main/java/com/ynstkz/shitu/android/activity/CourseDetailActivity.java

@@ -0,0 +1,26 @@
+package com.ynstkz.shitu.android.activity;
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+
+import com.ynstkz.shitu.android.R;
+import com.ynstkz.shitu.android.base.TitleBarActivity;
+
+/**
+ * 作者:fuchangle on 2018/2/27 10:45
+ */
+
+public class CourseDetailActivity extends TitleBarActivity{
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+    }
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.activity_course_detail;
+    }
+
+
+}

+ 2 - 1
app/src/main/java/com/ynstkz/shitu/android/adapter/HomeBannerAdapter.java

@@ -11,6 +11,7 @@ import android.widget.LinearLayout;
 
 import com.bumptech.glide.Glide;
 import com.ynstkz.shitu.android.R;
+import com.ynstkz.shitu.android.activity.CourseDetailActivity;
 import com.ynstkz.shitu.android.activity.OrgDetailActivity;
 import com.ynstkz.shitu.android.bean.HomeBannerBean;
 import com.ynstkz.shitu.android.exter.GlideRoundTransform;
@@ -61,7 +62,7 @@ public class HomeBannerAdapter extends PagerAdapter{
         imageView.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View view) {
-                context.startActivity(new Intent(context, OrgDetailActivity.class));
+                context.startActivity(new Intent(context, CourseDetailActivity.class));
             }
         });
         return imageView;

+ 133 - 0
app/src/main/res/layout/activity_course_detail.xml

@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/default_bg">
+
+    <include
+        android:id="@+id/view_title"
+        layout="@layout/view_title"/>
+
+    <ScrollView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@+id/view_title">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical">
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="150dp"
+                android:background="@color/white">
+
+                <android.support.v4.view.ViewPager
+                    android:id="@+id/vp_banner"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent" />
+
+            </RelativeLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:background="@color/white"
+                android:orientation="vertical"
+                android:padding="@dimen/default_content_margin">
+
+
+                <TextView
+                    android:id="@+id/tv_org_name"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="XX培训学校-某某分校"
+                    android:textColor="@color/color_333"
+                    android:textSize="@dimen/company_16sp" />
+
+                <RelativeLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="@dimen/company_15dp">
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="收藏:1234次"
+                        android:textColor="@color/color_666"
+                        android:textSize="@dimen/company_12sp" />
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_alignParentRight="true"
+                        android:text="市场价 ¥2280" />
+
+                </RelativeLayout>
+
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/company_10dp"
+                android:background="@color/white"
+                android:orientation="vertical"
+                android:padding="@dimen/default_content_margin">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="机构介绍"
+                    android:textColor="@color/color_333"
+                    android:textSize="@dimen/company_16sp" />
+
+                <TextView
+                    android:id="@+id/tv_org_desc"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="@dimen/company_5dp"
+                    android:text="新东方创办于1993年,23年专注教育培训,累积培训学员超过2000万,从早教到成人,业务涵盖早教、学前、小学、中学、四六级、考研、出国考试、留学咨询、英语能力提升、国际游学、国际教育、图书、网络课堂等60多所学校,30000多名教职员工,旨在为学员提供一站式终身学习服务"
+                    android:textColor="@color/color_666"
+                    android:textSize="@dimen/company_14sp" />
+
+            </LinearLayout>
+
+        </LinearLayout>
+
+    </ScrollView>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/company_45dp"
+        android:layout_alignParentBottom="true"
+        android:orientation="horizontal"
+        android:background="@color/white">
+
+        <TextView
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:layout_gravity="center"
+            android:gravity="center"
+            android:background="@color/white"
+            android:textSize="@dimen/company_16sp"
+            android:textColor="@color/color_price"
+            android:text="¥1280元"/>
+
+        <TextView
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:layout_gravity="center"
+            android:gravity="center"
+            android:background="@color/main_color"
+            android:textSize="@dimen/company_16sp"
+            android:textColor="@color/white"
+            android:text="立即报名"/>
+
+    </LinearLayout>
+
+</RelativeLayout>

+ 164 - 76
app/src/main/res/layout/activity_org_detail.xml

@@ -2,101 +2,189 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:orientation="vertical"
-    android:background="@color/default_bg">
+    android:background="@color/default_bg"
+    android:orientation="vertical">
 
-    <include layout="@layout/view_title"/>
+    <include layout="@layout/view_title" />
 
-    <RelativeLayout
+    <ScrollView
         android:layout_width="match_parent"
-        android:layout_height="150dp"
-        android:background="@color/white">
+        android:layout_height="wrap_content">
 
-        <android.support.v4.view.ViewPager
-            android:id="@+id/vp_banner"
+        <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="match_parent" />
+            android:layout_height="wrap_content"
+            android:orientation="vertical">
 
-    </RelativeLayout>
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="150dp"
+                android:background="@color/white">
 
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:orientation="vertical"
-        android:padding="@dimen/default_content_margin"
-        android:background="@color/white">
+                <android.support.v4.view.ViewPager
+                    android:id="@+id/vp_banner"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent" />
 
-        <RelativeLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content">
+            </RelativeLayout>
 
-            <TextView
-                android:id="@+id/tv_org_name"
-                android:layout_width="wrap_content"
+            <LinearLayout
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:textSize="@dimen/company_16sp"
-                android:textColor="@color/color_333"
-                android:text="XX培训学校-某某分校"/>
-
-            <TextView
-                android:id="@+id/tv_org_phone"
-                android:layout_width="wrap_content"
+                android:background="@color/white"
+                android:orientation="vertical"
+                android:padding="@dimen/default_content_margin">
+
+                <RelativeLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content">
+
+                    <TextView
+                        android:id="@+id/tv_org_name"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="XX培训学校-某某分校"
+                        android:textColor="@color/color_333"
+                        android:textSize="@dimen/company_16sp" />
+
+                    <TextView
+                        android:id="@+id/tv_org_phone"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_alignParentRight="true"
+                        android:text="15812454678"
+                        android:textColor="@color/color_666"
+                        android:textSize="@dimen/company_14sp" />
+
+                </RelativeLayout>
+
+                <RelativeLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="@dimen/company_15dp">
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="收藏:1234次"
+                        android:textColor="@color/color_666"
+                        android:textSize="@dimen/company_12sp" />
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_alignParentRight="true"
+                        android:text="昆明市盘龙区XX街道某某大厦20号" />
+
+                </RelativeLayout>
+
+
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_alignParentRight="true"
-                android:textSize="@dimen/company_14sp"
-                android:textColor="@color/color_666"
-                android:text="15812454678"/>
-
-        </RelativeLayout>
-
-        <RelativeLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="@dimen/company_15dp">
-
-            <TextView
-                android:layout_width="wrap_content"
+                android:layout_marginTop="@dimen/company_10dp"
+                android:background="@color/white"
+                android:orientation="vertical"
+                android:padding="@dimen/default_content_margin">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="机构介绍"
+                    android:textColor="@color/color_333"
+                    android:textSize="@dimen/company_16sp" />
+
+                <TextView
+                    android:id="@+id/tv_org_desc"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="@dimen/company_5dp"
+                    android:text="新东方创办于1993年,23年专注教育培训,累积培训学员超过2000万,从早教到成人,业务涵盖早教、学前、小学、中学、四六级、考研、出国考试、留学咨询、英语能力提升、国际游学、国际教育、图书、网络课堂等60多所学校,30000多名教职员工,旨在为学员提供一站式终身学习服务"
+                    android:textColor="@color/color_666"
+                    android:textSize="@dimen/company_14sp" />
+
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:textSize="@dimen/company_12sp"
-                android:textColor="@color/color_666"
-                android:text="收藏:1234次"/>
-
-            <TextView
-                android:layout_width="wrap_content"
+                android:layout_marginTop="@dimen/company_10dp"
+                android:background="@color/white"
+                android:orientation="vertical"
+                android:padding="@dimen/default_content_margin">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="特色服务"
+                    android:textColor="@color/color_333"
+                    android:textSize="@dimen/company_16sp" />
+
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_alignParentRight="true"
-                android:text="昆明市盘龙区XX街道某某大厦20号"/>
+                android:layout_marginTop="@dimen/company_10dp"
+                android:background="@color/white"
+                android:orientation="vertical"
+                android:padding="@dimen/default_content_margin">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="课程"
+                    android:textColor="@color/color_333"
+                    android:textSize="@dimen/company_16sp" />
+
+                <ListView
+                    android:id="@+id/lv_course"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:divider="@null" />
+
+            </LinearLayout>
+
+
+            <LinearLayout
+                android:id="@+id/ll_comment"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/company_10dp"
+                android:background="@color/white"
+                android:orientation="vertical"
+                android:padding="@dimen/default_content_margin">
+
 
-        </RelativeLayout>
+            </LinearLayout>
 
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/company_10dp"
+                android:background="@color/white"
+                android:orientation="vertical"
+                android:padding="@dimen/default_content_margin">
 
-    </LinearLayout>
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="其他相近推荐"
+                    android:textColor="@color/color_333"
+                    android:textSize="@dimen/company_16sp" />
 
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="@dimen/company_10dp"
-        android:background="@color/white"
-        android:padding="@dimen/default_content_margin"
-        android:orientation="vertical">
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:textSize="@dimen/company_16sp"
-            android:textColor="@color/color_333"
-            android:text="机构介绍"/>
+                <ListView
+                    android:id="@+id/lv_recommend"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:divider="@null" />
 
-        <TextView
-            android:id="@+id/tv_org_desc"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="@dimen/company_10dp"
-            android:textSize="@dimen/company_14sp"
-            android:textColor="@color/color_666"
-            android:text="新东方创办于1993年,23年专注教育培训,累积培训学员超过2000万,从早教到成人,业务涵盖早教、学前、小学、中学、四六级、考研、出国考试、留学咨询、英语能力提升、国际游学、国际教育、图书、网络课堂等60多所学校,30000多名教职员工,旨在为学员提供一站式终身学习服务"/>
+            </LinearLayout>
 
-    </LinearLayout>
+        </LinearLayout>
 
+    </ScrollView>
 
 </LinearLayout>

+ 3 - 0
app/src/main/res/values/colors.xml

@@ -13,4 +13,7 @@
     <color name="color_999">#999999</color>
     <color name="color_666">#666666</color>
     <color name="color_333">#333333</color>
+
+    <color name="color_price">#ff695c</color>
+
 </resources>