Commit e2485424e08d9b6eb6278222d866abec4b0e6def
1 parent
864e9f4c
Exists in
yxb_dev
and in
2 other branches
no message
Showing
13 changed files
with
145 additions
and
64 deletions
Show diff stats
app/src/main/java/com/shunzhi/parent/AppConfig.java
| @@ -22,7 +22,10 @@ public class AppConfig { | @@ -22,7 +22,10 @@ public class AppConfig { | ||
| 22 | public static String USER_SEX = "user_sex"; | 22 | public static String USER_SEX = "user_sex"; |
| 23 | public static String USER_IMAGE = "user_image"; | 23 | public static String USER_IMAGE = "user_image"; |
| 24 | public static String PARENT_ID = "parent_id"; | 24 | public static String PARENT_ID = "parent_id"; |
| 25 | + | ||
| 26 | + | ||
| 25 | public static boolean ISLOGIN = false; | 27 | public static boolean ISLOGIN = false; |
| 28 | + public static boolean ISBINDING = false; | ||
| 26 | 29 | ||
| 27 | public static int BINDING_SUCCESS_HEZUO = 1; | 30 | public static int BINDING_SUCCESS_HEZUO = 1; |
| 28 | public static int BINDING_SUCCESS_NOT = 2; | 31 | public static int BINDING_SUCCESS_NOT = 2; |
app/src/main/java/com/shunzhi/parent/adapter/MyConsultAdapter.java
| @@ -12,14 +12,13 @@ import android.widget.TextView; | @@ -12,14 +12,13 @@ import android.widget.TextView; | ||
| 12 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; | 12 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; |
| 13 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; | 13 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; |
| 14 | import com.shunzhi.parent.R; | 14 | import com.shunzhi.parent.R; |
| 15 | -import com.shunzhi.parent.bean.MyConsultBean; | ||
| 16 | -import com.shunzhi.parent.ui.activity.consult.ConsultTwoLevelActivity; | 15 | +import com.shunzhi.parent.bean.channel.ChannelContextBean; |
| 17 | 16 | ||
| 18 | /** | 17 | /** |
| 19 | * Created by ToaHanDong on 2018/3/14. | 18 | * Created by ToaHanDong on 2018/3/14. |
| 20 | */ | 19 | */ |
| 21 | 20 | ||
| 22 | -public class MyConsultAdapter extends BaseRecyclerViewAdapter<MyConsultBean> { | 21 | +public class MyConsultAdapter extends BaseRecyclerViewAdapter<ChannelContextBean> { |
| 23 | 22 | ||
| 24 | private Context mContext=null; | 23 | private Context mContext=null; |
| 25 | 24 | ||
| @@ -41,7 +40,7 @@ public class MyConsultAdapter extends BaseRecyclerViewAdapter<MyConsultBean> { | @@ -41,7 +40,7 @@ public class MyConsultAdapter extends BaseRecyclerViewAdapter<MyConsultBean> { | ||
| 41 | return new MyConsultViewHolder(view); | 40 | return new MyConsultViewHolder(view); |
| 42 | } | 41 | } |
| 43 | 42 | ||
| 44 | - private class MyConsultViewHolder extends BaseRecyclerViewHolder<MyConsultBean>{ | 43 | + private class MyConsultViewHolder extends BaseRecyclerViewHolder<ChannelContextBean>{ |
| 45 | 44 | ||
| 46 | TextView tvConsultTitle, tvConsultContent, tvPingLunNums, tvZhuanFaNums; | 45 | TextView tvConsultTitle, tvConsultContent, tvPingLunNums, tvZhuanFaNums; |
| 47 | ImageView iv_consult; | 46 | ImageView iv_consult; |
| @@ -55,11 +54,11 @@ public class MyConsultAdapter extends BaseRecyclerViewAdapter<MyConsultBean> { | @@ -55,11 +54,11 @@ public class MyConsultAdapter extends BaseRecyclerViewAdapter<MyConsultBean> { | ||
| 55 | } | 54 | } |
| 56 | 55 | ||
| 57 | @Override | 56 | @Override |
| 58 | - public void onBindViewHolder(MyConsultBean object, int position) { | ||
| 59 | - tvConsultContent.setText(object.consultContent); | ||
| 60 | - tvConsultTitle.setText(object.consultTitle); | ||
| 61 | - tvPingLunNums.setText(object.consultCounts); | ||
| 62 | - tvZhuanFaNums.setText(object.consultZhuanfaCounts); | 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()); | ||
| 63 | } | 62 | } |
| 64 | } | 63 | } |
| 65 | } | 64 | } |
app/src/main/java/com/shunzhi/parent/contract/consult/consultone/ConsultOneContract.java
| @@ -7,6 +7,8 @@ import com.share.mvpsdk.base.BasePresenter; | @@ -7,6 +7,8 @@ import com.share.mvpsdk.base.BasePresenter; | ||
| 7 | import com.share.mvpsdk.base.IBaseFragment; | 7 | import com.share.mvpsdk.base.IBaseFragment; |
| 8 | import com.share.mvpsdk.base.IBaseModel; | 8 | import com.share.mvpsdk.base.IBaseModel; |
| 9 | import com.shunzhi.parent.bean.GuangGaoBean; | 9 | import com.shunzhi.parent.bean.GuangGaoBean; |
| 10 | +import com.shunzhi.parent.bean.channel.ChannelBean; | ||
| 11 | +import com.shunzhi.parent.bean.channel.ChannelContextBean; | ||
| 10 | 12 | ||
| 11 | import java.util.List; | 13 | import java.util.List; |
| 12 | 14 | ||
| @@ -39,7 +41,9 @@ public interface ConsultOneContract { | @@ -39,7 +41,9 @@ public interface ConsultOneContract { | ||
| 39 | 41 | ||
| 40 | void showBanners(List<GuangGaoBean> guangGaoBeanList); | 42 | void showBanners(List<GuangGaoBean> guangGaoBeanList); |
| 41 | 43 | ||
| 42 | - void showConsultContent(); | 44 | + void showConsultContent(List<ChannelContextBean> list); |
| 45 | + | ||
| 46 | + void showChannel(List<ChannelBean> list); | ||
| 43 | 47 | ||
| 44 | 48 | ||
| 45 | } | 49 | } |
app/src/main/java/com/shunzhi/parent/model/consult/consultone/ConsultOneModel.java
| @@ -6,7 +6,6 @@ import com.share.mvpsdk.helper.RetrofitCreateHelper; | @@ -6,7 +6,6 @@ import com.share.mvpsdk.helper.RetrofitCreateHelper; | ||
| 6 | import com.share.mvpsdk.helper.RxHelper; | 6 | import com.share.mvpsdk.helper.RxHelper; |
| 7 | import com.shunzhi.parent.AppConfig; | 7 | import com.shunzhi.parent.AppConfig; |
| 8 | import com.shunzhi.parent.api.Consult; | 8 | import com.shunzhi.parent.api.Consult; |
| 9 | -import com.shunzhi.parent.bean.GuangGaoBean; | ||
| 10 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; | 9 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; |
| 11 | 10 | ||
| 12 | import io.reactivex.Observable; | 11 | import io.reactivex.Observable; |
| @@ -35,6 +34,9 @@ public class ConsultOneModel extends BaseModel implements ConsultOneContract.ICo | @@ -35,6 +34,9 @@ public class ConsultOneModel extends BaseModel implements ConsultOneContract.ICo | ||
| 35 | @Override | 34 | @Override |
| 36 | public Observable<JsonObject> getConsultContent(String areaName, int channel, int toFirstPage, int pageIndex) { | 35 | public Observable<JsonObject> getConsultContent(String areaName, int channel, int toFirstPage, int pageIndex) { |
| 37 | return RetrofitCreateHelper.getInstance().createApi(Consult.class, AppConfig.BASE_URL) | 36 | return RetrofitCreateHelper.getInstance().createApi(Consult.class, AppConfig.BASE_URL) |
| 38 | - .getConsultContent(areaName,channel,toFirstPage,pageIndex); | 37 | + .getConsultContent(areaName,channel,toFirstPage,pageIndex).compose(RxHelper.<JsonObject>rxSchedulerHelper()); |
| 39 | } | 38 | } |
| 39 | + | ||
| 40 | + | ||
| 41 | + | ||
| 40 | } | 42 | } |
app/src/main/java/com/shunzhi/parent/presenter/consult/consultone/ConsultOnePresenter.java
| 1 | package com.shunzhi.parent.presenter.consult.consultone; | 1 | package com.shunzhi.parent.presenter.consult.consultone; |
| 2 | 2 | ||
| 3 | +import android.util.Log; | ||
| 3 | import android.view.View; | 4 | import android.view.View; |
| 4 | import android.widget.LinearLayout; | 5 | import android.widget.LinearLayout; |
| 5 | 6 | ||
| 6 | import com.google.gson.Gson; | 7 | import com.google.gson.Gson; |
| 7 | import com.google.gson.JsonArray; | 8 | import com.google.gson.JsonArray; |
| 8 | import com.google.gson.JsonObject; | 9 | import com.google.gson.JsonObject; |
| 10 | +import com.share.mvpsdk.utils.OkHttpExceptionUtil; | ||
| 9 | import com.share.mvpsdk.utils.ToastUtils; | 11 | import com.share.mvpsdk.utils.ToastUtils; |
| 10 | import com.shunzhi.parent.R; | 12 | import com.shunzhi.parent.R; |
| 11 | import com.shunzhi.parent.bean.GuangGaoBean; | 13 | import com.shunzhi.parent.bean.GuangGaoBean; |
| 12 | import com.shunzhi.parent.bean.ToolBean; | 14 | import com.shunzhi.parent.bean.ToolBean; |
| 15 | +import com.shunzhi.parent.bean.channel.ChannelBean; | ||
| 16 | +import com.shunzhi.parent.bean.channel.ChannelContextBean; | ||
| 17 | +import com.shunzhi.parent.bean.channel.ChannelInfo; | ||
| 13 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; | 18 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; |
| 14 | import com.shunzhi.parent.model.consult.consultone.ConsultOneModel; | 19 | import com.shunzhi.parent.model.consult.consultone.ConsultOneModel; |
| 15 | import com.shunzhi.parent.ui.activity.consult.ConsultTwoLevelActivity; | 20 | import com.shunzhi.parent.ui.activity.consult.ConsultTwoLevelActivity; |
| @@ -20,6 +25,7 @@ import java.util.ArrayList; | @@ -20,6 +25,7 @@ import java.util.ArrayList; | ||
| 20 | import java.util.List; | 25 | import java.util.List; |
| 21 | 26 | ||
| 22 | import io.reactivex.functions.Consumer; | 27 | import io.reactivex.functions.Consumer; |
| 28 | +import retrofit2.HttpException; | ||
| 23 | 29 | ||
| 24 | /** | 30 | /** |
| 25 | * Created by ToaHanDong on 2018/3/14. | 31 | * Created by ToaHanDong on 2018/3/14. |
| @@ -80,6 +86,26 @@ public class ConsultOnePresenter extends ConsultOneContract.ConsultOnePresenter{ | @@ -80,6 +86,26 @@ public class ConsultOnePresenter extends ConsultOneContract.ConsultOnePresenter{ | ||
| 80 | 86 | ||
| 81 | @Override | 87 | @Override |
| 82 | public void getConsultContent(String areaName, int channel, int toFirstPage, int pageIndex) { | 88 | public void getConsultContent(String areaName, int channel, int toFirstPage, int pageIndex) { |
| 89 | + mRxManager.register(mIModel.getConsultContent(areaName, channel, toFirstPage, pageIndex).subscribe(new Consumer<JsonObject>() { | ||
| 90 | + @Override | ||
| 91 | + public void accept(JsonObject jsonObject) throws Exception { | ||
| 92 | + ToastUtils.showToast(jsonObject.toString()); | ||
| 93 | + JsonObject json=jsonObject.getAsJsonObject("data"); | ||
| 94 | + Gson g=new Gson(); | ||
| 95 | + ChannelInfo channelInfo = g.fromJson(json.toString(),ChannelInfo.class); | ||
| 96 | + Log.e("ssss-===",channelInfo.toString()); | ||
| 97 | + List<ChannelContextBean> contextList = channelInfo.getChannelContent(); | ||
| 98 | + List<ChannelBean> channelList = channelInfo.getSubchannel(); | ||
| 99 | + mIView.showChannel(channelList); | ||
| 100 | + mIView.showConsultContent(contextList); | ||
| 101 | + } | ||
| 102 | + }, new Consumer<Throwable>() { | ||
| 103 | + @Override | ||
| 104 | + public void accept(Throwable throwable) throws Exception { | ||
| 105 | + OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | ||
| 106 | + } | ||
| 107 | + })); | ||
| 108 | + | ||
| 83 | 109 | ||
| 84 | } | 110 | } |
| 85 | 111 |
app/src/main/java/com/shunzhi/parent/presenter/loginandregister/LoginAndRegisterPresenter.java
| @@ -139,6 +139,9 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -139,6 +139,9 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
| 139 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_SEX, String.valueOf(currentBean.getSex())); | 139 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_SEX, String.valueOf(currentBean.getSex())); |
| 140 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.PARENT_ID, String.valueOf(currentBean.getParentId())); | 140 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.PARENT_ID, String.valueOf(currentBean.getParentId())); |
| 141 | AppConfig.getAppConfig(AppContext.getContext()).set(AppConfig.USER_ID, currentBean.getUserid()); | 141 | AppConfig.getAppConfig(AppContext.getContext()).set(AppConfig.USER_ID, currentBean.getUserid()); |
| 142 | + if (currentBean.getStudentClass() != null && currentBean.getStudentClass().size() > 0) { | ||
| 143 | + AppConfig.ISBINDING = true; | ||
| 144 | + } | ||
| 142 | mIView.getUserInfo(0); | 145 | mIView.getUserInfo(0); |
| 143 | 146 | ||
| 144 | } else { | 147 | } else { |
app/src/main/java/com/shunzhi/parent/ui/activity/mywebview/WebViewActivity.java
| @@ -46,6 +46,14 @@ public class WebViewActivity extends BaseCompatActivity { | @@ -46,6 +46,14 @@ public class WebViewActivity extends BaseCompatActivity { | ||
| 46 | zuoye = findViewById(R.id.zuoye); | 46 | zuoye = findViewById(R.id.zuoye); |
| 47 | title_web = findViewById(R.id.title_web); | 47 | title_web = findViewById(R.id.title_web); |
| 48 | 48 | ||
| 49 | + close.setOnClickListener(new View.OnClickListener() { | ||
| 50 | + @Override | ||
| 51 | + public void onClick(View v) { | ||
| 52 | + onBackPressedSupport(); | ||
| 53 | + } | ||
| 54 | + }); | ||
| 55 | + | ||
| 56 | + | ||
| 49 | nesteScrollWebView = findViewById(R.id.nesteScrollWebView); | 57 | nesteScrollWebView = findViewById(R.id.nesteScrollWebView); |
| 50 | pvWeb = findViewById(R.id.pb_web); | 58 | pvWeb = findViewById(R.id.pb_web); |
| 51 | type = getIntent().getIntExtra("type", 0); | 59 | type = getIntent().getIntExtra("type", 0); |
app/src/main/java/com/shunzhi/parent/ui/fragment/MineFragment.java
| @@ -30,7 +30,7 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -30,7 +30,7 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
| 30 | implements MineContract.IMineView, View.OnClickListener { | 30 | implements MineContract.IMineView, View.OnClickListener { |
| 31 | LinearLayout childlayout, personinfo, layout_orderDetail, layout_order; | 31 | LinearLayout childlayout, personinfo, layout_orderDetail, layout_order; |
| 32 | RoundedImageView user_photo; | 32 | RoundedImageView user_photo; |
| 33 | - TextView user_name, user_mobile; | 33 | + TextView user_name, user_mobile,binding_state; |
| 34 | 34 | ||
| 35 | @NonNull | 35 | @NonNull |
| 36 | @Override | 36 | @Override |
| @@ -56,6 +56,10 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -56,6 +56,10 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
| 56 | user_photo = view.findViewById(R.id.user_photo); | 56 | user_photo = view.findViewById(R.id.user_photo); |
| 57 | user_name = view.findViewById(R.id.user_name); | 57 | user_name = view.findViewById(R.id.user_name); |
| 58 | user_mobile = view.findViewById(R.id.user_mobile); | 58 | user_mobile = view.findViewById(R.id.user_mobile); |
| 59 | + binding_state=view.findViewById(R.id.binding_state); | ||
| 60 | + if(AppConfig.ISBINDING){ | ||
| 61 | + binding_state.setText(""); | ||
| 62 | + } | ||
| 59 | 63 | ||
| 60 | } | 64 | } |
| 61 | 65 |
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultOneLevelFragment.java
| @@ -25,10 +25,14 @@ import com.shunzhi.parent.R; | @@ -25,10 +25,14 @@ import com.shunzhi.parent.R; | ||
| 25 | import com.shunzhi.parent.adapter.MyConsultAdapter; | 25 | import com.shunzhi.parent.adapter.MyConsultAdapter; |
| 26 | import com.shunzhi.parent.bean.GuangGaoBean; | 26 | import com.shunzhi.parent.bean.GuangGaoBean; |
| 27 | import com.shunzhi.parent.bean.MyConsultBean; | 27 | import com.shunzhi.parent.bean.MyConsultBean; |
| 28 | +import com.shunzhi.parent.bean.channel.ChannelBean; | ||
| 29 | +import com.shunzhi.parent.bean.channel.ChannelContextBean; | ||
| 28 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; | 30 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; |
| 29 | import com.shunzhi.parent.presenter.consult.consultone.ConsultOnePresenter; | 31 | import com.shunzhi.parent.presenter.consult.consultone.ConsultOnePresenter; |
| 32 | +import com.shunzhi.parent.ui.activity.consult.ConsultOneLevelActivity; | ||
| 33 | +import com.shunzhi.parent.util.AttrsUtils; | ||
| 34 | +import com.shunzhi.parent.views.TextAndImgShowView; | ||
| 30 | 35 | ||
| 31 | -import java.util.ArrayList; | ||
| 32 | import java.util.List; | 36 | import java.util.List; |
| 33 | 37 | ||
| 34 | public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneContract.ConsultOnePresenter, | 38 | public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneContract.ConsultOnePresenter, |
| @@ -77,30 +81,31 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -77,30 +81,31 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
| 77 | 81 | ||
| 78 | layout_control = view.findViewById(R.id.layout_control); | 82 | layout_control = view.findViewById(R.id.layout_control); |
| 79 | layout_control.measure(0, 0); | 83 | layout_control.measure(0, 0); |
| 80 | - mPresenter.getTools(layout_control); | 84 | +// mPresenter.getTools(layout_control); |
| 81 | recyclerViewGrally = view.findViewById(R.id.recyclerViewGrally); | 85 | recyclerViewGrally = view.findViewById(R.id.recyclerViewGrally); |
| 82 | recyclerViewConsultOne = view.findViewById(R.id.recyclerViewConsultOne); | 86 | recyclerViewConsultOne = view.findViewById(R.id.recyclerViewConsultOne); |
| 83 | 87 | ||
| 84 | - mPresenter.getBanners("3","杭州"); | ||
| 85 | - initRecyclerViewConsult(); | 88 | + mPresenter.getBanners("3","余杭"); |
| 89 | + mPresenter.getConsultContent("余杭区", 42, 0, 1); | ||
| 90 | +// initRecyclerViewConsult(); | ||
| 86 | } | 91 | } |
| 87 | 92 | ||
| 88 | - private void initRecyclerViewConsult() { | ||
| 89 | - if (null == myConsultAdapter) myConsultAdapter = new MyConsultAdapter(getActivity()); | ||
| 90 | - if (null == myConsultBeanList) myConsultBeanList = new ArrayList<>(); | ||
| 91 | - else myConsultBeanList.clear(); | ||
| 92 | - for (int i = 0; i < 12; i++) { | ||
| 93 | - MyConsultBean myConsultBean = new MyConsultBean(); | ||
| 94 | - myConsultBean.consultCounts = i + ""; | ||
| 95 | - myConsultBean.consultContent = "咨询内容" + i; | ||
| 96 | - myConsultBean.consultTitle = "咨询标题" + i; | ||
| 97 | - myConsultBean.consultZhuanfaCounts = "转发:" + i; | ||
| 98 | - myConsultBeanList.add(myConsultBean); | ||
| 99 | - } | ||
| 100 | - myConsultAdapter.addAll(myConsultBeanList); | ||
| 101 | - recyclerViewConsultOne.setAdapter(myConsultAdapter); | ||
| 102 | - | ||
| 103 | - } | 93 | +// private void initRecyclerViewConsult() { |
| 94 | +// if (null == myConsultAdapter) myConsultAdapter = new MyConsultAdapter(getActivity()); | ||
| 95 | +// if (null == myConsultBeanList) myConsultBeanList = new ArrayList<>(); | ||
| 96 | +// else myConsultBeanList.clear(); | ||
| 97 | +// for (int i = 0; i < 12; i++) { | ||
| 98 | +// MyConsultBean myConsultBean = new MyConsultBean(); | ||
| 99 | +// myConsultBean.consultCounts = i + ""; | ||
| 100 | +// myConsultBean.consultContent = "咨询内容" + i; | ||
| 101 | +// myConsultBean.consultTitle = "咨询标题" + i; | ||
| 102 | +// myConsultBean.consultZhuanfaCounts = "转发:" + i; | ||
| 103 | +// myConsultBeanList.add(myConsultBean); | ||
| 104 | +// } | ||
| 105 | +// myConsultAdapter.addAll(myConsultBeanList); | ||
| 106 | +// recyclerViewConsultOne.setAdapter(myConsultAdapter); | ||
| 107 | +// | ||
| 108 | +// } | ||
| 104 | 109 | ||
| 105 | @NonNull | 110 | @NonNull |
| 106 | @Override | 111 | @Override |
| @@ -126,8 +131,33 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -126,8 +131,33 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
| 126 | } | 131 | } |
| 127 | 132 | ||
| 128 | @Override | 133 | @Override |
| 129 | - public void showConsultContent() { | 134 | + public void showConsultContent(List<ChannelContextBean> list) { |
| 135 | +// contextList.clear(); | ||
| 136 | +// contextList.addAll(list); | ||
| 137 | + if (null == myConsultAdapter) myConsultAdapter = new MyConsultAdapter(getActivity()); | ||
| 138 | + myConsultAdapter.addAll(list); | ||
| 139 | + recyclerViewConsultOne.setAdapter(myConsultAdapter); | ||
| 140 | + } | ||
| 130 | 141 | ||
| 142 | + @Override | ||
| 143 | + public void showChannel(List<ChannelBean> list) { | ||
| 144 | + for (int i = 0; i < list.size(); i++) { | ||
| 145 | + TextAndImgShowView textAndImgShowView = new TextAndImgShowView(getActivity()); | ||
| 146 | + textAndImgShowView.setTextColor(R.color.textColor); | ||
| 147 | + textAndImgShowView.setText(list.get(i).getChannelName()); | ||
| 148 | +// textAndImgShowView.setImgs(R.drawable.play, Integer.parseInt(list.get(i).getChannelImage())); | ||
| 149 | + textAndImgShowView.addImgs(list.get(i).getChannelImage()); | ||
| 150 | + textAndImgShowView.setSelect(true); | ||
| 151 | + textAndImgShowView.setWidth(getActivity(), layout_control); | ||
| 152 | + textAndImgShowView.setBackground(AttrsUtils.getAttrs(getActivity()).getDrawable(0)); | ||
| 153 | + textAndImgShowView.setOnClickListener(new View.OnClickListener() { | ||
| 154 | + @Override | ||
| 155 | + public void onClick(View view) { | ||
| 156 | + ConsultOneLevelActivity.getInstance(getActivity()); | ||
| 157 | + } | ||
| 158 | + }); | ||
| 159 | + layout_control.addView(textAndImgShowView); | ||
| 160 | + } | ||
| 131 | } | 161 | } |
| 132 | 162 | ||
| 133 | private class MyGrallyAdapter extends BaseRecyclerViewAdapter<GuangGaoBean> { | 163 | private class MyGrallyAdapter extends BaseRecyclerViewAdapter<GuangGaoBean> { |
| @@ -165,7 +195,6 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -165,7 +195,6 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
| 165 | @Override | 195 | @Override |
| 166 | public void onBindViewHolder(GuangGaoBean object, int position) { | 196 | public void onBindViewHolder(GuangGaoBean object, int position) { |
| 167 | Glide.with(getActivity()).load(AppConfig.BASE_URL_IMG+object.fileSrc).error(R.drawable.ic_launcher_foreground).into(iv_grally); | 197 | Glide.with(getActivity()).load(AppConfig.BASE_URL_IMG+object.fileSrc).error(R.drawable.ic_launcher_foreground).into(iv_grally); |
| 168 | -// iv_grally.setImageResource(R.drawable.ic_launcher_background); | ||
| 169 | tv_grally_title.setText(object.describe+""); | 198 | tv_grally_title.setText(object.describe+""); |
| 170 | } | 199 | } |
| 171 | } | 200 | } |
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultTwoLevelFragment.java
| 1 | package com.shunzhi.parent.ui.fragment.consult; | 1 | package com.shunzhi.parent.ui.fragment.consult; |
| 2 | 2 | ||
| 3 | -import android.content.Context; | ||
| 4 | -import android.net.Uri; | ||
| 5 | import android.os.Bundle; | 3 | import android.os.Bundle; |
| 6 | import android.support.annotation.NonNull; | 4 | import android.support.annotation.NonNull; |
| 7 | import android.support.annotation.Nullable; | 5 | import android.support.annotation.Nullable; |
| 8 | -import android.support.v4.app.Fragment; | ||
| 9 | import android.support.v7.widget.RecyclerView; | 6 | import android.support.v7.widget.RecyclerView; |
| 10 | -import android.view.LayoutInflater; | ||
| 11 | import android.view.View; | 7 | import android.view.View; |
| 12 | -import android.view.ViewGroup; | ||
| 13 | import android.widget.TextView; | 8 | import android.widget.TextView; |
| 14 | 9 | ||
| 15 | import com.share.mvpsdk.base.BasePresenter; | 10 | import com.share.mvpsdk.base.BasePresenter; |
| @@ -18,6 +13,8 @@ import com.shunzhi.parent.R; | @@ -18,6 +13,8 @@ import com.shunzhi.parent.R; | ||
| 18 | import com.shunzhi.parent.adapter.MyConsultAdapter; | 13 | import com.shunzhi.parent.adapter.MyConsultAdapter; |
| 19 | import com.shunzhi.parent.bean.GuangGaoBean; | 14 | import com.shunzhi.parent.bean.GuangGaoBean; |
| 20 | import com.shunzhi.parent.bean.MyConsultBean; | 15 | import com.shunzhi.parent.bean.MyConsultBean; |
| 16 | +import com.shunzhi.parent.bean.channel.ChannelBean; | ||
| 17 | +import com.shunzhi.parent.bean.channel.ChannelContextBean; | ||
| 21 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; | 18 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; |
| 22 | import com.shunzhi.parent.presenter.consult.consultone.ConsultOnePresenter; | 19 | import com.shunzhi.parent.presenter.consult.consultone.ConsultOnePresenter; |
| 23 | 20 | ||
| @@ -50,23 +47,23 @@ public class ConsultTwoLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -50,23 +47,23 @@ public class ConsultTwoLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
| 50 | 47 | ||
| 51 | recyclerView = view.findViewById(R.id.recyclerView); | 48 | recyclerView = view.findViewById(R.id.recyclerView); |
| 52 | 49 | ||
| 53 | - initRecyclerView(); | 50 | +// initRecyclerView(); |
| 54 | } | 51 | } |
| 55 | 52 | ||
| 56 | - private void initRecyclerView() { | ||
| 57 | - | ||
| 58 | - if (null == myConsultAdapter) myConsultAdapter = new MyConsultAdapter(getActivity()); | ||
| 59 | - for (int i = 0; i < 12; i++) { | ||
| 60 | - MyConsultBean myConsultBean = new MyConsultBean(); | ||
| 61 | - myConsultBean.consultCounts = i + ""; | ||
| 62 | - myConsultBean.consultContent = "咨询内容" + i; | ||
| 63 | - myConsultBean.consultTitle = "咨询标题" + i; | ||
| 64 | - myConsultBean.consultZhuanfaCounts = "转发:" + i; | ||
| 65 | - myConsultBeanList.add(myConsultBean); | ||
| 66 | - } | ||
| 67 | - myConsultAdapter.addAll(myConsultBeanList); | ||
| 68 | - recyclerView.setAdapter(myConsultAdapter); | ||
| 69 | - } | 53 | +// private void initRecyclerView() { |
| 54 | +// | ||
| 55 | +// if (null == myConsultAdapter) myConsultAdapter = new MyConsultAdapter(getActivity()); | ||
| 56 | +// for (int i = 0; i < 12; i++) { | ||
| 57 | +// MyConsultBean myConsultBean = new MyConsultBean(); | ||
| 58 | +// myConsultBean.consultCounts = i + ""; | ||
| 59 | +// myConsultBean.consultContent = "咨询内容" + i; | ||
| 60 | +// myConsultBean.consultTitle = "咨询标题" + i; | ||
| 61 | +// myConsultBean.consultZhuanfaCounts = "转发:" + i; | ||
| 62 | +// myConsultBeanList.add(myConsultBean); | ||
| 63 | +// } | ||
| 64 | +// myConsultAdapter.addAll(myConsultBeanList); | ||
| 65 | +// recyclerView.setAdapter(myConsultAdapter); | ||
| 66 | +// } | ||
| 70 | 67 | ||
| 71 | @NonNull | 68 | @NonNull |
| 72 | @Override | 69 | @Override |
| @@ -84,11 +81,16 @@ public class ConsultTwoLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -84,11 +81,16 @@ public class ConsultTwoLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
| 84 | 81 | ||
| 85 | } | 82 | } |
| 86 | 83 | ||
| 87 | - /** | ||
| 88 | - * 显示咨询内容 | ||
| 89 | - */ | ||
| 90 | @Override | 84 | @Override |
| 91 | - public void showConsultContent() { | 85 | + public void showConsultContent(List<ChannelContextBean> list) { |
| 86 | + | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + @Override | ||
| 90 | + public void showChannel(List<ChannelBean> list) { | ||
| 92 | 91 | ||
| 93 | } | 92 | } |
| 93 | + | ||
| 94 | + | ||
| 95 | + | ||
| 94 | } | 96 | } |
app/src/main/res/layout/activity_web_view.xml
| @@ -16,11 +16,11 @@ | @@ -16,11 +16,11 @@ | ||
| 16 | > | 16 | > |
| 17 | <TextView | 17 | <TextView |
| 18 | android:id="@+id/close_btn" | 18 | android:id="@+id/close_btn" |
| 19 | - android:layout_width="30dp" | ||
| 20 | - android:layout_height="30dp" | 19 | + android:layout_width="20dp" |
| 20 | + android:layout_height="20dp" | ||
| 21 | android:layout_marginLeft="10dp" | 21 | android:layout_marginLeft="10dp" |
| 22 | android:layout_centerVertical="true" | 22 | android:layout_centerVertical="true" |
| 23 | - android:background="@drawable/close" | 23 | + android:background="@drawable/arrow_left" |
| 24 | /> | 24 | /> |
| 25 | <TextView | 25 | <TextView |
| 26 | android:id="@+id/title_web" | 26 | android:id="@+id/title_web" |
app/src/main/res/layout/fragment_mine.xml
| @@ -217,6 +217,7 @@ | @@ -217,6 +217,7 @@ | ||
| 217 | android:textSize="@dimen/txtsize_title" /> | 217 | android:textSize="@dimen/txtsize_title" /> |
| 218 | 218 | ||
| 219 | <TextView | 219 | <TextView |
| 220 | + android:id="@+id/binding_state" | ||
| 220 | android:layout_width="80dp" | 221 | android:layout_width="80dp" |
| 221 | android:layout_height="wrap_content" | 222 | android:layout_height="wrap_content" |
| 222 | android:layout_gravity="center_vertical" | 223 | android:layout_gravity="center_vertical" |
app/src/main/res/layout/top.xml
| @@ -7,8 +7,8 @@ | @@ -7,8 +7,8 @@ | ||
| 7 | 7 | ||
| 8 | <TextView | 8 | <TextView |
| 9 | android:id="@+id/back_top" | 9 | android:id="@+id/back_top" |
| 10 | - android:layout_width="30dp" | ||
| 11 | - android:layout_height="30dp" | 10 | + android:layout_width="20dp" |
| 11 | + android:layout_height="20dp" | ||
| 12 | android:layout_gravity="center_vertical" | 12 | android:layout_gravity="center_vertical" |
| 13 | android:background="@drawable/arrow_left" /> | 13 | android:background="@drawable/arrow_left" /> |
| 14 | 14 |