@@ -12,37 +12,35 @@ import com.petterp.floatingx.util.contentView
1212class ScopeHelper : BasisHelper () {
1313
1414 /* * 插入到Activity中 */
15- fun toControl (activity : Activity ): IFxScopeControl {
15+ fun toControl (activity : Activity ): IFxScopeControl < Activity > {
1616 initLog(FxScopeEnum .ACTIVITY_SCOPE .tag)
17- val control = initScopeControl( )
17+ val control = FxScopeControl < Activity >( this )
1818 activity.contentView?.let {
1919 control.setContainerGroup(it)
2020 } ? : fxLog?.e(" install to Activity the Error,current contentView(R.id.content) = null!" )
2121 return control
2222 }
2323
2424 /* * 插入到Fragment中 */
25- fun toControl (fragment : Fragment ): IFxScopeControl {
25+ fun toControl (fragment : Fragment ): IFxScopeControl < Fragment > {
2626 initLog(FxScopeEnum .FRAGMENT_SCOPE .tag)
2727 val rootView = fragment.view as ? FrameLayout
2828 checkNotNull(rootView) {
2929 " Check if your root layout is FrameLayout, or if the init call timing is after onCreateView()!"
3030 }
31- val control = initScopeControl( )
31+ val control = FxScopeControl < Fragment >( this )
3232 control.setContainerGroup(rootView)
3333 return control
3434 }
3535
3636 /* * 插入到ViewGroup中 */
37- fun toControl (group : FrameLayout ): IFxScopeControl {
37+ fun toControl (group : FrameLayout ): IFxScopeControl < FrameLayout > {
3838 initLog(FxScopeEnum .VIEW_GROUP_SCOPE .tag)
39- val control = initScopeControl( )
39+ val control = FxScopeControl < FrameLayout >( this )
4040 control.setContainerGroup(group)
4141 return control
4242 }
4343
44- private fun initScopeControl () = FxScopeControl (this )
45-
4644 companion object {
4745 @JvmStatic
4846 fun builder (): Builder = Builder ()
0 commit comments