forked from coolfire2015/RxFluxArchitecture
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
K0170016
authored and
K0170016
committed
Jun 25, 2019
1 parent
76d6ecd
commit 8825ed5
Showing
8 changed files
with
50 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 28 additions & 28 deletions
56
core-common/src/main/java/com/huyingbao/core/base/fragment/BaseRxBindFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
//package com.huyingbao.core.base.fragment | ||
// | ||
//import android.os.Bundle | ||
//import android.view.LayoutInflater | ||
//import android.view.View | ||
//import android.view.ViewGroup | ||
//import androidx.databinding.DataBindingUtil | ||
//import androidx.databinding.ViewDataBinding | ||
//import androidx.lifecycle.ViewModel | ||
//import com.huyingbao.core.arch.utils.autoCleared | ||
// | ||
// | ||
///** | ||
// * 使用DataBinding的Fragment | ||
// * | ||
// * Created by liujunfeng on 2019/6/10. | ||
// */ | ||
//abstract class BaseRxBindFragment<T : ViewModel, Y : ViewDataBinding> : BaseRxFragment<T>() { | ||
// /** | ||
// * 根据Fragment动态清理和获取binding对象 | ||
// */ | ||
// var binding by autoCleared<Y?>() | ||
// | ||
// override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { | ||
// binding = DataBindingUtil.inflate(inflater, getLayoutId(), container, false) | ||
// return binding?.root!! | ||
// } | ||
//} | ||
package com.huyingbao.core.base.fragment | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.databinding.DataBindingUtil | ||
import androidx.databinding.ViewDataBinding | ||
import androidx.lifecycle.ViewModel | ||
import com.huyingbao.core.arch.utils.autoCleared | ||
|
||
|
||
/** | ||
* 使用DataBinding的Fragment | ||
* | ||
* Created by liujunfeng on 2019/6/10. | ||
*/ | ||
abstract class BaseRxBindFragment<T : ViewModel, Y : ViewDataBinding> : BaseRxFragment<T>() { | ||
/** | ||
* 根据Fragment动态清理和获取binding对象 | ||
*/ | ||
var binding by autoCleared<Y?>() | ||
|
||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { | ||
binding = DataBindingUtil.inflate(inflater, getLayoutId(), container, false) | ||
return binding?.root!! | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters