8
8
9
9
``` groovy
10
10
dependencies {
11
- implementation 'com.github.DylanCaiCoding.LoadingStateView:loadingstateview-ktx:4.0.2 '
11
+ implementation 'com.github.DylanCaiCoding.LoadingStateView:loadingstateview-ktx:4.1.0 '
12
12
}
13
13
```
14
14
15
15
修改步骤如下:
16
16
17
- 1 . 实现 ` LoadingState by LoadingStateDelegate(), OnReloadListener, Decorative ` 接口,其中 ` LoadingState ` 接口委托给了 ` LoadingStateDelegate ` 代理类 。
18
- 2 . 在 Activity 的 ` setContentView() ` 方法后执行 ` decorateContentView(this, this ) ` 。在 Fragment 的 ` onCreateView() ` 返回 ` view.decorate(this, this) ` 。
17
+ 1 . 实现 ` LoadingState by LoadingStateDelegate() ` 。
18
+ 2 . 在 Activity 的 ` setContentView() ` 方法后执行 ` decorateContentView(this) ` 。在 Fragment 的 ` onCreateView() ` 返回 ` view.decorate(this) ` 。
19
19
20
20
<!-- tabs:start -->
21
21
@@ -28,12 +28,12 @@ dependencies {
28
28
29
29
``` kotlin
30
30
abstract class BaseActivity (private val layoutRes : Int ) : AppCompatActivity(),
31
- LoadingState by LoadingStateDelegate (), OnReloadListener , Decorative {
31
+ LoadingState by LoadingStateDelegate () {
32
32
33
33
override fun onCreate (savedInstanceState : Bundle ? ) {
34
34
super .onCreate(savedInstanceState)
35
35
setContentView(layoutRes)
36
- decorateContentView(this , this )
36
+ decorateContentView(this )
37
37
}
38
38
}
39
39
```
@@ -49,13 +49,13 @@ abstract class BaseActivity(private val layoutRes: Int) : AppCompatActivity(),
49
49
50
50
``` kotlin
51
51
abstract class BaseFragment (private val layoutRes : Int ) : Fragment(),
52
- LoadingState by LoadingStateDelegate (), OnReloadListener , Decorative {
52
+ LoadingState by LoadingStateDelegate () {
53
53
54
54
override fun onCreateView (
55
55
inflater : LayoutInflater , container : ViewGroup ? , savedInstanceState : Bundle ?
56
56
): View ? {
57
57
val root = inflater.inflate(layoutRes, container, false )
58
- return root.decorate(this , this )
58
+ return root.decorate(this )
59
59
}
60
60
}
61
61
```
0 commit comments