-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feature : SettingUserInfo base code 구현
> Related to : #26
- Loading branch information
Showing
4 changed files
with
72 additions
and
0 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
30 changes: 30 additions & 0 deletions
30
app/src/main/java/com/shootit/greme/ui/view/SettingUserInfoActivity.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.shootit.greme.ui.view | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import androidx.activity.viewModels | ||
import androidx.lifecycle.ViewModel | ||
import com.shootit.greme.R | ||
import com.shootit.greme.base.BaseActivity | ||
import com.shootit.greme.databinding.ActivitySettingUserInfoBinding | ||
import com.shootit.greme.repository.ChallengeRepository | ||
import com.shootit.greme.viewmodel.ChallengeInfoViewModel | ||
import com.shootit.greme.viewmodel.SettingUserInfoViewModel | ||
|
||
class SettingUserInfoActivity : BaseActivity<ActivitySettingUserInfoBinding>(R.layout.activity_setting_user_info) { | ||
override val viewModel by viewModels<SettingUserInfoViewModel> { | ||
SettingUserInfoViewModel.SettingUserInfoViewModelFactory( | ||
"tmp" | ||
) | ||
} | ||
|
||
override fun initViewModel(viewModel: ViewModel) { | ||
binding.lifecycleOwner = this@SettingUserInfoActivity | ||
binding.vm = this.viewModel | ||
} | ||
|
||
override fun onCreateAction() { | ||
|
||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
app/src/main/java/com/shootit/greme/viewmodel/SettingUserInfoViewModel.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.shootit.greme.viewmodel | ||
|
||
import androidx.lifecycle.ViewModel | ||
import androidx.lifecycle.ViewModelProvider | ||
|
||
class SettingUserInfoViewModel(private val tmp: String): ViewModel() { | ||
|
||
class SettingUserInfoViewModelFactory(private val tmp: String) | ||
: ViewModelProvider.Factory { | ||
override fun <T : ViewModel> create(modelClass: Class<T>): T { | ||
if (modelClass.isAssignableFrom(SettingUserInfoViewModel::class.java)) { | ||
return SettingUserInfoViewModel(tmp) as T | ||
} | ||
throw IllegalArgumentException("Not found ViewModel class.") | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools"> | ||
|
||
<data> | ||
<variable | ||
name="vm" | ||
type="com.shootit.greme.viewmodel.SettingUserInfoViewModel" /> | ||
</data> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".ui.view.SettingUserInfoActivity"> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
</layout> |