Commit 70b2f9e0fa5b4dcd4826e00074c96675bb51f946
1 parent
3305740f
Exists in
yxb_dev
and in
2 other branches
no message
Showing
22 changed files
with
47 additions
and
76 deletions
Show diff stats
app/src/main/java/com/shunzhi/parent/ui/fragment/CePingFragment.java
... | ... | @@ -193,7 +193,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP |
193 | 193 | public void showTools(List<ToolBean> toolBeanList) { |
194 | 194 | if (toolBeanList.size() > 0) { |
195 | 195 | tvCourse1.setText(toolBeanList.get(0).toolName); |
196 | - GlideUtils.showImg(getActivity(), ivCourse1, toolBeanList.get(0).toolImage); | |
196 | + GlideUtils.showImgWithDefaule(getActivity(), ivCourse1, toolBeanList.get(0).toolImage,R.drawable.activite1); | |
197 | 197 | if (TextUtils.isEmpty(toolBeanList.get(0).toolUrl)) { |
198 | 198 | tvCourse1.setTag(AppConfig.BASE_URL_ORDER |
199 | 199 | + "InformationDetail.aspx?id=" + toolBeanList.get(0).toolId + "&areaname=" + AppContext.getInstance().district); |
... | ... | @@ -204,7 +204,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP |
204 | 204 | |
205 | 205 | if (toolBeanList.size() > 1) { |
206 | 206 | tvCourse2.setText(toolBeanList.get(1).toolName); |
207 | - GlideUtils.showImg(getActivity(), ivCourse2, toolBeanList.get(1).toolImage); | |
207 | + GlideUtils.showImgWithDefaule(getActivity(), ivCourse2, toolBeanList.get(1).toolImage,R.drawable.activite2); | |
208 | 208 | if (TextUtils.isEmpty(toolBeanList.get(1).toolUrl)) { |
209 | 209 | tvCourse1.setTag(AppConfig.BASE_URL_ORDER |
210 | 210 | + "InformationDetail.aspx?id=" + toolBeanList.get(1).toolId + "&areaname=" + AppContext.getInstance().district); |
... | ... | @@ -215,7 +215,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP |
215 | 215 | |
216 | 216 | if (toolBeanList.size() > 2) { |
217 | 217 | tvCourse3.setText(toolBeanList.get(2).toolName); |
218 | - GlideUtils.showImg(getActivity(), ivCourse3, toolBeanList.get(2).toolImage); | |
218 | + GlideUtils.showImgWithDefaule(getActivity(), ivCourse3, toolBeanList.get(2).toolImage,R.drawable.activite3); | |
219 | 219 | if (TextUtils.isEmpty(toolBeanList.get(2).toolUrl)) { |
220 | 220 | tvCourse1.setTag(AppConfig.BASE_URL_ORDER |
221 | 221 | + "InformationDetail.aspx?id=" + toolBeanList.get(2).toolId + "&areaname=" + AppContext.getInstance().district); |
... | ... |
app/src/main/java/com/shunzhi/parent/util/GlideUtils.java
... | ... | @@ -26,4 +26,17 @@ public class GlideUtils { |
26 | 26 | } |
27 | 27 | } |
28 | 28 | |
29 | + | |
30 | + public static void showImgWithDefaule(Context context,ImageView imageView,String url,int defaultImg){ | |
31 | + if (!TextUtils.isEmpty(url)){ | |
32 | + if (url.startsWith("http")) | |
33 | + Glide.with(context).load(url).placeholder(defaultImg) | |
34 | + .into(imageView); | |
35 | + else Glide.with(context).load(AppConfig.BASE_URL_FILE+url).placeholder(defaultImg) | |
36 | + .into(imageView); | |
37 | + }else { | |
38 | + Glide.with(context).load(url).placeholder(defaultImg).centerCrop().into(imageView); | |
39 | + } | |
40 | + } | |
41 | + | |
29 | 42 | } |
... | ... |
app/src/main/java/com/shunzhi/parent/views/TextAndImgShowView.java
... | ... | @@ -54,9 +54,9 @@ public class TextAndImgShowView extends LinearLayout { |
54 | 54 | imgs = new int[]{normalDrawable, selectDrawable}; |
55 | 55 | } |
56 | 56 | |
57 | - public void addImgs(String imgUrl){ | |
57 | + public void addImgs(String imgUrl) { | |
58 | 58 | // Log.d("66666","imgUrl="+imgUrl); |
59 | - if (!imgUrl.startsWith("http"))imgUrl= AppConfig.BASE_URL_FILE+imgUrl; | |
59 | + if (!imgUrl.startsWith("http")) imgUrl = AppConfig.BASE_URL_FILE + imgUrl; | |
60 | 60 | Glide.with(getContext()).load(imgUrl).error(R.drawable.gxzt).into(image); |
61 | 61 | } |
62 | 62 | |
... | ... | @@ -80,13 +80,12 @@ public class TextAndImgShowView extends LinearLayout { |
80 | 80 | } |
81 | 81 | |
82 | 82 | public void setWidth(Activity activity, View layout_control) { |
83 | -// Log.d("66666", "layout_control=" + layout_control.getMeasuredWidth()); | |
84 | - LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT); | |
83 | + LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); | |
85 | 84 | params.width = (DisplayUtils.getScreenWidthPixels(activity) - |
86 | 85 | DisplayUtils.dp2px(layout_control.getPaddingLeft() + layout_control.getPaddingRight() |
87 | - )) / 4; | |
86 | + )) / 4; | |
88 | 87 | layout.setLayoutParams(params); |
89 | - LayoutParams params1 = new LayoutParams(DisplayUtils.px2dp(110),DisplayUtils.px2dp(110)); | |
88 | + LayoutParams params1 = new LayoutParams(DisplayUtils.px2dp(110), DisplayUtils.px2dp(110)); | |
90 | 89 | image.setLayoutParams(params1); |
91 | 90 | } |
92 | 91 | } |
... | ... |
56.3 KB
62 KB
74.1 KB
59.8 KB
47.8 KB
83.3 KB
101 KB
119 KB
app/src/main/res/drawable-xhdpi/xqjc.png
app/src/main/res/drawable-xhdpi/zxlx.png
145 KB
198 KB
217 KB
148 KB
109 KB
app/src/main/res/layout/fragment_ce_ping.xml
... | ... | @@ -83,13 +83,14 @@ |
83 | 83 | android:layout_marginRight="@dimen/size_dp_5" |
84 | 84 | android:layout_marginTop="@dimen/size_dp_20" |
85 | 85 | android:layout_weight="1" |
86 | - android:background="@drawable/shape_xueqing_radius8" | |
87 | - android:padding="@dimen/size_dp_5"> | |
86 | + android:background="@drawable/xqjc" | |
87 | + > | |
88 | 88 | |
89 | 89 | <com.shunzhi.parent.views.TextAndImgShowView |
90 | 90 | android:id="@+id/textAndImg_xqjc" |
91 | - android:layout_width="wrap_content" | |
92 | - android:layout_height="wrap_content" | |
91 | + android:visibility="gone" | |
92 | + android:layout_width="match_parent" | |
93 | + android:layout_height="match_parent" | |
93 | 94 | android:layout_gravity="center" |
94 | 95 | android:src="@drawable/xqjc" /> |
95 | 96 | |
... | ... | @@ -104,13 +105,14 @@ |
104 | 105 | android:layout_marginRight="@dimen/size_dp_10" |
105 | 106 | android:layout_marginTop="@dimen/size_dp_20" |
106 | 107 | android:layout_weight="1" |
107 | - android:background="@drawable/shape_zxlx_radius8" | |
108 | - android:padding="@dimen/size_dp_5"> | |
108 | + android:background="@drawable/zxlx" | |
109 | + > | |
109 | 110 | |
110 | 111 | <com.shunzhi.parent.views.TextAndImgShowView |
111 | 112 | android:id="@+id/textAndImg_zxlx" |
112 | - android:layout_width="wrap_content" | |
113 | - android:layout_height="wrap_content" | |
113 | + android:layout_width="match_parent" | |
114 | + android:visibility="gone" | |
115 | + android:layout_height="match_parent" | |
114 | 116 | android:layout_gravity="center" |
115 | 117 | android:src="@drawable/zxlx" /> |
116 | 118 | |
... | ... | @@ -167,7 +169,6 @@ |
167 | 169 | android:onClick="onClick" |
168 | 170 | android:background="@drawable/shape_xueqing_radius8"> |
169 | 171 | <ImageView |
170 | - android:layout_margin="@dimen/size_dp_8" | |
171 | 172 | android:layout_width="match_parent" |
172 | 173 | android:layout_height="match_parent" |
173 | 174 | android:scaleType="fitXY" |
... | ... | @@ -194,7 +195,7 @@ |
194 | 195 | android:layout_height="wrap_content" |
195 | 196 | android:layout_marginTop="@dimen/size_dp_5" |
196 | 197 | android:background="@drawable/shape_stroke_radius4_white" |
197 | - android:padding="@dimen/size_dp_5" | |
198 | + android:padding="@dimen/size_dp_2" | |
198 | 199 | android:text="点击参与" |
199 | 200 | android:textColor="@color/white" |
200 | 201 | android:textSize="@dimen/textSize14" /> |
... | ... | @@ -220,10 +221,10 @@ |
220 | 221 | android:onClick="onClick" |
221 | 222 | android:background="@drawable/shape_xueqing_radius8"> |
222 | 223 | <ImageView |
223 | - android:layout_margin="@dimen/size_dp_8" | |
224 | 224 | android:layout_width="match_parent" |
225 | 225 | android:layout_height="match_parent" |
226 | 226 | android:scaleType="fitXY" |
227 | + android:background="@drawable/shape_xueqing_radius8" | |
227 | 228 | android:id="@+id/ivCourse2" |
228 | 229 | /> |
229 | 230 | <LinearLayout |
... | ... | @@ -247,7 +248,7 @@ |
247 | 248 | android:layout_height="wrap_content" |
248 | 249 | android:layout_marginTop="@dimen/size_dp_5" |
249 | 250 | android:background="@drawable/shape_stroke_radius4_white" |
250 | - android:padding="@dimen/size_dp_5" | |
251 | + android:padding="@dimen/size_dp_2" | |
251 | 252 | android:text="点击参与" |
252 | 253 | android:textColor="@color/white" |
253 | 254 | android:textSize="@dimen/textSize14" /> |
... | ... | @@ -266,10 +267,10 @@ |
266 | 267 | android:onClick="onClick" |
267 | 268 | android:background="@drawable/shape_xueqing_radius8"> |
268 | 269 | <ImageView |
269 | - android:layout_margin="@dimen/size_dp_8" | |
270 | 270 | android:layout_width="match_parent" |
271 | 271 | android:layout_height="match_parent" |
272 | 272 | android:scaleType="fitXY" |
273 | + android:background="@drawable/shape_xueqing_radius8" | |
273 | 274 | android:id="@+id/ivCourse3" |
274 | 275 | /> |
275 | 276 | <LinearLayout |
... | ... | @@ -293,7 +294,7 @@ |
293 | 294 | android:layout_height="wrap_content" |
294 | 295 | android:layout_marginTop="@dimen/size_dp_5" |
295 | 296 | android:background="@drawable/shape_stroke_radius4_white" |
296 | - android:padding="@dimen/size_dp_5" | |
297 | + android:padding="@dimen/size_dp_2" | |
297 | 298 | android:text="点击参与" |
298 | 299 | android:textColor="@color/white" |
299 | 300 | android:textSize="@dimen/textSize14" /> |
... | ... |
app/src/main/res/layout/fragment_consult_one_level.xml
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | <android.support.v7.widget.RecyclerView |
10 | 10 | android:id="@+id/recyclerViewGrally" |
11 | 11 | android:layout_width="match_parent" |
12 | - android:layout_height="150dp" | |
12 | + android:layout_height="180dp" | |
13 | 13 | ></android.support.v7.widget.RecyclerView> |
14 | 14 | |
15 | 15 | <include layout="@layout/layout_textandimgshow"/> |
... | ... |
app/src/main/res/layout/fragment_zi_xun.xml
app/src/main/res/layout/layout_textandimgshow.xml
... | ... | @@ -2,9 +2,9 @@ |
2 | 2 | <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | 3 | android:layout_width="match_parent" |
4 | 4 | android:layout_height="wrap_content" |
5 | - android:orientation="horizontal" | |
6 | 5 | android:layout_margin="@dimen/size_dp_10" |
7 | 6 | android:background="@drawable/report_white" |
7 | + android:orientation="horizontal" | |
8 | 8 | android:scrollbars="none"> |
9 | 9 | |
10 | 10 | <HorizontalScrollView |
... | ... | @@ -13,59 +13,17 @@ |
13 | 13 | android:scrollbars="none" |
14 | 14 | |
15 | 15 | > |
16 | - <LinearLayout | |
17 | - android:id="@+id/layout_control" | |
18 | - android:layout_width="match_parent" | |
19 | - android:layout_height="wrap_content" | |
20 | - android:layout_marginBottom="@dimen/size_dp_5" | |
21 | - android:layout_marginTop="@dimen/size_dp_5" | |
22 | - android:background="@drawable/report_white" | |
23 | - android:elevation="@dimen/size_dp_3" | |
24 | - android:orientation="horizontal" | |
25 | - android:padding="@dimen/size_dp_10"> | |
26 | 16 | |
27 | - <!-- <LinearLayout | |
28 | - android:visibility="gone" | |
29 | - android:layout_width="wrap_content" | |
17 | + <LinearLayout | |
18 | + android:id="@+id/layout_control" | |
19 | + android:paddingTop="@dimen/size_dp_5" | |
20 | + android:paddingBottom="@dimen/size_dp_5" | |
21 | + android:layout_width="match_parent" | |
30 | 22 | android:layout_height="wrap_content" |
23 | + android:background="@drawable/report_white" | |
24 | + android:elevation="@dimen/size_dp_3" | |
31 | 25 | android:orientation="horizontal"> |
32 | 26 | |
33 | - <com.shunzhi.parent.views.TextAndImgShowView | |
34 | - android:id="@+id/textAndImg1" | |
35 | - android:layout_width="0dp" | |
36 | - android:layout_height="wrap_content" | |
37 | - android:layout_weight="1" | |
38 | - android:background="?android:selectableItemBackground"> | |
39 | - | |
40 | - </com.shunzhi.parent.views.TextAndImgShowView> | |
41 | - | |
42 | - <com.shunzhi.parent.views.TextAndImgShowView | |
43 | - android:id="@+id/textAndImg2" | |
44 | - android:layout_width="0dp" | |
45 | - android:layout_height="wrap_content" | |
46 | - android:layout_weight="1" | |
47 | - android:background="?android:selectableItemBackground"> | |
48 | - | |
49 | - </com.shunzhi.parent.views.TextAndImgShowView> | |
50 | - | |
51 | - <com.shunzhi.parent.views.TextAndImgShowView | |
52 | - android:id="@+id/textAndImg3" | |
53 | - android:layout_width="0dp" | |
54 | - android:layout_height="wrap_content" | |
55 | - android:layout_weight="1" | |
56 | - android:background="?android:selectableItemBackground"> | |
57 | - | |
58 | - </com.shunzhi.parent.views.TextAndImgShowView> | |
59 | - | |
60 | - <com.shunzhi.parent.views.TextAndImgShowView | |
61 | - android:id="@+id/textAndImg4" | |
62 | - android:layout_width="0dp" | |
63 | - android:layout_height="wrap_content" | |
64 | - android:layout_weight="1" | |
65 | - android:background="?android:selectableItemBackground"> | |
66 | - | |
67 | - </com.shunzhi.parent.views.TextAndImgShowView> | |
68 | - </LinearLayout>--> | |
69 | - </LinearLayout> | |
27 | + </LinearLayout> | |
70 | 28 | </HorizontalScrollView> |
71 | 29 | </android.support.design.widget.CoordinatorLayout> |
72 | 30 | \ No newline at end of file |
... | ... |