Skip to content

Commit

Permalink
Merge pull request #18 from Nbti/feat-sally-2
Browse files Browse the repository at this point in the history
[FEAT] 프로필 레이아웃 수정
  • Loading branch information
jung0115 authored Jun 10, 2023
2 parents bfa6ff5 + cea7a33 commit 70d904a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
14 changes: 9 additions & 5 deletions app/src/main/java/com/nbit/Idear/mypage/MyPageActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ class MyPageActivity : AppCompatActivity() {

// 프로필 추가 버튼
binding.linearAddProfile.setOnClickListener ( View.OnClickListener {
// 프로필 추가 페이지
val intent = Intent(this, AddProfileActivity::class.java)
intent.putExtra("mode", "add")
startActivity(intent)
if(profileListItems.size < 10) {
// 프로필 추가 페이지
val intent = Intent(this, AddProfileActivity::class.java)
intent.putExtra("mode", "add")
startActivity(intent)
}
})

}
Expand All @@ -72,10 +74,12 @@ class MyPageActivity : AppCompatActivity() {
add(item)
}
profileListAdapter.notifyDataSetChanged()

binding.textProfileListCount.text = profileListItems.size.toString()
}

// 수정 페이지 이동
fun moveToEditPage(profileNum: Int) {
fun moveToEditPage(profileId: Int) {
val intent = Intent(this, AddProfileActivity::class.java)
intent.putExtra("mode", "edit")
startActivity(intent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class ProfileListAdapter (
RecyclerView.ViewHolder(binding.root) {

fun bind(item: ProfileListItem) {
//binding.profileIcon.textMoodKeywordForIcon.text = item.moodKeyword
//binding.profileIcon.textMbtiForIcon.text = item.mbti
binding.profileIcon.textMoodKeywordForIcon.text = item.moodKeyword
binding.profileIcon.textMbtiForIcon.text = item.mbti

binding.textMoodKeywordForInfo.text = item.moodKeyword
binding.textMbtiForInfo.text = item.mbti
Expand All @@ -54,7 +54,7 @@ class ProfileListAdapter (

// 수정하기 버튼
binding.btnEditProfile.setOnClickListener {
onClickEditButton(item.profileNum)
onClickEditButton(item.profileId)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import android.graphics.Color

// 프로필 리스트 아이템
data class ProfileListItem(
val profileNum: Int,
val profileId: Int,
val moodKeyword: String, // 분위기 키워드
val mbti: String, // 엠비티아이
val formal: String, // 반말, 존댓말
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/item_profile_icon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@
android:gravity="center">

<!-- 분위기 키워드 -->
<!--<TextView
<TextView
android:id="@+id/text_mood_keyword_for_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="귀여운"
android:textSize="10sp"
android:textStyle="bold"
android:textColor="@color/white"/>-->
android:textColor="@color/white"/>

<!-- 엠비티아이 -->
<!--<TextView
<TextView
android:id="@+id/text_mbti_for_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ESFP"
android:textSize="10sp"
android:textStyle="bold"
android:textColor="@color/white"/>-->
android:textColor="@color/white"/>

</LinearLayout>

0 comments on commit 70d904a

Please sign in to comment.