Commit 8c2638401b896de9a7b0f9daa7c4ced4289adc57
1 parent
c169928b
Exists in
yxb_dev
and in
2 other branches
no message
Showing
15 changed files
with
71 additions
and
37 deletions
Show diff stats
app/src/main/java/com/shunzhi/parent/adapter/MyConsultAdapter.java
@@ -3,6 +3,7 @@ package com.shunzhi.parent.adapter; | @@ -3,6 +3,7 @@ package com.shunzhi.parent.adapter; | ||
3 | import android.content.Context; | 3 | import android.content.Context; |
4 | import android.support.v7.widget.LinearLayoutManager; | 4 | import android.support.v7.widget.LinearLayoutManager; |
5 | import android.support.v7.widget.RecyclerView; | 5 | import android.support.v7.widget.RecyclerView; |
6 | +import android.util.Log; | ||
6 | import android.view.LayoutInflater; | 7 | import android.view.LayoutInflater; |
7 | import android.view.View; | 8 | import android.view.View; |
8 | import android.view.ViewGroup; | 9 | import android.view.ViewGroup; |
@@ -19,6 +20,7 @@ import com.shunzhi.parent.AppContext; | @@ -19,6 +20,7 @@ import com.shunzhi.parent.AppContext; | ||
19 | import com.shunzhi.parent.R; | 20 | import com.shunzhi.parent.R; |
20 | import com.shunzhi.parent.bean.channel.ChannelContextBean; | 21 | import com.shunzhi.parent.bean.channel.ChannelContextBean; |
21 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | 22 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; |
23 | +import com.shunzhi.parent.util.GlideUtils; | ||
22 | 24 | ||
23 | /** | 25 | /** |
24 | * Created by ToaHanDong on 2018/3/14. | 26 | * Created by ToaHanDong on 2018/3/14. |
@@ -70,8 +72,7 @@ public class MyConsultAdapter extends BaseRecyclerViewAdapter<ChannelContextBean | @@ -70,8 +72,7 @@ public class MyConsultAdapter extends BaseRecyclerViewAdapter<ChannelContextBean | ||
70 | if (object.getIsAds() == 1) { | 72 | if (object.getIsAds() == 1) { |
71 | frame_ad.setVisibility(View.VISIBLE); | 73 | frame_ad.setVisibility(View.VISIBLE); |
72 | normal_content.setVisibility(View.GONE); | 74 | normal_content.setVisibility(View.GONE); |
73 | - Glide.with(mContext).load(object.getImage()).placeholder(R.color.xueqing_blue) | ||
74 | - .into(iv_consult); | 75 | + GlideUtils.showImg(mContext,iv_consult,object.getImage()); |
75 | frame_ad.setOnClickListener(new View.OnClickListener() { | 76 | frame_ad.setOnClickListener(new View.OnClickListener() { |
76 | @Override | 77 | @Override |
77 | public void onClick(View v) { | 78 | public void onClick(View v) { |
@@ -83,8 +84,7 @@ public class MyConsultAdapter extends BaseRecyclerViewAdapter<ChannelContextBean | @@ -83,8 +84,7 @@ public class MyConsultAdapter extends BaseRecyclerViewAdapter<ChannelContextBean | ||
83 | normal_content.setVisibility(View.VISIBLE); | 84 | normal_content.setVisibility(View.VISIBLE); |
84 | tvConsultTitle.setText(object.getTitle()); | 85 | tvConsultTitle.setText(object.getTitle()); |
85 | tvConsultContent.setText(object.getContent()); | 86 | tvConsultContent.setText(object.getContent()); |
86 | - Glide.with(mContext).load(object.getImage()).placeholder(R.color.xueqing_blue) | ||
87 | - .into(iv_consult); | 87 | + GlideUtils.showImg(mContext,iv_consult,object.getImage()); |
88 | normal_content.setOnClickListener(new View.OnClickListener() { | 88 | normal_content.setOnClickListener(new View.OnClickListener() { |
89 | @Override | 89 | @Override |
90 | public void onClick(View v) { | 90 | public void onClick(View v) { |
app/src/main/java/com/shunzhi/parent/presenter/loginandregister/LoginAndRegisterPresenter.java
@@ -158,7 +158,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -158,7 +158,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
158 | mRxManager.register(mIModel.getUserInfo(mobile, school_id, captcha).subscribe(new Consumer<UserInfo>() { | 158 | mRxManager.register(mIModel.getUserInfo(mobile, school_id, captcha).subscribe(new Consumer<UserInfo>() { |
159 | @Override | 159 | @Override |
160 | public void accept(UserInfo userInfo) throws Exception { | 160 | public void accept(UserInfo userInfo) throws Exception { |
161 | - Log.d("6666", "userInfo=" + userInfo.toString()); | 161 | +// Log.d("6666", "userInfo=" + userInfo.toString()); |
162 | if (userInfo != null) { | 162 | if (userInfo != null) { |
163 | CurrentBean currentBean = userInfo.getData(); | 163 | CurrentBean currentBean = userInfo.getData(); |
164 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, currentBean.getMobile()); | 164 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, currentBean.getMobile()); |
app/src/main/java/com/shunzhi/parent/ui/activity/PersonInfoActivity.java
@@ -18,6 +18,7 @@ import com.shunzhi.parent.AppContext; | @@ -18,6 +18,7 @@ import com.shunzhi.parent.AppContext; | ||
18 | import com.shunzhi.parent.R; | 18 | import com.shunzhi.parent.R; |
19 | import com.shunzhi.parent.contract.mine.PersonInfoContract; | 19 | import com.shunzhi.parent.contract.mine.PersonInfoContract; |
20 | import com.shunzhi.parent.presenter.mine.PersonInfoPrasenter; | 20 | import com.shunzhi.parent.presenter.mine.PersonInfoPrasenter; |
21 | +import com.shunzhi.parent.util.GlideUtils; | ||
21 | 22 | ||
22 | /** | 23 | /** |
23 | * Created by Administrator on 2018/3/10 0010. | 24 | * Created by Administrator on 2018/3/10 0010. |
@@ -56,9 +57,11 @@ public class PersonInfoActivity extends BaseMVPCompatActivity<PersonInfoContract | @@ -56,9 +57,11 @@ public class PersonInfoActivity extends BaseMVPCompatActivity<PersonInfoContract | ||
56 | private void initInfo() { | 57 | private void initInfo() { |
57 | String url = AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_IMAGE); | 58 | String url = AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_IMAGE); |
58 | if (!TextUtils.isEmpty(url)) { | 59 | if (!TextUtils.isEmpty(url)) { |
59 | - Glide.with(this).load(url).asBitmap().error(R.drawable.test).centerCrop().into(user_image); | 60 | + GlideUtils.showImg(this,user_image,url); |
61 | +// Glide.with(this).load(url).asBitmap().error(R.drawable.test).centerCrop().into(user_image); | ||
60 | } else { | 62 | } else { |
61 | - Glide.with(this).load(R.drawable.test).centerCrop().into(user_image); | 63 | +// Glide.with(this).load(R.drawable.test).centerCrop().into(user_image); |
64 | + GlideUtils.showImg(this,user_image,url); | ||
62 | } | 65 | } |
63 | user_image.setCornerRadius(20); | 66 | user_image.setCornerRadius(20); |
64 | user_image.setOval(true); | 67 | user_image.setOval(true); |
app/src/main/java/com/shunzhi/parent/ui/activity/consult/ConsultOneLevelActivity.java
@@ -56,7 +56,6 @@ public class ConsultOneLevelActivity extends BaseCompatActivity implements View. | @@ -56,7 +56,6 @@ public class ConsultOneLevelActivity extends BaseCompatActivity implements View. | ||
56 | Bundle bundle = new Bundle(); | 56 | Bundle bundle = new Bundle(); |
57 | bundle.putString("channel", channel); | 57 | bundle.putString("channel", channel); |
58 | consultOneLevelFragment.setArguments(bundle); | 58 | consultOneLevelFragment.setArguments(bundle); |
59 | -// ToastUtils.showToast("channel=" + channel); | ||
60 | fragmentTransaction = getSupportFragmentManager().beginTransaction(); | 59 | fragmentTransaction = getSupportFragmentManager().beginTransaction(); |
61 | fragmentTransaction.add(R.id.frame_consult, consultOneLevelFragment) | 60 | fragmentTransaction.add(R.id.frame_consult, consultOneLevelFragment) |
62 | .show(consultOneLevelFragment).commit(); | 61 | .show(consultOneLevelFragment).commit(); |
app/src/main/java/com/shunzhi/parent/ui/activity/mywebview/WebViewActivity.java
@@ -111,7 +111,6 @@ public class WebViewActivity extends BaseCompatActivity { | @@ -111,7 +111,6 @@ public class WebViewActivity extends BaseCompatActivity { | ||
111 | 111 | ||
112 | initWebView(); | 112 | initWebView(); |
113 | initWebSetting(nesteScrollWebView.getSettings()); | 113 | initWebSetting(nesteScrollWebView.getSettings()); |
114 | - ToastUtils.showToast(getIntent().getStringExtra("url")); | ||
115 | nesteScrollWebView.loadUrl(getIntent().getStringExtra("url")); | 114 | nesteScrollWebView.loadUrl(getIntent().getStringExtra("url")); |
116 | } | 115 | } |
117 | 116 |
app/src/main/java/com/shunzhi/parent/ui/fragment/CePingFragment.java
@@ -24,6 +24,7 @@ import com.shunzhi.parent.contract.ceping.CepingContract; | @@ -24,6 +24,7 @@ import com.shunzhi.parent.contract.ceping.CepingContract; | ||
24 | import com.shunzhi.parent.presenter.ceping.CePingPresenter; | 24 | import com.shunzhi.parent.presenter.ceping.CePingPresenter; |
25 | import com.shunzhi.parent.ui.activity.MyChildActivity; | 25 | import com.shunzhi.parent.ui.activity.MyChildActivity; |
26 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | 26 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; |
27 | +import com.shunzhi.parent.util.GlideUtils; | ||
27 | import com.shunzhi.parent.views.TextAndImgShowView; | 28 | import com.shunzhi.parent.views.TextAndImgShowView; |
28 | 29 | ||
29 | import java.util.List; | 30 | import java.util.List; |
@@ -181,17 +182,21 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -181,17 +182,21 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
181 | 182 | ||
182 | @Override | 183 | @Override |
183 | public void showTools(List<ToolBean> toolBeanList) { | 184 | public void showTools(List<ToolBean> toolBeanList) { |
184 | - if (toolBeanList.size() == 1) { | 185 | + if (toolBeanList.size() > 0) { |
185 | tvCourse1.setText(toolBeanList.get(0).toolName); | 186 | tvCourse1.setText(toolBeanList.get(0).toolName); |
186 | - Glide.with(getActivity()).load(toolBeanList.get(0).toolImage).into(ivCourse1); | 187 | + GlideUtils.showImg(getActivity(),ivCourse1,toolBeanList.get(0).toolImage); |
187 | tvCourse1.setTag(toolBeanList.get(0).toolUrl); | 188 | tvCourse1.setTag(toolBeanList.get(0).toolUrl); |
188 | - } else if (toolBeanList.size() == 2) { | 189 | + } |
190 | + | ||
191 | + if (toolBeanList.size() > 1) { | ||
189 | tvCourse2.setText(toolBeanList.get(1).toolName); | 192 | tvCourse2.setText(toolBeanList.get(1).toolName); |
190 | - Glide.with(getActivity()).load(toolBeanList.get(1).toolImage).into(ivCourse1); | 193 | + GlideUtils.showImg(getActivity(),ivCourse2,toolBeanList.get(1).toolImage); |
191 | tvCourse2.setTag(toolBeanList.get(1).toolUrl); | 194 | tvCourse2.setTag(toolBeanList.get(1).toolUrl); |
192 | - } else if (toolBeanList.size() == 3) { | 195 | + } |
196 | + | ||
197 | + if (toolBeanList.size() > 2) { | ||
193 | tvCourse3.setText(toolBeanList.get(2).toolName); | 198 | tvCourse3.setText(toolBeanList.get(2).toolName); |
194 | - Glide.with(getActivity()).load(toolBeanList.get(2).toolImage).into(ivCourse1); | 199 | + GlideUtils.showImg(getActivity(),ivCourse3,toolBeanList.get(2).toolImage); |
195 | tvCourse3.setTag(toolBeanList.get(2).toolUrl); | 200 | tvCourse3.setTag(toolBeanList.get(2).toolUrl); |
196 | } | 201 | } |
197 | } | 202 | } |
app/src/main/java/com/shunzhi/parent/ui/fragment/ConsultFragment.java
@@ -29,6 +29,7 @@ import com.shunzhi.parent.presenter.consult.ConsultPresenter; | @@ -29,6 +29,7 @@ import com.shunzhi.parent.presenter.consult.ConsultPresenter; | ||
29 | import com.shunzhi.parent.ui.activity.consult.ConsultOneLevelActivity; | 29 | import com.shunzhi.parent.ui.activity.consult.ConsultOneLevelActivity; |
30 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | 30 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; |
31 | import com.shunzhi.parent.util.AttrsUtils; | 31 | import com.shunzhi.parent.util.AttrsUtils; |
32 | +import com.shunzhi.parent.util.GlideUtils; | ||
32 | import com.shunzhi.parent.views.TextAndImgShowView; | 33 | import com.shunzhi.parent.views.TextAndImgShowView; |
33 | import com.stx.xhb.xbanner.XBanner; | 34 | import com.stx.xhb.xbanner.XBanner; |
34 | 35 | ||
@@ -89,7 +90,6 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -89,7 +90,6 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
89 | // mPresenter.getTools(layout_control); | 90 | // mPresenter.getTools(layout_control); |
90 | mPresenter.getBanners("2", AppContext.getInstance().district); | 91 | mPresenter.getBanners("2", AppContext.getInstance().district); |
91 | 92 | ||
92 | - | ||
93 | initBroadCast(); | 93 | initBroadCast(); |
94 | 94 | ||
95 | initListeners(); | 95 | initListeners(); |
@@ -129,8 +129,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -129,8 +129,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
129 | xBanner.setmAdapter(new XBanner.XBannerAdapter() { | 129 | xBanner.setmAdapter(new XBanner.XBannerAdapter() { |
130 | @Override | 130 | @Override |
131 | public void loadBanner(XBanner banner, Object model, View view, int position) { | 131 | public void loadBanner(XBanner banner, Object model, View view, int position) { |
132 | - Glide.with(getActivity()).load(imgesUrl.get(position)).placeholder(R.drawable.ic_launcher_background) | ||
133 | - .into((ImageView) view); | 132 | + GlideUtils.showImg(getActivity(),(ImageView) view,imgesUrl.get(position)); |
134 | } | 133 | } |
135 | }); | 134 | }); |
136 | 135 | ||
@@ -153,11 +152,6 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -153,11 +152,6 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
153 | public void onResume() { | 152 | public void onResume() { |
154 | super.onResume(); | 153 | super.onResume(); |
155 | xBanner.startAutoPlay(); | 154 | xBanner.startAutoPlay(); |
156 | -// if (!tvLocalAddress.getText().toString().equals(AppContext.getInstance().cityName)){ | ||
157 | -// tvLocalAddress.setText(AppContext.getInstance().district); | ||
158 | -// mPresenter.getBanners("2", AppContext.getInstance().district); | ||
159 | -// mPresenter.getContextChannel(AppContext.getInstance().district, 0, 1, 1); | ||
160 | -// } | ||
161 | } | 155 | } |
162 | 156 | ||
163 | @Override | 157 | @Override |
@@ -230,7 +224,6 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -230,7 +224,6 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
230 | TextAndImgShowView textAndImgShowView = new TextAndImgShowView(getActivity()); | 224 | TextAndImgShowView textAndImgShowView = new TextAndImgShowView(getActivity()); |
231 | textAndImgShowView.setTextColor(R.color.textColor); | 225 | textAndImgShowView.setTextColor(R.color.textColor); |
232 | textAndImgShowView.setText(list.get(i).getChannelName()); | 226 | textAndImgShowView.setText(list.get(i).getChannelName()); |
233 | -// textAndImgShowView.setImgs(R.drawable.play, Integer.parseInt(list.get(i).getChannelImage())); | ||
234 | textAndImgShowView.addImgs(list.get(i).getChannelImage()); | 227 | textAndImgShowView.addImgs(list.get(i).getChannelImage()); |
235 | textAndImgShowView.setSelect(true); | 228 | textAndImgShowView.setSelect(true); |
236 | textAndImgShowView.setWidth(getActivity(), layout_control); | 229 | textAndImgShowView.setWidth(getActivity(), layout_control); |
app/src/main/java/com/shunzhi/parent/ui/fragment/MineFragment.java
@@ -13,6 +13,7 @@ import android.widget.TextView; | @@ -13,6 +13,7 @@ import android.widget.TextView; | ||
13 | 13 | ||
14 | import com.bumptech.glide.Glide; | 14 | import com.bumptech.glide.Glide; |
15 | import com.makeramen.roundedimageview.RoundedImageView; | 15 | import com.makeramen.roundedimageview.RoundedImageView; |
16 | +import com.netease.nimlib.sdk.NIMClient; | ||
16 | import com.share.mvpsdk.base.BasePresenter; | 17 | import com.share.mvpsdk.base.BasePresenter; |
17 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; | 18 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
18 | import com.share.mvpsdk.utils.CacheUtils; | 19 | import com.share.mvpsdk.utils.CacheUtils; |
@@ -28,6 +29,7 @@ import com.shunzhi.parent.ui.activity.MyChildActivity; | @@ -28,6 +29,7 @@ import com.shunzhi.parent.ui.activity.MyChildActivity; | ||
28 | import com.shunzhi.parent.ui.activity.PersonInfoActivity; | 29 | import com.shunzhi.parent.ui.activity.PersonInfoActivity; |
29 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | 30 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; |
30 | import com.shunzhi.parent.ui.activity.orderdetail.OrderDetailActivity; | 31 | import com.shunzhi.parent.ui.activity.orderdetail.OrderDetailActivity; |
32 | +import com.shunzhi.parent.util.GlideUtils; | ||
31 | 33 | ||
32 | import static java.util.ResourceBundle.clearCache; | 34 | import static java.util.ResourceBundle.clearCache; |
33 | 35 | ||
@@ -77,9 +79,11 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -77,9 +79,11 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
77 | String url = AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_IMAGE); | 79 | String url = AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_IMAGE); |
78 | ToastUtils.showToast(url); | 80 | ToastUtils.showToast(url); |
79 | if (!TextUtils.isEmpty(url)) { | 81 | if (!TextUtils.isEmpty(url)) { |
80 | - Glide.with(getActivity()).load(url).asBitmap().error(R.drawable.test).centerCrop().into(user_photo); | 82 | + GlideUtils.showImg(getContext(),user_photo,url); |
83 | +// Glide.with(getActivity()).load(url).asBitmap().error(R.drawable.test).centerCrop().into(user_photo); | ||
81 | } else { | 84 | } else { |
82 | - Glide.with(getActivity()).load(R.drawable.test).centerCrop().into(user_photo); | 85 | +// Glide.with(getActivity()).load(R.drawable.test).centerCrop().into(user_photo); |
86 | + GlideUtils.showImg(getContext(),user_photo,url); | ||
83 | user_photo.setCornerRadius(20); | 87 | user_photo.setCornerRadius(20); |
84 | } | 88 | } |
85 | user_photo.setCornerRadius(20); | 89 | user_photo.setCornerRadius(20); |
@@ -87,6 +91,9 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -87,6 +91,9 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
87 | user_name.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_NAME)); | 91 | user_name.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_NAME)); |
88 | user_mobile.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME)); | 92 | user_mobile.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME)); |
89 | user_mobile.setVisibility(View.VISIBLE); | 93 | user_mobile.setVisibility(View.VISIBLE); |
94 | + }else { | ||
95 | + user_name.setVisibility(View.VISIBLE); | ||
96 | + user_mobile.setVisibility(View.GONE); | ||
90 | } | 97 | } |
91 | } | 98 | } |
92 | 99 | ||
@@ -156,6 +163,7 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -156,6 +163,7 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
156 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_IMAGE, ""); | 163 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_IMAGE, ""); |
157 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_NAME, ""); | 164 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_NAME, ""); |
158 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, ""); | 165 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, ""); |
166 | + AppConfig.ISLOGIN=false; | ||
159 | setPersonInfo(); | 167 | setPersonInfo(); |
160 | } | 168 | } |
161 | 169 |
app/src/main/java/com/shunzhi/parent/ui/fragment/StartFragment.java
@@ -22,6 +22,7 @@ import com.shunzhi.parent.bean.channel.ChannelContextBean; | @@ -22,6 +22,7 @@ import com.shunzhi.parent.bean.channel.ChannelContextBean; | ||
22 | import com.shunzhi.parent.contract.consult.ConsultContract; | 22 | import com.shunzhi.parent.contract.consult.ConsultContract; |
23 | import com.shunzhi.parent.presenter.consult.ConsultPresenter; | 23 | import com.shunzhi.parent.presenter.consult.ConsultPresenter; |
24 | import com.shunzhi.parent.ui.MainActivity; | 24 | import com.shunzhi.parent.ui.MainActivity; |
25 | +import com.shunzhi.parent.util.GlideUtils; | ||
25 | import com.stx.xhb.xbanner.XBanner; | 26 | import com.stx.xhb.xbanner.XBanner; |
26 | 27 | ||
27 | import java.util.ArrayList; | 28 | import java.util.ArrayList; |
@@ -99,12 +100,10 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | @@ -99,12 +100,10 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | ||
99 | xBanner.stopAutoPlay(); | 100 | xBanner.stopAutoPlay(); |
100 | xBanner.setmAutoPalyTime(10000); | 101 | xBanner.setmAutoPalyTime(10000); |
101 | // xBanner.setSlideScrollMode(View.OVER_SCROLL_NEVER); | 102 | // xBanner.setSlideScrollMode(View.OVER_SCROLL_NEVER); |
102 | - Log.d("66666","imgUrl="+imgUrl.toString()+"describeList="+describeList.toString()); | ||
103 | xBanner.setmAdapter(new XBanner.XBannerAdapter() { | 103 | xBanner.setmAdapter(new XBanner.XBannerAdapter() { |
104 | @Override | 104 | @Override |
105 | public void loadBanner(XBanner banner, Object model, View view, int position) { | 105 | public void loadBanner(XBanner banner, Object model, View view, int position) { |
106 | - Glide.with(getActivity()).load(imgUrl.get(position)).placeholder(R.drawable.ic_launcher_background) | ||
107 | - .into((ImageView) view); | 106 | + GlideUtils.showImg(getActivity(),(ImageView) view,imgUrl.get(position)); |
108 | } | 107 | } |
109 | }); | 108 | }); |
110 | 109 |
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultOneLevelFragment.java
@@ -13,14 +13,12 @@ import android.widget.ImageView; | @@ -13,14 +13,12 @@ import android.widget.ImageView; | ||
13 | import android.widget.LinearLayout; | 13 | import android.widget.LinearLayout; |
14 | import android.widget.TextView; | 14 | import android.widget.TextView; |
15 | 15 | ||
16 | -import com.bumptech.glide.Glide; | ||
17 | import com.jcodecraeer.xrecyclerview.XRecyclerView; | 16 | import com.jcodecraeer.xrecyclerview.XRecyclerView; |
18 | import com.share.mvpsdk.base.BasePresenter; | 17 | import com.share.mvpsdk.base.BasePresenter; |
19 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; | 18 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; |
20 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; | 19 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; |
21 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; | 20 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
22 | import com.share.mvpsdk.utils.DisplayUtils; | 21 | import com.share.mvpsdk.utils.DisplayUtils; |
23 | -import com.shunzhi.parent.AppConfig; | ||
24 | import com.shunzhi.parent.AppContext; | 22 | import com.shunzhi.parent.AppContext; |
25 | import com.shunzhi.parent.R; | 23 | import com.shunzhi.parent.R; |
26 | import com.shunzhi.parent.adapter.MyConsultAdapter; | 24 | import com.shunzhi.parent.adapter.MyConsultAdapter; |
@@ -32,6 +30,7 @@ import com.shunzhi.parent.presenter.consult.consultone.ConsultOnePresenter; | @@ -32,6 +30,7 @@ import com.shunzhi.parent.presenter.consult.consultone.ConsultOnePresenter; | ||
32 | import com.shunzhi.parent.ui.activity.consult.ConsultTwoLevelActivity; | 30 | import com.shunzhi.parent.ui.activity.consult.ConsultTwoLevelActivity; |
33 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | 31 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; |
34 | import com.shunzhi.parent.util.AttrsUtils; | 32 | import com.shunzhi.parent.util.AttrsUtils; |
33 | +import com.shunzhi.parent.util.GlideUtils; | ||
35 | import com.shunzhi.parent.views.TextAndImgShowView; | 34 | import com.shunzhi.parent.views.TextAndImgShowView; |
36 | 35 | ||
37 | import java.util.ArrayList; | 36 | import java.util.ArrayList; |
@@ -214,16 +213,14 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -214,16 +213,14 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
214 | 213 | ||
215 | @Override | 214 | @Override |
216 | public void onBindViewHolder(final GuangGaoBean object, int position) { | 215 | public void onBindViewHolder(final GuangGaoBean object, int position) { |
217 | - Glide.with(getActivity()).load(AppConfig.BASE_URL_FILE + object.fileSrc).error(R.drawable.ic_launcher_foreground).into(iv_grally); | ||
218 | - | 216 | + GlideUtils.showImg(mContext, iv_grally, object.fileSrc); |
219 | tv_grally_title.setText(object.describe + ""); | 217 | tv_grally_title.setText(object.describe + ""); |
220 | iv_grally.setOnClickListener(new View.OnClickListener() { | 218 | iv_grally.setOnClickListener(new View.OnClickListener() { |
221 | @Override | 219 | @Override |
222 | public void onClick(View v) { | 220 | public void onClick(View v) { |
223 | - WebViewActivity.getInstance(mContext,object.url, -1); | 221 | + WebViewActivity.getInstance(mContext, object.url, -1); |
224 | } | 222 | } |
225 | }); | 223 | }); |
226 | - | ||
227 | } | 224 | } |
228 | } | 225 | } |
229 | } | 226 | } |
app/src/main/java/com/shunzhi/parent/util/GlideUtils.java
0 → 100644
@@ -0,0 +1,29 @@ | @@ -0,0 +1,29 @@ | ||
1 | +package com.shunzhi.parent.util; | ||
2 | + | ||
3 | +import android.content.Context; | ||
4 | +import android.text.TextUtils; | ||
5 | +import android.widget.ImageView; | ||
6 | + | ||
7 | +import com.bumptech.glide.Glide; | ||
8 | +import com.shunzhi.parent.AppConfig; | ||
9 | +import com.shunzhi.parent.R; | ||
10 | + | ||
11 | +/** | ||
12 | + * Created by ToaHanDong on 2018/3/21. | ||
13 | + */ | ||
14 | + | ||
15 | +public class GlideUtils { | ||
16 | + | ||
17 | + public static void showImg(Context context, ImageView imageView,String url){ | ||
18 | + if (!TextUtils.isEmpty(url)){ | ||
19 | + if (url.startsWith("http")) | ||
20 | + Glide.with(context).load(url).placeholder(R.color.xueqing_blue) | ||
21 | + .into(imageView); | ||
22 | + else Glide.with(context).load(AppConfig.BASE_URL_FILE+url).placeholder(R.color.xueqing_blue) | ||
23 | + .into(imageView); | ||
24 | + }else { | ||
25 | + Glide.with(context).load(url).placeholder(R.color.xueqing_blue).centerCrop().into(imageView); | ||
26 | + } | ||
27 | + } | ||
28 | + | ||
29 | +} |
app/src/main/java/com/shunzhi/parent/views/TextAndImgShowView.java
@@ -17,6 +17,7 @@ import com.share.mvpsdk.utils.DisplayUtils; | @@ -17,6 +17,7 @@ import com.share.mvpsdk.utils.DisplayUtils; | ||
17 | import com.shunzhi.parent.AppConfig; | 17 | import com.shunzhi.parent.AppConfig; |
18 | import com.shunzhi.parent.AppContext; | 18 | import com.shunzhi.parent.AppContext; |
19 | import com.shunzhi.parent.R; | 19 | import com.shunzhi.parent.R; |
20 | +import com.shunzhi.parent.util.GlideUtils; | ||
20 | 21 | ||
21 | 22 | ||
22 | /** | 23 | /** |
@@ -57,6 +58,7 @@ public class TextAndImgShowView extends LinearLayout { | @@ -57,6 +58,7 @@ public class TextAndImgShowView extends LinearLayout { | ||
57 | } | 58 | } |
58 | 59 | ||
59 | public void addImgs(String imgUrl){ | 60 | public void addImgs(String imgUrl){ |
61 | +// Log.d("66666","imgUrl="+imgUrl); | ||
60 | if (!imgUrl.startsWith("http"))imgUrl= AppConfig.BASE_URL_FILE+imgUrl; | 62 | if (!imgUrl.startsWith("http"))imgUrl= AppConfig.BASE_URL_FILE+imgUrl; |
61 | Glide.with(getContext()).load(imgUrl).error(R.drawable.gxzt).into(image); | 63 | Glide.with(getContext()).load(imgUrl).error(R.drawable.gxzt).into(image); |
62 | } | 64 | } |
@@ -81,7 +83,7 @@ public class TextAndImgShowView extends LinearLayout { | @@ -81,7 +83,7 @@ public class TextAndImgShowView extends LinearLayout { | ||
81 | } | 83 | } |
82 | 84 | ||
83 | public void setWidth(Activity activity, View layout_control) { | 85 | public void setWidth(Activity activity, View layout_control) { |
84 | - Log.d("66666", "layout_control=" + layout_control.getMeasuredWidth()); | 86 | +// Log.d("66666", "layout_control=" + layout_control.getMeasuredWidth()); |
85 | LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); | 87 | LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); |
86 | params.width = (DisplayUtils.getScreenWidthPixels(activity) - | 88 | params.width = (DisplayUtils.getScreenWidthPixels(activity) - |
87 | DisplayUtils.dp2px(layout_control.getPaddingLeft() + layout_control.getPaddingRight() | 89 | DisplayUtils.dp2px(layout_control.getPaddingLeft() + layout_control.getPaddingRight() |
app/src/main/res/drawable-xhdpi/logo.png
app/src/main/res/drwable-xxhdpi/logo.png
app/src/main/res/values/strings.xml
1 | <resources> | 1 | <resources> |
2 | - <string name="app_name">parent</string> | 2 | + <string name="app_name">家长慧</string> |
3 | 3 | ||
4 | <!-- TODO: Remove or change this placeholder text --> | 4 | <!-- TODO: Remove or change this placeholder text --> |
5 | <string name="hello_blank_fragment">Hello blank fragment</string> | 5 | <string name="hello_blank_fragment">Hello blank fragment</string> |