From 8fd650caa7be7b7c87f3c3a2ae72c62dfb606e26 Mon Sep 17 00:00:00 2001 From: ddiyooong Date: Tue, 2 Jan 2024 02:17:29 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20QA=20=EC=98=A4=EB=A5=98/=EB=94=94?= =?UTF-8?q?=EC=9E=90=EC=9D=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/misc.xml | 2 +- .../presentation/detail/CafeCommentView.kt | 2 +- .../presentation/detail/CafeDetailFragment.kt | 1 + .../presentation/main/MainActivity.kt | 5 +- .../main/map/CafePreviewFragment.kt | 1 - .../presentation/models/CafeDetailUiModel.kt | 2 +- .../presentation/splash/SplashActivity.kt | 1 - .../res/layout/fragment_cafe_comments.xml | 5 +- .../main/res/layout/fragment_cafe_detail.xml | 66 ++++++++++++------- .../main/res/layout/fragment_cafe_preview.xml | 14 ++-- app/src/main/res/layout/fragment_home.xml | 1 + app/src/main/res/layout/fragment_my_favs.xml | 1 + .../main/res/layout/fragment_my_reviews.xml | 2 +- .../res/layout/fragment_write_comment.xml | 3 +- .../main/res/layout/layout_cafe_comment.xml | 1 - .../main/res/layout/layout_more_footer.xml | 5 +- app/src/main/res/layout/layout_reviews.xml | 1 + 17 files changed, 67 insertions(+), 46 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 59fd0a2..7ddf449 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -10,7 +10,7 @@ diff --git a/app/src/main/java/com/konkuk/mocacong/presentation/detail/CafeCommentView.kt b/app/src/main/java/com/konkuk/mocacong/presentation/detail/CafeCommentView.kt index 76057a9..53c378d 100644 --- a/app/src/main/java/com/konkuk/mocacong/presentation/detail/CafeCommentView.kt +++ b/app/src/main/java/com/konkuk/mocacong/presentation/detail/CafeCommentView.kt @@ -31,7 +31,7 @@ class CafeCommentView @JvmOverloads constructor( binding.commentMenuBtn.visibility = View.GONE if (comment.imgUrl.isNullOrBlank()) binding.profileImg.setImageResource(R.drawable.img_no_profile) else Glide.with(context).load(comment.imgUrl).into(binding.profileImg) - if(comment.nickname.isNullOrBlank()) binding.nicknameText.text = "(알 수 없음)" + binding.nicknameText.text = comment.nicknameText binding.contentText.text = comment.content invalidate() requestLayout() diff --git a/app/src/main/java/com/konkuk/mocacong/presentation/detail/CafeDetailFragment.kt b/app/src/main/java/com/konkuk/mocacong/presentation/detail/CafeDetailFragment.kt index 6c1994e..fa1b19e 100644 --- a/app/src/main/java/com/konkuk/mocacong/presentation/detail/CafeDetailFragment.kt +++ b/app/src/main/java/com/konkuk/mocacong/presentation/detail/CafeDetailFragment.kt @@ -15,6 +15,7 @@ class CafeDetailFragment : BaseFragment() { override fun afterViewCreated() { binding.vm = detailViewModel + detailViewModel.requestCafeDetailInfo() initLayout() } diff --git a/app/src/main/java/com/konkuk/mocacong/presentation/main/MainActivity.kt b/app/src/main/java/com/konkuk/mocacong/presentation/main/MainActivity.kt index 2e92a00..4f69888 100644 --- a/app/src/main/java/com/konkuk/mocacong/presentation/main/MainActivity.kt +++ b/app/src/main/java/com/konkuk/mocacong/presentation/main/MainActivity.kt @@ -147,7 +147,10 @@ class MainActivity : BaseActivity() { val fragment = getFragment(page) supportFragmentManager.commit { if (preFragment != fragment) hide(preFragment) - if (fragment.isAdded) show(fragment) + if (fragment.isAdded) { + if(fragment is CafeDetailFragment) detailViewModel.requestCafeDetailInfo() + show(fragment) + } else add(R.id.fragmentContainer, fragment, fragment.javaClass.name) } prevPage = page diff --git a/app/src/main/java/com/konkuk/mocacong/presentation/main/map/CafePreviewFragment.kt b/app/src/main/java/com/konkuk/mocacong/presentation/main/map/CafePreviewFragment.kt index 5d83831..a49ea3a 100644 --- a/app/src/main/java/com/konkuk/mocacong/presentation/main/map/CafePreviewFragment.kt +++ b/app/src/main/java/com/konkuk/mocacong/presentation/main/map/CafePreviewFragment.kt @@ -38,7 +38,6 @@ class CafePreviewFragment : BaseBottomSheet() { binding.root.setOnClickListener { detailViewModel.setBasicInfo(placeInfo) detailViewModel.cafeId = placeInfo.id - detailViewModel.requestCafeDetailInfo() mainViewModel.goto(MainPage.DETAIL) dismiss() } diff --git a/app/src/main/java/com/konkuk/mocacong/presentation/models/CafeDetailUiModel.kt b/app/src/main/java/com/konkuk/mocacong/presentation/models/CafeDetailUiModel.kt index 0592caf..dbd1014 100644 --- a/app/src/main/java/com/konkuk/mocacong/presentation/models/CafeDetailUiModel.kt +++ b/app/src/main/java/com/konkuk/mocacong/presentation/models/CafeDetailUiModel.kt @@ -32,7 +32,7 @@ class CafeDetailUiModel( val reviewsCountString: String val commentsCountString: String val noCommentVisibility: Int = if (commentsCount > 0) View.GONE else View.VISIBLE - val allCommentsVisibility: Int = if (commentsCount > 2) View.VISIBLE else View.GONE + val allCommentsVisibility: Int = if (commentsCount > 0) View.VISIBLE else View.GONE init { scoreString = String.format("%.1f / 5", score) diff --git a/app/src/main/java/com/konkuk/mocacong/presentation/splash/SplashActivity.kt b/app/src/main/java/com/konkuk/mocacong/presentation/splash/SplashActivity.kt index 9702e81..463b1b7 100644 --- a/app/src/main/java/com/konkuk/mocacong/presentation/splash/SplashActivity.kt +++ b/app/src/main/java/com/konkuk/mocacong/presentation/splash/SplashActivity.kt @@ -72,7 +72,6 @@ class SplashActivity : AppCompatActivity() { private suspend fun postRefresh(token: String) = repository.refresh(ReIssueRequest(token)) - private fun gotoActivity(activity: Class<*>?, startTime: Int) = lifecycleScope.launch { val endTime = System.currentTimeMillis() // 종료 시간 기록 val elapsedTime = endTime - startTime // 경과 시간 계산 diff --git a/app/src/main/res/layout/fragment_cafe_comments.xml b/app/src/main/res/layout/fragment_cafe_comments.xml index 6cbcd0a..400ef8d 100644 --- a/app/src/main/res/layout/fragment_cafe_comments.xml +++ b/app/src/main/res/layout/fragment_cafe_comments.xml @@ -12,13 +12,13 @@ @@ -71,9 +71,8 @@ comments="@{vm.cafeComments}" android:layout_width="match_parent" android:layout_height="0dp" - android:background="@color/brownGray" android:id="@+id/recyclerView" - android:paddingBottom="30dp" + android:layout_marginBottom="60dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintTop_toBottomOf="@id/header" /> diff --git a/app/src/main/res/layout/fragment_cafe_detail.xml b/app/src/main/res/layout/fragment_cafe_detail.xml index 0d9087c..0539d6b 100644 --- a/app/src/main/res/layout/fragment_cafe_detail.xml +++ b/app/src/main/res/layout/fragment_cafe_detail.xml @@ -11,6 +11,7 @@ @@ -74,20 +75,13 @@ - - + android:layout_height="wrap_content"> + + + app:layout_constraintBottom_toBottomOf="@id/addrImg" + app:layout_constraintStart_toEndOf="@id/addrImg" + app:layout_constraintTop_toTopOf="@id/addrImg" /> + + + app:layout_constraintBottom_toBottomOf="@id/callImg" + app:layout_constraintStart_toEndOf="@id/callImg" + app:layout_constraintTop_toTopOf="@id/callImg" /> + app:layout_constraintTop_toBottomOf="@id/divider"> @@ -38,7 +38,7 @@ android:gravity="center" android:text="@{place.addressString}" android:textColor="@color/darkBrown" - android:textSize="16sp" + android:textSize="12sp" app:layout_constraintTop_toBottomOf="@id/cafeName" /> @@ -60,7 +60,7 @@ android:layout_marginTop="20dp" android:text="@{preview.reviewsCount}" android:textColor="@color/darkBrown" - android:textSize="17sp" + android:textSize="14sp" app:layout_constraintBaseline_toBaselineOf="@id/reviewText" app:layout_constraintEnd_toEndOf="parent" /> @@ -73,7 +73,7 @@ android:gravity="center" android:text="평점" android:textColor="@color/darkBrown" - android:textSize="17sp" + android:textSize="14sp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/reviewText" /> @@ -92,7 +92,7 @@ android:layout_marginTop="20dp" android:text="@{preview.score}" android:textColor="@color/darkBrown" - android:textSize="17sp" + android:textSize="14sp" app:layout_constraintBaseline_toBaselineOf="@id/ratingText" app:layout_constraintEnd_toEndOf="parent" /> @@ -104,7 +104,7 @@ android:gravity="center" android:text="코딩 타입" android:textColor="@color/darkBrown" - android:textSize="17sp" + android:textSize="14sp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/ratingText" /> diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 4b736e3..6909348 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -39,6 +39,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="20dp" + android:padding="15dp" android:background="@color/transparent" android:elevation="10dp" android:src="@drawable/icon_menu" diff --git a/app/src/main/res/layout/fragment_my_favs.xml b/app/src/main/res/layout/fragment_my_favs.xml index d600304..22b216c 100644 --- a/app/src/main/res/layout/fragment_my_favs.xml +++ b/app/src/main/res/layout/fragment_my_favs.xml @@ -11,6 +11,7 @@ diff --git a/app/src/main/res/layout/fragment_write_comment.xml b/app/src/main/res/layout/fragment_write_comment.xml index 8ff5565..0de3141 100644 --- a/app/src/main/res/layout/fragment_write_comment.xml +++ b/app/src/main/res/layout/fragment_write_comment.xml @@ -89,8 +89,7 @@ + android:gravity="start"/> diff --git a/app/src/main/res/layout/layout_cafe_comment.xml b/app/src/main/res/layout/layout_cafe_comment.xml index ac3cd2b..ea145b4 100644 --- a/app/src/main/res/layout/layout_cafe_comment.xml +++ b/app/src/main/res/layout/layout_cafe_comment.xml @@ -2,7 +2,6 @@ - diff --git a/app/src/main/res/layout/layout_more_footer.xml b/app/src/main/res/layout/layout_more_footer.xml index 4251fff..6b2ddb0 100644 --- a/app/src/main/res/layout/layout_more_footer.xml +++ b/app/src/main/res/layout/layout_more_footer.xml @@ -2,13 +2,14 @@ + android:layout_height="wrap_content"> diff --git a/app/src/main/res/layout/layout_reviews.xml b/app/src/main/res/layout/layout_reviews.xml index 38fb1b9..dd2e41d 100644 --- a/app/src/main/res/layout/layout_reviews.xml +++ b/app/src/main/res/layout/layout_reviews.xml @@ -10,6 +10,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" + android:paddingEnd="10dp" android:orientation="vertical" >