Commit d045d156b1b84fb265eb7d62a9151bb05e168948
Exists in
yxb_dev
and in
2 other branches
Merge branch 'developer' into yxb_dev
Showing
17 changed files
with
73 additions
and
40 deletions
 
Show diff stats
app/src/main/java/com/shunzhi/parent/AppConfig.java
| ... | ... | @@ -36,7 +36,6 @@ public class AppConfig { | 
| 36 | 36 | |
| 37 | 37 | //http://campus.myjxt.com/ | 
| 38 | 38 | public static String BASE_URL="http://60.190.202.57:1000/"; | 
| 39 | - public static String BASE_URL_IMG="http://60.190.202.57:1000"; | |
| 40 | 39 | public static String BASE_URL_ORDER="http://60.190.202.57:8101/"; | 
| 41 | 40 | public static String BASE_URL_FILE="http://60.190.202.57:8196"; | 
| 42 | 41 | ... | ... | 
app/src/main/java/com/shunzhi/parent/adapter/MyConsultAdapter.java
| ... | ... | @@ -3,6 +3,7 @@ package com.shunzhi.parent.adapter; | 
| 3 | 3 | import android.content.Context; | 
| 4 | 4 | import android.support.v7.widget.LinearLayoutManager; | 
| 5 | 5 | import android.support.v7.widget.RecyclerView; | 
| 6 | +import android.util.Log; | |
| 6 | 7 | import android.view.LayoutInflater; | 
| 7 | 8 | import android.view.View; | 
| 8 | 9 | import android.view.ViewGroup; | 
| ... | ... | @@ -19,6 +20,7 @@ import com.shunzhi.parent.AppContext; | 
| 19 | 20 | import com.shunzhi.parent.R; | 
| 20 | 21 | import com.shunzhi.parent.bean.channel.ChannelContextBean; | 
| 21 | 22 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | 
| 23 | +import com.shunzhi.parent.util.GlideUtils; | |
| 22 | 24 | |
| 23 | 25 | /** | 
| 24 | 26 | * Created by ToaHanDong on 2018/3/14. | 
| ... | ... | @@ -70,8 +72,7 @@ public class MyConsultAdapter extends BaseRecyclerViewAdapter<ChannelContextBean | 
| 70 | 72 | if (object.getIsAds() == 1) { | 
| 71 | 73 | frame_ad.setVisibility(View.VISIBLE); | 
| 72 | 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 | 76 | frame_ad.setOnClickListener(new View.OnClickListener() { | 
| 76 | 77 | @Override | 
| 77 | 78 | public void onClick(View v) { | 
| ... | ... | @@ -83,8 +84,7 @@ public class MyConsultAdapter extends BaseRecyclerViewAdapter<ChannelContextBean | 
| 83 | 84 | normal_content.setVisibility(View.VISIBLE); | 
| 84 | 85 | tvConsultTitle.setText(object.getTitle()); | 
| 85 | 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 | 88 | normal_content.setOnClickListener(new View.OnClickListener() { | 
| 89 | 89 | @Override | 
| 90 | 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 | 158 | mRxManager.register(mIModel.getUserInfo(mobile, school_id, captcha).subscribe(new Consumer<UserInfo>() { | 
| 159 | 159 | @Override | 
| 160 | 160 | public void accept(UserInfo userInfo) throws Exception { | 
| 161 | - Log.d("6666", "userInfo=" + userInfo.toString()); | |
| 161 | +// Log.d("6666", "userInfo=" + userInfo.toString()); | |
| 162 | 162 | if (userInfo != null) { | 
| 163 | 163 | CurrentBean currentBean = userInfo.getData(); | 
| 164 | 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 | 18 | import com.shunzhi.parent.R; | 
| 19 | 19 | import com.shunzhi.parent.contract.mine.PersonInfoContract; | 
| 20 | 20 | import com.shunzhi.parent.presenter.mine.PersonInfoPrasenter; | 
| 21 | +import com.shunzhi.parent.util.GlideUtils; | |
| 21 | 22 | |
| 22 | 23 | /** | 
| 23 | 24 | * Created by Administrator on 2018/3/10 0010. | 
| ... | ... | @@ -56,9 +57,11 @@ public class PersonInfoActivity extends BaseMVPCompatActivity<PersonInfoContract | 
| 56 | 57 | private void initInfo() { | 
| 57 | 58 | String url = AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_IMAGE); | 
| 58 | 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 | 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 | 66 | user_image.setCornerRadius(20); | 
| 64 | 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 | 56 | Bundle bundle = new Bundle(); | 
| 57 | 57 | bundle.putString("channel", channel); | 
| 58 | 58 | consultOneLevelFragment.setArguments(bundle); | 
| 59 | -// ToastUtils.showToast("channel=" + channel); | |
| 60 | 59 | fragmentTransaction = getSupportFragmentManager().beginTransaction(); | 
| 61 | 60 | fragmentTransaction.add(R.id.frame_consult, consultOneLevelFragment) | 
| 62 | 61 | .show(consultOneLevelFragment).commit(); | ... | ... | 
app/src/main/java/com/shunzhi/parent/ui/activity/mywebview/WebViewActivity.java
| ... | ... | @@ -115,7 +115,6 @@ public class WebViewActivity extends BaseCompatActivity { | 
| 115 | 115 | |
| 116 | 116 | initWebView(); | 
| 117 | 117 | initWebSetting(nesteScrollWebView.getSettings()); | 
| 118 | - ToastUtils.showToast(getIntent().getStringExtra("url")); | |
| 119 | 118 | nesteScrollWebView.loadUrl(getIntent().getStringExtra("url")); | 
| 120 | 119 | } | 
| 121 | 120 | ... | ... | 
app/src/main/java/com/shunzhi/parent/ui/fragment/CePingFragment.java
| ... | ... | @@ -24,6 +24,7 @@ import com.shunzhi.parent.contract.ceping.CepingContract; | 
| 24 | 24 | import com.shunzhi.parent.presenter.ceping.CePingPresenter; | 
| 25 | 25 | import com.shunzhi.parent.ui.activity.MyChildActivity; | 
| 26 | 26 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | 
| 27 | +import com.shunzhi.parent.util.GlideUtils; | |
| 27 | 28 | import com.shunzhi.parent.views.TextAndImgShowView; | 
| 28 | 29 | |
| 29 | 30 | import java.util.List; | 
| ... | ... | @@ -181,17 +182,21 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | 
| 181 | 182 | |
| 182 | 183 | @Override | 
| 183 | 184 | public void showTools(List<ToolBean> toolBeanList) { | 
| 184 | - if (toolBeanList.size() == 1) { | |
| 185 | + if (toolBeanList.size() > 0) { | |
| 185 | 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 | 188 | tvCourse1.setTag(toolBeanList.get(0).toolUrl); | 
| 188 | - } else if (toolBeanList.size() == 2) { | |
| 189 | + } | |
| 190 | + | |
| 191 | + if (toolBeanList.size() > 1) { | |
| 189 | 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 | 194 | tvCourse2.setTag(toolBeanList.get(1).toolUrl); | 
| 192 | - } else if (toolBeanList.size() == 3) { | |
| 195 | + } | |
| 196 | + | |
| 197 | + if (toolBeanList.size() > 2) { | |
| 193 | 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 | 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 | 29 | import com.shunzhi.parent.ui.activity.consult.ConsultOneLevelActivity; | 
| 30 | 30 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | 
| 31 | 31 | import com.shunzhi.parent.util.AttrsUtils; | 
| 32 | +import com.shunzhi.parent.util.GlideUtils; | |
| 32 | 33 | import com.shunzhi.parent.views.TextAndImgShowView; | 
| 33 | 34 | import com.stx.xhb.xbanner.XBanner; | 
| 34 | 35 | |
| ... | ... | @@ -89,7 +90,6 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | 
| 89 | 90 | // mPresenter.getTools(layout_control); | 
| 90 | 91 | mPresenter.getBanners("2", AppContext.getInstance().district); | 
| 91 | 92 | |
| 92 | - | |
| 93 | 93 | initBroadCast(); | 
| 94 | 94 | |
| 95 | 95 | initListeners(); | 
| ... | ... | @@ -97,7 +97,6 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | 
| 97 | 97 | |
| 98 | 98 | private void initRecycler() { | 
| 99 | 99 | recycler_context.setLayoutManager(new LinearLayoutManager(getActivity())); | 
| 100 | - | |
| 101 | 100 | recycler_context.setLoadingListener(new XRecyclerView.LoadingListener() { | 
| 102 | 101 | @Override | 
| 103 | 102 | public void onRefresh() { | 
| ... | ... | @@ -130,8 +129,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | 
| 130 | 129 | xBanner.setmAdapter(new XBanner.XBannerAdapter() { | 
| 131 | 130 | @Override | 
| 132 | 131 | public void loadBanner(XBanner banner, Object model, View view, int position) { | 
| 133 | - Glide.with(getActivity()).load(imgesUrl.get(position)).placeholder(R.drawable.ic_launcher_background) | |
| 134 | - .into((ImageView) view); | |
| 132 | + GlideUtils.showImg(getActivity(),(ImageView) view,imgesUrl.get(position)); | |
| 135 | 133 | } | 
| 136 | 134 | }); | 
| 137 | 135 | |
| ... | ... | @@ -154,11 +152,6 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | 
| 154 | 152 | public void onResume() { | 
| 155 | 153 | super.onResume(); | 
| 156 | 154 | xBanner.startAutoPlay(); | 
| 157 | -// if (!tvLocalAddress.getText().toString().equals(AppContext.getInstance().cityName)){ | |
| 158 | -// tvLocalAddress.setText(AppContext.getInstance().district); | |
| 159 | -// mPresenter.getBanners("2", AppContext.getInstance().district); | |
| 160 | -// mPresenter.getContextChannel(AppContext.getInstance().district, 0, 1, 1); | |
| 161 | -// } | |
| 162 | 155 | } | 
| 163 | 156 | |
| 164 | 157 | @Override | 
| ... | ... | @@ -215,6 +208,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | 
| 215 | 208 | @Override | 
| 216 | 209 | public void showBanners(List<GuangGaoBean> guangGaoBeanList) { | 
| 217 | 210 | describeList.clear(); | 
| 211 | + imgesUrl.clear(); | |
| 218 | 212 | for (int i = 0; i < guangGaoBeanList.size(); i++) { | 
| 219 | 213 | imgesUrl.add(AppConfig.BASE_URL_FILE + guangGaoBeanList.get(i).fileSrc); | 
| 220 | 214 | describeList.add(guangGaoBeanList.get(i).describe); | 
| ... | ... | @@ -230,7 +224,6 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | 
| 230 | 224 | TextAndImgShowView textAndImgShowView = new TextAndImgShowView(getActivity()); | 
| 231 | 225 | textAndImgShowView.setTextColor(R.color.textColor); | 
| 232 | 226 | textAndImgShowView.setText(list.get(i).getChannelName()); | 
| 233 | -// textAndImgShowView.setImgs(R.drawable.play, Integer.parseInt(list.get(i).getChannelImage())); | |
| 234 | 227 | textAndImgShowView.addImgs(list.get(i).getChannelImage()); | 
| 235 | 228 | textAndImgShowView.setSelect(true); | 
| 236 | 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 | 13 | |
| 14 | 14 | import com.bumptech.glide.Glide; | 
| 15 | 15 | import com.makeramen.roundedimageview.RoundedImageView; | 
| 16 | +import com.netease.nimlib.sdk.NIMClient; | |
| 16 | 17 | import com.share.mvpsdk.base.BasePresenter; | 
| 17 | 18 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; | 
| 18 | 19 | import com.share.mvpsdk.utils.CacheUtils; | 
| ... | ... | @@ -27,6 +28,7 @@ import com.shunzhi.parent.ui.activity.MyChildActivity; | 
| 27 | 28 | import com.shunzhi.parent.ui.activity.PersonInfoActivity; | 
| 28 | 29 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | 
| 29 | 30 | import com.shunzhi.parent.ui.activity.orderdetail.OrderDetailActivity; | 
| 31 | +import com.shunzhi.parent.util.GlideUtils; | |
| 30 | 32 | |
| 31 | 33 | public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter, LoginAndRegisterContract.ILoginModel> | 
| 32 | 34 | implements MineContract.IMineView, View.OnClickListener { | 
| ... | ... | @@ -76,9 +78,11 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | 
| 76 | 78 | String url = AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_IMAGE); | 
| 77 | 79 | // ToastUtils.showToast(url); | 
| 78 | 80 | if (!TextUtils.isEmpty(url)) { | 
| 79 | - Glide.with(getActivity()).load(url).asBitmap().error(R.drawable.test).centerCrop().into(user_photo); | |
| 81 | + GlideUtils.showImg(getContext(),user_photo,url); | |
| 82 | +// Glide.with(getActivity()).load(url).asBitmap().error(R.drawable.test).centerCrop().into(user_photo); | |
| 80 | 83 | } else { | 
| 81 | - Glide.with(getActivity()).load(R.drawable.test).centerCrop().into(user_photo); | |
| 84 | +// Glide.with(getActivity()).load(R.drawable.test).centerCrop().into(user_photo); | |
| 85 | + GlideUtils.showImg(getContext(),user_photo,url); | |
| 82 | 86 | user_photo.setCornerRadius(20); | 
| 83 | 87 | } | 
| 84 | 88 | user_photo.setCornerRadius(20); | 
| ... | ... | @@ -86,6 +90,9 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | 
| 86 | 90 | user_name.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_NAME)); | 
| 87 | 91 | user_mobile.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME)); | 
| 88 | 92 | user_mobile.setVisibility(View.VISIBLE); | 
| 93 | + }else { | |
| 94 | + user_name.setVisibility(View.VISIBLE); | |
| 95 | + user_mobile.setVisibility(View.GONE); | |
| 89 | 96 | } | 
| 90 | 97 | } | 
| 91 | 98 | |
| ... | ... | @@ -158,6 +165,7 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | 
| 158 | 165 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_IMAGE, ""); | 
| 159 | 166 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_NAME, ""); | 
| 160 | 167 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, ""); | 
| 168 | + AppConfig.ISLOGIN=false; | |
| 161 | 169 | setPersonInfo(); | 
| 162 | 170 | } | 
| 163 | 171 | ... | ... | 
app/src/main/java/com/shunzhi/parent/ui/fragment/StartFragment.java
| ... | ... | @@ -22,6 +22,7 @@ import com.shunzhi.parent.bean.channel.ChannelContextBean; | 
| 22 | 22 | import com.shunzhi.parent.contract.consult.ConsultContract; | 
| 23 | 23 | import com.shunzhi.parent.presenter.consult.ConsultPresenter; | 
| 24 | 24 | import com.shunzhi.parent.ui.MainActivity; | 
| 25 | +import com.shunzhi.parent.util.GlideUtils; | |
| 25 | 26 | import com.stx.xhb.xbanner.XBanner; | 
| 26 | 27 | |
| 27 | 28 | import java.util.ArrayList; | 
| ... | ... | @@ -99,12 +100,10 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | 
| 99 | 100 | xBanner.stopAutoPlay(); | 
| 100 | 101 | xBanner.setmAutoPalyTime(10000); | 
| 101 | 102 | // xBanner.setSlideScrollMode(View.OVER_SCROLL_NEVER); | 
| 102 | - Log.d("66666","imgUrl="+imgUrl.toString()+"describeList="+describeList.toString()); | |
| 103 | 103 | xBanner.setmAdapter(new XBanner.XBannerAdapter() { | 
| 104 | 104 | @Override | 
| 105 | 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 | 13 | import android.widget.LinearLayout; | 
| 14 | 14 | import android.widget.TextView; | 
| 15 | 15 | |
| 16 | -import com.bumptech.glide.Glide; | |
| 17 | 16 | import com.jcodecraeer.xrecyclerview.XRecyclerView; | 
| 18 | 17 | import com.share.mvpsdk.base.BasePresenter; | 
| 19 | 18 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; | 
| 20 | 19 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; | 
| 21 | 20 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; | 
| 22 | 21 | import com.share.mvpsdk.utils.DisplayUtils; | 
| 23 | -import com.shunzhi.parent.AppConfig; | |
| 24 | 22 | import com.shunzhi.parent.AppContext; | 
| 25 | 23 | import com.shunzhi.parent.R; | 
| 26 | 24 | import com.shunzhi.parent.adapter.MyConsultAdapter; | 
| ... | ... | @@ -32,6 +30,7 @@ import com.shunzhi.parent.presenter.consult.consultone.ConsultOnePresenter; | 
| 32 | 30 | import com.shunzhi.parent.ui.activity.consult.ConsultTwoLevelActivity; | 
| 33 | 31 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | 
| 34 | 32 | import com.shunzhi.parent.util.AttrsUtils; | 
| 33 | +import com.shunzhi.parent.util.GlideUtils; | |
| 35 | 34 | import com.shunzhi.parent.views.TextAndImgShowView; | 
| 36 | 35 | |
| 37 | 36 | import java.util.ArrayList; | 
| ... | ... | @@ -214,16 +213,14 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | 
| 214 | 213 | |
| 215 | 214 | @Override | 
| 216 | 215 | public void onBindViewHolder(final GuangGaoBean object, int position) { | 
| 217 | - Glide.with(getActivity()).load(AppConfig.BASE_URL_IMG + object.fileSrc).error(R.drawable.ic_launcher_foreground).into(iv_grally); | |
| 218 | - | |
| 216 | + GlideUtils.showImg(mContext, iv_grally, object.fileSrc); | |
| 219 | 217 | tv_grally_title.setText(object.describe + ""); | 
| 220 | 218 | iv_grally.setOnClickListener(new View.OnClickListener() { | 
| 221 | 219 | @Override | 
| 222 | 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/ui/fragment/loginandregistfragment/LoginAndRegistFragment.java
| ... | ... | @@ -129,7 +129,7 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | 
| 129 | 129 | roundedImageView.setOnClickListener(new View.OnClickListener() { | 
| 130 | 130 | @Override | 
| 131 | 131 | public void onClick(View view) { | 
| 132 | - mPresenter.loginResult("18358585335", "123456"); | |
| 132 | + mPresenter.loginResult("18358575337", "575337"); | |
| 133 | 133 | } | 
| 134 | 134 | }); | 
| 135 | 135 | } | ... | ... | 
app/src/main/java/com/shunzhi/parent/util/GlideUtils.java
0 → 100644
| ... | ... | @@ -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 | 17 | import com.shunzhi.parent.AppConfig; | 
| 18 | 18 | import com.shunzhi.parent.AppContext; | 
| 19 | 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 | 58 | } | 
| 58 | 59 | |
| 59 | 60 | public void addImgs(String imgUrl){ | 
| 61 | +// Log.d("66666","imgUrl="+imgUrl); | |
| 60 | 62 | if (!imgUrl.startsWith("http"))imgUrl= AppConfig.BASE_URL_FILE+imgUrl; | 
| 61 | 63 | Glide.with(getContext()).load(imgUrl).error(R.drawable.gxzt).into(image); | 
| 62 | 64 | } | 
| ... | ... | @@ -81,7 +83,7 @@ public class TextAndImgShowView extends LinearLayout { | 
| 81 | 83 | } | 
| 82 | 84 | |
| 83 | 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 | 87 | LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); | 
| 86 | 88 | params.width = (DisplayUtils.getScreenWidthPixels(activity) - | 
| 87 | 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