diff --git a/src/main/resources/templates/ActivityTemplate.txt b/src/main/resources/templates/ActivityTemplate.txt index 6678311..39ec318 100644 --- a/src/main/resources/templates/ActivityTemplate.txt +++ b/src/main/resources/templates/ActivityTemplate.txt @@ -6,8 +6,7 @@ import kr.co.finda.finda.databinding.Activity$NAME$Binding import kr.co.finda.finda.ui.base.BaseActivity import org.koin.androidx.viewmodel.ext.android.viewModel - -class $NAME$Activity : BaseActivityV2( +class $NAME$Activity : BaseActivity( R.layout.$LAYOUT_NAME$ ) { @@ -19,10 +18,8 @@ class $NAME$Activity : BaseActivityV2( } override fun setupUiComponent() { - } override fun observeLiveData() { - } } \ No newline at end of file diff --git a/src/main/resources/templates/BottomSheetTemplate.txt b/src/main/resources/templates/BottomSheetTemplate.txt index f8d4dce..263ba7c 100644 --- a/src/main/resources/templates/BottomSheetTemplate.txt +++ b/src/main/resources/templates/BottomSheetTemplate.txt @@ -3,13 +3,22 @@ package $PACKAGE$ import kr.co.finda.finda.R import kr.co.finda.finda.databinding.BottomSheet$NAME$Binding import kr.co.finda.finda.ui.base.BaseBottomSheet +import org.koin.androidx.viewmodel.ext.android.viewModel class $NAME$BottomSheet : BaseBottomSheet( - R.layout.$LAYOUT_NAME$, - $NAME$ViewModel::class.java + R.layout.$LAYOUT_NAME$ ) { - override fun setBindingVariables() { + override val viewModel: $NAME$ViewModel by viewModel() + + override fun onInitialize(lifecycleOwner: LifecycleOwner) { + super.onInitialize(lifecycleOwner) binding.viewModel = viewModel } + + override fun setupUiComponent() { + } + + override fun observeLiveData() { + } } \ No newline at end of file diff --git a/src/main/resources/templates/FragmentTemplate.txt b/src/main/resources/templates/FragmentTemplate.txt index 91b94e6..e13661e 100644 --- a/src/main/resources/templates/FragmentTemplate.txt +++ b/src/main/resources/templates/FragmentTemplate.txt @@ -9,6 +9,7 @@ import org.koin.androidx.viewmodel.ext.android.sharedViewModel class $NAME$Fragment : BaseFragment( R.layout.$LAYOUT_NAME$ ) { + override val viewModel: $NAME$ViewModel by sharedViewModel() override fun onInitialize(lifecycleOwner: LifecycleOwner) { @@ -17,10 +18,8 @@ class $NAME$Fragment : BaseFragment( } override fun setupUiComponent() { - } override fun observeLiveData() { - } } \ No newline at end of file diff --git a/src/main/resources/templates/ViewModelTestTemplate.txt b/src/main/resources/templates/ViewModelTestTemplate.txt index d536206..6aba17a 100644 --- a/src/main/resources/templates/ViewModelTestTemplate.txt +++ b/src/main/resources/templates/ViewModelTestTemplate.txt @@ -1,6 +1,6 @@ package $PACKAGE$ -import kr.co.finda.BasicTest +import kr.co.finda.finda.coretest.BasicTest import org.junit.jupiter.api.BeforeEach class $NAME$ViewModelTest : BasicTest() { @@ -12,5 +12,4 @@ class $NAME$ViewModelTest : BasicTest() { viewModel = $NAME$ViewModel() } - } \ No newline at end of file