-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
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
视图全局配置 #23
Comments
抽象一个 |
道理明白,码不出- - |
抽象xml文件是啥意思?我的意思是说,可不可以在Application中用静态方法配置默认几个布局,这样,每个地方就不用再动态配置了 0.0 |
自定义 <?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="@layout/toolbar"/>
<com.classic.common.MultipleStatusView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="?attr/actionBarSize"
app:emptyView="@layout/custom_empty_view"
app:errorView="@layout/custom_error_view"
app:loadingView="@layout/custom_loading_view"
app:noNetworkView="@layout/custom_no_network_view">
<FrameLayout
android:id="you_content_view_id"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</com.classic.common.MultipleStatusView>
</FrameLayout> 然后有一个抽象的 |
鉴于资源覆盖的特性,在依赖本库的module中,或者作为appliaction的module中,分别创建几个布局文件,这里共4个,即:loading_view.xml 、 empty_view.xml 、error_view.xml以及no_network_view.xml ; 注意: 名字和【关键view的id】一定要与本库内部的相同,其它的样式根据自己项目来,即可实现全局配置。 |
对于整个app都公用同样一套布局的时候,可以增加一个全局配置布局的方法,app加载时一次性配置
The text was updated successfully, but these errors were encountered: