Commit ce0a88ea90f4de52fdde5a37ad915bf5b0794964

Authored by 陶汉栋
2 parents 34523b04 3808bda7

Merge branch 'yxb_dev' of http://git.shunzhi.net/taohd/parentwork into developer

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,10 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP @@ -55,7 +57,10 @@ 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_xqjc.setOnClickListener(this);
  62 + frame_zxxl = view.findViewById(R.id.frame_zxxl);
  63 + frame_zxxl.setOnClickListener(this);
59 ivCamera = view.findViewById(R.id.ivCamera); 64 ivCamera = view.findViewById(R.id.ivCamera);
60 tvLocalAddress = view.findViewById(R.id.tvLocalAddress); 65 tvLocalAddress = view.findViewById(R.id.tvLocalAddress);
61 textAndImg_xqjc = view.findViewById(R.id.textAndImg_xqjc); 66 textAndImg_xqjc = view.findViewById(R.id.textAndImg_xqjc);
@@ -94,7 +99,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP @@ -94,7 +99,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP
94 99
95 private void addTools(String districtName) { 100 private void addTools(String districtName) {
96 layout_control.measure(0, 0); 101 layout_control.measure(0, 0);
97 - mPresenter.getTools(layout_control,districtName ); 102 + mPresenter.getTools(layout_control, districtName);
98 103
99 } 104 }
100 105
@@ -152,10 +157,10 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP @@ -152,10 +157,10 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP
152 case R.id.ivCamera: 157 case R.id.ivCamera:
153 ToastUtils.showToast("功能暂不开放"); 158 ToastUtils.showToast("功能暂不开放");
154 break; 159 break;
155 - case R.id.textAndImg_xqjc: 160 + case R.id.frame_xqjc:
156 ToastUtils.showToast("功能暂不开放"); 161 ToastUtils.showToast("功能暂不开放");
157 break; 162 break;
158 - case R.id.textAndImg_zxlx: 163 + case R.id.frame_zxxl:
159 ToastUtils.showToast("功能暂不开放"); 164 ToastUtils.showToast("功能暂不开放");
160 break; 165 break;
161 default: 166 default:
@@ -192,7 +197,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP @@ -192,7 +197,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP
192 public void showTools(List<ToolBean> toolBeanList) { 197 public void showTools(List<ToolBean> toolBeanList) {
193 if (toolBeanList.size() > 0) { 198 if (toolBeanList.size() > 0) {
194 tvCourse1.setText(toolBeanList.get(0).toolName); 199 tvCourse1.setText(toolBeanList.get(0).toolName);
195 - GlideUtils.showImgWithDefaule(getActivity(), ivCourse1, toolBeanList.get(0).toolImage,R.drawable.activite1); 200 + GlideUtils.showImgWithDefaule(getActivity(), ivCourse1, toolBeanList.get(0).toolImage, R.drawable.activite1);
196 if (TextUtils.isEmpty(toolBeanList.get(0).toolUrl)) { 201 if (TextUtils.isEmpty(toolBeanList.get(0).toolUrl)) {
197 tvCourse1.setTag(AppConfig.BASE_URL_ORDER 202 tvCourse1.setTag(AppConfig.BASE_URL_ORDER
198 + "InformationDetail.aspx?id=" + toolBeanList.get(0).toolId + "&areaname=" + AppContext.getInstance().district); 203 + "InformationDetail.aspx?id=" + toolBeanList.get(0).toolId + "&areaname=" + AppContext.getInstance().district);
@@ -203,28 +208,31 @@ public class CePingFragment extends BaseMVPCompatFragment&lt;CepingContract.CePingP @@ -203,28 +208,31 @@ public class CePingFragment extends BaseMVPCompatFragment&lt;CepingContract.CePingP
203 208
204 if (toolBeanList.size() > 1) { 209 if (toolBeanList.size() > 1) {
205 tvCourse2.setText(toolBeanList.get(1).toolName); 210 tvCourse2.setText(toolBeanList.get(1).toolName);
206 - GlideUtils.showImgWithDefaule(getActivity(), ivCourse2, toolBeanList.get(1).toolImage,R.drawable.activite2); 211 + GlideUtils.showImgWithDefaule(getActivity(), ivCourse2, toolBeanList.get(1).toolImage, R.drawable.activite2);
207 if (TextUtils.isEmpty(toolBeanList.get(1).toolUrl)) { 212 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 - } 213 + tvCourse2.setTag(AppConfig.BASE_URL_ORDER
  214 + + "InformationDetail.aspx?id=" + toolBeanList.get(1).toolId + "&areaname=" + AppContext.getInstance().district);
  215 + } else {
  216 + tvCourse2.setTag(toolBeanList.get(1).toolUrl);
213 } 217 }
  218 + }
214 219
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 - } 220 + if(toolBeanList.size()>2)
  221 +
  222 + {
  223 + tvCourse3.setText(toolBeanList.get(2).toolName);
  224 + GlideUtils.showImgWithDefaule(getActivity(), ivCourse3, toolBeanList.get(2).toolImage, R.drawable.activite3);
  225 + if (TextUtils.isEmpty(toolBeanList.get(2).toolUrl)) {
  226 + tvCourse3.setTag(AppConfig.BASE_URL_ORDER
  227 + + "InformationDetail.aspx?id=" + toolBeanList.get(2).toolId + "&areaname=" + AppContext.getInstance().district);
  228 + } else {
  229 + tvCourse3.setTag(toolBeanList.get(2).toolUrl);
224 } 230 }
225 } 231 }
226 232
227 - public void refresh(){ 233 +}
  234 +
  235 + public void refresh() {
228 addTools(AppContext.getInstance().district); 236 addTools(AppContext.getInstance().district);
229 } 237 }
230 } 238 }