diff --git a/app/build.gradle b/app/build.gradle
index ef8934d..6c7146e 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -15,6 +15,7 @@ android {
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+
}
buildTypes {
@@ -30,6 +31,9 @@ android {
kotlinOptions {
jvmTarget = '17'
}
+ buildFeatures {
+ viewBinding true
+ }
}
dependencies {
@@ -38,6 +42,7 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.11.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
+ implementation 'androidx.recyclerview:recyclerview:1.3.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 3b8f448..042b163 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -13,14 +13,28 @@
android:theme="@style/Theme.NOWSOPTAndroid"
tools:targetApi="31">
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/sopt/now/Activity/HomeActivity.kt b/app/src/main/java/com/sopt/now/Activity/HomeActivity.kt
new file mode 100644
index 0000000..f22c8b2
--- /dev/null
+++ b/app/src/main/java/com/sopt/now/Activity/HomeActivity.kt
@@ -0,0 +1,75 @@
+package com.sopt.now.Activity
+
+import android.os.Bundle
+import android.util.Log
+import androidx.appcompat.app.AppCompatActivity
+import androidx.fragment.app.Fragment
+import com.sopt.now.Fragment.HomeFragment
+import com.sopt.now.Fragment.MyPageFragment
+import com.sopt.now.Fragment.SearchFragment
+import com.sopt.now.R
+import com.sopt.now.databinding.ActivityHomeBinding
+class HomeActivity : AppCompatActivity() {
+ private lateinit var binding: ActivityHomeBinding
+ private val nameId="ID"
+ private val namePassword = "PASSWORD"
+ private val nameNickname = "NICKNAME"
+ private val nameMbti = "MBTI"
+
+ private lateinit var userId: String
+ private lateinit var userPassword: String
+ private lateinit var userNickname: String
+ private lateinit var userMbti: String
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ binding = ActivityHomeBinding.inflate(layoutInflater)
+ setContentView(binding.root)
+
+ Log.d("HomeActivity","HomeActivity onCreate")
+
+
+ userId = intent.getStringExtra(nameId).toString()
+ userPassword = intent.getStringExtra(namePassword).toString()
+ userNickname = intent.getStringExtra(nameNickname).toString()
+ userMbti = intent.getStringExtra(nameMbti).toString()
+
+ clickBottomNavigation()
+
+ val currentFragment = supportFragmentManager.findFragmentById(binding.fcvHome.id)
+ if (currentFragment == null) {
+ supportFragmentManager.beginTransaction()
+ .add(binding.fcvHome.id, HomeFragment(userNickname))
+ .commit()
+ }
+ }
+
+ private fun clickBottomNavigation() {
+ binding.bnvHome.setOnItemSelectedListener {
+ when (it.itemId) {
+ R.id.menu_home -> {
+ replaceFragment(HomeFragment(userNickname))
+ true
+ }
+
+ R.id.menu_search -> {
+ replaceFragment(SearchFragment())
+ true
+ }
+
+ R.id.menu_mypage -> {
+ replaceFragment(MyPageFragment(userId,userPassword,userNickname,userMbti))
+ true
+ }
+
+ else -> false
+ }
+ }
+ }
+
+ private fun replaceFragment(fragment: Fragment) {
+ supportFragmentManager.beginTransaction()
+ .replace(binding.fcvHome.id, fragment)
+ .commit()
+ }
+}
diff --git a/app/src/main/java/com/sopt/now/Activity/LoginActivity.kt b/app/src/main/java/com/sopt/now/Activity/LoginActivity.kt
new file mode 100644
index 0000000..5bcac09
--- /dev/null
+++ b/app/src/main/java/com/sopt/now/Activity/LoginActivity.kt
@@ -0,0 +1,75 @@
+package com.sopt.now.Activity
+
+
+import android.content.Intent
+import android.os.Bundle
+import android.util.Log
+import androidx.appcompat.app.AppCompatActivity
+import com.google.android.material.snackbar.Snackbar
+import com.sopt.now.databinding.ActivityLoginBinding
+
+class LoginActivity : AppCompatActivity() {
+ private lateinit var binding: ActivityLoginBinding
+ private val nameId = "ID"
+ private val namePassword = "PASSWORD"
+ private val nameNickname = "NICKNAME"
+ private val nameMbti = "MBTI"
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ binding = ActivityLoginBinding.inflate(layoutInflater)
+ setContentView(binding.root)
+
+ val id = intent.getStringExtra(nameId)
+ val password = intent.getStringExtra(namePassword)
+ val nickname = intent.getStringExtra(nameNickname)
+ val mbti = intent.getStringExtra(nameMbti)
+
+
+ binding.loginBtn.setOnClickListener {
+ val enteredId = binding.editTextId.text.toString()
+ val enteredPassword = binding.editTextPw.text.toString()
+
+ when {
+ enteredId != id -> {
+ Snackbar.make(
+ binding.root,
+ "아이디를 확인하세요.",
+ Snackbar.LENGTH_SHORT
+ ).show()
+ }
+
+ enteredPassword != password -> {
+ Snackbar.make(
+ binding.root,
+ "비밀번호를 확인하세요.",
+ Snackbar.LENGTH_SHORT
+ ).show()
+ }
+
+ else -> {
+ Log.d("Login Success", "Login Success")
+ val intentHome = Intent(this, HomeActivity::class.java).apply {
+ putExtra(nameId, id)
+ putExtra(namePassword, password)
+ putExtra(nameNickname, nickname)
+ putExtra(nameMbti, mbti)
+ }
+ Snackbar.make(
+ binding.root,
+ "로그인 성공!",
+ Snackbar.LENGTH_SHORT
+ ).show()
+ startActivity(intentHome)
+
+ }
+ }
+
+ }
+ binding.goSignupBtn.setOnClickListener {
+ val intentSignup = Intent(this, SignUpActivity::class.java)
+ startActivity(intentSignup)
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/sopt/now/Activity/MainActivity.kt b/app/src/main/java/com/sopt/now/Activity/MainActivity.kt
new file mode 100644
index 0000000..cbe42ea
--- /dev/null
+++ b/app/src/main/java/com/sopt/now/Activity/MainActivity.kt
@@ -0,0 +1,77 @@
+package com.sopt.now.Activity
+
+import android.os.Bundle
+import androidx.appcompat.app.AppCompatActivity
+import com.google.android.material.snackbar.Snackbar
+import com.sopt.now.R
+import com.sopt.now.databinding.ActivityMainBinding
+
+class MainActivity : AppCompatActivity() {
+ private lateinit var binding: ActivityMainBinding
+ private val nameId="ID"
+ private val namePassword = "PASSWORD"
+ private val nameNickname = "NICKNAME"
+ private val nameMbti = "MBTI"
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ binding = ActivityMainBinding.inflate(layoutInflater) //TODO: inflate 두 번 하면 오류 공부
+ setContentView(binding.root)
+
+
+
+ val id = intent.getStringExtra(nameId)
+ val password = intent.getStringExtra(namePassword)
+ val nickname = intent.getStringExtra(nameNickname)
+ val mbti = intent.getStringExtra(nameMbti)
+
+ Snackbar.make(
+ binding.root,
+ "로그인 성공!",
+ Snackbar.LENGTH_SHORT
+ ).show()
+
+
+ binding.textNickname.text = getString(R.string.nickname,nickname)
+ binding.textMbti.text = getString(R.string.mbti,mbti)
+ binding.textId.text="$id"
+ binding.textPw.text="$password"
+
+
+
+ val mbtiImageName = mbti?.lowercase() + ".png"
+ val mbtiImageId = mbtiImageName.let { resources.getIdentifier(it, "drawable", packageName) }
+ // TODO: getIdentifier 말고 다른 방법으로 파일 찾아보기
+ if (mbtiImageId != 0) {
+ binding.imageMbti.setImageResource(mbtiImageId)
+
+ }
+
+ val mbtiDescriptionMap = mapOf(
+ "ISFP" to R.string.isfp,
+ "ISFJ" to R.string.isfj,
+ "ISTP" to R.string.istp,
+ "ISTJ" to R.string.istj,
+ "INFP" to R.string.infp,
+ "INFJ" to R.string.infj,
+ "INTP" to R.string.intp,
+ "INTJ" to R.string.intj,
+ "ESFP" to R.string.esfp,
+ "ESFJ" to R.string.esfj,
+ "ESTP" to R.string.estp,
+ "ESTJ" to R.string.estj,
+ "ENFP" to R.string.enfp,
+ "ENFJ" to R.string.enfj,
+ "ENTP" to R.string.entp,
+ "ENTJ" to R.string.entj
+
+ )
+
+ val mbtiDescriptionResId = mbti?.let { mbtiDescriptionMap[it] }
+
+
+ val mbtiDescription = mbtiDescriptionResId?.let { getString(it) } ?: getString(R.string.default_description)
+
+ binding.textMbtiDes.text = mbtiDescription
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/sopt/now/Activity/SignUpActivity.kt b/app/src/main/java/com/sopt/now/Activity/SignUpActivity.kt
new file mode 100644
index 0000000..872b1b7
--- /dev/null
+++ b/app/src/main/java/com/sopt/now/Activity/SignUpActivity.kt
@@ -0,0 +1,81 @@
+package com.sopt.now.Activity
+
+import android.content.Intent
+import android.os.Bundle
+import androidx.appcompat.app.AppCompatActivity
+import com.google.android.material.snackbar.Snackbar
+import com.sopt.now.databinding.ActivitySignUpBinding
+
+class SignUpActivity : AppCompatActivity() {
+ private lateinit var binding: ActivitySignUpBinding
+ private val nameId="ID"
+ private val namePassword = "PASSWORD"
+ private val nameNickname = "NICKNAME"
+ private val nameMbti = "MBTI"
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ binding = ActivitySignUpBinding.inflate(layoutInflater)
+ setContentView(binding.root)
+
+
+ binding.signupBtn.setOnClickListener {
+ val mbtiInput = binding.editTextMbti.text.toString().uppercase()
+
+ val id = binding.editTextId.text.toString()
+ val password = binding.editTextPw.text.toString()
+ val nickname = binding.editTextNn.text.toString()
+ val mbti = binding.editTextMbti.text.toString().uppercase()
+
+ when {
+ id.length !in 6..10 -> {
+ Snackbar.make(
+ binding.root,
+ "ID는 6~10글자여야 합니다.",
+ Snackbar.LENGTH_SHORT
+ ).show()
+ }
+ password.length !in 8..12 -> {
+ Snackbar.make(
+ binding.root,
+ "Password는 8~12글자여야 합니다.",
+ Snackbar.LENGTH_SHORT
+ ).show()
+ }
+ nickname.isEmpty() -> {
+ Snackbar.make(
+ binding.root,
+ "닉네임은 한 글자 이상이어야 합니다.",
+ Snackbar.LENGTH_SHORT
+ ).show()
+ }
+ mbtiInput.length != 4 || !validMBTI(mbtiInput) -> {
+ Snackbar.make(
+ binding.root,
+ "MBTI 형식이 올바르지 않습니다. (E/I, S/N, F/T, P/J)",
+ Snackbar.LENGTH_SHORT
+ ).show()
+ }
+ else -> {
+ val intent = Intent(this, LoginActivity::class.java).apply {
+ putExtra(nameId, id)
+ putExtra(namePassword, password)
+ putExtra(nameNickname, nickname)
+ putExtra(nameMbti, mbti)
+ }
+ Snackbar.make(
+ binding.root,
+ "회원가입 성공",
+ Snackbar.LENGTH_SHORT
+ ).show()
+ startActivity(intent)
+ }
+ }
+ }
+ }
+}
+
+fun validMBTI(mbti:String):Boolean{
+ val validMBTIPattern = Regex("[EI][SN][TF][JP]")
+ return validMBTIPattern.matches(mbti)
+}
diff --git a/app/src/main/java/com/sopt/now/Adapter/FriendAdapter.kt b/app/src/main/java/com/sopt/now/Adapter/FriendAdapter.kt
new file mode 100644
index 0000000..34b690c
--- /dev/null
+++ b/app/src/main/java/com/sopt/now/Adapter/FriendAdapter.kt
@@ -0,0 +1,29 @@
+package com.sopt.now.Adapter
+
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.recyclerview.widget.RecyclerView
+import com.sopt.now.DataFile.Friend
+import com.sopt.now.ViewHolder.FriendViewHolder
+import com.sopt.now.databinding.ItemFriendBinding
+
+class FriendAdapter : RecyclerView.Adapter() {
+ private var friendList: List = emptyList()
+
+ override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): FriendViewHolder {
+ val inflater = LayoutInflater.from(parent.context)
+ val binding = ItemFriendBinding.inflate(inflater, parent, false)
+ return FriendViewHolder(binding)
+ }
+
+ override fun onBindViewHolder(holder: FriendViewHolder, position: Int) {
+ holder.onBind(friendList[position])
+ }
+
+ override fun getItemCount() = friendList.size
+
+ fun setFriendList(friendList: List) {
+ this.friendList = friendList.toList()
+ notifyDataSetChanged()
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/sopt/now/Adapter/MyProfileAdapter.kt b/app/src/main/java/com/sopt/now/Adapter/MyProfileAdapter.kt
new file mode 100644
index 0000000..3ca26f9
--- /dev/null
+++ b/app/src/main/java/com/sopt/now/Adapter/MyProfileAdapter.kt
@@ -0,0 +1,31 @@
+package com.sopt.now.Adapter
+
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.recyclerview.widget.RecyclerView
+import com.sopt.now.DataFile.MyProfile
+import com.sopt.now.ViewHolder.MyProfileHolder
+import com.sopt.now.databinding.ItemMyprofileBinding
+
+class MyProfileAdapter : RecyclerView.Adapter() {
+ // 임시의 빈 리스트
+ private var myprofile: List = emptyList()
+
+
+ override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyProfileHolder {
+ val inflater = LayoutInflater.from(parent.context)
+ val binding = ItemMyprofileBinding.inflate(inflater, parent, false)
+ return MyProfileHolder(binding)
+ }
+
+ override fun onBindViewHolder(holder: MyProfileHolder, position: Int) {
+ holder.onBind(myprofile[position])
+ }
+
+ override fun getItemCount() = myprofile.size
+
+ fun setMyProfile(myprofile: List) {
+ this.myprofile = myprofile.toList()
+ notifyDataSetChanged()
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/sopt/now/DataFile/Friend.kt b/app/src/main/java/com/sopt/now/DataFile/Friend.kt
new file mode 100644
index 0000000..4dd7696
--- /dev/null
+++ b/app/src/main/java/com/sopt/now/DataFile/Friend.kt
@@ -0,0 +1,9 @@
+package com.sopt.now.DataFile
+
+import androidx.annotation.DrawableRes
+
+data class Friend(
+ @DrawableRes val profileImage: Int,
+ val name: String,
+ val selfDescription: String,
+)
\ No newline at end of file
diff --git a/app/src/main/java/com/sopt/now/DataFile/MyProfile.kt b/app/src/main/java/com/sopt/now/DataFile/MyProfile.kt
new file mode 100644
index 0000000..74aafd1
--- /dev/null
+++ b/app/src/main/java/com/sopt/now/DataFile/MyProfile.kt
@@ -0,0 +1,9 @@
+package com.sopt.now.DataFile
+
+import androidx.annotation.DrawableRes
+
+data class MyProfile(
+ @DrawableRes val profileImage: Int,
+ val name: String,
+ val selfDescription: String,
+)
\ No newline at end of file
diff --git a/app/src/main/java/com/sopt/now/Fragment/HomeFragment.kt b/app/src/main/java/com/sopt/now/Fragment/HomeFragment.kt
new file mode 100644
index 0000000..4765a1a
--- /dev/null
+++ b/app/src/main/java/com/sopt/now/Fragment/HomeFragment.kt
@@ -0,0 +1,180 @@
+package com.sopt.now.Fragment
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.fragment.app.Fragment
+import androidx.recyclerview.widget.ConcatAdapter
+import androidx.recyclerview.widget.LinearLayoutManager
+import com.sopt.now.Adapter.FriendAdapter
+import com.sopt.now.Adapter.MyProfileAdapter
+import com.sopt.now.DataFile.Friend
+import com.sopt.now.DataFile.MyProfile
+import com.sopt.now.R
+import com.sopt.now.databinding.FragmentHomeBinding
+
+class HomeFragment(userncikname: String) : Fragment() {
+ private var _binding: FragmentHomeBinding? = null
+ private val binding: FragmentHomeBinding
+ get() = requireNotNull(_binding) {
+ "바인딩 객체 생성 완료"
+ }
+
+ override fun onCreateView(
+ inflater: LayoutInflater,
+ container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View {
+ _binding = FragmentHomeBinding.inflate(inflater, container, false)
+ return binding.root
+ }
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+ val myprofileAdapter = MyProfileAdapter()
+ val friendAdapter = FriendAdapter()
+
+
+ val concatAdapter = ConcatAdapter(myprofileAdapter, friendAdapter)
+
+
+ binding.rvFriends.run {
+ adapter = concatAdapter
+ layoutManager = LinearLayoutManager(requireContext())
+ }
+ myprofileAdapter.setMyProfile(myProfile)
+ friendAdapter.setFriendList(mockFriendList)
+
+ }
+
+ override fun onDestroyView() {
+ super.onDestroyView()
+ _binding = null
+ }
+
+ private val myProfile = listOf(
+ MyProfile(
+ profileImage = R.drawable.baseline_person_outline_24,
+ name = userncikname,
+ selfDescription = "내 프로필 소개 텍스트"
+ )
+ )
+ val friendIcon = R.drawable.baseline_person_24
+
+ private val mockFriendList = listOf(
+ Friend(
+ profileImage = friendIcon,
+ name = "강문수",
+ selfDescription = "34기 안드로이드 YB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "공세영",
+ selfDescription = "34기 안드로이드 YB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "김명석",
+ selfDescription = "34기 안드로이드 YB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "김아린",
+ selfDescription = "34기 안드로이드 YB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "김언지",
+ selfDescription = "34기 안드로이드 OB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "김윤서",
+ selfDescription = "34기 안드로이드 YB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "박동민",
+ selfDescription = "34기 안드로이드 OB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "박유진",
+ selfDescription = "34기 안드로이드 YB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "배지현",
+ selfDescription = "34기 안드로이드 OB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "배찬우",
+ selfDescription = "34기 안드로이드 OB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "손민재",
+ selfDescription = "34기 안드로이드 YB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "송혜음",
+ selfDescription = "34기 안드로이드 YB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "우상욱",
+ selfDescription = "34기 안드로이드 OB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "유정현",
+ selfDescription = "34기 안드로이드 YB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "윤서희",
+ selfDescription = "34기 안드로이드 YB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "곽의진",
+ selfDescription = "34기 안드로이드 파트장",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "이가을",
+ selfDescription = "34기 안드로이드 YB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "이나경",
+ selfDescription = "34기 안드로이드 YB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "이석준",
+ selfDescription = "34기 안드로이드 YB",
+ ),
+ Friend(
+ profileImage = friendIcon,
+ name = "이석찬",
+ selfDescription = "34기 안드로이드 YB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "이연진",
+ selfDescription = "34기 안드로이드 YB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "이유빈",
+ selfDescription = "34기 안드로이드 OB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "임하늘",
+ selfDescription = "34기 안드로이드 YB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "주효은",
+ selfDescription = "34기 안드로이드 YB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "최준서",
+ selfDescription = "34기 안드로이드 OB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "이현진",
+ selfDescription = "34기 안드로이드 YB",
+ ), Friend(
+ profileImage = friendIcon,
+ name = "박효빈",
+ selfDescription = "34기 안드로이드 YB",
+ )
+
+ )
+
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/sopt/now/Fragment/MyPageFragment.kt b/app/src/main/java/com/sopt/now/Fragment/MyPageFragment.kt
new file mode 100644
index 0000000..61b80a7
--- /dev/null
+++ b/app/src/main/java/com/sopt/now/Fragment/MyPageFragment.kt
@@ -0,0 +1,90 @@
+package com.sopt.now.Fragment
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.fragment.app.Fragment
+import com.sopt.now.R
+import com.sopt.now.databinding.FragmentMypageBinding
+
+class MyPageFragment(userId:String,userPassword:String,userNickname:String,userMbti:String): Fragment() {
+ private var _binding: FragmentMypageBinding? = null
+ private val binding: FragmentMypageBinding
+ get() = requireNotNull(_binding) {
+ "바인딩 객체 생성 완료"
+ }
+
+ private val id = userId
+ private val password = userPassword
+ private val nickname = userNickname
+ private val mbti = userMbti
+
+
+
+ override fun onCreateView(
+ inflater: LayoutInflater,
+ container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View {
+ _binding = FragmentMypageBinding.inflate(inflater, container, false)
+ return binding.root
+
+
+ }
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+
+
+ binding.textNickname.text = getString(R.string.nickname,nickname)
+ binding.textMbti.text = getString(R.string.mbti,mbti)
+ binding.textId.text=id
+ binding.textPw.text=password
+
+
+
+ val mbtiImageName = mbti.lowercase() + ".png"
+ val mbtiImageId = mbtiImageName.let { resources.getIdentifier(it, "drawable",null) }
+ if (mbtiImageId != 0) {
+ binding.imageMbti.setImageResource(mbtiImageId)
+
+ }
+
+ val mbtiDescriptionMap = mapOf(
+ "ISFP" to R.string.isfp,
+ "ISFJ" to R.string.isfj,
+ "ISTP" to R.string.istp,
+ "ISTJ" to R.string.istj,
+ "INFP" to R.string.infp,
+ "INFJ" to R.string.infj,
+ "INTP" to R.string.intp,
+ "INTJ" to R.string.intj,
+ "ESFP" to R.string.esfp,
+ "ESFJ" to R.string.esfj,
+ "ESTP" to R.string.estp,
+ "ESTJ" to R.string.estj,
+ "ENFP" to R.string.enfp,
+ "ENFJ" to R.string.enfj,
+ "ENTP" to R.string.entp,
+ "ENTJ" to R.string.entj
+
+ )
+
+ val mbtiDescriptionResId = mbti.let { mbtiDescriptionMap[it] }
+
+
+ val mbtiDescription = mbtiDescriptionResId?.let { getString(it) } ?: getString(R.string.default_description)
+
+ binding.textMbtiDes.text = mbtiDescription
+
+
+
+ }
+
+ override fun onDestroyView() {
+ super.onDestroyView()
+ _binding = null
+ }
+
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/sopt/now/Fragment/SearchFragment.kt b/app/src/main/java/com/sopt/now/Fragment/SearchFragment.kt
new file mode 100644
index 0000000..b627981
--- /dev/null
+++ b/app/src/main/java/com/sopt/now/Fragment/SearchFragment.kt
@@ -0,0 +1,35 @@
+package com.sopt.now.Fragment
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.fragment.app.Fragment
+import com.sopt.now.databinding.FragmentSearchBinding
+
+class SearchFragment: Fragment() {
+
+ private var _binding: FragmentSearchBinding? = null
+ private val binding: FragmentSearchBinding
+ get() = requireNotNull(_binding) {
+ "바인딩 객체 생성 완료"
+ }
+
+ override fun onCreateView(
+ inflater: LayoutInflater,
+ container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View {
+ _binding = FragmentSearchBinding.inflate(inflater, container, false)
+ return binding.root
+ }
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+ // TODO: 기존 액티비티의 onCreate에 작성했던 init로직을 이제는 여기에 작성합니다.
+ }
+
+ override fun onDestroyView() {
+ super.onDestroyView()
+ _binding = null
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/sopt/now/MainActivity.kt b/app/src/main/java/com/sopt/now/MainActivity.kt
deleted file mode 100644
index 23e7302..0000000
--- a/app/src/main/java/com/sopt/now/MainActivity.kt
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.sopt.now
-
-import android.os.Bundle
-import androidx.activity.enableEdgeToEdge
-import androidx.appcompat.app.AppCompatActivity
-import androidx.core.view.ViewCompat
-import androidx.core.view.WindowInsetsCompat
-
-class MainActivity : AppCompatActivity() {
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContentView(R.layout.activity_main)
-
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/sopt/now/ViewHolder/FriendViewHolder.kt b/app/src/main/java/com/sopt/now/ViewHolder/FriendViewHolder.kt
new file mode 100644
index 0000000..3d936b3
--- /dev/null
+++ b/app/src/main/java/com/sopt/now/ViewHolder/FriendViewHolder.kt
@@ -0,0 +1,16 @@
+package com.sopt.now.ViewHolder
+
+import androidx.recyclerview.widget.RecyclerView
+import com.sopt.now.DataFile.Friend
+import com.sopt.now.databinding.ItemFriendBinding
+
+class FriendViewHolder(private val binding: ItemFriendBinding) : RecyclerView.ViewHolder(binding.root) {
+
+ fun onBind(friendData: Friend) {
+ binding.run {
+ ivProfile.setImageResource(friendData.profileImage)
+ tvName.text = friendData.name
+ tvSelfDescription.text = friendData.selfDescription
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/sopt/now/ViewHolder/MyProfileHolder.kt b/app/src/main/java/com/sopt/now/ViewHolder/MyProfileHolder.kt
new file mode 100644
index 0000000..7e1ca40
--- /dev/null
+++ b/app/src/main/java/com/sopt/now/ViewHolder/MyProfileHolder.kt
@@ -0,0 +1,16 @@
+package com.sopt.now.ViewHolder
+
+import androidx.recyclerview.widget.RecyclerView
+import com.sopt.now.DataFile.MyProfile
+import com.sopt.now.databinding.ItemMyprofileBinding
+
+class MyProfileHolder(val binding: ItemMyprofileBinding) : RecyclerView.ViewHolder(binding.root) {
+
+ fun onBind(profileData: MyProfile) {
+ binding.run {
+ ivProfile.setImageResource(profileData.profileImage)
+ tvName.text = profileData.name
+ tvSelfDescription.text = profileData.selfDescription
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/res/drawable/baseline_home_24.xml b/app/src/main/res/drawable/baseline_home_24.xml
new file mode 100644
index 0000000..20cb4d6
--- /dev/null
+++ b/app/src/main/res/drawable/baseline_home_24.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable/baseline_person_24.xml b/app/src/main/res/drawable/baseline_person_24.xml
new file mode 100644
index 0000000..a37d9a8
--- /dev/null
+++ b/app/src/main/res/drawable/baseline_person_24.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable/baseline_person_outline_24.xml b/app/src/main/res/drawable/baseline_person_outline_24.xml
new file mode 100644
index 0000000..a3be1b8
--- /dev/null
+++ b/app/src/main/res/drawable/baseline_person_outline_24.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable/baseline_search_24.xml b/app/src/main/res/drawable/baseline_search_24.xml
new file mode 100644
index 0000000..d29c6ea
--- /dev/null
+++ b/app/src/main/res/drawable/baseline_search_24.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable/enfj.png b/app/src/main/res/drawable/enfj.png
new file mode 100644
index 0000000..b17899c
Binary files /dev/null and b/app/src/main/res/drawable/enfj.png differ
diff --git a/app/src/main/res/drawable/enfp.png b/app/src/main/res/drawable/enfp.png
new file mode 100644
index 0000000..0138913
Binary files /dev/null and b/app/src/main/res/drawable/enfp.png differ
diff --git a/app/src/main/res/drawable/entj.png b/app/src/main/res/drawable/entj.png
new file mode 100644
index 0000000..d652a63
Binary files /dev/null and b/app/src/main/res/drawable/entj.png differ
diff --git a/app/src/main/res/drawable/entp.png b/app/src/main/res/drawable/entp.png
new file mode 100644
index 0000000..eaafd7f
Binary files /dev/null and b/app/src/main/res/drawable/entp.png differ
diff --git a/app/src/main/res/drawable/esfj.png b/app/src/main/res/drawable/esfj.png
new file mode 100644
index 0000000..9452a0a
Binary files /dev/null and b/app/src/main/res/drawable/esfj.png differ
diff --git a/app/src/main/res/drawable/esfp.png b/app/src/main/res/drawable/esfp.png
new file mode 100644
index 0000000..4b0ed00
Binary files /dev/null and b/app/src/main/res/drawable/esfp.png differ
diff --git a/app/src/main/res/drawable/estj.png b/app/src/main/res/drawable/estj.png
new file mode 100644
index 0000000..34a6f9b
Binary files /dev/null and b/app/src/main/res/drawable/estj.png differ
diff --git a/app/src/main/res/drawable/estp.png b/app/src/main/res/drawable/estp.png
new file mode 100644
index 0000000..4e8cbdb
Binary files /dev/null and b/app/src/main/res/drawable/estp.png differ
diff --git a/app/src/main/res/drawable/infj.png b/app/src/main/res/drawable/infj.png
new file mode 100644
index 0000000..26f24df
Binary files /dev/null and b/app/src/main/res/drawable/infj.png differ
diff --git a/app/src/main/res/drawable/infp.png b/app/src/main/res/drawable/infp.png
new file mode 100644
index 0000000..6fb3d44
Binary files /dev/null and b/app/src/main/res/drawable/infp.png differ
diff --git a/app/src/main/res/drawable/intj.png b/app/src/main/res/drawable/intj.png
new file mode 100644
index 0000000..8acc68d
Binary files /dev/null and b/app/src/main/res/drawable/intj.png differ
diff --git a/app/src/main/res/drawable/intp.png b/app/src/main/res/drawable/intp.png
new file mode 100644
index 0000000..aa8e210
Binary files /dev/null and b/app/src/main/res/drawable/intp.png differ
diff --git a/app/src/main/res/drawable/isfj.png b/app/src/main/res/drawable/isfj.png
new file mode 100644
index 0000000..6275396
Binary files /dev/null and b/app/src/main/res/drawable/isfj.png differ
diff --git a/app/src/main/res/drawable/isfp.png b/app/src/main/res/drawable/isfp.png
new file mode 100644
index 0000000..20371c2
Binary files /dev/null and b/app/src/main/res/drawable/isfp.png differ
diff --git a/app/src/main/res/drawable/istj.png b/app/src/main/res/drawable/istj.png
new file mode 100644
index 0000000..51c4c55
Binary files /dev/null and b/app/src/main/res/drawable/istj.png differ
diff --git a/app/src/main/res/drawable/istp.png b/app/src/main/res/drawable/istp.png
new file mode 100644
index 0000000..f595d2c
Binary files /dev/null and b/app/src/main/res/drawable/istp.png differ
diff --git a/app/src/main/res/layout/activity_home.xml b/app/src/main/res/layout/activity_home.xml
new file mode 100644
index 0000000..5d256cc
--- /dev/null
+++ b/app/src/main/res/layout/activity_home.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml
new file mode 100644
index 0000000..83a30ed
--- /dev/null
+++ b/app/src/main/res/layout/activity_login.xml
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 86a5d97..e6fbcae 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -1,19 +1,117 @@
-
+ android:layout_height="match_parent">
+
+
+
+
+
+
+
+
+
+
+ app:layout_constraintEnd_toEndOf="parent"
+ android:layout_marginTop="8dp"/>
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/app/src/main/res/layout/activity_sign_up.xml b/app/src/main/res/layout/activity_sign_up.xml
new file mode 100644
index 0000000..223e058
--- /dev/null
+++ b/app/src/main/res/layout/activity_sign_up.xml
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml
new file mode 100644
index 0000000..55449e1
--- /dev/null
+++ b/app/src/main/res/layout/fragment_home.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_mypage.xml b/app/src/main/res/layout/fragment_mypage.xml
new file mode 100644
index 0000000..762c25a
--- /dev/null
+++ b/app/src/main/res/layout/fragment_mypage.xml
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_search.xml b/app/src/main/res/layout/fragment_search.xml
new file mode 100644
index 0000000..9bd552a
--- /dev/null
+++ b/app/src/main/res/layout/fragment_search.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_friend.xml b/app/src/main/res/layout/item_friend.xml
new file mode 100644
index 0000000..b7736d8
--- /dev/null
+++ b/app/src/main/res/layout/item_friend.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_myprofile.xml b/app/src/main/res/layout/item_myprofile.xml
new file mode 100644
index 0000000..35a51ed
--- /dev/null
+++ b/app/src/main/res/layout/item_myprofile.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/menu/menu_home.xml b/app/src/main/res/menu/menu_home.xml
new file mode 100644
index 0000000..1c9a8ab
--- /dev/null
+++ b/app/src/main/res/menu/menu_home.xml
@@ -0,0 +1,22 @@
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index be0d381..162c30a 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1,3 +1,22 @@
NOW SOPT Android
+ 겸손하고 융통성 있는 호기심 많은 예술가
+ 주변사람을 보호할 준비가 되어 있는 헌신적이고 따뜻한 스타일
+ 논리적이고 뛰어난 상황 적응력을 지닌 만능 재주꾼
+ 사실을 중시하는 믿음직한 현실주의자
+ 상냥한 성격의 이타주의자로 건강하고 밝은 사회 건설에 앞장서는 낭만형
+ 조용하고 신비로우며 샘솟는 영감으로 지칠 줄 모르는 이상주의자
+ 사회 현상을 빠르게 파악하고 비평하는 논리적인 사색가
+ 한번 시작한 일은 끝까지 해내는 용의주도한 전략가
+ 우호적인 성격과 분위기를 리드하며 에너지가 넘치는 자유로운 영혼의 연예인
+ 배려심이 넘치고 항상 다른 사람을 도울 준비가 되어 있는 성격으로 인기가 많고 사교성 높은 마당발
+ 다양함을 선호하고 즐기는 뛰어난 직관력 모험을 즐기는 사업가
+ 사물과 사람을 관리하는 데 뛰어난 능력을 가진 경영자
+ 창의적이며 항상 웃을 거리를 찾아다니는 활발한 성격으로 사람들과 자유롭게 어울리기를 좋아하는 넘치는 열정의 소유자
+ 넘치는 카리스마와 영향력으로 청중을 압도하는 리더형
+ 풍부한 상상력으로 지적인 도전을 즐기며 뜨거운 논쟁을 즐기는 변론가
+ 비전을 갖고 타인을 동기 부여하는 리더쉽을 지닌 대담한 통솔자
+ Default Description
+ 닉네임: %1s
+ MBTI: %1s
\ No newline at end of file