generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 2
AOS-654 Template 값들을 V2 기준에 맞게 변경 #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,15 +1,28 @@ | ||
| package $PACKAGE$ | ||
|
|
||
| import androidx.lifecycle.LifecycleOwner | ||
| import kr.co.finda.finda.R | ||
| import kr.co.finda.finda.databinding.Activity$NAME$Binding | ||
| import kr.co.finda.finda.ui.base.BaseActivity | ||
| import kr.co.finda.finda.ui.base.v2.BaseActivityV2 | ||
| import org.koin.androidx.viewmodel.ext.android.viewModel | ||
|
|
||
| class $NAME$Activity : BaseActivity<Activity$NAME$Binding, $NAME$ViewModel>( | ||
| R.layout.$LAYOUT_NAME$, | ||
| $NAME$ViewModel::class.java | ||
|
|
||
| class $NAME$Activity : BaseActivityV2<Activity$NAME$Binding, $NAME$ViewModel>( | ||
| 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() { | ||
|
|
||
| } | ||
| } |
This file contains hidden or 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,15 +1,27 @@ | ||
| package $PACKAGE$ | ||
|
|
||
| import androidx.lifecycle.LifecycleOwner | ||
| import kr.co.finda.finda.R | ||
| import kr.co.finda.finda.databinding.Fragment$NAME$Binding | ||
| import kr.co.finda.finda.ui.base.BaseFragment | ||
| import kr.co.finda.finda.ui.base.v2.BaseFragmentV2 | ||
| import org.koin.androidx.viewmodel.ext.android.sharedViewModel | ||
|
|
||
| class $NAME$Fragment : BaseFragment<Fragment$NAME$Binding, $NAME$ViewModel>( | ||
| R.layout.$LAYOUT_NAME$, | ||
| $NAME$ViewModel::class.java | ||
| class $NAME$Fragment : BaseFragment<Fragment$NAME$Binding>( | ||
| R.layout.$LAYOUT_NAME$ | ||
| ) { | ||
|
|
||
| override fun setBindingVariables() { | ||
| binding.viewModel = viewModel | ||
| } | ||
| override val viewModel: $NAME$ViewModel by sharedViewModel() | ||
|
|
||
| override fun onInitialize(lifecycleOwner: LifecycleOwner) { | ||
| super.onInitialize(lifecycleOwner) | ||
| binding.viewModel = viewModel | ||
| } | ||
|
|
||
| override fun setupUiComponent() { | ||
|
|
||
| } | ||
|
|
||
| override fun observeLiveData() { | ||
|
|
||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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,8 +1,8 @@ | ||
| package $PACKAGE$ | ||
|
|
||
| import kr.co.finda.finda.coreComponent.ui.base.BaseViewModel | ||
| import kr.co.finda.finda.ui.base.v2.BaseViewModelV2 | ||
|
|
||
| class $NAME$ViewModel : BaseViewModel() { | ||
| class $NAME$ViewModel : BaseViewModelV2() { | ||
|
|
||
|
|
||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분같은 경우엔 sharedViewModel를 사용하지 않는 케이스일 경우가 더 많을 것 같아서,
그냥 비워둔채로 나두어도 괜찮을 것 같습니다.
템플릿으론 생성만 해주고, 이런 부분은 상세 구현쪽이라고 생각하는 것이 좋을 것 같습니다.
Activity같은 경우는 거의 고정이라 잘 모르겠지만, fragment는 비우는 것이 더 좋을 것 같습니다.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
근데 Fragment으로 설정하고 생성하면 일단 ViewModel도 같이 생성하는 거 아닌가요
일단 기본적으로 템플릿인데 ViewModel 파일은 생성되고, sharedViewModel() 과 import 문 등을 직접 추가해야 되는 경우는 오히려 발생하면 안된다고 생각합니다. 차라리 지우는 형태로 가는 것이 맞다고 봐요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그러네요 그럼 유지하는 것으로 approve 하겠습니다