Skip to content

Commit

Permalink
feat(FestivalDetail): 축제 상세 dday 디자인 변경 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
SeongHoonC committed Mar 6, 2024
1 parent 78d3439 commit 6a7034e
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ object FakeFestivals {
val festivalDetail = FestivalDetail(
id = 1L,
name = "부경대 대동제",
startDate = LocalDate.now(),
endDate = LocalDate.now().plusDays(5L),
startDate = LocalDate.now().plusDays(7L),
endDate = LocalDate.now().plusDays(10L),
posterImageUrl = "https://mblogthumb-phinf.pstatic.net/MjAyMzA1MjNfMTMx/MDAxNjg0ODIwNzY5NzQ5.MuYItN1HCOQUcADB6B7ua0SO9Au_QNNk01-6yZkcTH0g.wxSjluY-Glq20JIojs7OuScLQWh6c_sQsoW5xXqiM7Ag.JPEG.chummilmil99/SE-126908ba-0f82-4903-91c5-695db78a98e9.jpg?type=w800",
school = School(id = 2L, name = "부경대학교", imageUrl = ""),
socialMedias = listOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.appcompat.content.res.AppCompatResources
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentTransaction
import androidx.fragment.app.commit
Expand Down Expand Up @@ -102,17 +103,33 @@ class FestivalDetailFragment : Fragment() {
private fun TextView.setFestivalDDay(startDate: LocalDate, endDate: LocalDate) {
when {
LocalDate.now() in startDate..endDate -> {
text = context.getString(R.string.festival_detail_tv_dday)
text = context.getString(R.string.festival_detail_tv_dday_in_progress)
setTextColor(context.getColor(R.color.secondary_pink_01))
background = AppCompatResources.getDrawable(
context,
R.drawable.bg_festival_list_dday_in_progress,
)
}

LocalDate.now() < startDate -> {
text = context.getString(
R.string.festival_detail_tv_dday_format,
(LocalDate.now().toEpochDay() - startDate.toEpochDay()).toString(),
)
val dDay = LocalDate.now().toEpochDay() - startDate.toEpochDay()
val backgroundColor = if (dDay >= -7L) {
context.getColor(R.color.secondary_pink_01)
} else {
context.getColor(R.color.contents_gray_07)
}
setBackgroundColor(backgroundColor)
setTextColor(context.getColor(R.color.background_gray_01))
text = context.getString(R.string.festival_detail_tv_dday_format, dDay.toString())
}

else -> {
setBackgroundColor(Color.TRANSPARENT)
setTextColor(context.getColor(R.color.background_gray_01))
background = AppCompatResources.getDrawable(
context,
R.drawable.bg_festival_detail_dday_end,
)
text = context.getString(R.string.festival_detail_tv_dday_end)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<stroke
android:color="@color/background_gray_01"
android:width="1dp" />
<solid
android:color="@color/transparent" />
</shape>
Original file line number Diff line number Diff line change
Expand Up @@ -70,28 +70,20 @@
app:layout_constraintTop_toBottomOf="@id/ivFestivalBackground"
tools:src="@drawable/ic_launcher_foreground" />

<androidx.cardview.widget.CardView
android:id="@+id/cvFestivalDDay"
android:layout_width="68dp"
<TextView
android:id="@+id/tvFestivalDDay"
style="@style/H5Bold14Lh16"
android:layout_width="56dp"
android:layout_height="24dp"
android:layout_gravity="center"
android:layout_marginStart="30dp"
android:layout_marginBottom="8dp"
app:cardBackgroundColor="@color/secondary_pink_01"
app:cardCornerRadius="1000dp"
android:background="@color/secondary_pink_01"
android:gravity="center"
android:textColor="@color/background_gray_01"
app:layout_constraintBottom_toBottomOf="@+id/ivFestivalBackground"
app:layout_constraintStart_toEndOf="@+id/ivFestivalPoster">

<TextView
android:id="@+id/tvFestivalDDay"
style="@style/H5Bold14Lh16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="@color/background_gray_01"
tools:text="D-DAY" />

</androidx.cardview.widget.CardView>

app:layout_constraintStart_toEndOf="@+id/ivFestivalPoster"
tools:text="D-DAY" />

<androidx.cardview.widget.CardView
android:id="@+id/cvBookmark"
Expand Down Expand Up @@ -124,6 +116,7 @@
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:gravity="start"
android:includeFontPadding="false"
android:maxLines="2"
android:text="@{successUiState.festival.name}"
android:textColor="@color/contents_gray_07"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<string name="artist_detail_tv_dday_format">D%1$s</string>

<!-- String related to festival detail -->
<string name="festival_detail_tv_dday">D-DAY</string>
<string name="festival_detail_tv_dday_in_progress">진행 중</string>
<string name="festival_detail_tv_dday_format">D%1$s</string>
<string name="festival_detail_tv_dday_end">종료</string>

Expand Down

0 comments on commit 6a7034e

Please sign in to comment.