diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/courses/CoursesFragment.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/courses/CoursesFragment.java index ce3614bc750e2e6be81463dd84f04c6fd5257d38..d652ef9c048b42e1c7672a5b0f8dbf8243d28b2b 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/courses/CoursesFragment.java +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/courses/CoursesFragment.java @@ -65,6 +65,9 @@ public class CoursesFragment extends BaseFragment super.onViewCreated(view, savedInstanceState); smartRefreshLayout = view.findViewById(R.id.refreshLayout); multipleStatusView = view.findViewById(R.id.multipleStatusView); + multipleStatusView.setOnRetryClickListener(v -> { + lazyInit(); + }); mRecyclerView = view.findViewById(R.id.recyclerView); mFrameLayout = view.findViewById(R.id.fragmentRefreshLayout); 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 bf11eb89d50d261bd329297ca3b31a7db1ab8e09..e87b158de793bc47e8e2cdd63441705a7ec9bfd2 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 @@ -100,6 +100,9 @@ public class CaseFragment extends BaseFragment implements Gat super.onViewCreated(view, savedInstanceState); smartRefreshLayout = view.findViewById(R.id.refreshLayout); multipleStatusView = view.findViewById(R.id.multipleStatusView); + multipleStatusView.setOnRetryClickListener(v -> { + lazyInit(); + }); mRecyclerView = view.findViewById(R.id.recyclerView); mFrameLayout = view.findViewById(R.id.fragmentRefreshLayout); 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 8f85573b203f740a18159932bdde633d1d69275a..45b012496d137ecb5330ba291d22b9b71e29d6e4 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 @@ -31,7 +31,8 @@ import com.mindspore.himindspore.ui.gateway.mvp.GateContract; import com.mindspore.himindspore.ui.gateway.mvp.GateDetailPresenter; import com.zzhoujay.richtext.RichText; -public class ContentDetailActivity extends BaseActivity implements GateContract.GateDetailView,View.OnClickListener { +public class ContentDetailActivity extends BaseActivity implements + GateContract.GateDetailView, View.OnClickListener { private RecyclerView recyclerView; @@ -69,7 +70,11 @@ public class ContentDetailActivity extends BaseActivity imp mComEdit.setShowSoftInputOnFocus(false); mComEdit.setOnClickListener(this); multipleStatusView = findViewById(R.id.multipleStatusView); - presenter.requestTrendDetailData(id); + multipleStatusView.setOnRetryClickListener(v -> { + requestNetworkData(); + }); + + requestNetworkData(); commentView = findViewById(R.id.com_comment_image); favoritesView = findViewById(R.id.com_favorites_image); @@ -82,6 +87,9 @@ public class ContentDetailActivity extends BaseActivity imp initData(); } + private void requestNetworkData() { + presenter.requestTrendDetailData(id); + } private void initData() { layoutManager = new VirtualLayoutManager(this); 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 1f6da26b95ab9cebd8b592d3d075dcc5374d014e..74e39b2e99b67d3d98db3d26226dfc0cb78a4a35 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 @@ -93,6 +93,9 @@ public class IntroduceFragment extends BaseFragment implement super.onViewCreated(view, savedInstanceState); smartRefreshLayout = view.findViewById(R.id.refreshLayout); multipleStatusView = view.findViewById(R.id.multipleStatusView); + multipleStatusView.setOnRetryClickListener(v -> { + lazyInit(); + }); mRecyclerView = view.findViewById(R.id.recyclerView); initData(); } 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 9c8d6752943307b4b07ddcb8286c4d17fed28ff5..99526fea9a6f0aec395261f1b36d7352cb810878 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 @@ -105,6 +105,9 @@ public class TrendFragment extends BaseFragment implements Ga super.onViewCreated(view, savedInstanceState); smartRefreshLayout = view.findViewById(R.id.refreshLayout); multipleStatusView = view.findViewById(R.id.multipleStatusView); + multipleStatusView.setOnRetryClickListener(v -> { + lazyInit(); + }); mRecyclerView = view.findViewById(R.id.recyclerView); mFrameLayout = view.findViewById(R.id.fragmentRefreshLayout); initView(); diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/lessons/LessonsActivity.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/lessons/LessonsActivity.java index a252bb902e77b0e9529f6a399d821c80eca60d67..33352b3ae228f7375395d8e9d4ed05cff551dfa7 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/lessons/LessonsActivity.java +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/lessons/LessonsActivity.java @@ -152,6 +152,10 @@ private final static int[] tabs = {R.string.lessons_introduction, beginTv = findViewById(R.id.begin_study); smartRefreshLayout = findViewById(R.id.refreshLayout); multipleStatusView = findViewById(R.id.multipleStatusView); + multipleStatusView.setOnRetryClickListener(v -> { + requestNetworkData(); + }); + LinearLayout mBulletChat = findViewById(R.id.bullet_chat_layout); LinearLayout mStoreLayout = findViewById(R.id.store_layout); LinearLayout mForwardLayout = findViewById(R.id.forward_layout); @@ -163,15 +167,19 @@ private final static int[] tabs = {R.string.lessons_introduction, mForwardLayout.setOnClickListener(LessonsActivity.this); mCacheLayout.setOnClickListener(LessonsActivity.this); - // 获取网络数据 presenter = new CourseDetailsPresenter(this); - presenter.requestDetailsDetailsData(id); + requestNetworkData(); initTabLayout(); initViewPager(); initFootView(); } + private void requestNetworkData(){ + // 获取网络数据 + presenter.requestDetailsDetailsData(id); + } + @Override public int getLayout() { return R.layout.activity_lessons; diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_content_detail.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_content_detail.xml index 140f3d1a1909b53fa5394e356b400b75bf2568c4..47f699766a2b029856a23e76f2511d42a97fa525 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_content_detail.xml +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_content_detail.xml @@ -101,7 +101,7 @@ app:emptyView="@layout/layout_empty_view" app:errorView="@layout/layout_error_view" app:loadingView="@layout/layout_loading_view" - app:noNetworkView="@layout/no_network_view"> + app:noNetworkView="@layout/layout_network_view">