Commit 252d2ee02c7e951394147eb0a20db1a0d201843a
1 parent
de5c40dd
Exists in
yxb_dev
and in
2 other branches
no message
Showing
2 changed files
with
17 additions
and
21 deletions
Show diff stats
app/src/main/java/com/shunzhi/parent/ui/fragment/CePingFragment.java
@@ -93,7 +93,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -93,7 +93,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
93 | 93 | ||
94 | private void addTools() { | 94 | private void addTools() { |
95 | layout_control.measure(0, 0); | 95 | layout_control.measure(0, 0); |
96 | - mPresenter.getTools(layout_control, AppContext.getInstance().district); | 96 | + mPresenter.getTools(layout_control, "余杭区"); |
97 | 97 | ||
98 | } | 98 | } |
99 | 99 | ||
@@ -101,8 +101,8 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -101,8 +101,8 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
101 | public void onResume() { | 101 | public void onResume() { |
102 | super.onResume(); | 102 | super.onResume(); |
103 | // if (!tvLocalAddress.getText().toString().equals(AppContext.getInstance().cityName)){ | 103 | // if (!tvLocalAddress.getText().toString().equals(AppContext.getInstance().cityName)){ |
104 | - tvLocalAddress.setText(AppContext.getInstance().district); | ||
105 | - addTools(); | 104 | + tvLocalAddress.setText(AppContext.getInstance().district); |
105 | + addTools(); | ||
106 | // } | 106 | // } |
107 | } | 107 | } |
108 | 108 | ||
@@ -134,16 +134,16 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -134,16 +134,16 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
134 | public void onClick(View view) { | 134 | public void onClick(View view) { |
135 | switch (view.getId()) { | 135 | switch (view.getId()) { |
136 | case R.id.frame_hot1://热门课程 | 136 | case R.id.frame_hot1://热门课程 |
137 | - if (tvCourse1.getTag()!=null) | ||
138 | - WebViewActivity.getInstance(getActivity(),tvCourse1.getTag().toString(),-1); | 137 | + if (tvCourse1.getTag() != null) |
138 | + WebViewActivity.getInstance(getActivity(), tvCourse1.getTag().toString(), -1); | ||
139 | break; | 139 | break; |
140 | case R.id.frame_hot2: | 140 | case R.id.frame_hot2: |
141 | - if (tvCourse2.getTag()!=null) | ||
142 | - WebViewActivity.getInstance(getActivity(),tvCourse2.getTag().toString(),-1); | 141 | + if (tvCourse2.getTag() != null) |
142 | + WebViewActivity.getInstance(getActivity(), tvCourse2.getTag().toString(), -1); | ||
143 | break; | 143 | break; |
144 | case R.id.frame_hot3: | 144 | case R.id.frame_hot3: |
145 | - if (tvCourse3.getTag()!=null) | ||
146 | - WebViewActivity.getInstance(getActivity(),tvCourse3.getTag().toString(),-1); | 145 | + if (tvCourse3.getTag() != null) |
146 | + WebViewActivity.getInstance(getActivity(), tvCourse3.getTag().toString(), -1); | ||
147 | break; | 147 | break; |
148 | case R.id.tvLocalAddress: | 148 | case R.id.tvLocalAddress: |
149 | // AppContext.getInstance().startLocation(); | 149 | // AppContext.getInstance().startLocation(); |
@@ -185,30 +185,27 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -185,30 +185,27 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
185 | public void getCity(String name) { | 185 | public void getCity(String name) { |
186 | tvLocalAddress.setText(name.split(" ")[2]); | 186 | tvLocalAddress.setText(name.split(" ")[2]); |
187 | mPresenter.getTools(layout_control, name.split(" ")[2]); | 187 | mPresenter.getTools(layout_control, name.split(" ")[2]); |
188 | - AppContext.getInstance().cityName=name.split(" ")[1]; | ||
189 | - AppContext.getInstance().district=name.split(" ")[2]; | 188 | + AppContext.getInstance().cityName = name.split(" ")[1]; |
189 | + AppContext.getInstance().district = name.split(" ")[2]; | ||
190 | } | 190 | } |
191 | 191 | ||
192 | @Override | 192 | @Override |
193 | public void showTools(List<ToolBean> toolBeanList) { | 193 | public void showTools(List<ToolBean> toolBeanList) { |
194 | - | ||
195 | if (toolBeanList.size() > 0) { | 194 | if (toolBeanList.size() > 0) { |
196 | tvCourse1.setText(toolBeanList.get(0).toolName); | 195 | tvCourse1.setText(toolBeanList.get(0).toolName); |
197 | - GlideUtils.showImg(getActivity(),ivCourse1,toolBeanList.get(0).toolImage); | ||
198 | - | 196 | + GlideUtils.showImg(getActivity(), ivCourse1, toolBeanList.get(0).toolImage); |
199 | tvCourse1.setTag(toolBeanList.get(0).toolUrl); | 197 | tvCourse1.setTag(toolBeanList.get(0).toolUrl); |
200 | } | 198 | } |
201 | 199 | ||
202 | if (toolBeanList.size() > 1) { | 200 | if (toolBeanList.size() > 1) { |
203 | tvCourse2.setText(toolBeanList.get(1).toolName); | 201 | tvCourse2.setText(toolBeanList.get(1).toolName); |
204 | - | ||
205 | - GlideUtils.showImg(getActivity(),ivCourse2,toolBeanList.get(1).toolImage); | 202 | + GlideUtils.showImg(getActivity(), ivCourse2, toolBeanList.get(1).toolImage); |
206 | tvCourse2.setTag(toolBeanList.get(1).toolUrl); | 203 | tvCourse2.setTag(toolBeanList.get(1).toolUrl); |
207 | } | 204 | } |
208 | 205 | ||
209 | if (toolBeanList.size() > 2) { | 206 | if (toolBeanList.size() > 2) { |
210 | tvCourse3.setText(toolBeanList.get(2).toolName); | 207 | tvCourse3.setText(toolBeanList.get(2).toolName); |
211 | - GlideUtils.showImg(getActivity(),ivCourse3,toolBeanList.get(2).toolImage); | 208 | + GlideUtils.showImg(getActivity(), ivCourse3, toolBeanList.get(2).toolImage); |
212 | tvCourse3.setTag(toolBeanList.get(2).toolUrl); | 209 | tvCourse3.setTag(toolBeanList.get(2).toolUrl); |
213 | } | 210 | } |
214 | } | 211 | } |
app/src/main/java/com/shunzhi/parent/views/TextAndImgShowView.java
@@ -5,7 +5,6 @@ import android.content.Context; | @@ -5,7 +5,6 @@ import android.content.Context; | ||
5 | import android.support.annotation.DrawableRes; | 5 | import android.support.annotation.DrawableRes; |
6 | import android.support.annotation.Nullable; | 6 | import android.support.annotation.Nullable; |
7 | import android.util.AttributeSet; | 7 | import android.util.AttributeSet; |
8 | -import android.util.Log; | ||
9 | import android.view.View; | 8 | import android.view.View; |
10 | import android.widget.FrameLayout; | 9 | import android.widget.FrameLayout; |
11 | import android.widget.ImageView; | 10 | import android.widget.ImageView; |
@@ -15,9 +14,7 @@ import android.widget.TextView; | @@ -15,9 +14,7 @@ import android.widget.TextView; | ||
15 | import com.bumptech.glide.Glide; | 14 | import com.bumptech.glide.Glide; |
16 | import com.share.mvpsdk.utils.DisplayUtils; | 15 | import com.share.mvpsdk.utils.DisplayUtils; |
17 | import com.shunzhi.parent.AppConfig; | 16 | import com.shunzhi.parent.AppConfig; |
18 | -import com.shunzhi.parent.AppContext; | ||
19 | import com.shunzhi.parent.R; | 17 | import com.shunzhi.parent.R; |
20 | -import com.shunzhi.parent.util.GlideUtils; | ||
21 | 18 | ||
22 | 19 | ||
23 | /** | 20 | /** |
@@ -84,10 +81,12 @@ public class TextAndImgShowView extends LinearLayout { | @@ -84,10 +81,12 @@ public class TextAndImgShowView extends LinearLayout { | ||
84 | 81 | ||
85 | public void setWidth(Activity activity, View layout_control) { | 82 | public void setWidth(Activity activity, View layout_control) { |
86 | // Log.d("66666", "layout_control=" + layout_control.getMeasuredWidth()); | 83 | // Log.d("66666", "layout_control=" + layout_control.getMeasuredWidth()); |
87 | - LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); | 84 | + LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT); |
88 | params.width = (DisplayUtils.getScreenWidthPixels(activity) - | 85 | params.width = (DisplayUtils.getScreenWidthPixels(activity) - |
89 | DisplayUtils.dp2px(layout_control.getPaddingLeft() + layout_control.getPaddingRight() | 86 | DisplayUtils.dp2px(layout_control.getPaddingLeft() + layout_control.getPaddingRight() |
90 | )) / 4; | 87 | )) / 4; |
91 | layout.setLayoutParams(params); | 88 | layout.setLayoutParams(params); |
89 | + LayoutParams params1 = new LayoutParams(52,52); | ||
90 | + image.setLayoutParams(params1); | ||
92 | } | 91 | } |
93 | } | 92 | } |