Quellcode durchsuchen

绘制机构详情界面

316044749 vor 7 Jahren
Ursprung
Commit
22a53e082a

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

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

+ 25 - 0
app/src/main/java/com/ynstkz/shitu/android/activity/OrgDetailActivity.java

@@ -0,0 +1,25 @@
+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/24 15:31
+ */
+
+public class OrgDetailActivity extends TitleBarActivity{
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+    }
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.activity_org_detail;
+    }
+}

+ 9 - 0
app/src/main/java/com/ynstkz/shitu/android/adapter/HomeBannerAdapter.java

@@ -1,14 +1,17 @@
 package com.ynstkz.shitu.android.adapter;
 
 import android.content.Context;
+import android.content.Intent;
 import android.support.v4.view.PagerAdapter;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.ImageView;
+import android.widget.LinearLayout;
 
 import com.bumptech.glide.Glide;
 import com.ynstkz.shitu.android.R;
+import com.ynstkz.shitu.android.activity.OrgDetailActivity;
 import com.ynstkz.shitu.android.bean.HomeBannerBean;
 import com.ynstkz.shitu.android.exter.GlideRoundTransform;
 
@@ -55,6 +58,12 @@ public class HomeBannerAdapter extends PagerAdapter{
         ImageView imageView = (ImageView) LayoutInflater.from(context).inflate(R.layout.item_home_banner_img,null);
         Glide.with(context).load(listDatas.get(position).getUrl()).into(imageView);
         container.addView(imageView);
+        imageView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                context.startActivity(new Intent(context, OrgDetailActivity.class));
+            }
+        });
         return imageView;
     }
 }

+ 1 - 0
app/src/main/java/com/ynstkz/shitu/android/fragment/HomeFragment.java

@@ -243,5 +243,6 @@ public class HomeFragment extends BaseFragment implements PullToRefreshBase.OnRe
         super.onDestroyView();
         ButterKnife.unbind(this);
         EventBus.getDefault().unregister(this);
+        handler.removeCallbacksAndMessages(null);
     }
 }

+ 102 - 0
app/src/main/res/layout/activity_org_detail.xml

@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="utf-8"?>
+<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">
+
+    <include layout="@layout/view_title"/>
+
+    <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:orientation="vertical"
+        android:padding="@dimen/default_content_margin"
+        android:background="@color/white">
+
+        <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: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: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_height="wrap_content"
+                android:textSize="@dimen/company_12sp"
+                android:textColor="@color/color_666"
+                android:text="收藏:1234次"/>
+
+            <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_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="机构介绍"/>
+
+        <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>