Skip to content

Commit

Permalink
✨ feature : SettingUserInfo base code 구현
Browse files Browse the repository at this point in the history
> Related to : #26
  • Loading branch information
eunjjungg committed Jan 21, 2023
1 parent dd657e0 commit 3709eb4
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
android:theme="@style/Theme.Greme"
android:usesCleartextTraffic="true"
tools:targetApi="31">
<activity
android:name=".ui.view.SettingUserInfoActivity"
android:exported="false">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".ui.view.OtherUserDiaryActivity"
android:exported="false">
Expand Down
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() {

}

}
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.")
}
}
}
18 changes: 18 additions & 0 deletions app/src/main/res/layout/activity_setting_user_info.xml
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>

0 comments on commit 3709eb4

Please sign in to comment.