We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
比如在网络请求开始前显示loading 弹窗,网络请求结束时销毁弹窗,ViewModel里面调用Model层获取数据,那么在调用Model层前显示loading,请求结束时销毁loading,而ViewModel不建议应用View层,我该如何通知View层去显示或者销毁loading弹窗呢,暂时我想到的办法是另外每个页面都需要单独定义一个LiveData去设置显示还是销毁,然后View层观察他的值的变化。
想问下有没有更好的办法。
The text was updated successfully, but these errors were encountered:
在ViewModel 里面定义一个public 的 loadingLiveData.,开始和结束发送数据,然后在View层去添加observer
Sorry, something went wrong.
如 LiveData loadingLiveData=new LiveData<>(); loadingLiveData.setValue(true|false)
No branches or pull requests
比如在网络请求开始前显示loading 弹窗,网络请求结束时销毁弹窗,ViewModel里面调用Model层获取数据,那么在调用Model层前显示loading,请求结束时销毁loading,而ViewModel不建议应用View层,我该如何通知View层去显示或者销毁loading弹窗呢,暂时我想到的办法是另外每个页面都需要单独定义一个LiveData去设置显示还是销毁,然后View层观察他的值的变化。
想问下有没有更好的办法。
The text was updated successfully, but these errors were encountered: