Skip to content

Commit

Permalink
[feat] : #15 Friend Emotion Image Add, Bottom Connect
Browse files Browse the repository at this point in the history
  • Loading branch information
SsongSik committed Jul 8, 2023
1 parent e1dfbca commit 02a5c58
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import android.view.View
import androidx.recyclerview.widget.RecyclerView
import com.teampome.pome.util.common.CommonUtil

class BottomEmojiGridSpaceItemDecoration(private val spanCount: Int): RecyclerView.ItemDecoration() {
class BottomEmojiGridSpaceItemDecoration(private val spanCount: Int) :
RecyclerView.ItemDecoration() {
// 3, 20
override fun getItemOffsets(
outRect: Rect,
Expand All @@ -28,5 +29,9 @@ class BottomEmojiGridSpaceItemDecoration(private val spanCount: Int): RecyclerVi
} else if (column == 2) {
outRect.left = spaceInPx
}

if (position >= 3) {
outRect.top = CommonUtil.dpToPx(parent.context, 30)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.teampome.pome.presentation.friend
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.teampome.pome.R
import com.teampome.pome.databinding.ItemBottomEmojiBinding
import com.teampome.pome.model.response.FriendEmotionResponse

Expand Down Expand Up @@ -30,7 +31,20 @@ class FriendEmotionAdapter(
private val binding: ItemBottomEmojiBinding
) : RecyclerView.ViewHolder(binding.root) {
fun bind(friendEmotion: FriendEmotionResponse) {
binding.friendEmotionHappyTv.text = friendEmotion.nickname
with(binding) {
friendEmotionHappyTv.text = friendEmotion.nickname

val imageResource = when(friendEmotion.emotionId) {
0 -> R.drawable.emotion_happy_54
1 -> R.drawable.emotion_what_54
2 -> R.drawable.emotion_sad_54
3 -> R.drawable.emotion_funny_54
4 -> R.drawable.emotion_smile_54
else -> R.drawable.emotion_flex_54
}

friendEmotionHappyAiv.setImageResource(imageResource)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@ import android.view.View
import android.widget.Toast
import androidx.fragment.app.viewModels
import androidx.navigation.fragment.findNavController
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.teampome.pome.R
import com.teampome.pome.databinding.FragmentFriendBinding
import com.teampome.pome.databinding.PomeCalendarBottomSheetDialogBinding
import com.teampome.pome.databinding.PomeFriendEmotionBottomSheetDialogBinding
import com.teampome.pome.databinding.PomeFriendSettingBottomSheetDialogBinding
import com.teampome.pome.databinding.PomeRecordMoreGoalBottomSheetDialogBinding
import com.teampome.pome.model.response.FriendEmotionResponse
import com.teampome.pome.util.base.ApiResponse
import com.teampome.pome.util.base.BaseFragment
Expand Down
Binary file added app/src/main/res/drawable/emotion_flex_54.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/emotion_funny_54.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/emotion_happy_54.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/emotion_sad_54.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/emotion_smile_54.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/emotion_what_54.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/friend_bottom_emoji_rv"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_height="256dp"
android:layout_marginStart="10dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="20dp"
Expand Down

0 comments on commit 02a5c58

Please sign in to comment.