Skip to content

Commit

Permalink
#212 Change dining container layout
Browse files Browse the repository at this point in the history
  • Loading branch information
wateralsie committed Apr 16, 2024
1 parent 5219c83 commit 2915dce
Show file tree
Hide file tree
Showing 5 changed files with 224 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class MainActivity : KoinNavigationDrawerActivity() {
}

observeLiveData(selectedType) {
binding.textViewDiningTime.text = it.localized(this@MainActivity)
binding.textViewDiningTodayOrTomorrow.text = it.localized(this@MainActivity)
}

observeLiveData(busTimer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class DiningContainerFragment : Fragment(R.layout.fragment_dining_container) {

private fun initView() {
place.apply {
binding.textViewDiningContainer.text = this.toString()
// binding.textViewDiningContainer.text = this.toString()
}
}

Expand Down
8 changes: 4 additions & 4 deletions koin/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
android:layout_height="wrap_content">

<TextView
android:id="@+id/text_view_dining_time"
android:id="@+id/text_view_dining_today_or_tomorrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
Expand All @@ -134,7 +134,7 @@
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="아침" />
tools:text="오늘" />

<TextView
android:id="@+id/text_view_dining_title"
Expand All @@ -145,8 +145,8 @@
android:textColor="@color/colorPrimary"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@id/text_view_dining_time"
app:layout_constraintTop_toTopOf="@id/text_view_dining_time" />
app:layout_constraintStart_toEndOf="@id/text_view_dining_today_or_tomorrow"
app:layout_constraintTop_toTopOf="@id/text_view_dining_today_or_tomorrow" />


</androidx.constraintlayout.widget.ConstraintLayout>
Expand Down
221 changes: 214 additions & 7 deletions koin/src/main/res/layout/fragment_dining_container.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,224 @@

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:background="@color/container_background"
android:paddingHorizontal="24dp"
android:paddingTop="16dp"
android:paddingBottom="109dp"
tools:context=".ui.main.fragment.DiningContainerFragment">

<TextView
android:id="@+id/text_view_dining_container"
android:layout_width="wrap_content"
<com.google.android.material.card.MaterialCardView
android:id="@+id/dining_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:cardCornerRadius="8dp"
app:cardElevation="0dp"
app:layout_constraintTop_toTopOf="parent"
tools:text="어디야??" />
app:strokeColor="@color/container_stroke"
app:strokeWidth="1dp">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/text_view_dining_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="18dp"
android:includeFontPadding="false"
android:textColor="@color/black"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="아침" />

<TextView
android:id="@+id/text_view_dining_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="17dp"
android:layout_marginEnd="16dp"
android:includeFontPadding="false"
android:paddingHorizontal="8dp"
android:paddingVertical="4dp"
android:textSize="12sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:background="@drawable/dining_soldout_fill_radius_4"
tools:text="@string/dining_soldout"
tools:textColor="@color/dining_soldout_text" />

<View
android:id="@+id/view_dining_container_line"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="16dp"
android:background="@color/container_stroke_inside"
app:layout_constraintTop_toBottomOf="@id/text_view_dining_status" />

<TableLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/view_dining_container_line">

<TableRow android:paddingBottom="4dp">

<TextView
android:id="@+id/text_view_dining_container_menu_0"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/black"
android:textSize="12sp"
tools:text="메뉴1" />

<TextView
android:id="@+id/text_view_dining_container_menu_1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/black"
android:textSize="12sp"
tools:text="메뉴2" />

</TableRow>

<TableRow android:paddingBottom="4dp">

<TextView
android:id="@+id/text_view_dining_container_menu_2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/black"
android:textSize="12sp"
tools:text="메뉴3" />

<TextView
android:id="@+id/text_view_dining_container_menu_3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/black"
android:textSize="12sp"
tools:text="메뉴4" />

</TableRow>

<TableRow android:paddingBottom="4dp">

<TextView
android:id="@+id/text_view_dining_container_menu_4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/black"
android:textSize="12sp"
tools:text="까르보나라민트초코파맛첵스파게티" />

<TextView
android:id="@+id/text_view_dining_container_menu_5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/black"
android:textSize="12sp"
tools:text="메뉴6" />

</TableRow>

<TableRow android:paddingBottom="4dp">

<TextView
android:id="@+id/text_view_dining_container_menu_6"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/black"
android:textSize="12sp"
tools:text="메뉴7" />

<TextView
android:id="@+id/text_view_dining_container_menu_7"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/black"
android:textSize="12sp"
tools:text="메뉴8" />

</TableRow>

<TableRow android:paddingBottom="4dp">

<TextView
android:id="@+id/text_view_dining_container_menu_8"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/black"
android:textSize="12sp"
tools:text="메뉴9" />

<TextView
android:id="@+id/text_view_dining_container_menu_9"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/black"
android:textSize="12sp"
tools:text="까르보나라민트초코파맛첵스파게티" />

</TableRow>

</TableLayout>

<include
android:id="@+id/view_empty_dining"
layout="@layout/dining_view_empty"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="invisible" />

</androidx.constraintlayout.widget.ConstraintLayout>

</com.google.android.material.card.MaterialCardView>

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
4 changes: 4 additions & 0 deletions koin/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
<!-- dining changed -->
<color name="dining_changed_text">#4B4B4B</color>
<color name="dining_changed_background">#EEEEEE</color>
<!-- main-dining -->
<color name="container_background">#FAFAFA</color>
<color name="container_stroke">#E1E1E1</color>
<color name="container_stroke_inside">#EEEEEE</color>
</resources>

0 comments on commit 2915dce

Please sign in to comment.