Commit abc79afd7cf5814dfa8a278d1656df6f08466249
Exists in
yxb_dev
and in
2 other branches
Merge branch 'yxb_dev' of http://git.shunzhi.net/taohd/parentwork into yxb_dev
Showing
24 changed files
with
647 additions
and
53 deletions
Show diff stats
88.4 KB
app/src/main/java/com/shunzhi/parent/ui/fragment/CePingFragment.java
... | ... | @@ -4,6 +4,7 @@ import android.os.Bundle; |
4 | 4 | import android.support.annotation.NonNull; |
5 | 5 | import android.support.annotation.Nullable; |
6 | 6 | import android.view.View; |
7 | +import android.widget.FrameLayout; | |
7 | 8 | import android.widget.ImageView; |
8 | 9 | import android.widget.TextView; |
9 | 10 | |
... | ... | @@ -12,13 +13,17 @@ import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
12 | 13 | import com.shunzhi.parent.R; |
13 | 14 | import com.shunzhi.parent.views.TextAndImgShowView; |
14 | 15 | |
16 | +import butterknife.OnClick; | |
17 | + | |
15 | 18 | public class CePingFragment extends BaseMVPCompatFragment { |
16 | 19 | |
17 | 20 | TextView tvLocalAddress; |
18 | 21 | |
19 | 22 | ImageView ivCamera; |
20 | 23 | |
21 | - TextAndImgShowView textAndImg1,textAndImg2,textAndImg3,textAndImg4; | |
24 | + TextAndImgShowView textAndImg1,textAndImg2,textAndImg3,textAndImg4,textAndImg_xqjc,textAndImg_zxlx; | |
25 | + | |
26 | + FrameLayout frame_hot1; | |
22 | 27 | |
23 | 28 | @Override |
24 | 29 | public int getLayoutId() { |
... | ... | @@ -33,23 +38,40 @@ public class CePingFragment extends BaseMVPCompatFragment { |
33 | 38 | textAndImg2=view.findViewById(R.id.textAndImg2); |
34 | 39 | textAndImg3=view.findViewById(R.id.textAndImg3); |
35 | 40 | textAndImg4=view.findViewById(R.id.textAndImg4); |
41 | + textAndImg_xqjc=view.findViewById(R.id.textAndImg_xqjc); | |
42 | + textAndImg_zxlx=view.findViewById(R.id.textAndImg_zxlx); | |
43 | + frame_hot1=view.findViewById(R.id.frame_hot1); | |
44 | + | |
36 | 45 | |
37 | 46 | textAndImg1.setTextColor(R.color.textColor); |
38 | - textAndImg1.setText("工具一"); | |
39 | - textAndImg1.setImgs(R.drawable.play,R.drawable.play); | |
47 | + textAndImg1.setText("高校直通"); | |
48 | + textAndImg1.setImgs(R.drawable.play,R.drawable.gxzt); | |
49 | + textAndImg1.setSelect(true); | |
40 | 50 | |
41 | 51 | textAndImg2.setTextColor(R.color.textColor); |
42 | - textAndImg2.setText("工具二"); | |
43 | - textAndImg2.setImgs(R.drawable.play,R.drawable.play); | |
52 | + textAndImg2.setText("专业查询"); | |
53 | + textAndImg2.setImgs(R.drawable.play,R.drawable.zycx); | |
54 | + textAndImg2.setSelect(true); | |
44 | 55 | |
45 | 56 | textAndImg3.setTextColor(R.color.textColor); |
46 | - textAndImg3.setText("工具三"); | |
47 | - textAndImg3.setImgs(R.drawable.play,R.drawable.play); | |
57 | + textAndImg3.setText("传媒艺考"); | |
58 | + textAndImg3.setImgs(R.drawable.play,R.drawable.cmyk); | |
59 | + textAndImg3.setSelect(true); | |
48 | 60 | |
49 | 61 | textAndImg4.setTextColor(R.color.textColor); |
50 | - textAndImg4.setText("工具四"); | |
51 | - textAndImg4.setImgs(R.drawable.play,R.drawable.play); | |
62 | + textAndImg4.setText("排行榜"); | |
63 | + textAndImg4.setImgs(R.drawable.play,R.drawable.phb); | |
64 | + textAndImg4.setSelect(true); | |
52 | 65 | |
66 | + textAndImg_xqjc.setTextColor(R.color.white); | |
67 | + textAndImg_xqjc.setText("学情检测"); | |
68 | + textAndImg_xqjc.setImgs(R.drawable.xqjc,R.drawable.xqjc); | |
69 | + textAndImg_xqjc.setSelect(true); | |
70 | + | |
71 | + textAndImg_zxlx.setText("专项训练"); | |
72 | + textAndImg_zxlx.setTextColor(R.color.white); | |
73 | + textAndImg_zxlx.setImgs(R.drawable.zxlx,R.drawable.zxlx); | |
74 | + textAndImg_zxlx.setSelect(true); | |
53 | 75 | } |
54 | 76 | |
55 | 77 | @NonNull |
... | ... | @@ -57,4 +79,20 @@ public class CePingFragment extends BaseMVPCompatFragment { |
57 | 79 | public BasePresenter initPresenter() { |
58 | 80 | return null; |
59 | 81 | } |
82 | + | |
83 | + @OnClick({R.id.frame_hot1,R.id.frame_hot2,R.id.frame_hot3}) | |
84 | + void click(View view){ | |
85 | + switch (view.getId()){ | |
86 | + case R.id.frame_hot1://热门课程 | |
87 | + | |
88 | + break; | |
89 | + case R.id.frame_hot2: | |
90 | + | |
91 | + break; | |
92 | + case R.id.frame_hot3: | |
93 | + | |
94 | + break; | |
95 | + } | |
96 | + } | |
97 | + | |
60 | 98 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/ConsultFragment.java
1 | 1 | package com.shunzhi.parent.ui.fragment; |
2 | 2 | |
3 | 3 | import android.os.Bundle; |
4 | +import android.support.annotation.NonNull; | |
5 | +import android.support.annotation.Nullable; | |
4 | 6 | import android.support.v4.app.Fragment; |
5 | 7 | import android.view.LayoutInflater; |
6 | 8 | import android.view.View; |
7 | 9 | import android.view.ViewGroup; |
10 | +import android.widget.ImageView; | |
8 | 11 | |
12 | +import com.bumptech.glide.Glide; | |
13 | +import com.share.mvpsdk.base.BasePresenter; | |
14 | +import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; | |
9 | 15 | import com.shunzhi.parent.R; |
16 | +import com.shunzhi.parent.views.TextAndImgShowView; | |
17 | +import com.stx.xhb.xbanner.XBanner; | |
10 | 18 | |
11 | -public class ConsultFragment extends Fragment { | |
19 | +import java.io.ByteArrayOutputStream; | |
20 | +import java.io.IOException; | |
21 | +import java.io.InputStream; | |
22 | +import java.util.ArrayList; | |
23 | +import java.util.List; | |
12 | 24 | |
25 | +public class ConsultFragment extends BaseMVPCompatFragment { | |
26 | + | |
27 | + ImageView ivSearch; | |
28 | + | |
29 | + TextAndImgShowView textAndImg1,textAndImg2,textAndImg3,textAndImg4; | |
30 | + | |
31 | + XBanner xBanner; | |
32 | + | |
33 | + List<String> imgesUrl = new ArrayList<>(); | |
34 | + | |
35 | + @Override | |
36 | + public int getLayoutId() { | |
37 | + return R.layout.fragment_zi_xun; | |
38 | + } | |
39 | + | |
40 | + @Override | |
41 | + public void initUI(View view, @Nullable Bundle savedInstanceState) { | |
42 | + | |
43 | + ivSearch=view.findViewById(R.id.ivSearch); | |
44 | + textAndImg1=view.findViewById(R.id.textAndImg1); | |
45 | + textAndImg2=view.findViewById(R.id.textAndImg2); | |
46 | + textAndImg3=view.findViewById(R.id.textAndImg3); | |
47 | + textAndImg4=view.findViewById(R.id.textAndImg4); | |
48 | + xBanner=view.findViewById(R.id.xBanner); | |
49 | + | |
50 | + textAndImg1.setTextColor(R.color.textColor); | |
51 | + textAndImg1.setText("小学"); | |
52 | + textAndImg1.setImgs(R.drawable.play,R.drawable.xiaoxue); | |
53 | + textAndImg1.setSelect(true); | |
54 | + | |
55 | + textAndImg2.setTextColor(R.color.textColor); | |
56 | + textAndImg2.setText("中学"); | |
57 | + textAndImg2.setImgs(R.drawable.play,R.drawable.zhongxue); | |
58 | + textAndImg2.setSelect(true); | |
59 | + | |
60 | + textAndImg3.setTextColor(R.color.textColor); | |
61 | + textAndImg3.setText("高中"); | |
62 | + textAndImg3.setImgs(R.drawable.play,R.drawable.gaozhong); | |
63 | + textAndImg3.setSelect(true); | |
64 | + | |
65 | + textAndImg4.setTextColor(R.color.textColor); | |
66 | + textAndImg4.setText("家长"); | |
67 | + textAndImg4.setImgs(R.drawable.play,R.drawable.parent); | |
68 | + textAndImg4.setSelect(true); | |
69 | + | |
70 | + initBanners(); | |
71 | + } | |
72 | + | |
73 | + private void initBanners() { | |
74 | + | |
75 | + InputStream inputStream=getClass().getResourceAsStream("/assets/banners.png"); | |
76 | + try { | |
77 | + imgesUrl.add(new String(InputStreamToByte(inputStream))); | |
78 | + imgesUrl.add(new String(InputStreamToByte(inputStream))); | |
79 | + imgesUrl.add(new String(InputStreamToByte(inputStream))); | |
80 | + imgesUrl.add(new String(InputStreamToByte(inputStream))); | |
81 | + } catch (IOException e) { | |
82 | + e.printStackTrace(); | |
83 | + } | |
84 | + xBanner.setData(imgesUrl,null); | |
85 | + xBanner.setmAdapter(new XBanner.XBannerAdapter() { | |
86 | + @Override | |
87 | + public void loadBanner(XBanner banner, Object model, View view, int position) { | |
88 | + Glide.with(getActivity()).load(imgesUrl.get(position)).placeholder(R.drawable.ic_launcher_background) | |
89 | + .into((ImageView) view); | |
90 | + } | |
91 | + }); | |
92 | + | |
93 | + } | |
94 | + | |
95 | + @NonNull | |
13 | 96 | @Override |
14 | - public View onCreateView(LayoutInflater inflater, ViewGroup container, | |
15 | - Bundle savedInstanceState) { | |
16 | - // Inflate the layout for this fragment | |
17 | - return inflater.inflate(R.layout.fragment_zi_xun, container, false); | |
97 | + public BasePresenter initPresenter() { | |
98 | + return null; | |
18 | 99 | } |
19 | 100 | |
101 | + private byte[] InputStreamToByte(InputStream is) throws IOException { | |
102 | + ByteArrayOutputStream bytestream = new ByteArrayOutputStream(); | |
103 | + int ch; | |
104 | + while ((ch = is.read()) != -1) { | |
105 | + bytestream.write(ch); | |
106 | + } | |
107 | + byte imgdata[] = bytestream.toByteArray(); | |
108 | + bytestream.close(); | |
109 | + return imgdata; | |
110 | + | |
111 | + } | |
112 | + | |
113 | + @Override | |
114 | + public void onResume() { | |
115 | + super.onResume(); | |
116 | + xBanner.startAutoPlay(); | |
117 | + } | |
118 | + | |
119 | + @Override | |
120 | + public void onStop() { | |
121 | + super.onStop(); | |
122 | + xBanner.stopAutoPlay(); | |
123 | + } | |
20 | 124 | } | ... | ... |
5.19 KB
7.01 KB
4.71 KB
5.14 KB
4.25 KB
836 Bytes
4.96 KB
6.08 KB
1.37 KB
6.26 KB
2.3 KB
5.72 KB
app/src/main/res/drawable/shape_stroke_radius4_white.xml
0 → 100644
... | ... | @@ -0,0 +1,8 @@ |
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | +<shape xmlns:android="http://schemas.android.com/apk/res/android"> | |
3 | + | |
4 | + <corners android:radius="@dimen/dp_4"/> | |
5 | + | |
6 | + <stroke android:color="@color/white" android:width="0.5dp"/> | |
7 | + | |
8 | +</shape> | |
0 | 9 | \ No newline at end of file | ... | ... |
app/src/main/res/layout/fragment_ce_ping.xml
... | ... | @@ -3,97 +3,314 @@ |
3 | 3 | android:layout_width="match_parent" |
4 | 4 | android:layout_height="match_parent" |
5 | 5 | android:background="@color/bgColor" |
6 | + android:orientation="vertical" | |
6 | 7 | tools:context="com.shunzhi.parent.ui.fragment.CePingFragment"> |
7 | 8 | |
8 | 9 | <FrameLayout |
9 | 10 | android:layout_width="match_parent" |
10 | 11 | android:layout_height="?android:actionBarSize" |
11 | - android:background="@color/titleColor" | |
12 | - > | |
12 | + android:background="@color/titleColor"> | |
13 | + | |
13 | 14 | <TextView |
15 | + android:id="@+id/tvLocalAddress" | |
14 | 16 | android:layout_width="wrap_content" |
15 | 17 | android:layout_height="match_parent" |
16 | - android:text="杭州" | |
18 | + android:drawablePadding="@dimen/size_dp_5" | |
19 | + android:drawableRight="@drawable/pull" | |
17 | 20 | android:gravity="center" |
18 | - android:textColor="@color/textColor" | |
19 | 21 | android:paddingLeft="@dimen/size_dp_15" |
20 | - android:drawableRight="@drawable/pull" | |
21 | - android:drawablePadding="@dimen/size_dp_5" | |
22 | - android:textSize="@dimen/textSize16" | |
23 | - android:id="@+id/tvLocalAddress" | |
24 | - /> | |
22 | + android:text="杭州" | |
23 | + android:textColor="@color/textColor" | |
24 | + android:textSize="@dimen/textSize16" /> | |
25 | 25 | |
26 | 26 | <TextView |
27 | 27 | style="@style/TextView_Wrap_16" |
28 | 28 | android:layout_gravity="center" |
29 | 29 | android:gravity="center" |
30 | 30 | android:text="@string/ceping" |
31 | - android:textColor="@color/textColor" | |
32 | - /> | |
31 | + android:textColor="@color/textColor" /> | |
33 | 32 | |
34 | 33 | |
35 | 34 | <ImageView |
35 | + android:id="@+id/ivCamera" | |
36 | 36 | android:layout_width="wrap_content" |
37 | 37 | android:layout_height="match_parent" |
38 | - android:src="@drawable/camera" | |
39 | 38 | android:layout_gravity="right" |
40 | - android:paddingRight="@dimen/size_dp_15" | |
41 | 39 | android:paddingLeft="@dimen/size_dp_15" |
42 | - android:id="@+id/ivCamera" | |
43 | - /> | |
40 | + android:paddingRight="@dimen/size_dp_15" | |
41 | + android:src="@drawable/camera" /> | |
44 | 42 | |
45 | 43 | </FrameLayout> |
46 | 44 | |
47 | 45 | <LinearLayout |
48 | 46 | android:layout_width="match_parent" |
49 | - android:layout_height="wrap_content" | |
50 | - android:background="@drawable/shape_bg_radius8" | |
51 | - android:orientation="vertical" | |
47 | + android:layout_height="0dp" | |
52 | 48 | android:layout_margin="@dimen/size_dp_10" |
53 | - > | |
49 | + android:layout_weight="3" | |
50 | + android:background="@drawable/shape_bg_radius8" | |
51 | + android:orientation="vertical"> | |
54 | 52 | |
55 | 53 | |
54 | + <!--工具栏--> | |
56 | 55 | <LinearLayout |
56 | + android:layout_marginTop="@dimen/size_dp_5" | |
57 | + android:layout_marginBottom="@dimen/size_dp_5" | |
57 | 58 | android:layout_width="match_parent" |
58 | 59 | android:layout_height="wrap_content" |
59 | 60 | android:orientation="horizontal" |
60 | - > | |
61 | + android:padding="@dimen/size_dp_10"> | |
61 | 62 | |
62 | - <com.shunzhi.parent.views.TextAndImgShowView | |
63 | - android:id="@+id/textAndImg1" | |
64 | - android:layout_width="0dp" | |
65 | - android:layout_weight="1" | |
66 | - android:layout_height="wrap_content"> | |
63 | + <com.shunzhi.parent.views.TextAndImgShowView | |
64 | + android:id="@+id/textAndImg1" | |
65 | + android:layout_width="0dp" | |
66 | + android:layout_height="wrap_content" | |
67 | + android:layout_weight="1" | |
68 | + android:background="?android:selectableItemBackground"> | |
67 | 69 | |
68 | - </com.shunzhi.parent.views.TextAndImgShowView> | |
70 | + </com.shunzhi.parent.views.TextAndImgShowView> | |
69 | 71 | |
70 | 72 | <com.shunzhi.parent.views.TextAndImgShowView |
71 | 73 | android:id="@+id/textAndImg2" |
72 | 74 | android:layout_width="0dp" |
73 | - android:layout_weight="1" | |
74 | - android:layout_height="wrap_content"> | |
75 | + android:layout_height="wrap_content" | |
76 | + android:layout_weight="1"> | |
75 | 77 | |
76 | 78 | </com.shunzhi.parent.views.TextAndImgShowView> |
77 | 79 | |
78 | 80 | <com.shunzhi.parent.views.TextAndImgShowView |
79 | 81 | android:id="@+id/textAndImg3" |
80 | 82 | android:layout_width="0dp" |
81 | - android:layout_weight="1" | |
82 | - android:layout_height="wrap_content"> | |
83 | + android:layout_height="wrap_content" | |
84 | + android:layout_weight="1"> | |
83 | 85 | |
84 | 86 | </com.shunzhi.parent.views.TextAndImgShowView> |
85 | 87 | |
86 | 88 | <com.shunzhi.parent.views.TextAndImgShowView |
87 | 89 | android:id="@+id/textAndImg4" |
88 | 90 | android:layout_width="0dp" |
89 | - android:layout_weight="1" | |
90 | - android:layout_height="wrap_content"> | |
91 | + android:layout_height="wrap_content" | |
92 | + android:layout_weight="1"> | |
91 | 93 | |
92 | 94 | </com.shunzhi.parent.views.TextAndImgShowView> |
93 | 95 | |
94 | 96 | </LinearLayout> |
95 | 97 | |
98 | + <View | |
99 | + android:layout_width="match_parent" | |
100 | + android:layout_height="0.5dp" | |
101 | + android:layout_marginLeft="@dimen/size_dp_5" | |
102 | + android:layout_marginRight="@dimen/size_dp_5" | |
103 | + android:background="@color/bg_gray" /> | |
104 | + | |
105 | + <LinearLayout | |
106 | + android:layout_width="match_parent" | |
107 | + android:layout_height="match_parent" | |
108 | + android:gravity="center" | |
109 | + android:orientation="horizontal"> | |
110 | + | |
111 | + <FrameLayout | |
112 | + android:id="@+id/frame_xqjc" | |
113 | + android:layout_width="0dp" | |
114 | + android:layout_weight="1" | |
115 | + android:layout_height="match_parent" | |
116 | + android:layout_marginBottom="@dimen/size_dp_20" | |
117 | + android:layout_marginRight="@dimen/size_dp_10" | |
118 | + android:layout_marginLeft="@dimen/textSize20" | |
119 | + android:layout_marginTop="@dimen/size_dp_20" | |
120 | + android:background="@drawable/shape_xueqing_radius8" | |
121 | + android:padding="@dimen/size_dp_20"> | |
122 | + | |
123 | + <com.shunzhi.parent.views.TextAndImgShowView | |
124 | + android:id="@+id/textAndImg_xqjc" | |
125 | + android:layout_width="wrap_content" | |
126 | + android:layout_height="wrap_content" | |
127 | + android:layout_gravity="center" | |
128 | + android:src="@drawable/xqjc" /> | |
129 | + | |
130 | + </FrameLayout> | |
131 | + | |
132 | + <FrameLayout | |
133 | + android:id="@+id/frame_zxxl" | |
134 | + android:layout_width="0dp" | |
135 | + android:layout_weight="1" | |
136 | + android:layout_height="match_parent" | |
137 | + android:layout_marginBottom="@dimen/size_dp_20" | |
138 | + android:layout_marginLeft="@dimen/size_dp_10" | |
139 | + android:layout_marginTop="@dimen/size_dp_20" | |
140 | + android:background="@drawable/shape_zxlx_radius8" | |
141 | + android:layout_marginRight="@dimen/textSize20" | |
142 | + android:padding="@dimen/size_dp_20"> | |
143 | + | |
144 | + <com.shunzhi.parent.views.TextAndImgShowView | |
145 | + android:id="@+id/textAndImg_zxlx" | |
146 | + android:layout_width="wrap_content" | |
147 | + android:layout_height="wrap_content" | |
148 | + android:layout_gravity="center" | |
149 | + android:src="@drawable/zxlx" /> | |
150 | + | |
151 | + </FrameLayout> | |
152 | + | |
153 | + </LinearLayout> | |
154 | + | |
155 | + </LinearLayout> | |
156 | + | |
157 | + | |
158 | + <LinearLayout | |
159 | + android:layout_width="match_parent" | |
160 | + android:layout_height="wrap_content" | |
161 | + android:layout_marginLeft="@dimen/size_dp_10" | |
162 | + android:layout_marginRight="@dimen/size_dp_10" | |
163 | + android:gravity="center_vertical"> | |
164 | + | |
165 | + <View | |
166 | + android:layout_width="0dp" | |
167 | + android:layout_height="1dp" | |
168 | + android:layout_weight="1" | |
169 | + android:background="@color/huodong_blue"></View> | |
170 | + | |
171 | + <TextView | |
172 | + android:layout_width="wrap_content" | |
173 | + android:layout_height="wrap_content" | |
174 | + android:text="活动专栏" | |
175 | + android:textColor="@color/huodong_blue" | |
176 | + android:textSize="@dimen/textSize18" | |
177 | + | |
178 | + /> | |
179 | + | |
180 | + <View | |
181 | + android:layout_width="0dp" | |
182 | + android:layout_height="1dp" | |
183 | + android:layout_weight="1" | |
184 | + android:background="@color/huodong_blue"></View> | |
96 | 185 | |
97 | 186 | </LinearLayout> |
98 | 187 | |
188 | + <LinearLayout | |
189 | + android:layout_width="match_parent" | |
190 | + android:layout_height="0dp" | |
191 | + android:layout_margin="@dimen/size_dp_10" | |
192 | + android:layout_weight="2"> | |
193 | + | |
194 | + <FrameLayout | |
195 | + android:id="@+id/frame_hot1" | |
196 | + android:layout_width="0dp" | |
197 | + android:layout_height="match_parent" | |
198 | + android:layout_marginRight="@dimen/size_dp_5" | |
199 | + android:layout_weight="1" | |
200 | + android:background="@drawable/shape_xueqing_radius8"> | |
201 | + | |
202 | + <LinearLayout | |
203 | + android:layout_width="wrap_content" | |
204 | + android:layout_height="wrap_content" | |
205 | + android:layout_gravity="bottom|left" | |
206 | + android:layout_marginBottom="@dimen/size_dp_5" | |
207 | + android:layout_marginLeft="@dimen/size_dp_5" | |
208 | + android:orientation="vertical"> | |
209 | + | |
210 | + <TextView | |
211 | + android:layout_width="wrap_content" | |
212 | + android:layout_height="wrap_content" | |
213 | + android:text="热门课程" | |
214 | + android:textColor="@color/white" | |
215 | + android:textSize="@dimen/textSize16" /> | |
216 | + | |
217 | + <TextView | |
218 | + android:layout_width="wrap_content" | |
219 | + android:layout_height="wrap_content" | |
220 | + android:layout_marginTop="@dimen/size_dp_5" | |
221 | + android:background="@drawable/shape_stroke_radius4_white" | |
222 | + android:padding="@dimen/size_dp_5" | |
223 | + android:text="点击参与" | |
224 | + android:textColor="@color/white" | |
225 | + android:textSize="@dimen/textSize14" /> | |
226 | + | |
227 | + </LinearLayout> | |
228 | + | |
229 | + </FrameLayout> | |
230 | + | |
231 | + <LinearLayout | |
232 | + android:layout_width="0dp" | |
233 | + android:layout_height="match_parent" | |
234 | + android:layout_marginLeft="@dimen/size_dp_5" | |
235 | + android:layout_weight="1" | |
236 | + android:orientation="vertical"> | |
237 | + | |
238 | + <FrameLayout | |
239 | + android:id="@+id/frame_hot2" | |
240 | + android:layout_width="match_parent" | |
241 | + android:layout_height="0dp" | |
242 | + android:layout_marginBottom="@dimen/size_dp_5" | |
243 | + android:layout_marginRight="@dimen/size_dp_5" | |
244 | + android:layout_weight="1" | |
245 | + android:background="@drawable/shape_xueqing_radius8"> | |
246 | + | |
247 | + <LinearLayout | |
248 | + android:layout_width="wrap_content" | |
249 | + android:layout_height="wrap_content" | |
250 | + android:layout_gravity="bottom|left" | |
251 | + android:layout_marginBottom="@dimen/size_dp_5" | |
252 | + android:layout_marginLeft="@dimen/size_dp_5" | |
253 | + android:orientation="vertical"> | |
254 | + | |
255 | + <TextView | |
256 | + android:layout_width="wrap_content" | |
257 | + android:layout_height="wrap_content" | |
258 | + android:text="热门课程" | |
259 | + android:textColor="@color/white" | |
260 | + android:textSize="@dimen/textSize16" /> | |
261 | + | |
262 | + <TextView | |
263 | + android:layout_width="wrap_content" | |
264 | + android:layout_height="wrap_content" | |
265 | + android:layout_marginTop="@dimen/size_dp_5" | |
266 | + android:background="@drawable/shape_stroke_radius4_white" | |
267 | + android:padding="@dimen/size_dp_5" | |
268 | + android:text="点击参与" | |
269 | + android:textColor="@color/white" | |
270 | + android:textSize="@dimen/textSize14" /> | |
271 | + | |
272 | + </LinearLayout> | |
273 | + | |
274 | + </FrameLayout> | |
275 | + | |
276 | + <FrameLayout | |
277 | + android:id="@+id/frame_hot3" | |
278 | + android:layout_width="match_parent" | |
279 | + android:layout_height="0dp" | |
280 | + android:layout_marginRight="@dimen/size_dp_5" | |
281 | + android:layout_marginTop="@dimen/size_dp_5" | |
282 | + android:layout_weight="1" | |
283 | + android:background="@drawable/shape_xueqing_radius8"> | |
284 | + | |
285 | + <LinearLayout | |
286 | + android:layout_width="wrap_content" | |
287 | + android:layout_height="wrap_content" | |
288 | + android:layout_gravity="bottom|left" | |
289 | + android:layout_marginBottom="@dimen/size_dp_5" | |
290 | + android:layout_marginLeft="@dimen/size_dp_5" | |
291 | + android:orientation="vertical"> | |
292 | + | |
293 | + <TextView | |
294 | + android:layout_width="wrap_content" | |
295 | + android:layout_height="wrap_content" | |
296 | + android:text="热门课程" | |
297 | + android:textColor="@color/white" | |
298 | + android:textSize="@dimen/textSize16" /> | |
299 | + | |
300 | + <TextView | |
301 | + android:layout_width="wrap_content" | |
302 | + android:layout_height="wrap_content" | |
303 | + android:layout_marginTop="@dimen/size_dp_5" | |
304 | + android:background="@drawable/shape_stroke_radius4_white" | |
305 | + android:padding="@dimen/size_dp_5" | |
306 | + android:text="点击参与" | |
307 | + android:textColor="@color/white" | |
308 | + android:textSize="@dimen/textSize14" /> | |
309 | + | |
310 | + </LinearLayout> | |
311 | + | |
312 | + </FrameLayout> | |
313 | + | |
314 | + </LinearLayout> | |
315 | + </LinearLayout> | |
99 | 316 | </LinearLayout> | ... | ... |
app/src/main/res/layout/fragment_zi_xun.xml
1 | -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
1 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
2 | 2 | xmlns:tools="http://schemas.android.com/tools" |
3 | 3 | android:layout_width="match_parent" |
4 | 4 | android:layout_height="match_parent" |
5 | + android:orientation="vertical" | |
6 | + android:background="@color/bgColor" | |
5 | 7 | tools:context="com.shunzhi.parent.ui.fragment.ConsultFragment"> |
6 | 8 | |
7 | - <!-- TODO: Update blank fragment layout --> | |
8 | - <TextView | |
9 | + <LinearLayout | |
9 | 10 | android:layout_width="match_parent" |
10 | - android:layout_height="match_parent" | |
11 | - android:text="@string/hello_blank_fragment" /> | |
11 | + android:layout_height="?android:actionBarSize" | |
12 | + android:background="@color/titleColor"> | |
12 | 13 | |
13 | -</FrameLayout> | |
14 | + <TextView | |
15 | + android:id="@+id/tvLocalAddress" | |
16 | + android:layout_width="wrap_content" | |
17 | + android:layout_height="match_parent" | |
18 | + android:drawablePadding="@dimen/size_dp_5" | |
19 | + android:drawableRight="@drawable/pull" | |
20 | + android:gravity="center" | |
21 | + android:paddingLeft="@dimen/size_dp_15" | |
22 | + android:text="杭州" | |
23 | + android:textColor="@color/textColor" | |
24 | + android:textSize="@dimen/textSize16" /> | |
25 | + | |
26 | + <FrameLayout | |
27 | + android:focusableInTouchMode="true" | |
28 | + android:focusable="true" | |
29 | + android:layout_width="match_parent" | |
30 | + android:layout_height="match_parent"> | |
31 | + | |
32 | + <EditText | |
33 | + android:layout_width="match_parent" | |
34 | + android:layout_height="match_parent" | |
35 | + android:background="@drawable/shape_edit_radius4_white" | |
36 | + android:layout_margin="@dimen/size_dp_10" | |
37 | + android:hint="请输入搜索内容" | |
38 | + android:textSize="@dimen/textSize16" | |
39 | + android:gravity="center" | |
40 | + android:id="@+id/et_search" | |
41 | + /> | |
42 | + | |
43 | + <ImageView | |
44 | + android:id="@+id/ivSearch" | |
45 | + android:layout_width="wrap_content" | |
46 | + android:layout_height="match_parent" | |
47 | + android:layout_gravity="right" | |
48 | + android:paddingLeft="@dimen/size_dp_15" | |
49 | + android:paddingRight="@dimen/size_dp_15" | |
50 | + android:src="@drawable/search_black" /> | |
51 | + | |
52 | + </FrameLayout> | |
53 | + | |
54 | + | |
55 | + </LinearLayout> | |
56 | + | |
57 | +<com.stx.xhb.xbanner.XBanner | |
58 | + android:id="@+id/xBanner" | |
59 | + android:layout_width="match_parent" | |
60 | + android:layout_height="0dp" | |
61 | + android:layout_weight="2" | |
62 | + ></com.stx.xhb.xbanner.XBanner> | |
63 | + | |
64 | + <LinearLayout | |
65 | + android:layout_margin="@dimen/size_dp_10" | |
66 | + android:layout_marginTop="@dimen/size_dp_5" | |
67 | + android:layout_marginBottom="@dimen/size_dp_5" | |
68 | + android:layout_width="match_parent" | |
69 | + android:layout_height="wrap_content" | |
70 | + android:orientation="horizontal" | |
71 | + android:background="@color/white" | |
72 | + android:padding="@dimen/size_dp_10"> | |
73 | + | |
74 | + <com.shunzhi.parent.views.TextAndImgShowView | |
75 | + android:id="@+id/textAndImg1" | |
76 | + android:layout_width="0dp" | |
77 | + android:layout_height="wrap_content" | |
78 | + android:layout_weight="1" | |
79 | + android:background="?android:selectableItemBackground"> | |
80 | + | |
81 | + </com.shunzhi.parent.views.TextAndImgShowView> | |
82 | + | |
83 | + <com.shunzhi.parent.views.TextAndImgShowView | |
84 | + android:id="@+id/textAndImg2" | |
85 | + android:layout_width="0dp" | |
86 | + android:layout_height="wrap_content" | |
87 | + android:layout_weight="1"> | |
88 | + | |
89 | + </com.shunzhi.parent.views.TextAndImgShowView> | |
90 | + | |
91 | + <com.shunzhi.parent.views.TextAndImgShowView | |
92 | + android:id="@+id/textAndImg3" | |
93 | + android:layout_width="0dp" | |
94 | + android:layout_height="wrap_content" | |
95 | + android:layout_weight="1"> | |
96 | + | |
97 | + </com.shunzhi.parent.views.TextAndImgShowView> | |
98 | + | |
99 | + <com.shunzhi.parent.views.TextAndImgShowView | |
100 | + android:id="@+id/textAndImg4" | |
101 | + android:layout_width="0dp" | |
102 | + android:layout_height="wrap_content" | |
103 | + android:layout_weight="1"> | |
104 | + | |
105 | + </com.shunzhi.parent.views.TextAndImgShowView> | |
106 | + | |
107 | + </LinearLayout> | |
108 | + | |
109 | + <LinearLayout | |
110 | + android:layout_width="match_parent" | |
111 | + android:layout_height="0dp" | |
112 | + android:layout_weight="1" | |
113 | + android:orientation="vertical" | |
114 | + > | |
115 | + | |
116 | + <TextView | |
117 | + android:layout_width="wrap_content" | |
118 | + android:layout_height="wrap_content" | |
119 | + android:textSize="@dimen/textSize16" | |
120 | + android:textColor="@color/xueqing_blue" | |
121 | + android:text="@string/consult_huati" | |
122 | + android:layout_marginLeft="@dimen/size_dp_10" | |
123 | + /> | |
124 | + | |
125 | + <LinearLayout | |
126 | + android:layout_marginLeft="@dimen/size_dp_10" | |
127 | + android:layout_marginRight="@dimen/size_dp_10" | |
128 | + android:background="@color/white" | |
129 | + android:layout_width="match_parent" | |
130 | + android:layout_height="match_parent"> | |
131 | + | |
132 | + <LinearLayout | |
133 | + android:layout_width="0dp" | |
134 | + android:layout_height="match_parent" | |
135 | + android:layout_weight="4" | |
136 | + android:orientation="vertical" | |
137 | + android:padding="@dimen/size_dp_5" | |
138 | + > | |
139 | + | |
140 | + <TextView | |
141 | + android:layout_width="match_parent" | |
142 | + android:layout_height="0dp" | |
143 | + android:layout_weight="2" | |
144 | + android:gravity="center_vertical" | |
145 | + android:textColor="@color/textColor" | |
146 | + android:textSize="@dimen/textSize14" | |
147 | + android:text="学校初一段家长统一测试使用家长慧得到良好反馈评价" | |
148 | + android:maxLines="2" | |
149 | + android:ellipsize="end" | |
150 | + android:id="@+id/tvConsultTitle" | |
151 | + /> | |
152 | + <TextView | |
153 | + android:gravity="center_vertical" | |
154 | + android:layout_width="match_parent" | |
155 | + android:layout_height="0dp" | |
156 | + android:layout_weight="2" | |
157 | + android:singleLine="true" | |
158 | + android:textColor="@color/zxlx" | |
159 | + android:textSize="@dimen/textSize14" | |
160 | + android:text="家长表示对孩子学习情况更加了解" | |
161 | + android:maxLines="2" | |
162 | + android:ellipsize="end" | |
163 | + android:id="@+id/tvConsultContent" | |
164 | + /> | |
165 | + | |
166 | + <FrameLayout | |
167 | + android:layout_width="match_parent" | |
168 | + android:layout_height="0dp" | |
169 | + android:layout_weight="1" | |
170 | + > | |
171 | + <TextView | |
172 | + style="@style/TextView_Wrap_16" | |
173 | + android:textSize="@dimen/textSize14" | |
174 | + android:text="评论:30" | |
175 | + android:layout_gravity="center_vertical" | |
176 | + android:id="@+id/tvPingLunNums" | |
177 | + /> | |
178 | + <TextView | |
179 | + style="@style/TextView_Wrap_16" | |
180 | + android:textSize="@dimen/textSize14" | |
181 | + android:text="转发:50" | |
182 | + android:layout_gravity="right|center_vertical" | |
183 | + android:id="@+id/tvZhuanFaNums" | |
184 | + /> | |
185 | + </FrameLayout> | |
186 | + </LinearLayout> | |
187 | + | |
188 | + <ImageView | |
189 | + android:layout_width="0dp" | |
190 | + android:layout_height="match_parent" | |
191 | + android:layout_weight="2" | |
192 | + android:src="@color/xueqing_blue" | |
193 | + /> | |
194 | + </LinearLayout> | |
195 | + | |
196 | + </LinearLayout> | |
197 | + | |
198 | + | |
199 | + <FrameLayout | |
200 | + android:layout_width="match_parent" | |
201 | + android:layout_height="0dp" | |
202 | + android:layout_weight="2" | |
203 | + android:layout_margin="@dimen/size_dp_10" | |
204 | + > | |
205 | + <cn.jzvd.JZVideoPlayerStandard | |
206 | + android:id="@+id/videoplayer" | |
207 | + android:layout_width="match_parent" | |
208 | + android:layout_height="match_parent" | |
209 | + ></cn.jzvd.JZVideoPlayerStandard> | |
210 | + | |
211 | + </FrameLayout> | |
212 | + | |
213 | +</LinearLayout> | ... | ... |
app/src/main/res/values/colors.xml
... | ... | @@ -14,5 +14,7 @@ |
14 | 14 | <color name="titleColor">#C6DAFF</color> |
15 | 15 | <color name="bgColor">#F0EFF5</color> |
16 | 16 | <color name="textColor">#494947</color> |
17 | - | |
17 | + <color name="xueqing_blue">#ABC9FF</color> | |
18 | + <color name="zxlx">#1BE2E5</color> | |
19 | + <color name="huodong_blue">#ACD1FB</color> | |
18 | 20 | </resources> | ... | ... |
app/src/main/res/values/strings.xml
mvpsdk/build.gradle