Skip to content

Commit

Permalink
[chore] #3 코드리뷰 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
Doreminwoo committed Nov 23, 2023
1 parent 1e6d2f7 commit 8399254
Show file tree
Hide file tree
Showing 11 changed files with 116 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ data class ResponsePopularStoreDto(
@Serializable
data class StoreData(
@SerialName("shop_id")
val shop_id: Int,
val shopId: Int,
@SerialName("name")
val name: String,
@SerialName("average_star")
val average_star: Double,
val averageStar: Double,
@SerialName("review_count")
val review_count: Int,
val reviewCount: Int,
@SerialName("shop_category")
val shop_category: String,
val shopCategory: String,
@SerialName("short_address")
val short_address: String,
val shortAddress: String,
@SerialName("average_waiting")
val average_waiting: Int,
val averageWaiting: Int,
@SerialName("current_waiting")
val current_waiting: Int,
val currentWaiting: Int,
@SerialName("profile_photo_url")
val profile_photo_url: String,
val profilePhotoUrl: String,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class PopularStoreAdapter(context: Context) :
inner class PopularStoreViewHolder(val binding: ItemPopularStoreBinding) :
RecyclerView.ViewHolder(binding.root) {
fun onBind(storeData: ResponsePopularStoreDto.StoreData) {
binding.data = storeData
binding.storeData = storeData
}
}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
android:shape="rectangle">
<gradient
android:angle="180"
android:endColor="@color/white_0"
android:endColor="@color/transparent_white"
android:startColor="@color/white" />
</shape>
128 changes: 70 additions & 58 deletions app/src/main/res/layout/activity_popular_store.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
tools:context=".presentation.store.PopularStoreActivity">

<com.google.android.material.appbar.MaterialToolbar
Expand All @@ -24,113 +25,124 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navigationIcon="@drawable/ic_back_24px">
app:navigationIcon="@drawable/ic_back_gray_800_24px">

<TextView
android:id="@+id/tv_popular_store_tb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/area_seoul_south"
android:textAppearance="@style/TextAppearance.Body1.SemiBold" />
android:textAppearance="@style/TextAppearance.Body1.SemiBold"
android:textColor="@color/gray_800"
tools:layout_editor_absoluteX="56dp"
tools:layout_editor_absoluteY="22dp" />

<ImageButton
android:id="@+id/imageButton"
android:id="@+id/ib_popular_store_area"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="2dp"
android:background="@color/white"
android:src="@drawable/ic_polygon_black_8px" />
android:src="@drawable/ic_polygon_gray_800_8px" />

</com.google.android.material.appbar.MaterialToolbar>

<com.google.android.material.chip.ChipGroup
android:id="@+id/cg_popular_store_area"
android:layout_width="0dp"
<HorizontalScrollView
android:id="@+id/hsv_popular_store_chip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:orientation="horizontal"
android:scrollbars="none"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tb_popular_store"
app:singleLine="true"
app:singleSelection="true">

<com.google.android.material.chip.Chip
style="@style/Style.Material3.Chip.Suggestion.Waiting"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:checked="true"
android:text="@string/area_all" />

<com.google.android.material.chip.Chip
style="@style/Style.Material3.Chip.Suggestion.Waiting"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/area_seoul_gangnam" />
app:layout_constraintTop_toBottomOf="@id/tb_popular_store">

<com.google.android.material.chip.Chip
style="@style/Style.Material3.Chip.Suggestion.Waiting"
<com.google.android.material.chip.ChipGroup
android:id="@+id/cg_popular_store_area"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/area_seoul_apgujeong" />

<com.google.android.material.chip.Chip
style="@style/Style.Material3.Chip.Suggestion.Waiting"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/area_seoul_samsung" />

<com.google.android.material.chip.Chip
style="@style/Style.Material3.Chip.Suggestion.Waiting"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/area_seoul_seocho" />

</com.google.android.material.chip.ChipGroup>
android:layout_marginStart="16dp"
android:orientation="horizontal"
app:singleLine="true"
app:singleSelection="true">

<com.google.android.material.chip.Chip
style="@style/Style.Material3.Chip.Suggestion.Waiting"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:checked="true"
android:text="@string/area_all" />

<com.google.android.material.chip.Chip
style="@style/Style.Material3.Chip.Suggestion.Waiting"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/area_seoul_gangnam" />

<com.google.android.material.chip.Chip
style="@style/Style.Material3.Chip.Suggestion.Waiting"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/area_seoul_apgujeong" />

<com.google.android.material.chip.Chip
style="@style/Style.Material3.Chip.Suggestion.Waiting"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/area_seoul_samsung" />

<com.google.android.material.chip.Chip
style="@style/Style.Material3.Chip.Suggestion.Waiting"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/area_seoul_seocho" />

</com.google.android.material.chip.ChipGroup>
</HorizontalScrollView>

<ImageButton
android:id="@+id/ic_popular_store_arrow_down"
android:id="@+id/iv_popular_store_arrow_down"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_white_100_0"
android:background="@drawable/shape_gradient_white_rect"
android:paddingStart="27dp"
android:paddingTop="6dp"
android:paddingEnd="16dp"
android:paddingBottom="6dp"
android:src="@drawable/ic_arrow_down_black_36px"
app:layout_constraintBottom_toBottomOf="@id/cg_popular_store_area"
app:layout_constraintBottom_toBottomOf="@id/hsv_popular_store_chip"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/cg_popular_store_area" />
app:layout_constraintTop_toTopOf="@id/hsv_popular_store_chip" />

<View
android:id="@+id/line"
android:layout_width="360dp"
android:id="@+id/view_popular_store_horizontal_1dp"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="11dp"
android:background="@color/gray_000"
app:layout_constraintTop_toBottomOf="@id/cg_popular_store_area"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
app:layout_constraintTop_toBottomOf="@id/hsv_popular_store_chip" />

<TextView
android:id="@+id/tv_popular_store_text1"
android:id="@+id/tv_popular_store_avg_people_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:text="@string/popular_store_text1"
android:text="@string/popular_store_avg_personnel"
android:textAppearance="@style/TextAppearance.Caption1.SemiBold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/line" />
app:layout_constraintTop_toBottomOf="@id/view_popular_store_horizontal_1dp" />

<TextView
android:id="@+id/tv_popular_store_text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/popular_store_text2"
android:text="@string/popular_store_standard"
android:textAppearance="@style/TextAppearance.Caption1.Regular"
app:layout_constraintBottom_toBottomOf="@id/tv_popular_store_text1"
app:layout_constraintStart_toEndOf="@id/tv_popular_store_text1"
app:layout_constraintTop_toTopOf="@id/tv_popular_store_text1" />
app:layout_constraintBottom_toBottomOf="@id/tv_popular_store_avg_people_number"
app:layout_constraintStart_toEndOf="@id/tv_popular_store_avg_people_number"
app:layout_constraintTop_toTopOf="@id/tv_popular_store_avg_people_number" />

<TextView
android:id="@+id/tv_popular_store_area"
Expand All @@ -142,7 +154,7 @@
android:textAppearance="@style/TextAppearance.Body1.SemiBold"
android:textColor="@color/secondary"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_popular_store_text1" />
app:layout_constraintTop_toBottomOf="@id/tv_popular_store_avg_people_number" />

<TextView
android:id="@+id/tv_popular_store_best"
Expand Down
41 changes: 19 additions & 22 deletions app/src/main/res/layout/item_popular_store.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<data>

<variable
name="data"
name="storeData"
type="org.sopt.tabling.data.model.response.ResponsePopularStoreDto.StoreData" />
</data>

Expand All @@ -18,7 +18,7 @@
android:id="@+id/tv_popular_store_number"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@{String.valueOf(data.shop_id)}"
android:text="@{String.valueOf(storeData.shopId)}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/iv_popular_store"
Expand All @@ -32,7 +32,7 @@
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:scaleType="centerCrop"
app:image="@{data.profile_photo_url}"
app:image="@{storeData.profilePhotoUrl}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1"
app:layout_constraintStart_toEndOf="@id/tv_popular_store_number"
Expand All @@ -41,17 +41,14 @@

<com.google.android.material.chip.Chip
android:id="@+id/chip_popular_store_waiting_num"
style="@style/Widget.Material3.Chip.Style"
style="@style/Style.Material3.Chip.Suggestion.Waiting.Item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginTop="4dp"
android:checkable="false"
android:text="@{data.current_waiting == 0 ? @string/item_popular_store_no_waiting : @string/item_popular_store_waiting(data.current_waiting) }"
android:textAppearance="@style/TextAppearance.Caption2"
android:textColor="@{data.current_waiting == 0 ? @color/gray_200 : @color/white }"
app:chipBackgroundColor="@{data.current_waiting == 0 ? @color/gray_600 : @color/primary }"
app:chipStrokeColor="@android:color/transparent"
android:text="@{storeData.currentWaiting == 0 ? @string/popular_store_no_waiting_team : @string/popular_store_waiting_team(storeData.currentWaiting) }"
android:textColor="@{storeData.currentWaiting == 0 ? @color/gray_200 : @color/white }"
app:chipBackgroundColor="@{storeData.currentWaiting == 0 ? @color/gray_600 : @color/primary }"
app:layout_constraintStart_toStartOf="@id/iv_popular_store"
app:layout_constraintTop_toTopOf="@id/iv_popular_store"
tools:text="대기 14팀" />
Expand All @@ -62,7 +59,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:text="@{data.name}"
android:text="@{storeData.name}"
android:textAppearance="@style/TextAppearance.Body1.SemiBold"
android:textColor="@color/gray_400"
app:layout_constraintStart_toEndOf="@id/iv_popular_store"
Expand All @@ -85,7 +82,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="3dp"
android:layout_marginTop="1dp"
android:text="@{String.valueOf(data.average_star)}"
android:text="@{String.valueOf(storeData.averageStar)}"
android:textAppearance="@style/TextAppearance.Body2.Regular"
android:textColor="@color/gray_800"
app:layout_constraintStart_toEndOf="@id/ic_popular_store_star"
Expand All @@ -97,7 +94,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="1dp"
android:text="@{String.valueOf(data.review_count)}"
android:text="@{storeData.reviewCount > 300 ? @string/popular_store_review_count_over : @string/popular_store_review_count(storeData.reviewCount) }"
android:textAppearance="@style/TextAppearance.Body2.Regular"
android:textColor="@color/gray_800"
app:layout_constraintStart_toEndOf="@id/tv_popular_store_review"
Expand All @@ -110,7 +107,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="1dp"
android:text="@{data.shop_category}"
android:text="@{storeData.shopCategory}"
android:textAppearance="@style/TextAppearance.Body2.Regular"
android:textColor="@color/gray_200"
app:layout_constraintStart_toEndOf="@id/iv_popular_store"
Expand All @@ -132,7 +129,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="1dp"
android:text="@{data.short_address}"
android:text="@{storeData.shortAddress}"
android:textAppearance="@style/TextAppearance.Body2.Regular"
android:textColor="@color/gray_200"
app:layout_constraintBottom_toBottomOf="@id/tv_popular_store_food_type"
Expand All @@ -148,14 +145,14 @@
android:layout_marginTop="1dp"
app:layout_constraintStart_toEndOf="@id/iv_popular_store"
app:layout_constraintTop_toBottomOf="@id/tv_popular_store_food_type"
app:srcCompat="@drawable/ic_people_grey_24px" />
app:srcCompat="@drawable/ic_people_grey_100_24px" />

<TextView
android:id="@+id/tv_popular_store_1"
android:id="@+id/tv_popular_store_avg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="1dp"
android:text="@string/item_popular_store_avg"
android:text="@string/popular_store_avg"
android:textAppearance="@style/TextAppearance.Caption1.Regular"
android:textColor="@color/gray_300"
app:layout_constraintBottom_toBottomOf="@id/ic_popular_store_people"
Expand All @@ -167,19 +164,19 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:text="@{String.valueOf(data.average_waiting)}"
android:text="@{String.valueOf(storeData.averageWaiting)}"
android:textAppearance="@style/TextAppearance.Caption1.SemiBold"
android:textColor="@color/gray_600"
app:layout_constraintBottom_toBottomOf="@id/ic_popular_store_people"
app:layout_constraintStart_toEndOf="@id/tv_popular_store_1"
app:layout_constraintStart_toEndOf="@id/tv_popular_store_avg"
app:layout_constraintTop_toTopOf="@id/ic_popular_store_people"
tools:text="4753" />

<TextView
android:id="@+id/tv_popular_store_2"
android:id="@+id/tv_popular_store_wait"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/item_popular_store_wait"
android:text="@string/popular_store_wait"
android:textAppearance="@style/TextAppearance.Caption1.Regular"
android:textColor="@color/gray_300"
app:layout_constraintBottom_toBottomOf="@id/ic_popular_store_people"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<resources>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="white_0">#00FFFFFF</color>
<color name="transparent_white">#00FFFFFF</color>

<!--primary-->
<color name="primary">#F85A40</color>
Expand Down
Loading

0 comments on commit 8399254

Please sign in to comment.