Skip to content

Commit

Permalink
[FEAT/#30] 여행 중, 여행 남은 일수 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
leeeyubin committed Jan 8, 2024
1 parent d18cd26 commit d688777
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class TripDashBoardViewModel : ViewModel() {
title = "여행 제목 자리",
startDate = "2002.09.22",
endDate = "2005.03.31",
day = 10
day = -10
),
OngoingListModel(
title = "상호랑 제주도 여행",
Expand Down Expand Up @@ -47,26 +47,20 @@ class TripDashBoardViewModel : ViewModel() {
title = "솝트랑 MT",
startDate = "2021.03.24",
endDate = "2021.03.31",
day = -10
day = 0
),
OngoingListModel(
title = "굉굉 신년회",
startDate = "2024.01.02",
endDate = "2024.01.32",
day = 10
day = 0
),
OngoingListModel(
title = "안드 단체 여행",
startDate = "2020.03.24",
endDate = "2021.03.31",
day = 100
),
OngoingListModel(
title = "유빈이 생일 파티",
startDate = "2022.09.22",
endDate = "2022.09.23",
day = 120
),
OngoingListModel(
title = "두릅",
startDate = "2003.03.24",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.going.presentation.tripdashboard.triplist

import android.view.View
import androidx.recyclerview.widget.RecyclerView
import com.going.domain.entity.response.OngoingListModel
import com.going.presentation.databinding.ItemDashBoardOngoingBinding
Expand All @@ -16,7 +17,13 @@ class OngoingViewHolder(
tvDashboardTripTitle.text = item.title
tvDashboardDateStart.text = item.startDate
tvDashboardDateEnd.text = item.endDate
tvDashboardDeadlineDay.text = item.day.toString()

if(item.day <= 0){
layoutDashboardTraveling.visibility = View.VISIBLE
layoutDashboardDayLeft.visibility = View.INVISIBLE
}else{
tvDashboardDeadlineDay.text = item.day.toString()
}

layoutDashboard.setOnSingleClickListener {
listener.onDashBoardSelectedListener(item)
Expand Down
2 changes: 1 addition & 1 deletion presentation/src/main/res/drawable/ic_dash_board_blur.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
android:endY="104"
android:type="linear">
<item android:offset="0" android:color="#00F3F3F6"/>
<item android:offset="0.14" android:color="#FFF3F3F6"/>
<item android:offset="0.26" android:color="#FFF3F3F6"/>
</gradient>
</aapt:attr>
</path>
Expand Down
16 changes: 15 additions & 1 deletion presentation/src/main/res/layout/activity_trip_dash_board.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,17 @@

<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_dashboard"
style="@style/TextAppearance.Doorip.Body2.Bold"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_dashboard_setting"
app:tabIndicatorColor="@color/gray_500"
app:tabIndicatorFullWidth="true"
app:tabIndicatorHeight="2dp"
android:background="@color/white_000"
app:tabRippleColor="@android:color/transparent"
app:tabSelectedTextColor="@color/gray_500"
app:tabTextAppearance="@style/TextAppearance.Doorip.Body2.Bold"
app:tabTextColor="@color/gray_200" />

<androidx.viewpager2.widget.ViewPager2
Expand All @@ -55,6 +59,15 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tab_dashboard" />

<ImageView
android:id="@+id/iv_dashboard_blur"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:src="@drawable/ic_dash_board_blur"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_dashboard_create_trip"
style="@style/button_style"
Expand All @@ -64,6 +77,7 @@
android:layout_marginBottom="22dp"
android:background="@drawable/sel_rounded_corner_button"
android:backgroundTint="@color/gray_500"
android:outlineProvider="none"
android:text="@string/dashboard_btn_create_trip"
android:textColor="@color/white_000"
app:layout_constraintBottom_toBottomOf="parent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:text="굉굉이들이랑 합숙"
android:textColor="@color/gray_300"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

Expand Down
28 changes: 27 additions & 1 deletion presentation/src/main/res/layout/item_dash_board_ongoing.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@
app:layout_constraintTop_toTopOf="@id/tv_dashboard_date_dash" />

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_dashboard_day_inprogress"
android:id="@+id/layout_dashboard_day_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:visibility="visible"
android:background="@drawable/shape_rect_2_red100_fill"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
Expand Down Expand Up @@ -113,6 +114,31 @@

</androidx.constraintlayout.widget.ConstraintLayout>

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_dashboard_traveling"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:visibility="invisible"
android:background="@drawable/shape_rect_2_red100_fill"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">

<TextView
android:id="@+id/tv_dashboard_traveling"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingVertical="2dp"
android:paddingHorizontal="8dp"
android:text="여행중"
android:textAppearance="@style/TextAppearance.Doorip.Detail2.Bold"
android:textColor="@color/red_500"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

</androidx.constraintlayout.widget.ConstraintLayout>

</androidx.constraintlayout.widget.ConstraintLayout>

0 comments on commit d688777

Please sign in to comment.