Skip to content

Commit

Permalink
fix: QA 오류/디자인 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ddiyooong committed Jan 1, 2024
1 parent b0ec36b commit 8fd650c
Show file tree
Hide file tree
Showing 17 changed files with 67 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class CafeDetailFragment : BaseFragment<FragmentCafeDetailBinding>() {

override fun afterViewCreated() {
binding.vm = detailViewModel
detailViewModel.requestCafeDetailInfo()
initLayout()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class CafePreviewFragment : BaseBottomSheet<FragmentCafePreviewBinding>() {
binding.root.setOnClickListener {
detailViewModel.setBasicInfo(placeInfo)
detailViewModel.cafeId = placeInfo.id
detailViewModel.requestCafeDetailInfo()
mainViewModel.goto(MainPage.DETAIL)
dismiss()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 // 경과 시간 계산
Expand Down
5 changes: 2 additions & 3 deletions app/src/main/res/layout/fragment_cafe_comments.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:background="@color/brownGray"
android:layout_height="match_parent">

<View
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@color/brownGray"
app:layout_constraintHeight_percent="0.2"
app:layout_constraintTop_toTopOf="parent" />

Expand Down Expand Up @@ -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" />

Expand Down
66 changes: 42 additions & 24 deletions app/src/main/res/layout/fragment_cafe_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:background="@color/white"
android:layout_height="match_parent">

<ScrollView
Expand All @@ -34,60 +35,53 @@
app:layout_constraintTop_toTopOf="parent">

<ImageView
cafeImage="@{vm.cafeDetailInfo.images[0]}"
android:layout_height="match_parent"
android:layout_rowSpan="2"
cafeImage="@{vm.cafeDetailInfo.images[0]}"
android:layout_columnWeight="1"
android:background="@drawable/img_nothing"
android:scaleType="centerCrop" />


<ImageView
cafeImage="@{vm.cafeDetailInfo.images[1]}"
android:layout_width="100dp"
android:layout_height="100dp"
cafeImage="@{vm.cafeDetailInfo.images[1]}"
android:background="@drawable/img_nothing"
android:scaleType="centerCrop" />

<ImageView
cafeImage="@{vm.cafeDetailInfo.images[2]}"
android:layout_width="100dp"
android:layout_height="100dp"
cafeImage="@{vm.cafeDetailInfo.images[2]}"
android:background="@drawable/img_nothing"
android:scaleType="centerCrop" />

<ImageView
cafeImage="@{vm.cafeDetailInfo.images[3]}"
android:layout_width="100dp"
android:layout_height="100dp"
cafeImage="@{vm.cafeDetailInfo.images[3]}"
android:background="@drawable/img_nothing"
android:scaleType="centerCrop" />

<ImageView
cafeImage="@{vm.cafeDetailInfo.images[4]}"
android:layout_width="100dp"
android:layout_height="100dp"
cafeImage="@{vm.cafeDetailInfo.images[4]}"
android:background="@drawable/img_nothing"
android:scaleType="centerCrop" />
</GridLayout>


<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:layout_height="wrap_content">

<TextView
android:id="@+id/cafeName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:gravity="center"
android:text="@{vm.cafeBasicInfo.name}"
android:textColor="@color/darkBrown"
Expand Down Expand Up @@ -174,41 +168,64 @@
app:layout_constraintStart_toEndOf="@id/editBtn"
app:layout_constraintTop_toTopOf="@id/editBtn" />

<ImageView
android:id="@+id/addrImg"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_margin="20dp"
android:background="@color/transparent"
android:src="@drawable/detail_location"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/editBtn" />

<TextView
android:id="@+id/addrText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:paddingHorizontal="10dp"
android:layout_marginStart="42dp"
android:text="@{vm.cafeBasicInfo.addressString}"
android:textColor="@color/textGray"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/editBtn" />
app:layout_constraintBottom_toBottomOf="@id/addrImg"
app:layout_constraintStart_toEndOf="@id/addrImg"
app:layout_constraintTop_toTopOf="@id/addrImg" />


<ImageView
android:id="@+id/callImg"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_margin="20dp"
android:background="@color/transparent"
android:src="@drawable/detail_call"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/addrImg" />

<TextView
android:id="@+id/telText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:paddingHorizontal="10dp"
android:layout_marginStart="42dp"
android:text="@{vm.cafeBasicInfo.phoneString}"
android:textColor="@color/textGray"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/addrText" />
app:layout_constraintBottom_toBottomOf="@id/callImg"
app:layout_constraintStart_toEndOf="@id/callImg"
app:layout_constraintTop_toTopOf="@id/callImg" />

<include
android:id="@+id/reviewsLayout"
layout="@layout/layout_reviews"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginTop="24dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/telText"
app:reviews="@{vm.cafeDetailInfo.reviews}" />

<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="40dp"
Expand All @@ -218,10 +235,11 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="10dp"
android:layout_marginTop="40dp"
android:orientation="vertical"
android:paddingBottom="60dp"
app:layout_constraintTop_toBottomOf="@id/reviewsLayout">
app:layout_constraintTop_toBottomOf="@id/divider">

<com.konkuk.mocacong.presentation.detail.CafeCommentView
android:id="@+id/comment1"
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/res/layout/fragment_cafe_preview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
android:paddingHorizontal="20dp"
android:text="@{place.name}"
android:textColor="@color/darkBrown"
android:textSize="25sp"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintTop_toTopOf="parent" />

Expand All @@ -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" />

<TextView
Expand All @@ -49,7 +49,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/addrText" />

Expand All @@ -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" />

Expand All @@ -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" />

Expand All @@ -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" />

Expand All @@ -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" />

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/fragment_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/fragment_my_favs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:background="@color/brownGray"
android:layout_height="match_parent">

<include
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_my_reviews.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:background="@color/brownGray"
android:layout_height="match_parent">

<include
Expand All @@ -25,7 +26,6 @@
myReviews="@{vm.reviewResponse}"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@color/white"
android:id="@+id/recyclerView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/headerLayout" />
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/res/layout/fragment_write_comment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="200dp"
android:gravity="start"
android:text="ddd" />
android:gravity="start"/>

</com.google.android.material.textfield.TextInputLayout>

Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/layout_cafe_comment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<layout>

<data>

<variable
name="comment"
type="com.konkuk.mocacong.data.entities.Comment" />
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/res/layout/layout_more_footer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="더보기"
android:background="@color/white"
android:gravity="center"
android:padding="10dp"
android:padding="20dp"
android:layout_marginVertical="0.2dp"
/>

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/layout_reviews.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
>

Expand Down

0 comments on commit 8fd650c

Please sign in to comment.