88
99``` groovy
1010dependencies {
11- implementation 'com.github.DylanCaiCoding.LoadingStateView:loadingstateview-ktx:4.0.2 '
11+ implementation 'com.github.DylanCaiCoding.LoadingStateView:loadingstateview-ktx:4.1.0 '
1212}
1313```
1414
1515修改步骤如下:
1616
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) ` 。
1919
2020<!-- tabs:start -->
2121
@@ -28,12 +28,12 @@ dependencies {
2828
2929``` kotlin
3030abstract class BaseActivity (private val layoutRes : Int ) : AppCompatActivity(),
31- LoadingState by LoadingStateDelegate (), OnReloadListener , Decorative {
31+ LoadingState by LoadingStateDelegate () {
3232
3333 override fun onCreate (savedInstanceState : Bundle ? ) {
3434 super .onCreate(savedInstanceState)
3535 setContentView(layoutRes)
36- decorateContentView(this , this )
36+ decorateContentView(this )
3737 }
3838}
3939```
@@ -49,13 +49,13 @@ abstract class BaseActivity(private val layoutRes: Int) : AppCompatActivity(),
4949
5050``` kotlin
5151abstract class BaseFragment (private val layoutRes : Int ) : Fragment(),
52- LoadingState by LoadingStateDelegate (), OnReloadListener , Decorative {
52+ LoadingState by LoadingStateDelegate () {
5353
5454 override fun onCreateView (
5555 inflater : LayoutInflater , container : ViewGroup ? , savedInstanceState : Bundle ?
5656 ): View ? {
5757 val root = inflater.inflate(layoutRes, container, false )
58- return root.decorate(this , this )
58+ return root.decorate(this )
5959 }
6060}
6161```
0 commit comments