Commit 066e39d829baecc257139bae78446e5e89c7d49c
1 parent
011cb910
Exists in
yxb_dev
and in
2 other branches
no message
Showing
1 changed file
with
27 additions
and
21 deletions
Show diff stats
app/src/main/java/com/shunzhi/parent/ui/fragment/CePingFragment.java
@@ -10,6 +10,7 @@ import android.support.annotation.Nullable; | @@ -10,6 +10,7 @@ import android.support.annotation.Nullable; | ||
10 | import android.support.design.widget.FloatingActionButton; | 10 | import android.support.design.widget.FloatingActionButton; |
11 | import android.text.TextUtils; | 11 | import android.text.TextUtils; |
12 | import android.view.View; | 12 | import android.view.View; |
13 | +import android.widget.FrameLayout; | ||
13 | import android.widget.ImageView; | 14 | import android.widget.ImageView; |
14 | import android.widget.LinearLayout; | 15 | import android.widget.LinearLayout; |
15 | import android.widget.TextView; | 16 | import android.widget.TextView; |
@@ -47,6 +48,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -47,6 +48,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
47 | LinearLayout layout_control; | 48 | LinearLayout layout_control; |
48 | 49 | ||
49 | CityPicker cityPicker = null; | 50 | CityPicker cityPicker = null; |
51 | + FrameLayout frame_zxxl, frame_xqjc; | ||
50 | 52 | ||
51 | @Override | 53 | @Override |
52 | public int getLayoutId() { | 54 | public int getLayoutId() { |
@@ -55,7 +57,8 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -55,7 +57,8 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
55 | 57 | ||
56 | @Override | 58 | @Override |
57 | public void initUI(View view, @Nullable Bundle savedInstanceState) { | 59 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
58 | - | 60 | + frame_xqjc = view.findViewById(R.id.frame_xqjc); |
61 | + frame_zxxl = view.findViewById(R.id.frame_zxxl); | ||
59 | ivCamera = view.findViewById(R.id.ivCamera); | 62 | ivCamera = view.findViewById(R.id.ivCamera); |
60 | tvLocalAddress = view.findViewById(R.id.tvLocalAddress); | 63 | tvLocalAddress = view.findViewById(R.id.tvLocalAddress); |
61 | textAndImg_xqjc = view.findViewById(R.id.textAndImg_xqjc); | 64 | textAndImg_xqjc = view.findViewById(R.id.textAndImg_xqjc); |
@@ -94,7 +97,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -94,7 +97,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
94 | 97 | ||
95 | private void addTools(String districtName) { | 98 | private void addTools(String districtName) { |
96 | layout_control.measure(0, 0); | 99 | layout_control.measure(0, 0); |
97 | - mPresenter.getTools(layout_control,districtName ); | 100 | + mPresenter.getTools(layout_control, districtName); |
98 | 101 | ||
99 | } | 102 | } |
100 | 103 | ||
@@ -152,10 +155,10 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -152,10 +155,10 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
152 | case R.id.ivCamera: | 155 | case R.id.ivCamera: |
153 | ToastUtils.showToast("功能暂不开放"); | 156 | ToastUtils.showToast("功能暂不开放"); |
154 | break; | 157 | break; |
155 | - case R.id.textAndImg_xqjc: | 158 | + case R.id.frame_xqjc: |
156 | ToastUtils.showToast("功能暂不开放"); | 159 | ToastUtils.showToast("功能暂不开放"); |
157 | break; | 160 | break; |
158 | - case R.id.textAndImg_zxlx: | 161 | + case R.id.frame_zxxl: |
159 | ToastUtils.showToast("功能暂不开放"); | 162 | ToastUtils.showToast("功能暂不开放"); |
160 | break; | 163 | break; |
161 | default: | 164 | default: |
@@ -192,7 +195,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -192,7 +195,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
192 | public void showTools(List<ToolBean> toolBeanList) { | 195 | public void showTools(List<ToolBean> toolBeanList) { |
193 | if (toolBeanList.size() > 0) { | 196 | if (toolBeanList.size() > 0) { |
194 | tvCourse1.setText(toolBeanList.get(0).toolName); | 197 | tvCourse1.setText(toolBeanList.get(0).toolName); |
195 | - GlideUtils.showImgWithDefaule(getActivity(), ivCourse1, toolBeanList.get(0).toolImage,R.drawable.activite1); | 198 | + GlideUtils.showImgWithDefaule(getActivity(), ivCourse1, toolBeanList.get(0).toolImage, R.drawable.activite1); |
196 | if (TextUtils.isEmpty(toolBeanList.get(0).toolUrl)) { | 199 | if (TextUtils.isEmpty(toolBeanList.get(0).toolUrl)) { |
197 | tvCourse1.setTag(AppConfig.BASE_URL_ORDER | 200 | tvCourse1.setTag(AppConfig.BASE_URL_ORDER |
198 | + "InformationDetail.aspx?id=" + toolBeanList.get(0).toolId + "&areaname=" + AppContext.getInstance().district); | 201 | + "InformationDetail.aspx?id=" + toolBeanList.get(0).toolId + "&areaname=" + AppContext.getInstance().district); |
@@ -203,28 +206,31 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -203,28 +206,31 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
203 | 206 | ||
204 | if (toolBeanList.size() > 1) { | 207 | if (toolBeanList.size() > 1) { |
205 | tvCourse2.setText(toolBeanList.get(1).toolName); | 208 | tvCourse2.setText(toolBeanList.get(1).toolName); |
206 | - GlideUtils.showImgWithDefaule(getActivity(), ivCourse2, toolBeanList.get(1).toolImage,R.drawable.activite2); | 209 | + GlideUtils.showImgWithDefaule(getActivity(), ivCourse2, toolBeanList.get(1).toolImage, R.drawable.activite2); |
207 | if (TextUtils.isEmpty(toolBeanList.get(1).toolUrl)) { | 210 | if (TextUtils.isEmpty(toolBeanList.get(1).toolUrl)) { |
208 | - tvCourse1.setTag(AppConfig.BASE_URL_ORDER | ||
209 | - + "InformationDetail.aspx?id=" + toolBeanList.get(1).toolId + "&areaname=" + AppContext.getInstance().district); | ||
210 | - } else { | ||
211 | - tvCourse1.setTag(toolBeanList.get(1).toolUrl); | ||
212 | - } | 211 | + tvCourse2.setTag(AppConfig.BASE_URL_ORDER |
212 | + + "InformationDetail.aspx?id=" + toolBeanList.get(1).toolId + "&areaname=" + AppContext.getInstance().district); | ||
213 | + } else { | ||
214 | + tvCourse2.setTag(toolBeanList.get(1).toolUrl); | ||
213 | } | 215 | } |
216 | + } | ||
214 | 217 | ||
215 | - if (toolBeanList.size() > 2) { | ||
216 | - tvCourse3.setText(toolBeanList.get(2).toolName); | ||
217 | - GlideUtils.showImgWithDefaule(getActivity(), ivCourse3, toolBeanList.get(2).toolImage,R.drawable.activite3); | ||
218 | - if (TextUtils.isEmpty(toolBeanList.get(2).toolUrl)) { | ||
219 | - tvCourse1.setTag(AppConfig.BASE_URL_ORDER | ||
220 | - + "InformationDetail.aspx?id=" + toolBeanList.get(2).toolId + "&areaname=" + AppContext.getInstance().district); | ||
221 | - } else { | ||
222 | - tvCourse1.setTag(toolBeanList.get(2).toolUrl); | ||
223 | - } | 218 | + if(toolBeanList.size()>2) |
219 | + | ||
220 | + { | ||
221 | + tvCourse3.setText(toolBeanList.get(2).toolName); | ||
222 | + GlideUtils.showImgWithDefaule(getActivity(), ivCourse3, toolBeanList.get(2).toolImage, R.drawable.activite3); | ||
223 | + if (TextUtils.isEmpty(toolBeanList.get(2).toolUrl)) { | ||
224 | + tvCourse3.setTag(AppConfig.BASE_URL_ORDER | ||
225 | + + "InformationDetail.aspx?id=" + toolBeanList.get(2).toolId + "&areaname=" + AppContext.getInstance().district); | ||
226 | + } else { | ||
227 | + tvCourse3.setTag(toolBeanList.get(2).toolUrl); | ||
224 | } | 228 | } |
225 | } | 229 | } |
226 | 230 | ||
227 | - public void refresh(){ | 231 | +} |
232 | + | ||
233 | + public void refresh() { | ||
228 | addTools(AppContext.getInstance().district); | 234 | addTools(AppContext.getInstance().district); |
229 | } | 235 | } |
230 | } | 236 | } |