From af3798c777f563dbd7dad0da4fc807c007127a39 Mon Sep 17 00:00:00 2001 From: youjin09222 Date: Fri, 3 May 2024 16:43:25 +0900 Subject: [PATCH] =?UTF-8?q?mod/#9:=20selfDescription=EC=97=90=EC=84=9C=20p?= =?UTF-8?q?hone=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/sopt/now/test/data/Friend.kt | 2 +- .../java/com/sopt/now/test/data/UserData.kt | 3 +-- .../com/sopt/now/test/data/UserPreference.kt | 10 ++++---- .../sopt/now/test/friend/FriendViewHolder.kt | 4 ++-- .../now/test/presentation/HomeFragment.kt | 2 +- .../now/test/presentation/HomeViewModel.kt | 21 +++++++++-------- .../now/test/presentation/MyPageFragment.kt | 5 ++-- app/src/main/res/layout/activity_sign_up.xml | 6 ++--- app/src/main/res/layout/fragment_mypage.xml | 23 ++----------------- app/src/main/res/layout/item_friend.xml | 4 ++-- app/src/main/res/layout/item_user.xml | 4 ++-- app/src/main/res/values/strings.xml | 4 ++-- 12 files changed, 33 insertions(+), 55 deletions(-) diff --git a/app/src/main/java/com/sopt/now/test/data/Friend.kt b/app/src/main/java/com/sopt/now/test/data/Friend.kt index d8cff03..95e548b 100644 --- a/app/src/main/java/com/sopt/now/test/data/Friend.kt +++ b/app/src/main/java/com/sopt/now/test/data/Friend.kt @@ -5,7 +5,7 @@ import androidx.annotation.DrawableRes data class Friend( @DrawableRes val profileImage: Int, val name: String, - val selfDescription: String, + val phone: String, ) { companion object { const val TYPE_USER = 0 diff --git a/app/src/main/java/com/sopt/now/test/data/UserData.kt b/app/src/main/java/com/sopt/now/test/data/UserData.kt index 159a145..e3c3fb0 100644 --- a/app/src/main/java/com/sopt/now/test/data/UserData.kt +++ b/app/src/main/java/com/sopt/now/test/data/UserData.kt @@ -6,7 +6,6 @@ import kotlinx.android.parcel.Parcelize @Parcelize data class UserData( val userId: String, - val userPw: String, val userName: String, - val selfDescription: String + val userPhone: String ): Parcelable \ No newline at end of file diff --git a/app/src/main/java/com/sopt/now/test/data/UserPreference.kt b/app/src/main/java/com/sopt/now/test/data/UserPreference.kt index 2c562ca..ba86105 100644 --- a/app/src/main/java/com/sopt/now/test/data/UserPreference.kt +++ b/app/src/main/java/com/sopt/now/test/data/UserPreference.kt @@ -9,9 +9,8 @@ class UserPreference(context: Context) { fun saveUserData(userData: UserData) { with(sharedPreferences.edit()){ putString("userId", userData.userId) - putString("userPw", userData.userPw) putString("userName", userData.userName) - putString("selfDescription", userData.selfDescription) + putString("userPhone", userData.userPhone) apply() } } @@ -20,12 +19,11 @@ class UserPreference(context: Context) { fun getUserData(): UserData? { with(sharedPreferences){ val userId = getString("userId", null) - val userPw = getString("userPw", null) val userName = getString("userName", null) - val selfDescription = getString("selfDescription", null) + val userPhone = getString("userPhone", null) - return if (userId != null && userPw != null && userName != null && selfDescription != null) { - UserData(userId, userPw, userName, selfDescription) + return if (userId != null && userName != null && userPhone != null) { + UserData(userId, userName, userPhone) } else { null } diff --git a/app/src/main/java/com/sopt/now/test/friend/FriendViewHolder.kt b/app/src/main/java/com/sopt/now/test/friend/FriendViewHolder.kt index a4c50fc..c78de7a 100644 --- a/app/src/main/java/com/sopt/now/test/friend/FriendViewHolder.kt +++ b/app/src/main/java/com/sopt/now/test/friend/FriendViewHolder.kt @@ -13,7 +13,7 @@ class FriendViewHolder(private val binding: ItemFriendBinding) : BaseViewHolder( binding.run { ivFriendProfile.setImageResource(friendData.profileImage) tvFriendName.text = friendData.name - tvFriendDescription.text = friendData.selfDescription + tvFriendPhone.text = friendData.phone } } } @@ -23,7 +23,7 @@ class UserViewHolder(private val binding: ItemUserBinding) : BaseViewHolder(bind binding.run { ivMyProfile.setImageResource(userData.profileImage) tvMyName.text = userData.name - tvMyDescription.text = userData.selfDescription + tvMyPhone.text = userData.phone } } } \ No newline at end of file diff --git a/app/src/main/java/com/sopt/now/test/presentation/HomeFragment.kt b/app/src/main/java/com/sopt/now/test/presentation/HomeFragment.kt index caadb4e..1e2364a 100644 --- a/app/src/main/java/com/sopt/now/test/presentation/HomeFragment.kt +++ b/app/src/main/java/com/sopt/now/test/presentation/HomeFragment.kt @@ -47,7 +47,7 @@ class HomeFragment: Fragment() { val newFriend = Friend( profileImage = R.drawable.iv_user_profile, name = it.userName, - selfDescription = it.selfDescription + phone = it.userPhone ) viewModel.mockFriendList.add(0, newFriend) } diff --git a/app/src/main/java/com/sopt/now/test/presentation/HomeViewModel.kt b/app/src/main/java/com/sopt/now/test/presentation/HomeViewModel.kt index 9b4be37..64ff286 100644 --- a/app/src/main/java/com/sopt/now/test/presentation/HomeViewModel.kt +++ b/app/src/main/java/com/sopt/now/test/presentation/HomeViewModel.kt @@ -2,58 +2,59 @@ package com.sopt.now.test.presentation import androidx.lifecycle.ViewModel import com.sopt.now.R +import com.sopt.now.test.data.Friend class HomeViewModel() : ViewModel() { val mockFriendList = mutableListOf( Friend( profileImage = R.drawable.iv_friend_profile, name = "AAA", - selfDescription = "AAA님의 한 줄 소개", + phone = "AAA님의 한 줄 소개", ), Friend( profileImage = R.drawable.iv_friend_profile, name = "BBB", - selfDescription = "BBB님의 한 줄 소개", + phone = "BBB님의 한 줄 소개", ), Friend( profileImage = R.drawable.iv_friend_profile, name = "CCC", - selfDescription = "CCC님의 한 줄 소개", + phone = "CCC님의 한 줄 소개", ), Friend( profileImage = R.drawable.iv_friend_profile, name = "DDD", - selfDescription = "DDD님의 한 줄 소개", + phone = "DDD님의 한 줄 소개", ), Friend( profileImage = R.drawable.iv_friend_profile, name = "EEE", - selfDescription = "EEE님의 한 줄 소개", + phone = "EEE님의 한 줄 소개", ), Friend( profileImage = R.drawable.iv_friend_profile, name = "FFF", - selfDescription = "FFF님의 한 줄 소개", + phone = "FFF님의 한 줄 소개", ), Friend( profileImage = R.drawable.iv_friend_profile, name = "GGG", - selfDescription = "GGG님의 한 줄 소개", + phone = "GGG님의 한 줄 소개", ), Friend( profileImage = R.drawable.iv_friend_profile, name = "HHH", - selfDescription = "HHH님의 한 줄 소개", + phone = "HHH님의 한 줄 소개", ), Friend( profileImage = R.drawable.iv_friend_profile, name = "III", - selfDescription = "III님의 한 줄 소개", + phone = "III님의 한 줄 소개", ), Friend( profileImage = R.drawable.iv_friend_profile, name = "JJJ", - selfDescription = "JJJ님의 한 줄 소개", + phone = "JJJ님의 한 줄 소개", ) ) } \ No newline at end of file diff --git a/app/src/main/java/com/sopt/now/test/presentation/MyPageFragment.kt b/app/src/main/java/com/sopt/now/test/presentation/MyPageFragment.kt index 0a0b231..2c6e3c9 100644 --- a/app/src/main/java/com/sopt/now/test/presentation/MyPageFragment.kt +++ b/app/src/main/java/com/sopt/now/test/presentation/MyPageFragment.kt @@ -35,10 +35,9 @@ class MyPageFragment : Fragment() { val userData = userPreference.getUserData() if (userData != null) { with(binding) { - tvMyName.text = userData.userName - tvMyDescription.text = userData.selfDescription tvMyId.text = userData.userId - tvMyPw.text = userData.userPw + tvMyName.text = userData.userName + tvMyPhone.text = userData.userPhone } } } diff --git a/app/src/main/res/layout/activity_sign_up.xml b/app/src/main/res/layout/activity_sign_up.xml index 44158e0..5e82a3c 100644 --- a/app/src/main/res/layout/activity_sign_up.xml +++ b/app/src/main/res/layout/activity_sign_up.xml @@ -83,16 +83,16 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="30dp" - android:text="@string/tv_user_description" + android:text="@string/tv_user_phone" android:textSize="20sp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/et_sign_up_name"/> diff --git a/app/src/main/res/layout/fragment_mypage.xml b/app/src/main/res/layout/fragment_mypage.xml index 0f790c2..c62f7c4 100644 --- a/app/src/main/res/layout/fragment_mypage.xml +++ b/app/src/main/res/layout/fragment_mypage.xml @@ -30,10 +30,10 @@ app:layout_constraintTop_toTopOf="@+id/iv_my_profile" /> @@ -55,23 +55,4 @@ android:text="@string/tv_id" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/tv_id"/> - - - - \ 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 index b42f1ec..3793400 100644 --- a/app/src/main/res/layout/item_friend.xml +++ b/app/src/main/res/layout/item_friend.xml @@ -28,10 +28,10 @@ app:layout_constraintTop_toTopOf="@id/iv_friend_profile" /> SIGN UP 닉네임 닉네임을 입력해주세요. - 한 줄 소개 - 한 줄 소개를 입력해주세요. + 핸드폰 번호 + 핸드폰 번호를 입력해주세요. \ No newline at end of file