Skip to content

Commit

Permalink
Merge pull request #244 from TeamDon-tBe/fix/#233-bnv-qa
Browse files Browse the repository at this point in the history
[Fix/#233] 1.0.0 업뎃 전 버전 코드 변경, 슬랙 디자인 qa 반영
  • Loading branch information
sohyun127 authored Mar 26, 2024
2 parents 3b5f648 + 13e03ee commit 6c448a1
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ data class CommentEntity(
val memberNickname: String,
val isGhost: Boolean,
val memberGhost: Int,
val isLiked: Boolean,
val commentLikedNumber: Int,
var isLiked: Boolean,
var commentLikedNumber: Int,
val contentText: String,
val time: String,
val commentId: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ data class FeedEntity(
val memberId: Int,
val memberProfileUrl: String,
val memberNickname: String,
val isLiked: Boolean,
var isLiked: Boolean,
val isGhost: Boolean,
val memberGhost: Int,
val contentLikedNumber: Int,
var contentLikedNumber: Int,
val commentNumber: Int,
val contentText: String,
val time: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@ import com.teamdontbe.feature.util.pagingSubmitData
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import timber.log.Timber

@AndroidEntryPoint
class HomeFragment : BindingFragment<FragmentHomeBinding>(R.layout.fragment_home) {
private val homeViewModel by activityViewModels<HomeViewModel>()

private lateinit var homeFeedAdapter: HomePagingFeedAdapter
private var deleteFeedPosition: Int = -1

override fun initView() {
statusBarColorOf(R.color.gray_1)
Expand Down Expand Up @@ -81,7 +79,6 @@ class HomeFragment : BindingFragment<FragmentHomeBinding>(R.layout.fragment_home
feedData.memberId == homeViewModel.getMemberId(),
it,
)
deleteFeedPosition = position
}
}

Expand Down Expand Up @@ -179,10 +176,7 @@ class HomeFragment : BindingFragment<FragmentHomeBinding>(R.layout.fragment_home
}

private fun handleDeleteFeedSuccess() {
if (deleteFeedPosition != -1) {
homeFeedAdapter.deleteItem(deleteFeedPosition)
deleteFeedPosition = -1
}
homeFeedAdapter.refresh()
val dialog = DeleteCompleteDialogFragment()
dialog.show(childFragmentManager, DELETE_POSTING)
}
Expand Down Expand Up @@ -217,7 +211,7 @@ class HomeFragment : BindingFragment<FragmentHomeBinding>(R.layout.fragment_home
homeFeedAdapter.registerAdapterDataObserver(object : RecyclerView.AdapterDataObserver() {
override fun onItemRangeInserted(positionStart: Int, itemCount: Int) {
super.onItemRangeInserted(positionStart, itemCount)
binding.rvHome.smoothScrollToPosition(0)
if (positionStart == 0) scrollRecyclerViewToTop()
homeFeedAdapter.unregisterAdapterDataObserver(this)
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ class HomeFeedViewHolder(
onClickLikedBtn(contentId, btnHomeHeart.isSelected)
}
val likeNumber = tvHomeHeartNum.text.toString()
tvHomeHeartNum.text =
if (btnHomeHeart.isSelected) (likeNumber.toInt() - 1).toString() else (likeNumber.toInt() + 1).toString()
val likeNumberChanged = if (btnHomeHeart.isSelected) (likeNumber.toInt() - 1) else (likeNumber.toInt() + 1)
tvHomeHeartNum.text = likeNumberChanged.toString()
data.isLiked = !btnHomeHeart.isSelected
data.contentLikedNumber = likeNumberChanged
btnHomeHeart.isSelected = !btnHomeHeart.isSelected
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ class HomeDetailFragment :

private fun handleCommentPostingSuccess() {
homeDetailCommentAdapter.refresh()
binding.rvHomeDetail.post {
binding.rvHomeDetail.smoothScrollToPosition(homeDetailCommentAdapter.itemCount + 1)
}
requireContext().hideKeyboard(binding.root)
(requireActivity() as MainActivity).findViewById<View>(R.id.bnv_main).visibility =
View.VISIBLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ class HomeDetailCommentViewHolder(
ivCommentGhostFillGreen.isVisible = data.memberId !== userId
dividerComment.isVisible = data.memberId !== userId
btnCommentHeart.isSelected = data.isLiked

dividerCommentDivideBottom.isVisible = (lastPosition !== position)
dividerCommentDivideBottom.isVisible = (lastPosition !== absoluteAdapterPosition)
if (data.isGhost) {
setFeedTransparent(-85)
binding.tvCommentTransparency.text = context.getString(
Expand Down Expand Up @@ -63,8 +62,11 @@ class HomeDetailCommentViewHolder(
btnCommentHeart.setOnDuplicateBlockClick {
onClickLikedBtn(data.commentId, btnCommentHeart.isSelected)
val likeNumber = tvCommentLikeNum.text.toString()
tvCommentLikeNum.text =
if (btnCommentHeart.isSelected) (likeNumber.toInt() - 1).toString() else (likeNumber.toInt() + 1).toString()
val likeNumberChanged =
if (btnCommentHeart.isSelected) (likeNumber.toInt() - 1) else (likeNumber.toInt() + 1)
tvCommentLikeNum.text = likeNumberChanged.toString()
data.isLiked = !btnCommentHeart.isSelected
data.commentLikedNumber = likeNumberChanged
btnCommentHeart.isSelected = !btnCommentHeart.isSelected
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class MyPageCommentFragment :
initDeleteObserve()
initTransparentObserve()
stateCommentItemNull()
scrollRecyclerViewToTop()
//scrollRecyclerViewToTop()
}

private fun initMemberProfile() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ class MyPageCommentViewHolder(
btnCommentHeart.setOnClickListener {
onClickLikedBtn(data.commentId, btnCommentHeart.isSelected)
val likeNumber = tvCommentLikeNum.text.toString()
tvCommentLikeNum.text =
if (btnCommentHeart.isSelected) (likeNumber.toInt() - 1).toString() else (likeNumber.toInt() + 1).toString()
val likeNumberChanged =
if (btnCommentHeart.isSelected) (likeNumber.toInt() - 1) else (likeNumber.toInt() + 1)
tvCommentLikeNum.text = likeNumberChanged.toString()
data.isLiked = !btnCommentHeart.isSelected
data.commentLikedNumber = likeNumberChanged
btnCommentHeart.isSelected = !btnCommentHeart.isSelected
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class MyPageFeedFragment :
initDeleteObserve()
initTransparentObserve()
stateFeedItemNull()
scrollRecyclerViewToTop()
//scrollRecyclerViewToTop()
}

private fun initMemberProfile() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ class MyPageFeedViewHolder(
onClickLikedBtn(contentId, btnHomeHeart.isSelected)
}
val likeNumber = tvHomeHeartNum.text.toString()
tvHomeHeartNum.text =
if (btnHomeHeart.isSelected) (likeNumber.toInt() - 1).toString() else (likeNumber.toInt() + 1).toString()
val likeNumberChanged =
if (btnHomeHeart.isSelected) (likeNumber.toInt() - 1) else (likeNumber.toInt() + 1)
tvHomeHeartNum.text = likeNumberChanged.toString()
data.isLiked = !btnHomeHeart.isSelected
data.contentLikedNumber = likeNumberChanged
btnHomeHeart.isSelected = !btnHomeHeart.isSelected
}
}
Expand Down
7 changes: 4 additions & 3 deletions feature/src/main/res/layout/activity_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_login_symbol" />

<ImageButton
<ImageView
android:id="@+id/btn_login_kakao"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginHorizontal="17dp"
android:layout_marginBottom="36dp"
app:layout_constraintDimensionRatio="6.52:1"
android:background="@android:color/transparent"
android:src="@drawable/ic_login_kakao"
app:layout_constraintBottom_toBottomOf="parent"
Expand Down
20 changes: 13 additions & 7 deletions feature/src/main/res/layout/fragment_transparent_dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,69 +40,75 @@
android:id="@+id/rg_transparent_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="18dp"
android:layout_marginStart="23dp"
android:layout_marginTop="26dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_transparent_subtitle">

<com.google.android.material.radiobutton.MaterialRadioButton
android:id="@+id/rb_transparent_content_1"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:button="@null"
android:drawableStart="@drawable/sel_my_page_auth_withdraw_reason_drawable_btn"
android:drawablePadding="7dp"
android:minWidth="0dp"
android:textAppearance="@style/TextAppearance.DontBe.body_regular_16" />

<com.google.android.material.radiobutton.MaterialRadioButton
android:id="@+id/rb_transparent_content_2"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:button="@null"
android:drawableStart="@drawable/sel_my_page_auth_withdraw_reason_drawable_btn"
android:drawablePadding="7dp"
android:minWidth="0dp"
android:textAppearance="@style/TextAppearance.DontBe.body_regular_16" />

<com.google.android.material.radiobutton.MaterialRadioButton
android:id="@+id/rb_transparent_content_3"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:button="@null"
android:drawableStart="@drawable/sel_my_page_auth_withdraw_reason_drawable_btn"
android:drawablePadding="7dp"
android:minWidth="0dp"
android:textAppearance="@style/TextAppearance.DontBe.body_regular_16" />

<com.google.android.material.radiobutton.MaterialRadioButton
android:id="@+id/rb_transparent_content_4"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:button="@null"
android:drawableStart="@drawable/sel_my_page_auth_withdraw_reason_drawable_btn"
android:drawablePadding="7dp"
android:minWidth="0dp"
android:textAppearance="@style/TextAppearance.DontBe.body_regular_16" />

<com.google.android.material.radiobutton.MaterialRadioButton
android:id="@+id/rb_transparent_content_5"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:button="@null"
android:drawableStart="@drawable/sel_my_page_auth_withdraw_reason_drawable_btn"
android:drawablePadding="7dp"
android:minWidth="0dp"
android:textAppearance="@style/TextAppearance.DontBe.body_regular_16" />

<com.google.android.material.radiobutton.MaterialRadioButton
android:id="@+id/rb_transparent_content_6"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:button="@null"
android:drawableStart="@drawable/sel_my_page_auth_withdraw_reason_drawable_btn"
android:drawablePadding="7dp"
android:minWidth="0dp"
android:textAppearance="@style/TextAppearance.DontBe.body_regular_16" />
</RadioGroup>

Expand Down
8 changes: 5 additions & 3 deletions feature/src/main/res/layout/item_home_comment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,27 +163,29 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="28dp"
android:layout_marginBottom="14dp"
android:background="@drawable/sel_home_heart"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintEnd_toStartOf="@id/tv_comment_like_num"
app:layout_constraintTop_toBottomOf="@id/tv_comment_content" />

<TextView
android:id="@+id/tv_comment_like_num"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="14dp"
android:ellipsize="end"
android:gravity="start"
android:maxLines="1"
android:text="@{Integer.toString(comment.commentLikedNumber)}"
android:textAppearance="@style/TextAppearance.DontBe.cap_regular_12"
android:textColor="@color/gray_11"
app:layout_constraintBottom_toBottomOf="@id/btn_comment_heart"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/btn_comment_heart"
app:layout_constraintTop_toTopOf="@id/btn_comment_heart"
tools:text="54" />
tools:text="544" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
2 changes: 1 addition & 1 deletion feature/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<resources>
<string name="app_name">DontBe</string>
<string name="app_name">Don\'t be</string>
<!-- 바텀 내비게이션 -->
<string name="menu_item_home">홈</string>
<string name="menu_item_posting">글쓰기</string>
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ compileSdk = "34"
minSdk = "28"
targetSdk = "34"
appVersion = "1.0.0"
versionCode = "2"
versionCode = "3"

# kotlin
kotlin = "1.9.10"
Expand Down

0 comments on commit 6c448a1

Please sign in to comment.