Commit 10a30b8e6451dd9ad4dec816cb044a63e8fbd188
1 parent
e80f77fb
Exists in
yxb_dev
and in
2 other branches
no message
Showing
9 changed files
with
84 additions
and
110 deletions
Show diff stats
| @@ -0,0 +1,12 @@ | @@ -0,0 +1,12 @@ | ||
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<project version="4"> | ||
| 3 | + <component name="RunConfigurationProducerService"> | ||
| 4 | + <option name="ignoredProducers"> | ||
| 5 | + <set> | ||
| 6 | + <option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" /> | ||
| 7 | + <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" /> | ||
| 8 | + <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" /> | ||
| 9 | + </set> | ||
| 10 | + </option> | ||
| 11 | + </component> | ||
| 12 | +</project> | ||
| 0 | \ No newline at end of file | 13 | \ No newline at end of file |
app/src/main/java/com/shunzhi/parent/adapter/ContextAdapter.java
| @@ -1,78 +0,0 @@ | @@ -1,78 +0,0 @@ | ||
| 1 | -package com.shunzhi.parent.adapter; | ||
| 2 | - | ||
| 3 | -import android.content.Context; | ||
| 4 | -import android.view.LayoutInflater; | ||
| 5 | -import android.view.View; | ||
| 6 | -import android.view.ViewGroup; | ||
| 7 | -import android.widget.FrameLayout; | ||
| 8 | -import android.widget.ImageView; | ||
| 9 | -import android.widget.LinearLayout; | ||
| 10 | -import android.widget.TextView; | ||
| 11 | - | ||
| 12 | -import com.bumptech.glide.Glide; | ||
| 13 | -import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; | ||
| 14 | -import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; | ||
| 15 | -import com.shunzhi.parent.R; | ||
| 16 | -import com.shunzhi.parent.bean.channel.ChannelContextBean; | ||
| 17 | - | ||
| 18 | -/** | ||
| 19 | - * Created by lenovo on 2018/3/18. | ||
| 20 | - */ | ||
| 21 | - | ||
| 22 | -public class ContextAdapter extends BaseRecyclerViewAdapter<ChannelContextBean> { | ||
| 23 | - Context context; | ||
| 24 | - | ||
| 25 | - public ContextAdapter(Context context) { | ||
| 26 | - this.context = context; | ||
| 27 | - } | ||
| 28 | - | ||
| 29 | - | ||
| 30 | - @Override | ||
| 31 | - public BaseRecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | ||
| 32 | - View view = LayoutInflater.from(context).inflate(R.layout.layout_consult_content, null); | ||
| 33 | - return new MyViewHolder(view); | ||
| 34 | - } | ||
| 35 | - | ||
| 36 | - private class MyViewHolder extends BaseRecyclerViewHolder<ChannelContextBean> { | ||
| 37 | - TextView tvConsultTitle, tvConsultContent, tvPingLunNums, tvZhuanFaNums; | ||
| 38 | - ImageView iv_consult, image_ad; | ||
| 39 | - FrameLayout frame_ad; | ||
| 40 | - LinearLayout normal_content; | ||
| 41 | - | ||
| 42 | - | ||
| 43 | - public MyViewHolder(View view) { | ||
| 44 | - super(view); | ||
| 45 | - tvConsultContent = view.findViewById(R.id.tvConsultContent); | ||
| 46 | - tvConsultTitle = view.findViewById(R.id.tvConsultTitle); | ||
| 47 | - tvPingLunNums = view.findViewById(R.id.tvPingLunNums); | ||
| 48 | - tvZhuanFaNums = view.findViewById(R.id.tvZhuanFaNums); | ||
| 49 | - iv_consult = view.findViewById(R.id.iv_consult); | ||
| 50 | - frame_ad = view.findViewById(R.id.frame_ad); | ||
| 51 | - image_ad = view.findViewById(R.id.image_ad); | ||
| 52 | - normal_content = view.findViewById(R.id.normal_content); | ||
| 53 | - | ||
| 54 | - } | ||
| 55 | - | ||
| 56 | - @Override | ||
| 57 | - public void onBindViewHolder(final ChannelContextBean object, int position) { | ||
| 58 | - if (object.getIsAds() == 1) { | ||
| 59 | - frame_ad.setVisibility(View.VISIBLE); | ||
| 60 | - normal_content.setVisibility(View.GONE); | ||
| 61 | - Glide.with(context).load(object.getImage()).placeholder(R.color.xueqing_blue) | ||
| 62 | - .into(iv_consult); | ||
| 63 | - } else { | ||
| 64 | - frame_ad.setVisibility(View.GONE); | ||
| 65 | - normal_content.setVisibility(View.VISIBLE); | ||
| 66 | - tvConsultTitle.setText(object.getTitle()); | ||
| 67 | - tvConsultContent.setText(object.getContent()); | ||
| 68 | - Glide.with(context).load(object.getImage()).placeholder(R.color.xueqing_blue) | ||
| 69 | - .into(iv_consult); | ||
| 70 | - } | ||
| 71 | - | ||
| 72 | - | ||
| 73 | - } | ||
| 74 | - | ||
| 75 | - } | ||
| 76 | - | ||
| 77 | - | ||
| 78 | -} |
app/src/main/java/com/shunzhi/parent/adapter/MyConsultAdapter.java
| @@ -6,13 +6,19 @@ import android.support.v7.widget.RecyclerView; | @@ -6,13 +6,19 @@ import android.support.v7.widget.RecyclerView; | ||
| 6 | import android.view.LayoutInflater; | 6 | import android.view.LayoutInflater; |
| 7 | import android.view.View; | 7 | import android.view.View; |
| 8 | import android.view.ViewGroup; | 8 | import android.view.ViewGroup; |
| 9 | +import android.widget.FrameLayout; | ||
| 9 | import android.widget.ImageView; | 10 | import android.widget.ImageView; |
| 11 | +import android.widget.LinearLayout; | ||
| 10 | import android.widget.TextView; | 12 | import android.widget.TextView; |
| 11 | 13 | ||
| 14 | +import com.bumptech.glide.Glide; | ||
| 12 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; | 15 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; |
| 13 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; | 16 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; |
| 17 | +import com.shunzhi.parent.AppConfig; | ||
| 18 | +import com.shunzhi.parent.AppContext; | ||
| 14 | import com.shunzhi.parent.R; | 19 | import com.shunzhi.parent.R; |
| 15 | import com.shunzhi.parent.bean.channel.ChannelContextBean; | 20 | import com.shunzhi.parent.bean.channel.ChannelContextBean; |
| 21 | +import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | ||
| 16 | 22 | ||
| 17 | /** | 23 | /** |
| 18 | * Created by ToaHanDong on 2018/3/14. | 24 | * Created by ToaHanDong on 2018/3/14. |
| @@ -20,16 +26,16 @@ import com.shunzhi.parent.bean.channel.ChannelContextBean; | @@ -20,16 +26,16 @@ import com.shunzhi.parent.bean.channel.ChannelContextBean; | ||
| 20 | 26 | ||
| 21 | public class MyConsultAdapter extends BaseRecyclerViewAdapter<ChannelContextBean> { | 27 | public class MyConsultAdapter extends BaseRecyclerViewAdapter<ChannelContextBean> { |
| 22 | 28 | ||
| 23 | - private Context mContext=null; | 29 | + private Context mContext = null; |
| 24 | 30 | ||
| 25 | - public MyConsultAdapter(Context context){ | ||
| 26 | - mContext=context; | 31 | + public MyConsultAdapter(Context context) { |
| 32 | + mContext = context; | ||
| 27 | } | 33 | } |
| 28 | 34 | ||
| 29 | @Override | 35 | @Override |
| 30 | public void onAttachedToRecyclerView(RecyclerView recyclerView) { | 36 | public void onAttachedToRecyclerView(RecyclerView recyclerView) { |
| 31 | super.onAttachedToRecyclerView(recyclerView); | 37 | super.onAttachedToRecyclerView(recyclerView); |
| 32 | - LinearLayoutManager layoutManager=new LinearLayoutManager(mContext); | 38 | + LinearLayoutManager layoutManager = new LinearLayoutManager(mContext); |
| 33 | layoutManager.setOrientation(LinearLayoutManager.VERTICAL); | 39 | layoutManager.setOrientation(LinearLayoutManager.VERTICAL); |
| 34 | recyclerView.setLayoutManager(layoutManager); | 40 | recyclerView.setLayoutManager(layoutManager); |
| 35 | } | 41 | } |
| @@ -40,25 +46,54 @@ public class MyConsultAdapter extends BaseRecyclerViewAdapter<ChannelContextBean | @@ -40,25 +46,54 @@ public class MyConsultAdapter extends BaseRecyclerViewAdapter<ChannelContextBean | ||
| 40 | return new MyConsultViewHolder(view); | 46 | return new MyConsultViewHolder(view); |
| 41 | } | 47 | } |
| 42 | 48 | ||
| 43 | - private class MyConsultViewHolder extends BaseRecyclerViewHolder<ChannelContextBean>{ | 49 | + private class MyConsultViewHolder extends BaseRecyclerViewHolder<ChannelContextBean> { |
| 44 | 50 | ||
| 45 | TextView tvConsultTitle, tvConsultContent, tvPingLunNums, tvZhuanFaNums; | 51 | TextView tvConsultTitle, tvConsultContent, tvPingLunNums, tvZhuanFaNums; |
| 46 | - ImageView iv_consult; | 52 | + ImageView iv_consult, image_ad; |
| 53 | + FrameLayout frame_ad; | ||
| 54 | + LinearLayout normal_content; | ||
| 55 | + | ||
| 47 | public MyConsultViewHolder(View itemView) { | 56 | public MyConsultViewHolder(View itemView) { |
| 48 | super(itemView); | 57 | super(itemView); |
| 49 | - tvConsultTitle = itemView.findViewById(R.id.tvConsultTitle); | ||
| 50 | tvConsultContent = itemView.findViewById(R.id.tvConsultContent); | 58 | tvConsultContent = itemView.findViewById(R.id.tvConsultContent); |
| 59 | + tvConsultTitle = itemView.findViewById(R.id.tvConsultTitle); | ||
| 51 | tvPingLunNums = itemView.findViewById(R.id.tvPingLunNums); | 60 | tvPingLunNums = itemView.findViewById(R.id.tvPingLunNums); |
| 52 | tvZhuanFaNums = itemView.findViewById(R.id.tvZhuanFaNums); | 61 | tvZhuanFaNums = itemView.findViewById(R.id.tvZhuanFaNums); |
| 53 | iv_consult = itemView.findViewById(R.id.iv_consult); | 62 | iv_consult = itemView.findViewById(R.id.iv_consult); |
| 63 | + frame_ad = itemView.findViewById(R.id.frame_ad); | ||
| 64 | + image_ad = itemView.findViewById(R.id.image_ad); | ||
| 65 | + normal_content = itemView.findViewById(R.id.normal_content); | ||
| 54 | } | 66 | } |
| 55 | 67 | ||
| 56 | @Override | 68 | @Override |
| 57 | - public void onBindViewHolder(ChannelContextBean object, int position) { | ||
| 58 | - tvConsultContent.setText(object.getContent()); | ||
| 59 | - tvConsultTitle.setText(object.getTitle()); | ||
| 60 | -// tvPingLunNums.setText(object.getForwardingNum()); | ||
| 61 | -// tvZhuanFaNums.setText(object.getTalkNum()); | 69 | + public void onBindViewHolder(final ChannelContextBean object, int position) { |
| 70 | + if (object.getIsAds() == 1) { | ||
| 71 | + frame_ad.setVisibility(View.VISIBLE); | ||
| 72 | + normal_content.setVisibility(View.GONE); | ||
| 73 | + Glide.with(mContext).load(object.getImage()).placeholder(R.color.xueqing_blue) | ||
| 74 | + .into(iv_consult); | ||
| 75 | + frame_ad.setOnClickListener(new View.OnClickListener() { | ||
| 76 | + @Override | ||
| 77 | + public void onClick(View v) { | ||
| 78 | + WebViewActivity.getInstance(mContext,object.getUrl(), -1); | ||
| 79 | + } | ||
| 80 | + }); | ||
| 81 | + } else { | ||
| 82 | + frame_ad.setVisibility(View.GONE); | ||
| 83 | + normal_content.setVisibility(View.VISIBLE); | ||
| 84 | + tvConsultTitle.setText(object.getTitle()); | ||
| 85 | + tvConsultContent.setText(object.getContent()); | ||
| 86 | + Glide.with(mContext).load(object.getImage()).placeholder(R.color.xueqing_blue) | ||
| 87 | + .into(iv_consult); | ||
| 88 | + normal_content.setOnClickListener(new View.OnClickListener() { | ||
| 89 | + @Override | ||
| 90 | + public void onClick(View v) { | ||
| 91 | + WebViewActivity.getInstance(mContext, AppConfig.BASE_URL_ORDER | ||
| 92 | + +"InformationDetail.aspx?id="+object.getId()+"&areaname="+ AppContext.getInstance().district, -1); | ||
| 93 | + } | ||
| 94 | + }); | ||
| 95 | + } | ||
| 96 | + | ||
| 62 | } | 97 | } |
| 63 | } | 98 | } |
| 64 | } | 99 | } |
app/src/main/java/com/shunzhi/parent/ui/activity/binding/SelectSchoolActivity.java
| @@ -71,7 +71,7 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity<SchoolListContra | @@ -71,7 +71,7 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity<SchoolListContra | ||
| 71 | go_next.setOnClickListener(this); | 71 | go_next.setOnClickListener(this); |
| 72 | tvLocalAddress = findViewById(R.id.tvLocalAddress); | 72 | tvLocalAddress = findViewById(R.id.tvLocalAddress); |
| 73 | tvLocalAddress.setOnClickListener(this); | 73 | tvLocalAddress.setOnClickListener(this); |
| 74 | - tvLocalAddress.setText(AppContext.getInstance().cityName); | 74 | + tvLocalAddress.setText(AppContext.getInstance().district); |
| 75 | setSchoolList(); | 75 | setSchoolList(); |
| 76 | 76 | ||
| 77 | 77 |
app/src/main/java/com/shunzhi/parent/ui/activity/mywebview/WebViewActivity.java
| @@ -126,7 +126,9 @@ public class WebViewActivity extends BaseCompatActivity { | @@ -126,7 +126,9 @@ public class WebViewActivity extends BaseCompatActivity { | ||
| 126 | nesteScrollWebView.goBack(); | 126 | nesteScrollWebView.goBack(); |
| 127 | } else { | 127 | } else { |
| 128 | super.onBackPressedSupport(); | 128 | super.onBackPressedSupport(); |
| 129 | - startActivity(new Intent().setClass(this, MainActivity.class)); | 129 | + if(type!=-1&&type!= AppConfig.ORDER_CENTER) { |
| 130 | + startActivity(new Intent().setClass(this, MainActivity.class)); | ||
| 131 | + } | ||
| 130 | } | 132 | } |
| 131 | } | 133 | } |
| 132 | 134 |
app/src/main/java/com/shunzhi/parent/ui/fragment/CePingFragment.java
| @@ -99,7 +99,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -99,7 +99,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
| 99 | public void onResume() { | 99 | public void onResume() { |
| 100 | super.onResume(); | 100 | super.onResume(); |
| 101 | // if (!tvLocalAddress.getText().toString().equals(AppContext.getInstance().cityName)){ | 101 | // if (!tvLocalAddress.getText().toString().equals(AppContext.getInstance().cityName)){ |
| 102 | - tvLocalAddress.setText(AppContext.getInstance().cityName); | 102 | + tvLocalAddress.setText(AppContext.getInstance().district); |
| 103 | addTools(); | 103 | addTools(); |
| 104 | // } | 104 | // } |
| 105 | } | 105 | } |
| @@ -173,7 +173,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -173,7 +173,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
| 173 | 173 | ||
| 174 | @Override | 174 | @Override |
| 175 | public void getCity(String name) { | 175 | public void getCity(String name) { |
| 176 | - tvLocalAddress.setText(name.split(" ")[1]); | 176 | + tvLocalAddress.setText(name.split(" ")[2]); |
| 177 | mPresenter.getTools(layout_control, name.split(" ")[2]); | 177 | mPresenter.getTools(layout_control, name.split(" ")[2]); |
| 178 | AppContext.getInstance().cityName=name.split(" ")[1]; | 178 | AppContext.getInstance().cityName=name.split(" ")[1]; |
| 179 | AppContext.getInstance().district=name.split(" ")[2]; | 179 | AppContext.getInstance().district=name.split(" ")[2]; |
app/src/main/java/com/shunzhi/parent/ui/fragment/ConsultFragment.java
| @@ -8,7 +8,6 @@ import android.os.Bundle; | @@ -8,7 +8,6 @@ import android.os.Bundle; | ||
| 8 | import android.support.annotation.NonNull; | 8 | import android.support.annotation.NonNull; |
| 9 | import android.support.annotation.Nullable; | 9 | import android.support.annotation.Nullable; |
| 10 | import android.support.v7.widget.LinearLayoutManager; | 10 | import android.support.v7.widget.LinearLayoutManager; |
| 11 | -import android.util.Log; | ||
| 12 | import android.view.View; | 11 | import android.view.View; |
| 13 | import android.widget.ImageView; | 12 | import android.widget.ImageView; |
| 14 | import android.widget.LinearLayout; | 13 | import android.widget.LinearLayout; |
| @@ -21,7 +20,7 @@ import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; | @@ -21,7 +20,7 @@ import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; | ||
| 21 | import com.shunzhi.parent.AppConfig; | 20 | import com.shunzhi.parent.AppConfig; |
| 22 | import com.shunzhi.parent.AppContext; | 21 | import com.shunzhi.parent.AppContext; |
| 23 | import com.shunzhi.parent.R; | 22 | import com.shunzhi.parent.R; |
| 24 | -import com.shunzhi.parent.adapter.ContextAdapter; | 23 | +import com.shunzhi.parent.adapter.MyConsultAdapter; |
| 25 | import com.shunzhi.parent.bean.GuangGaoBean; | 24 | import com.shunzhi.parent.bean.GuangGaoBean; |
| 26 | import com.shunzhi.parent.bean.channel.ChannelBean; | 25 | import com.shunzhi.parent.bean.channel.ChannelBean; |
| 27 | import com.shunzhi.parent.bean.channel.ChannelContextBean; | 26 | import com.shunzhi.parent.bean.channel.ChannelContextBean; |
| @@ -49,7 +48,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -49,7 +48,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
| 49 | 48 | ||
| 50 | XRecyclerView recycler_context; | 49 | XRecyclerView recycler_context; |
| 51 | 50 | ||
| 52 | - ContextAdapter contextAdapter; | 51 | + MyConsultAdapter contextAdapter; |
| 53 | 52 | ||
| 54 | List<String> imgesUrl = new ArrayList<>(); | 53 | List<String> imgesUrl = new ArrayList<>(); |
| 55 | List<String> describeList = new ArrayList<>(); | 54 | List<String> describeList = new ArrayList<>(); |
| @@ -82,7 +81,6 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -82,7 +81,6 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
| 82 | videoplayer = view.findViewById(R.id.videoplayer); | 81 | videoplayer = view.findViewById(R.id.videoplayer); |
| 83 | tvLocalAddress = view.findViewById(R.id.tvLocalAddress); | 82 | tvLocalAddress = view.findViewById(R.id.tvLocalAddress); |
| 84 | layout_control = view.findViewById(R.id.layout_control); | 83 | layout_control = view.findViewById(R.id.layout_control); |
| 85 | - | ||
| 86 | tvLocalAddress.setText(AppContext.getInstance().district); | 84 | tvLocalAddress.setText(AppContext.getInstance().district); |
| 87 | videoplayer.batteryLevel.setVisibility(View.GONE); | 85 | videoplayer.batteryLevel.setVisibility(View.GONE); |
| 88 | videoplayer.replayTextView.setVisibility(View.GONE); | 86 | videoplayer.replayTextView.setVisibility(View.GONE); |
| @@ -99,7 +97,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -99,7 +97,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
| 99 | 97 | ||
| 100 | private void initRecycler() { | 98 | private void initRecycler() { |
| 101 | recycler_context.setLayoutManager(new LinearLayoutManager(getActivity())); | 99 | recycler_context.setLayoutManager(new LinearLayoutManager(getActivity())); |
| 102 | -// contextAdapter = new ContextAdapter(getActivity()); | 100 | + |
| 103 | recycler_context.setLoadingListener(new XRecyclerView.LoadingListener() { | 101 | recycler_context.setLoadingListener(new XRecyclerView.LoadingListener() { |
| 104 | @Override | 102 | @Override |
| 105 | public void onRefresh() { | 103 | public void onRefresh() { |
| @@ -140,7 +138,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -140,7 +138,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
| 140 | xBanner.setOnItemClickListener(new XBanner.OnItemClickListener() { | 138 | xBanner.setOnItemClickListener(new XBanner.OnItemClickListener() { |
| 141 | @Override | 139 | @Override |
| 142 | public void onItemClick(XBanner banner, int position) { | 140 | public void onItemClick(XBanner banner, int position) { |
| 143 | - WebViewActivity.getInstance(getContext(), imgesUrl.get(position), -1); | 141 | + WebViewActivity.getInstance(getContext(), describeList.get(position), -1); |
| 144 | } | 142 | } |
| 145 | }); | 143 | }); |
| 146 | 144 | ||
| @@ -157,9 +155,9 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -157,9 +155,9 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
| 157 | super.onResume(); | 155 | super.onResume(); |
| 158 | xBanner.startAutoPlay(); | 156 | xBanner.startAutoPlay(); |
| 159 | // if (!tvLocalAddress.getText().toString().equals(AppContext.getInstance().cityName)){ | 157 | // if (!tvLocalAddress.getText().toString().equals(AppContext.getInstance().cityName)){ |
| 160 | - tvLocalAddress.setText(AppContext.getInstance().cityName); | ||
| 161 | - mPresenter.getBanners("2", AppContext.getInstance().district); | ||
| 162 | - mPresenter.getContextChannel(AppContext.getInstance().district, 0, 1, 1); | 158 | +// tvLocalAddress.setText(AppContext.getInstance().district); |
| 159 | +// mPresenter.getBanners("2", AppContext.getInstance().district); | ||
| 160 | +// mPresenter.getContextChannel(AppContext.getInstance().district, 0, 1, 1); | ||
| 163 | // } | 161 | // } |
| 164 | } | 162 | } |
| 165 | 163 | ||
| @@ -256,7 +254,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -256,7 +254,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
| 256 | public void showContext(List<ChannelContextBean> list) { | 254 | public void showContext(List<ChannelContextBean> list) { |
| 257 | contextList.addAll(list); | 255 | contextList.addAll(list); |
| 258 | if (contextAdapter == null) { | 256 | if (contextAdapter == null) { |
| 259 | - contextAdapter = new ContextAdapter(getActivity()); | 257 | + contextAdapter = new MyConsultAdapter(getActivity()); |
| 260 | contextAdapter.addAll(contextList); | 258 | contextAdapter.addAll(contextList); |
| 261 | recycler_context.setAdapter(contextAdapter); | 259 | recycler_context.setAdapter(contextAdapter); |
| 262 | } else { | 260 | } else { |
| @@ -268,7 +266,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -268,7 +266,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
| 268 | @Override | 266 | @Override |
| 269 | public void getCity(String name) { | 267 | public void getCity(String name) { |
| 270 | first=true; | 268 | first=true; |
| 271 | - tvLocalAddress.setText(name.split(" ")[1]); | 269 | + tvLocalAddress.setText(name.split(" ")[2]); |
| 272 | mPresenter.getBanners("2", name.split(" ")[2]); | 270 | mPresenter.getBanners("2", name.split(" ")[2]); |
| 273 | mPresenter.getContextChannel(name.split(" ")[2], 0, 1, 1); | 271 | mPresenter.getContextChannel(name.split(" ")[2], 0, 1, 1); |
| 274 | AppContext.getInstance().cityName = name.split(" ")[1]; | 272 | AppContext.getInstance().cityName = name.split(" ")[1]; |
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultOneLevelFragment.java
| @@ -20,7 +20,6 @@ import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; | @@ -20,7 +20,6 @@ import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; | ||
| 20 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; | 20 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; |
| 21 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; | 21 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
| 22 | import com.share.mvpsdk.utils.DisplayUtils; | 22 | import com.share.mvpsdk.utils.DisplayUtils; |
| 23 | -import com.share.mvpsdk.utils.ToastUtils; | ||
| 24 | import com.shunzhi.parent.AppConfig; | 23 | import com.shunzhi.parent.AppConfig; |
| 25 | import com.shunzhi.parent.AppContext; | 24 | import com.shunzhi.parent.AppContext; |
| 26 | import com.shunzhi.parent.R; | 25 | import com.shunzhi.parent.R; |
| @@ -31,14 +30,13 @@ import com.shunzhi.parent.bean.channel.ChannelContextBean; | @@ -31,14 +30,13 @@ import com.shunzhi.parent.bean.channel.ChannelContextBean; | ||
| 31 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; | 30 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; |
| 32 | import com.shunzhi.parent.presenter.consult.consultone.ConsultOnePresenter; | 31 | import com.shunzhi.parent.presenter.consult.consultone.ConsultOnePresenter; |
| 33 | import com.shunzhi.parent.ui.activity.consult.ConsultTwoLevelActivity; | 32 | import com.shunzhi.parent.ui.activity.consult.ConsultTwoLevelActivity; |
| 33 | +import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | ||
| 34 | import com.shunzhi.parent.util.AttrsUtils; | 34 | import com.shunzhi.parent.util.AttrsUtils; |
| 35 | import com.shunzhi.parent.views.TextAndImgShowView; | 35 | import com.shunzhi.parent.views.TextAndImgShowView; |
| 36 | 36 | ||
| 37 | import java.util.ArrayList; | 37 | import java.util.ArrayList; |
| 38 | import java.util.List; | 38 | import java.util.List; |
| 39 | 39 | ||
| 40 | -import retrofit2.http.HEAD; | ||
| 41 | - | ||
| 42 | public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneContract.ConsultOnePresenter, | 40 | public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneContract.ConsultOnePresenter, |
| 43 | ConsultOneContract.IConsultOneModel> implements View.OnClickListener, ConsultOneContract.IConsultOneView { | 41 | ConsultOneContract.IConsultOneModel> implements View.OnClickListener, ConsultOneContract.IConsultOneView { |
| 44 | 42 | ||
| @@ -215,9 +213,16 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -215,9 +213,16 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
| 215 | } | 213 | } |
| 216 | 214 | ||
| 217 | @Override | 215 | @Override |
| 218 | - public void onBindViewHolder(GuangGaoBean object, int position) { | 216 | + public void onBindViewHolder(final GuangGaoBean object, int position) { |
| 219 | Glide.with(getActivity()).load(AppConfig.BASE_URL_IMG + object.fileSrc).error(R.drawable.ic_launcher_foreground).into(iv_grally); | 217 | Glide.with(getActivity()).load(AppConfig.BASE_URL_IMG + object.fileSrc).error(R.drawable.ic_launcher_foreground).into(iv_grally); |
| 220 | tv_grally_title.setText(object.describe + ""); | 218 | tv_grally_title.setText(object.describe + ""); |
| 219 | + iv_grally.setOnClickListener(new View.OnClickListener() { | ||
| 220 | + @Override | ||
| 221 | + public void onClick(View v) { | ||
| 222 | + WebViewActivity.getInstance(mContext,object.url, -1); | ||
| 223 | + } | ||
| 224 | + }); | ||
| 225 | + | ||
| 221 | } | 226 | } |
| 222 | } | 227 | } |
| 223 | } | 228 | } |
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultTwoLevelFragment.java
| @@ -51,7 +51,7 @@ public class ConsultTwoLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -51,7 +51,7 @@ public class ConsultTwoLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
| 51 | channel = getArguments().getString("channel"); | 51 | channel = getArguments().getString("channel"); |
| 52 | recyclerView = view.findViewById(R.id.recyclerView); | 52 | recyclerView = view.findViewById(R.id.recyclerView); |
| 53 | 53 | ||
| 54 | - mPresenter.getConsultContent(AppContext.getInstance().district, Integer.parseInt(channel), 0, 1); | 54 | +// mPresenter.getConsultContent(AppContext.getInstance().district, Integer.parseInt(channel), 0, 1); |
| 55 | recyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); | 55 | recyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); |
| 56 | recyclerView.setLoadingListener(new XRecyclerView.LoadingListener() { | 56 | recyclerView.setLoadingListener(new XRecyclerView.LoadingListener() { |
| 57 | @Override | 57 | @Override |