Commit d878a8a1f6ce0aa27294cc4677ca0cb39eeb90cd
Exists in
yxb_dev
and in
2 other branches
Merge branch 'developer' into yxb_dev
# Conflicts: # app/src/main/java/com/shunzhi/parent/model/consult/consultone/ConsultOneModel.java
Showing
12 changed files
with
72 additions
and
29 deletions
Show diff stats
app/src/main/java/com/shunzhi/parent/api/Consult.java
| @@ -15,13 +15,18 @@ import retrofit2.http.Query; | @@ -15,13 +15,18 @@ import retrofit2.http.Query; | ||
| 15 | 15 | ||
| 16 | public interface Consult { | 16 | public interface Consult { |
| 17 | 17 | ||
| 18 | - @GET("/api/ParentService/GetAds") | 18 | + @GET("api/ParentService/GetAds") |
| 19 | Observable<JsonObject> getBanners(@Query("position") String position, @Query("areaName") String areaName); | 19 | Observable<JsonObject> getBanners(@Query("position") String position, @Query("areaName") String areaName); |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | @FormUrlEncoded | 22 | @FormUrlEncoded |
| 23 | - @POST("/api/ParentService/GetChannelInfo") | 23 | + @POST("api/ParentService/GetChannelInfo") |
| 24 | Observable<JsonObject> getConsultContent(@Field("areaName") String areaName, @Field("channel") int channel | 24 | Observable<JsonObject> getConsultContent(@Field("areaName") String areaName, @Field("channel") int channel |
| 25 | , @Field("toFirstPage") int toFirstPage, @Field("pageIndex") int pageIndex); | 25 | , @Field("toFirstPage") int toFirstPage, @Field("pageIndex") int pageIndex); |
| 26 | 26 | ||
| 27 | + @FormUrlEncoded | ||
| 28 | + @POST("api/ParentService/GetInformationTopic") | ||
| 29 | + Observable<JsonObject> getInformationTopic(@Field("keyword") String keyword,@Field("areaName") String areaName, @Field("channel") String channel | ||
| 30 | + , @Field("toFirstPage") String toFirstPage, @Field("pageIndex") int pageIndex); | ||
| 31 | + | ||
| 27 | } | 32 | } |
app/src/main/java/com/shunzhi/parent/model/consult/consultone/ConsultOneModel.java
| @@ -5,6 +5,7 @@ import com.share.mvpsdk.base.BaseModel; | @@ -5,6 +5,7 @@ import com.share.mvpsdk.base.BaseModel; | ||
| 5 | import com.share.mvpsdk.helper.RetrofitCreateHelper; | 5 | 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.AppContext; | ||
| 8 | import com.shunzhi.parent.api.Consult; | 9 | import com.shunzhi.parent.api.Consult; |
| 9 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; | 10 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; |
| 10 | 11 | ||
| @@ -39,7 +40,8 @@ public class ConsultOneModel extends BaseModel implements ConsultOneContract.ICo | @@ -39,7 +40,8 @@ public class ConsultOneModel extends BaseModel implements ConsultOneContract.ICo | ||
| 39 | 40 | ||
| 40 | @Override | 41 | @Override |
| 41 | public Observable<JsonObject> getInformationTopic(String keyword, String areaName, String channel, String toFirstPage, int pageIndex) { | 42 | public Observable<JsonObject> getInformationTopic(String keyword, String areaName, String channel, String toFirstPage, int pageIndex) { |
| 42 | - return null; | 43 | + return RetrofitCreateHelper.getInstance().createApi(Consult.class, AppConfig.BASE_URL) |
| 44 | + .getInformationTopic(keyword,areaName,channel,toFirstPage,pageIndex).compose(RxHelper.<JsonObject>rxSchedulerHelper()); | ||
| 43 | } | 45 | } |
| 44 | 46 | ||
| 45 | 47 |
app/src/main/java/com/shunzhi/parent/presenter/consult/ConsultPresenter.java
| @@ -54,7 +54,7 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { | @@ -54,7 +54,7 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { | ||
| 54 | textAndImgShowView.setOnClickListener(new View.OnClickListener() { | 54 | textAndImgShowView.setOnClickListener(new View.OnClickListener() { |
| 55 | @Override | 55 | @Override |
| 56 | public void onClick(View view) { | 56 | public void onClick(View view) { |
| 57 | - ConsultOneLevelActivity.getInstance(mIView.getBindActivity()); | 57 | +// ConsultOneLevelActivity.getInstance(mIView.getBindActivity()); |
| 58 | } | 58 | } |
| 59 | }); | 59 | }); |
| 60 | layout_control.addView(textAndImgShowView); | 60 | layout_control.addView(textAndImgShowView); |
| @@ -94,7 +94,7 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { | @@ -94,7 +94,7 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { | ||
| 94 | mRxManager.register(mIModel.getContextChannel(areaName, channel, toFirstPage, pageIndex).subscribe(new Consumer<JsonObject>() { | 94 | mRxManager.register(mIModel.getContextChannel(areaName, channel, toFirstPage, pageIndex).subscribe(new Consumer<JsonObject>() { |
| 95 | @Override | 95 | @Override |
| 96 | public void accept(JsonObject jsonObject) throws Exception { | 96 | public void accept(JsonObject jsonObject) throws Exception { |
| 97 | - ToastUtils.showToast(jsonObject.toString()); | 97 | +// ToastUtils.showToast(jsonObject.toString()); |
| 98 | JsonObject json=jsonObject.getAsJsonObject("data"); | 98 | JsonObject json=jsonObject.getAsJsonObject("data"); |
| 99 | Gson g=new Gson(); | 99 | Gson g=new Gson(); |
| 100 | ChannelInfo channelInfo = g.fromJson(json.toString(),ChannelInfo.class); | 100 | ChannelInfo channelInfo = g.fromJson(json.toString(),ChannelInfo.class); |
app/src/main/java/com/shunzhi/parent/presenter/consult/consultone/ConsultOnePresenter.java
| @@ -52,7 +52,7 @@ public class ConsultOnePresenter extends ConsultOneContract.ConsultOnePresenter{ | @@ -52,7 +52,7 @@ public class ConsultOnePresenter extends ConsultOneContract.ConsultOnePresenter{ | ||
| 52 | textAndImgShowView.setOnClickListener(new View.OnClickListener() { | 52 | textAndImgShowView.setOnClickListener(new View.OnClickListener() { |
| 53 | @Override | 53 | @Override |
| 54 | public void onClick(View view) { | 54 | public void onClick(View view) { |
| 55 | - ConsultTwoLevelActivity.getInstance(mIView.getBindActivity()); | 55 | +// ConsultTwoLevelActivity.getInstance(mIView.getBindActivity()); |
| 56 | } | 56 | } |
| 57 | }); | 57 | }); |
| 58 | } | 58 | } |
| @@ -89,7 +89,7 @@ public class ConsultOnePresenter extends ConsultOneContract.ConsultOnePresenter{ | @@ -89,7 +89,7 @@ public class ConsultOnePresenter extends ConsultOneContract.ConsultOnePresenter{ | ||
| 89 | mRxManager.register(mIModel.getConsultContent(areaName, channel, toFirstPage, pageIndex).subscribe(new Consumer<JsonObject>() { | 89 | mRxManager.register(mIModel.getConsultContent(areaName, channel, toFirstPage, pageIndex).subscribe(new Consumer<JsonObject>() { |
| 90 | @Override | 90 | @Override |
| 91 | public void accept(JsonObject jsonObject) throws Exception { | 91 | public void accept(JsonObject jsonObject) throws Exception { |
| 92 | - ToastUtils.showToast(jsonObject.toString()); | 92 | +// ToastUtils.showToast(jsonObject.toString()); |
| 93 | JsonObject json=jsonObject.getAsJsonObject("data"); | 93 | JsonObject json=jsonObject.getAsJsonObject("data"); |
| 94 | Gson g=new Gson(); | 94 | Gson g=new Gson(); |
| 95 | ChannelInfo channelInfo = g.fromJson(json.toString(),ChannelInfo.class); | 95 | ChannelInfo channelInfo = g.fromJson(json.toString(),ChannelInfo.class); |
app/src/main/java/com/shunzhi/parent/ui/activity/consult/ConsultOneLevelActivity.java
| @@ -2,27 +2,40 @@ package com.shunzhi.parent.ui.activity.consult; | @@ -2,27 +2,40 @@ package com.shunzhi.parent.ui.activity.consult; | ||
| 2 | 2 | ||
| 3 | import android.content.Context; | 3 | import android.content.Context; |
| 4 | import android.content.Intent; | 4 | import android.content.Intent; |
| 5 | +import android.support.v4.app.FragmentTransaction; | ||
| 5 | import android.support.v7.app.AppCompatActivity; | 6 | import android.support.v7.app.AppCompatActivity; |
| 6 | import android.os.Bundle; | 7 | import android.os.Bundle; |
| 7 | import android.view.View; | 8 | import android.view.View; |
| 8 | import android.widget.EditText; | 9 | import android.widget.EditText; |
| 10 | +import android.widget.FrameLayout; | ||
| 9 | import android.widget.ImageView; | 11 | import android.widget.ImageView; |
| 10 | import android.widget.TextView; | 12 | import android.widget.TextView; |
| 11 | 13 | ||
| 12 | import com.share.mvpsdk.base.activity.BaseCompatActivity; | 14 | import com.share.mvpsdk.base.activity.BaseCompatActivity; |
| 15 | +import com.share.mvpsdk.utils.ToastUtils; | ||
| 13 | import com.shunzhi.parent.R; | 16 | import com.shunzhi.parent.R; |
| 17 | +import com.shunzhi.parent.ui.fragment.consult.ConsultOneLevelFragment; | ||
| 14 | 18 | ||
| 15 | public class ConsultOneLevelActivity extends BaseCompatActivity implements View.OnClickListener{ | 19 | public class ConsultOneLevelActivity extends BaseCompatActivity implements View.OnClickListener{ |
| 16 | 20 | ||
| 17 | 21 | ||
| 18 | - public static void getInstance(Context context){ | 22 | + public static void getInstance(Context context,String channel){ |
| 19 | Intent intent=new Intent(context,ConsultOneLevelActivity.class); | 23 | Intent intent=new Intent(context,ConsultOneLevelActivity.class); |
| 24 | + intent.putExtra("channel",channel); | ||
| 20 | context.startActivity(intent); | 25 | context.startActivity(intent); |
| 21 | } | 26 | } |
| 22 | 27 | ||
| 23 | EditText et_search; | 28 | EditText et_search; |
| 24 | 29 | ||
| 25 | ImageView ivSearch,ivBack; | 30 | ImageView ivSearch,ivBack; |
| 31 | + | ||
| 32 | + String channel=""; | ||
| 33 | + | ||
| 34 | + FrameLayout frame_consult; | ||
| 35 | + | ||
| 36 | + FragmentTransaction fragmentTransaction=null; | ||
| 37 | + | ||
| 38 | + ConsultOneLevelFragment consultOneLevelFragment=null; | ||
| 26 | @Override | 39 | @Override |
| 27 | protected void initView(Bundle savedInstanceState) { | 40 | protected void initView(Bundle savedInstanceState) { |
| 28 | 41 | ||
| @@ -32,12 +45,23 @@ public class ConsultOneLevelActivity extends BaseCompatActivity implements View. | @@ -32,12 +45,23 @@ public class ConsultOneLevelActivity extends BaseCompatActivity implements View. | ||
| 32 | 45 | ||
| 33 | private void initViews() { | 46 | private void initViews() { |
| 34 | 47 | ||
| 48 | + channel=getIntent().getStringExtra("channel"); | ||
| 49 | + consultOneLevelFragment=new ConsultOneLevelFragment(); | ||
| 35 | et_search=findViewById(R.id.et_search); | 50 | et_search=findViewById(R.id.et_search); |
| 36 | ivSearch=findViewById(R.id.ivSearch); | 51 | ivSearch=findViewById(R.id.ivSearch); |
| 37 | ivBack=findViewById(R.id.ivBack); | 52 | ivBack=findViewById(R.id.ivBack); |
| 53 | + frame_consult=findViewById(R.id.frame_consult); | ||
| 38 | 54 | ||
| 39 | ivSearch.setOnClickListener(this); | 55 | ivSearch.setOnClickListener(this); |
| 40 | ivBack.setOnClickListener(this); | 56 | ivBack.setOnClickListener(this); |
| 57 | + | ||
| 58 | + Bundle bundle=new Bundle(); | ||
| 59 | + bundle.putString("channel",channel); | ||
| 60 | + consultOneLevelFragment.setArguments(bundle); | ||
| 61 | + ToastUtils.showToast("channel="+channel); | ||
| 62 | + fragmentTransaction=getSupportFragmentManager().beginTransaction(); | ||
| 63 | + fragmentTransaction.add(R.id.frame_consult,consultOneLevelFragment) | ||
| 64 | + .show(consultOneLevelFragment).commit(); | ||
| 41 | } | 65 | } |
| 42 | 66 | ||
| 43 | @Override | 67 | @Override |
app/src/main/java/com/shunzhi/parent/ui/activity/consult/ConsultTwoLevelActivity.java
| @@ -21,8 +21,9 @@ import java.util.List; | @@ -21,8 +21,9 @@ import java.util.List; | ||
| 21 | 21 | ||
| 22 | public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements View.OnClickListener { | 22 | public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements View.OnClickListener { |
| 23 | 23 | ||
| 24 | - public static void getInstance(Context context){ | 24 | + public static void getInstance(Context context,String channel){ |
| 25 | Intent intent=new Intent(context,ConsultTwoLevelActivity.class); | 25 | Intent intent=new Intent(context,ConsultTwoLevelActivity.class); |
| 26 | + intent.putExtra("channel",channel); | ||
| 26 | context.startActivity(intent); | 27 | context.startActivity(intent); |
| 27 | } | 28 | } |
| 28 | 29 | ||
| @@ -30,7 +31,7 @@ public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements Vi | @@ -30,7 +31,7 @@ public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements Vi | ||
| 30 | 31 | ||
| 31 | EditText et_search; | 32 | EditText et_search; |
| 32 | 33 | ||
| 33 | - | 34 | + String channel; |
| 34 | @Override | 35 | @Override |
| 35 | protected void initView(Bundle savedInstanceState) { | 36 | protected void initView(Bundle savedInstanceState) { |
| 36 | initViews(); | 37 | initViews(); |
| @@ -43,7 +44,7 @@ public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements Vi | @@ -43,7 +44,7 @@ public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements Vi | ||
| 43 | 44 | ||
| 44 | 45 | ||
| 45 | private void initViews() { | 46 | private void initViews() { |
| 46 | - | 47 | + channel=getIntent().getStringExtra("channel"); |
| 47 | ivBack = findViewById(R.id.ivBack); | 48 | ivBack = findViewById(R.id.ivBack); |
| 48 | ivBack.setOnClickListener(this); | 49 | ivBack.setOnClickListener(this); |
| 49 | 50 |
app/src/main/java/com/shunzhi/parent/ui/fragment/CePingFragment.java
| @@ -173,7 +173,9 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -173,7 +173,9 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
| 173 | public void getCity(String name) { | 173 | public void getCity(String name) { |
| 174 | tvLocalAddress.setText(name.split(" ")[1]); | 174 | tvLocalAddress.setText(name.split(" ")[1]); |
| 175 | mPresenter.getTools(layout_control, name.split(" ")[2]); | 175 | mPresenter.getTools(layout_control, name.split(" ")[2]); |
| 176 | - ToastUtils.showToast(name.split(" ")[2]); | 176 | + AppContext.getInstance().cityName=name.split(" ")[1]; |
| 177 | + AppContext.getInstance().district=name.split(" ")[2]; | ||
| 178 | +// ToastUtils.showToast(name.split(" ")[2]); | ||
| 177 | } | 179 | } |
| 178 | 180 | ||
| 179 | @Override | 181 | @Override |
app/src/main/java/com/shunzhi/parent/ui/fragment/ConsultFragment.java
| @@ -196,7 +196,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -196,7 +196,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
| 196 | } | 196 | } |
| 197 | 197 | ||
| 198 | @Override | 198 | @Override |
| 199 | - public void showChannel(List<ChannelBean> list) { | 199 | + public void showChannel(final List<ChannelBean> list) { |
| 200 | for (int i = 0; i < list.size(); i++) { | 200 | for (int i = 0; i < list.size(); i++) { |
| 201 | TextAndImgShowView textAndImgShowView = new TextAndImgShowView(getActivity()); | 201 | TextAndImgShowView textAndImgShowView = new TextAndImgShowView(getActivity()); |
| 202 | textAndImgShowView.setTextColor(R.color.textColor); | 202 | textAndImgShowView.setTextColor(R.color.textColor); |
| @@ -206,10 +206,12 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -206,10 +206,12 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
| 206 | textAndImgShowView.setSelect(true); | 206 | textAndImgShowView.setSelect(true); |
| 207 | textAndImgShowView.setWidth(getActivity(), layout_control); | 207 | textAndImgShowView.setWidth(getActivity(), layout_control); |
| 208 | textAndImgShowView.setBackground(AttrsUtils.getAttrs(getActivity()).getDrawable(0)); | 208 | textAndImgShowView.setBackground(AttrsUtils.getAttrs(getActivity()).getDrawable(0)); |
| 209 | + textAndImgShowView.setTag(list.get(i)); | ||
| 209 | textAndImgShowView.setOnClickListener(new View.OnClickListener() { | 210 | textAndImgShowView.setOnClickListener(new View.OnClickListener() { |
| 210 | @Override | 211 | @Override |
| 211 | public void onClick(View view) { | 212 | public void onClick(View view) { |
| 212 | - ConsultOneLevelActivity.getInstance(getActivity()); | 213 | + ChannelBean channelBean= (ChannelBean) view.getTag(); |
| 214 | + ConsultOneLevelActivity.getInstance(getActivity(),channelBean.getId()+""); | ||
| 213 | } | 215 | } |
| 214 | }); | 216 | }); |
| 215 | layout_control.addView(textAndImgShowView); | 217 | layout_control.addView(textAndImgShowView); |
| @@ -233,5 +235,9 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -233,5 +235,9 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
| 233 | @Override | 235 | @Override |
| 234 | public void getCity(String name) { | 236 | public void getCity(String name) { |
| 235 | tvLocalAddress.setText(name.split(" ")[1]); | 237 | tvLocalAddress.setText(name.split(" ")[1]); |
| 238 | + mPresenter.getBanners("2", name.split(" ")[2]); | ||
| 239 | + mPresenter.getContextChannel(name.split(" ")[2], 0, 1, 1); | ||
| 240 | + AppContext.getInstance().cityName=name.split(" ")[1]; | ||
| 241 | + AppContext.getInstance().district=name.split(" ")[2]; | ||
| 236 | } | 242 | } |
| 237 | } | 243 | } |
app/src/main/java/com/shunzhi/parent/ui/fragment/StartFragment.java
| @@ -54,6 +54,7 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | @@ -54,6 +54,7 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | ||
| 54 | @Override | 54 | @Override |
| 55 | public void onClick(View view) { | 55 | public void onClick(View view) { |
| 56 | startNewActivity(MainActivity.class); | 56 | startNewActivity(MainActivity.class); |
| 57 | + getActivity().finish(); | ||
| 57 | } | 58 | } |
| 58 | }); | 59 | }); |
| 59 | 60 |
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultOneLevelFragment.java
| @@ -20,6 +20,7 @@ import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; | @@ -20,6 +20,7 @@ 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; | ||
| 23 | import com.shunzhi.parent.AppConfig; | 24 | import com.shunzhi.parent.AppConfig; |
| 24 | import com.shunzhi.parent.AppContext; | 25 | import com.shunzhi.parent.AppContext; |
| 25 | import com.shunzhi.parent.R; | 26 | import com.shunzhi.parent.R; |
| @@ -31,6 +32,7 @@ import com.shunzhi.parent.bean.channel.ChannelContextBean; | @@ -31,6 +32,7 @@ import com.shunzhi.parent.bean.channel.ChannelContextBean; | ||
| 31 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; | 32 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; |
| 32 | import com.shunzhi.parent.presenter.consult.consultone.ConsultOnePresenter; | 33 | import com.shunzhi.parent.presenter.consult.consultone.ConsultOnePresenter; |
| 33 | import com.shunzhi.parent.ui.activity.consult.ConsultOneLevelActivity; | 34 | import com.shunzhi.parent.ui.activity.consult.ConsultOneLevelActivity; |
| 35 | +import com.shunzhi.parent.ui.activity.consult.ConsultTwoLevelActivity; | ||
| 34 | import com.shunzhi.parent.util.AttrsUtils; | 36 | import com.shunzhi.parent.util.AttrsUtils; |
| 35 | import com.shunzhi.parent.views.TextAndImgShowView; | 37 | import com.shunzhi.parent.views.TextAndImgShowView; |
| 36 | 38 | ||
| @@ -49,6 +51,8 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -49,6 +51,8 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
| 49 | 51 | ||
| 50 | List<MyConsultBean> myConsultBeanList = null; | 52 | List<MyConsultBean> myConsultBeanList = null; |
| 51 | 53 | ||
| 54 | + String channel=""; | ||
| 55 | + | ||
| 52 | @Override | 56 | @Override |
| 53 | public int getLayoutId() { | 57 | public int getLayoutId() { |
| 54 | return R.layout.fragment_consult_one_level; | 58 | return R.layout.fragment_consult_one_level; |
| @@ -79,7 +83,8 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -79,7 +83,8 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
| 79 | } | 83 | } |
| 80 | 84 | ||
| 81 | private void initViews(View view) { | 85 | private void initViews(View view) { |
| 82 | - | 86 | + channel=getArguments().getString("channel"); |
| 87 | + ToastUtils.showToast(channel); | ||
| 83 | layout_control = view.findViewById(R.id.layout_control); | 88 | layout_control = view.findViewById(R.id.layout_control); |
| 84 | layout_control.measure(0, 0); | 89 | layout_control.measure(0, 0); |
| 85 | // mPresenter.getTools(layout_control); | 90 | // mPresenter.getTools(layout_control); |
| @@ -87,7 +92,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -87,7 +92,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
| 87 | recyclerViewConsultOne = view.findViewById(R.id.recyclerViewConsultOne); | 92 | recyclerViewConsultOne = view.findViewById(R.id.recyclerViewConsultOne); |
| 88 | 93 | ||
| 89 | mPresenter.getBanners("3", AppContext.getInstance().district); | 94 | mPresenter.getBanners("3", AppContext.getInstance().district); |
| 90 | - mPresenter.getConsultContent(AppContext.getInstance().district, 42, 0, 1); | 95 | + mPresenter.getConsultContent(AppContext.getInstance().district, Integer.parseInt(channel), 0, 1); |
| 91 | // initRecyclerViewConsult(); | 96 | // initRecyclerViewConsult(); |
| 92 | } | 97 | } |
| 93 | 98 | ||
| @@ -132,8 +137,6 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -132,8 +137,6 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
| 132 | 137 | ||
| 133 | @Override | 138 | @Override |
| 134 | public void showConsultContent(List<ChannelContextBean> list) { | 139 | public void showConsultContent(List<ChannelContextBean> list) { |
| 135 | -// contextList.clear(); | ||
| 136 | -// contextList.addAll(list); | ||
| 137 | if (null == myConsultAdapter) myConsultAdapter = new MyConsultAdapter(getActivity()); | 140 | if (null == myConsultAdapter) myConsultAdapter = new MyConsultAdapter(getActivity()); |
| 138 | myConsultAdapter.addAll(list); | 141 | myConsultAdapter.addAll(list); |
| 139 | recyclerViewConsultOne.setAdapter(myConsultAdapter); | 142 | recyclerViewConsultOne.setAdapter(myConsultAdapter); |
| @@ -150,10 +153,12 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -150,10 +153,12 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
| 150 | textAndImgShowView.setSelect(true); | 153 | textAndImgShowView.setSelect(true); |
| 151 | textAndImgShowView.setWidth(getActivity(), layout_control); | 154 | textAndImgShowView.setWidth(getActivity(), layout_control); |
| 152 | textAndImgShowView.setBackground(AttrsUtils.getAttrs(getActivity()).getDrawable(0)); | 155 | textAndImgShowView.setBackground(AttrsUtils.getAttrs(getActivity()).getDrawable(0)); |
| 156 | + textAndImgShowView.setTag(list.get(i)); | ||
| 153 | textAndImgShowView.setOnClickListener(new View.OnClickListener() { | 157 | textAndImgShowView.setOnClickListener(new View.OnClickListener() { |
| 154 | @Override | 158 | @Override |
| 155 | public void onClick(View view) { | 159 | public void onClick(View view) { |
| 156 | - ConsultOneLevelActivity.getInstance(getActivity()); | 160 | + ChannelBean channelBean= (ChannelBean) view.getTag(); |
| 161 | + ConsultTwoLevelActivity.getInstance(getActivity(),channelBean.getId()+""); | ||
| 157 | } | 162 | } |
| 158 | }); | 163 | }); |
| 159 | layout_control.addView(textAndImgShowView); | 164 | layout_control.addView(textAndImgShowView); |
app/src/main/res/layout/activity_consult_one_level.xml
| @@ -10,11 +10,10 @@ | @@ -10,11 +10,10 @@ | ||
| 10 | <include layout="@layout/layout_search_back"/> | 10 | <include layout="@layout/layout_search_back"/> |
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | - <fragment | ||
| 14 | - android:id="@+id/MyFragment" | 13 | + <FrameLayout |
| 15 | android:layout_width="match_parent" | 14 | android:layout_width="match_parent" |
| 16 | android:layout_height="match_parent" | 15 | android:layout_height="match_parent" |
| 17 | - android:name="com.shunzhi.parent.ui.fragment.consult.ConsultOneLevelFragment" | ||
| 18 | - /> | 16 | + android:id="@+id/frame_consult" |
| 17 | + ></FrameLayout> | ||
| 19 | 18 | ||
| 20 | </LinearLayout> | 19 | </LinearLayout> |
app/src/main/res/layout/fragment_mine.xml
| @@ -241,7 +241,7 @@ | @@ -241,7 +241,7 @@ | ||
| 241 | <LinearLayout | 241 | <LinearLayout |
| 242 | android:layout_width="match_parent" | 242 | android:layout_width="match_parent" |
| 243 | android:gravity="center_vertical" | 243 | android:gravity="center_vertical" |
| 244 | - android:layout_height="40dp"> | 244 | + android:layout_height="?android:actionBarSize"> |
| 245 | 245 | ||
| 246 | <TextView | 246 | <TextView |
| 247 | android:layout_width="25dp" | 247 | android:layout_width="25dp" |
| @@ -269,7 +269,7 @@ | @@ -269,7 +269,7 @@ | ||
| 269 | 269 | ||
| 270 | <LinearLayout | 270 | <LinearLayout |
| 271 | android:layout_width="match_parent" | 271 | android:layout_width="match_parent" |
| 272 | - android:layout_height="40dp" | 272 | + android:layout_height="?android:actionBarSize" |
| 273 | android:gravity="center_vertical" | 273 | android:gravity="center_vertical" |
| 274 | 274 | ||
| 275 | > | 275 | > |
| @@ -299,7 +299,7 @@ | @@ -299,7 +299,7 @@ | ||
| 299 | android:background="@color/bottomline" /> | 299 | android:background="@color/bottomline" /> |
| 300 | <LinearLayout | 300 | <LinearLayout |
| 301 | android:layout_width="match_parent" | 301 | android:layout_width="match_parent" |
| 302 | - android:layout_height="40dp" | 302 | + android:layout_height="?android:actionBarSize" |
| 303 | android:gravity="center_vertical" | 303 | android:gravity="center_vertical" |
| 304 | > | 304 | > |
| 305 | 305 | ||
| @@ -324,14 +324,12 @@ | @@ -324,14 +324,12 @@ | ||
| 324 | <TextView | 324 | <TextView |
| 325 | android:id="@+id/tvExit" | 325 | android:id="@+id/tvExit" |
| 326 | android:layout_width="match_parent" | 326 | android:layout_width="match_parent" |
| 327 | - android:layout_height="wrap_content" | 327 | + android:layout_height="?android:actionBarSize" |
| 328 | android:layout_gravity="center_vertical" | 328 | android:layout_gravity="center_vertical" |
| 329 | android:gravity="center" | 329 | android:gravity="center" |
| 330 | android:layout_weight="1" | 330 | android:layout_weight="1" |
| 331 | android:layout_marginTop="@dimen/size_dp_15" | 331 | android:layout_marginTop="@dimen/size_dp_15" |
| 332 | android:layout_marginBottom="@dimen/size_dp_15" | 332 | android:layout_marginBottom="@dimen/size_dp_15" |
| 333 | - android:paddingTop="@dimen/size_dp_5" | ||
| 334 | - android:paddingBottom="@dimen/size_dp_5" | ||
| 335 | android:background="@drawable/shape_xueqing_radius8" | 333 | android:background="@drawable/shape_xueqing_radius8" |
| 336 | android:text="退出登录" | 334 | android:text="退出登录" |
| 337 | android:textColor="@color/white" | 335 | android:textColor="@color/white" |