From 238031ea0dbb25ec8858fc2729d1cb13762ac663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E4=B9=BE=E5=B3=B0?= Date: Mon, 26 Jul 2021 15:50:04 +0800 Subject: [PATCH] Portal page refresh problem delete gateway more button --- .../himindspore/ui/gateway/CaseFragment.java | 2 +- .../ui/gateway/ContentDetailActivity.java | 3 +++ .../ui/gateway/IntroduceFragment.java | 17 ++++++++++------- .../himindspore/ui/gateway/TrendFragment.java | 2 +- .../adapter/IntroduceComponentAdapter.java | 1 - .../gateway/adapter/IntroduceCoreAdapter.java | 3 --- .../adapter/viewHolder/HorScrollViewHolder.java | 3 --- .../main/res/layout/activity_content_detail.xml | 2 +- .../res/layout/adapter_component_hor_view.xml | 11 ----------- 9 files changed, 16 insertions(+), 28 deletions(-) diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/CaseFragment.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/CaseFragment.java index 275c10744c..3e4182266e 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/CaseFragment.java +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/CaseFragment.java @@ -127,7 +127,7 @@ public class CaseFragment extends BaseFragment implements Gat @Override public void onRefresh(@NonNull @NotNull RefreshLayout refreshLayout) { - pageIndex = 1; + mList.clear(); isRefresh = true; presenter.requestGateMainData(pageIndex, pageSize, type); } diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/ContentDetailActivity.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/ContentDetailActivity.java index c0142dd07b..e33939b975 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/ContentDetailActivity.java +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/ContentDetailActivity.java @@ -2,6 +2,7 @@ package com.mindspore.himindspore.ui.gateway; import android.app.Activity; import android.content.Intent; +import android.util.Log; import android.view.View; import android.view.WindowManager; import android.widget.EditText; @@ -67,6 +68,7 @@ public class ContentDetailActivity extends BaseActivity imp recyclerView = findViewById(R.id.recyclerView); EditText mComEdit = findViewById(R.id.com_edit); mComEdit.setShowSoftInputOnFocus(false); + mComEdit.setOnClickListener(this); multipleStatusView = findViewById(R.id.multipleStatusView); presenter.requestTrendDetialData(id); @@ -183,6 +185,7 @@ public class ContentDetailActivity extends BaseActivity imp case R.id.com_favorites_image: case R.id.com_likes_image: case R.id.com_share: + case R.id.com_edit: MyToast.FunctionNoOpen(); break; default: diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/IntroduceFragment.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/IntroduceFragment.java index b8b9ee1d19..1de4f62503 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/IntroduceFragment.java +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/IntroduceFragment.java @@ -16,6 +16,7 @@ package com.mindspore.himindspore.ui.gateway; import android.os.Bundle; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -39,6 +40,9 @@ import com.mindspore.himindspore.ui.gateway.adapter.IntroduceCoreAdapter; import com.mindspore.himindspore.ui.gateway.mvp.GateContract; import com.mindspore.himindspore.ui.gateway.mvp.GateListPresenter; import com.scwang.smart.refresh.layout.SmartRefreshLayout; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.listener.OnRefreshListener; +import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; import java.util.ArrayList; import java.util.List; @@ -100,11 +104,12 @@ public class IntroduceFragment extends BaseFragment implement private void initDatas() { smartRefreshLayout.setFooterHeight(0); smartRefreshLayout.setEnableRefresh(true); + smartRefreshLayout.setEnableLoadMore(true); smartRefreshLayout.setEnableHeaderTranslationContent(true); smartRefreshLayout.setOnRefreshListener(refreshLayout -> { isRefresh = true; mList.clear(); - presenter.requestGateMainData(pageIndex, pageSize,type); + presenter.requestGateMainData(pageIndex, pageSize, type); }); layoutManager = new VirtualLayoutManager(getActivity()); @@ -126,7 +131,7 @@ public class IntroduceFragment extends BaseFragment implement GateMainBean.EntitiesBean bean = mList.get(i); if ("BANNER".equalsIgnoreCase(bean.getType())) { bannerList.add(bean); - } else if ("MODULE".equalsIgnoreCase( bean.getType())) { + } else if ("MODULE".equalsIgnoreCase(bean.getType())) { strackList.add(bean); } else if ("CORE".equalsIgnoreCase(bean.getType())) { coreList.add(bean); @@ -139,13 +144,10 @@ public class IntroduceFragment extends BaseFragment implement IntroduceBannerAdapter bannerAdapter = new IntroduceBannerAdapter(getActivity(), singleLayoutHelper, bannerList); delegateAdapter.addAdapter(bannerAdapter); - viewPool.setMaxRecycledViews(itemType++, mList.size()); SingleLayoutHelper horizontalListLayoutHelper = new SingleLayoutHelper(); IntroduceComponentAdapter introduceComponentAdapter = new IntroduceComponentAdapter(getActivity(), horizontalListLayoutHelper, strackList); delegateAdapter.addAdapter(introduceComponentAdapter); - - viewPool.setMaxRecycledViews(itemType++, mList.size()); SingleLayoutHelper horizontalListLayoutHelper2 = new SingleLayoutHelper(); IntroduceCoreAdapter introduceCoreAdapter = new IntroduceCoreAdapter(getActivity(), horizontalListLayoutHelper2, coreList); delegateAdapter.addAdapter(introduceCoreAdapter); @@ -155,7 +157,7 @@ public class IntroduceFragment extends BaseFragment implement @Override protected void lazyInit() { mList.clear(); - presenter.requestGateMainData(pageIndex, pageSize,type); + presenter.requestGateMainData(pageIndex, pageSize, type); } @Override @@ -175,8 +177,9 @@ public class IntroduceFragment extends BaseFragment implement @Override public void getResponseData(BaseResponseBean baseBean) { this.gateMainBean = baseBean.getData(); + Log.e("jiagouzhanshi", gateMainBean.toString()); multipleStatusView.showContent(); - + delegateAdapter.clear(); if (gateMainBean.getNumber() == 0) { mList.clear(); mList.addAll(gateMainBean.getEntities()); diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/TrendFragment.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/TrendFragment.java index 00584c0e41..77651f9e99 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/TrendFragment.java +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/TrendFragment.java @@ -129,7 +129,7 @@ public class TrendFragment extends BaseFragment implements Ga @Override public void onRefresh(@NonNull @NotNull RefreshLayout refreshLayout) { - pageIndex = 1; + mList.clear(); isRefresh = true; presenter.requestGateMainData(pageIndex, pageSize, type); } diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/adapter/IntroduceComponentAdapter.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/adapter/IntroduceComponentAdapter.java index c066308ed3..750d817ff0 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/adapter/IntroduceComponentAdapter.java +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/adapter/IntroduceComponentAdapter.java @@ -61,7 +61,6 @@ public class IntroduceComponentAdapter extends DelegateAdapter.Adapter MyToast.MakeText("功能还未放开",800)); } @Override diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/adapter/IntroduceCoreAdapter.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/adapter/IntroduceCoreAdapter.java index f7043cbb69..c279774c5b 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/adapter/IntroduceCoreAdapter.java +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/adapter/IntroduceCoreAdapter.java @@ -68,7 +68,6 @@ public class IntroduceCoreAdapter extends DelegateAdapter.Adapter MyToast.MakeText("功能还未放开", 800)); } @@ -123,13 +122,11 @@ public class IntroduceCoreAdapter extends DelegateAdapter.Adapter - -