Skip to content
This repository was archived by the owner on Jul 16, 2024. It is now read-only.

Commit 4bea6dd

Browse files
committed
增加 IFragmentCommon
1 parent 6cfc0e8 commit 4bea6dd

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

common/src/main/kotlin/io/goooler/demoapp/common/base/BaseThemeDialogFragment.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@ import io.goooler.demoapp.base.core.BaseDialogFragment
1313

1414
abstract class BaseThemeDialogFragment<VB : ViewDataBinding> @ContentView constructor(
1515
@LayoutRes private val layoutId: Int
16-
) : BaseDialogFragment(), ITheme {
16+
) : BaseDialogFragment(), ITheme, IFragmentCommon {
1717

1818
protected lateinit var binding: VB
1919

20+
override fun showLoading() {}
21+
22+
override fun hideLoading() {}
23+
24+
override fun initOnce() {}
25+
2026
override fun onCreate(savedInstanceState: Bundle?) {
2127
super.onCreate(savedInstanceState)
2228
binding = DataBindingUtil.inflate(layoutInflater, layoutId, null, false)
2329
initOnce()
2430
}
2531

26-
protected open fun initOnce() {}
27-
28-
override fun showLoading() {}
29-
30-
override fun hideLoading() {}
31-
3232
override fun onCreateView(
3333
inflater: LayoutInflater,
3434
container: ViewGroup?,

common/src/main/kotlin/io/goooler/demoapp/common/base/BaseThemeFragment.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@ import io.goooler.demoapp.base.core.BaseFragment
1313

1414
abstract class BaseThemeFragment<VB : ViewDataBinding> @ContentView constructor(
1515
@LayoutRes private val layoutId: Int
16-
) : BaseFragment(), ITheme {
16+
) : BaseFragment(), ITheme, IFragmentCommon {
1717

1818
protected lateinit var binding: VB
1919

2020
override fun showLoading() {}
2121

2222
override fun hideLoading() {}
2323

24+
override fun initOnce() {}
25+
2426
override fun onCreate(savedInstanceState: Bundle?) {
2527
super.onCreate(savedInstanceState)
2628
binding = DataBindingUtil.inflate(layoutInflater, layoutId, null, false)
@@ -33,11 +35,13 @@ abstract class BaseThemeFragment<VB : ViewDataBinding> @ContentView constructor(
3335
savedInstanceState: Bundle?
3436
): View = binding.root
3537

36-
protected open fun initOnce() {}
37-
3838
@CallSuper
3939
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
4040
super.onViewCreated(view, savedInstanceState)
4141
binding.lifecycleOwner = viewLifecycleOwner
4242
}
4343
}
44+
45+
interface IFragmentCommon {
46+
fun initOnce()
47+
}

0 commit comments

Comments
 (0)