From 633624a9da79ade07b497892443cd769c2a8b80e Mon Sep 17 00:00:00 2001 From: Doracoin Date: Sun, 1 Nov 2020 12:43:51 +0800 Subject: [PATCH] Update BaseVmFragment.kt Fixed a tip message --- .../me/hgj/jetpackmvvm/base/fragment/BaseVmFragment.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/JetpackMvvm/src/main/java/me/hgj/jetpackmvvm/base/fragment/BaseVmFragment.kt b/JetpackMvvm/src/main/java/me/hgj/jetpackmvvm/base/fragment/BaseVmFragment.kt index af95d8c..d754a13 100644 --- a/JetpackMvvm/src/main/java/me/hgj/jetpackmvvm/base/fragment/BaseVmFragment.kt +++ b/JetpackMvvm/src/main/java/me/hgj/jetpackmvvm/base/fragment/BaseVmFragment.kt @@ -126,7 +126,11 @@ abstract class BaseVmFragment : Fragment() { */ private fun registorDefUIChange() { mViewModel.loadingChange.showDialog.observe(viewLifecycleOwner, Observer { - showLoading() + showLoading( + if (it.isEmpty()) { + "请求网络中..." + } else it + ) }) mViewModel.loadingChange.dismissDialog.observe(viewLifecycleOwner, Observer { dismissLoading() @@ -150,4 +154,4 @@ abstract class BaseVmFragment : Fragment() { } } -} \ No newline at end of file +}