-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat] 핑글 개최 프로세스 - 내용요약/확인 뷰 구현 #65
Changes from 16 commits
0e4f8d0
7bdcadd
9f44ed5
b636da2
9cc5d0e
664d517
5c6af6c
9b1a288
de8f744
ded080d
bfb3843
0f2d198
0f4b962
40737a4
7c99cab
b6205e9
17a8d76
884dc9c
7d06e51
9b877f5
0bf7f3e
88597a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,26 +2,31 @@ package org.sopt.pingle.presentation.ui.main.plan | |
|
||
import android.os.Bundle | ||
import android.view.View | ||
import androidx.fragment.app.viewModels | ||
import androidx.fragment.app.activityViewModels | ||
import androidx.lifecycle.flowWithLifecycle | ||
import androidx.lifecycle.lifecycleScope | ||
import kotlinx.coroutines.flow.launchIn | ||
import kotlinx.coroutines.flow.onEach | ||
import org.sopt.pingle.R | ||
import org.sopt.pingle.databinding.FragmentPlanCategoryBinding | ||
import org.sopt.pingle.presentation.type.CategoryType | ||
import org.sopt.pingle.util.base.BindingFragment | ||
import timber.log.Timber | ||
|
||
class PlanCategoryFragment : | ||
BindingFragment<FragmentPlanCategoryBinding>(R.layout.fragment_plan_category) { | ||
private val viewModel by viewModels<PlanViewModel>() | ||
private val viewModel by activityViewModels<PlanViewModel>() | ||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
|
||
binding.planViewModel = viewModel | ||
binding.lifecycleOwner = this | ||
|
||
initLayout() | ||
addListeners() | ||
} | ||
viewModel.selectedCategory.flowWithLifecycle(lifecycle).onEach { | ||
Timber.tag("observe:categoryType").d(viewModel.selectedCategory.value?.name.toString()) | ||
}.launchIn(lifecycleScope) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. timber나 로그 코드 모두 삭제해주세요 |
||
|
||
private fun initLayout() { | ||
addListeners() | ||
} | ||
|
||
private fun addListeners() { | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,38 @@ | ||||||
package org.sopt.pingle.presentation.ui.main.plan | ||||||
|
||||||
import android.os.Bundle | ||||||
import android.view.View | ||||||
import androidx.fragment.app.activityViewModels | ||||||
import org.sopt.pingle.R | ||||||
import org.sopt.pingle.databinding.FragmentPlanSummaryConfirmationBinding | ||||||
import org.sopt.pingle.presentation.type.CategoryType | ||||||
import org.sopt.pingle.util.base.BindingFragment | ||||||
import org.sopt.pingle.util.fragment.colorOf | ||||||
|
||||||
class PlanSummaryConfirmationFragment : | ||||||
BindingFragment<FragmentPlanSummaryConfirmationBinding>(R.layout.fragment_plan_summary_confirmation) { | ||||||
private val viewModel by activityViewModels<PlanViewModel>() | ||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||||||
super.onViewCreated(view, savedInstanceState) | ||||||
|
||||||
initLayout() | ||||||
} | ||||||
|
||||||
private fun initLayout() { | ||||||
val category: CategoryType? = viewModel.selectedCategory.value | ||||||
if (category != null) { | ||||||
with(binding) { | ||||||
badgePlanSummaryConfirmationCategory.setBadgeCategoryType(category) | ||||||
tvPlanSummaryConfirmationName.setTextColor(colorOf((category.textColor))) | ||||||
tvPlanSummaryConfirmationName.text = viewModel.planTitle.value | ||||||
tvPlanSummaryConfirmationOwnerName.text = "개최자" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이거 나중에 서버통신으로 사용자 정보 받아와서 개최자 닉네임 넣어주는 로직으로 수정해주는 거 맞죠? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 넵 API명세서에 있는 거 씁니둥,, |
||||||
tvPlanSummaryConfirmationCalenderDetail.text = | ||||||
viewModel.planDate.value + "\n" + makeTimeClean(viewModel.startTime.value) + " ~ " + makeTimeClean(viewModel.endTime.value) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기도 스트링 추출해서 사용해주세요 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이건 나중에 서버통신으로 없앨 부분이라 그냥 둘게욥 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 날짜도 변환해주세요 |
||||||
tvPlanSummaryConfirmationMapDetail.text = viewModel.selectedLocation.value?.location | ||||||
tvPlanSummaryConfirmationRecruitmentDetail.text = getString(R.string.plan_summary_confirmation_recruitment_number, viewModel.selectedRecruitment.value) | ||||||
} | ||||||
} | ||||||
} | ||||||
|
||||||
private fun makeTimeClean(time: String): String = time.substring(0, 5) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
이런 식으로 네이밍하는 게 좋을 것 같고 0이랑 5는 상수화 해주세요 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 뭔가 직관적이지 않은 것 같아서 convertDateFormat, convertTimeFormat으로 수정했슴둥 |
||||||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,201 @@ | ||||||
<?xml version="1.0" encoding="utf-8"?> | ||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android" | ||||||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||||||
xmlns:tools="http://schemas.android.com/tools"> | ||||||
|
||||||
<data> | ||||||
|
||||||
<variable | ||||||
name="planViewModel" | ||||||
type="org.sopt.pingle.presentation.ui.main.plan.PlanViewModel" /> | ||||||
</data> | ||||||
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout | ||||||
android:id="@+id/layout_plan_summary_confirmation" | ||||||
android:layout_width="match_parent" | ||||||
android:layout_height="match_parent"> | ||||||
|
||||||
<TextView | ||||||
android:id="@+id/tv_plan_summary_confirmation_title" | ||||||
android:layout_width="wrap_content" | ||||||
android:layout_height="wrap_content" | ||||||
android:layout_marginStart="@dimen/spacing8" | ||||||
android:text="@string/plan_summary_confirmation_title" | ||||||
android:textAppearance="@style/TextAppearance.Pingle.Title.Semi.24" | ||||||
android:textColor="@color/white" | ||||||
app:layout_constraintStart_toStartOf="parent" | ||||||
app:layout_constraintTop_toTopOf="parent" /> | ||||||
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 제목 2줄 되었을 때에도 카드 크기 고정되어야 합니다. 대응했나요? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 디자인 측에서 늘어나는게 맞다고 해서 그렇게 반영했습니당! (1/9 기준) |
||||||
android:id="@+id/layout_plan_summary_confirmation_card_top" | ||||||
android:layout_width="0dp" | ||||||
android:layout_height="wrap_content" | ||||||
android:layout_marginTop="@dimen/spacing25" | ||||||
android:background="@drawable/shape_border_radius_15" | ||||||
android:backgroundTint="@color/g_10" | ||||||
app:layout_constraintEnd_toEndOf="parent" | ||||||
app:layout_constraintStart_toStartOf="parent" | ||||||
app:layout_constraintTop_toBottomOf="@id/tv_plan_summary_confirmation_title"> | ||||||
|
||||||
<org.sopt.pingle.util.component.PingleBadge | ||||||
android:id="@+id/badge_plan_summary_confirmation_category" | ||||||
android:layout_width="wrap_content" | ||||||
android:layout_height="wrap_content" | ||||||
android:layout_marginStart="@dimen/spacing24" | ||||||
android:layout_marginTop="@dimen/spacing22" | ||||||
app:layout_constraintStart_toStartOf="parent" | ||||||
app:layout_constraintTop_toTopOf="parent" /> | ||||||
|
||||||
<TextView | ||||||
android:id="@+id/tv_plan_summary_confirmation_name" | ||||||
android:layout_width="0dp" | ||||||
android:layout_height="wrap_content" | ||||||
android:layout_marginStart="@dimen/spacing24" | ||||||
android:layout_marginTop="8dp" | ||||||
android:layout_marginEnd="@dimen/spacing25" | ||||||
android:maxLines="2" | ||||||
android:textAppearance="@style/TextAppearance.Pingle.Sub.Bold.16" | ||||||
android:textColor="@color/pingle_orange" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 빼주세요 |
||||||
app:layout_constraintEnd_toEndOf="parent" | ||||||
app:layout_constraintStart_toStartOf="parent" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. badge에 제약 주세요 |
||||||
app:layout_constraintTop_toBottomOf="@id/badge_plan_summary_confirmation_category" | ||||||
tools:text="강남 모각작팟" /> | ||||||
|
||||||
<TextView | ||||||
android:id="@+id/tv_plan_summary_confirmation_owner_name" | ||||||
android:layout_width="wrap_content" | ||||||
android:layout_height="wrap_content" | ||||||
android:layout_marginStart="@dimen/spacing24" | ||||||
android:layout_marginTop="4dp" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 피그마 보니까 8dp길래 8dp로 수정했습니다!!!! |
||||||
android:layout_marginBottom="@dimen/spacing22" | ||||||
android:textAppearance="@style/TextAppearance.Pingle.Body.Med.14" | ||||||
android:textColor="@color/g_03" | ||||||
app:layout_constraintBottom_toBottomOf="parent" | ||||||
app:layout_constraintStart_toStartOf="parent" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 얘도 badge 에 제약 주세요. 아니면 가이드 라인 사용해주세요 |
||||||
app:layout_constraintTop_toBottomOf="@id/tv_plan_summary_confirmation_name" | ||||||
tools:text="개최자" /> | ||||||
</androidx.constraintlayout.widget.ConstraintLayout> | ||||||
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout | ||||||
android:id="@+id/layout_plan_summary_confirmation_card_bottom" | ||||||
android:layout_width="0dp" | ||||||
android:layout_height="wrap_content" | ||||||
android:background="@drawable/shape_border_radius_15" | ||||||
android:backgroundTint="@color/g_10" | ||||||
app:layout_constraintEnd_toEndOf="parent" | ||||||
app:layout_constraintStart_toStartOf="parent" | ||||||
app:layout_constraintTop_toBottomOf="@id/layout_plan_summary_confirmation_card_top"> | ||||||
|
||||||
<ImageView | ||||||
android:id="@+id/iv_plan_summary_confirmation_calendar" | ||||||
android:layout_width="wrap_content" | ||||||
android:layout_height="wrap_content" | ||||||
android:layout_marginStart="@dimen/spacing24" | ||||||
android:layout_marginTop="29dp" | ||||||
android:src="@drawable/ic_all_calendar_24" | ||||||
app:layout_constraintStart_toStartOf="parent" | ||||||
app:layout_constraintTop_toTopOf="parent" /> | ||||||
|
||||||
<TextView | ||||||
android:id="@+id/tv_plan_summary_confirmation_calender_title" | ||||||
android:layout_width="wrap_content" | ||||||
android:layout_height="wrap_content" | ||||||
android:text="@string/plan_summary_confirmation_date" | ||||||
android:textAppearance="@style/TextAppearance.Pingle.Body.Semi.14" | ||||||
android:textColor="@color/g_01" | ||||||
app:layout_constraintBottom_toBottomOf="@id/iv_plan_summary_confirmation_calendar" | ||||||
app:layout_constraintStart_toEndOf="@id/iv_plan_summary_confirmation_calendar" | ||||||
app:layout_constraintTop_toTopOf="@id/iv_plan_summary_confirmation_calendar" /> | ||||||
|
||||||
<TextView | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 텍스트 최대 길이 확인해주시고 반영해주세요. |
||||||
android:id="@+id/tv_plan_summary_confirmation_calender_detail" | ||||||
android:layout_width="0dp" | ||||||
android:layout_height="wrap_content" | ||||||
android:layout_marginStart="50dp" | ||||||
android:textAppearance="@style/TextAppearance.Pingle.Body.Med.14" | ||||||
android:textColor="@color/g_03" | ||||||
app:layout_constraintStart_toEndOf="@id/tv_plan_summary_confirmation_calender_title" | ||||||
app:layout_constraintTop_toTopOf="@id/iv_plan_summary_confirmation_calendar" | ||||||
tools:text="0000년 00월 00일\n00:00 ~ 00:00" /> | ||||||
|
||||||
<ImageView | ||||||
android:id="@+id/iv_plan_summary_confirmation_map" | ||||||
android:layout_width="wrap_content" | ||||||
android:layout_height="wrap_content" | ||||||
android:layout_marginStart="@dimen/spacing24" | ||||||
android:layout_marginTop="@dimen/spacing14" | ||||||
android:src="@drawable/ic_all_map_24" | ||||||
app:layout_constraintStart_toStartOf="parent" | ||||||
app:layout_constraintTop_toBottomOf="@id/tv_plan_summary_confirmation_calender_detail" /> | ||||||
|
||||||
<TextView | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기도 텍스트 최대 길이 확인해주시고 적용해주세요 |
||||||
android:id="@+id/tv_plan_summary_confirmation_map_title" | ||||||
android:layout_width="wrap_content" | ||||||
android:layout_height="wrap_content" | ||||||
android:text="@string/plan_summary_confirmation_location" | ||||||
android:textAppearance="@style/TextAppearance.Pingle.Body.Semi.14" | ||||||
android:textColor="@color/g_01" | ||||||
app:layout_constraintBottom_toBottomOf="@id/iv_plan_summary_confirmation_map" | ||||||
app:layout_constraintStart_toEndOf="@id/iv_plan_summary_confirmation_map" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. startToStartOf로 일시 텍스트에 제약 주세요 아래 모집인원 상세 정보도 마찬가지 |
||||||
app:layout_constraintTop_toTopOf="@id/iv_plan_summary_confirmation_map" /> | ||||||
|
||||||
<TextView | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 가운데 정렬 아니에요 피그마 다시 확인하고 수정해주세요 |
||||||
android:id="@+id/tv_plan_summary_confirmation_map_detail" | ||||||
android:layout_width="0dp" | ||||||
android:layout_height="wrap_content" | ||||||
android:layout_marginStart="50dp" | ||||||
android:textAppearance="@style/TextAppearance.Pingle.Body.Med.14" | ||||||
android:textColor="@color/g_03" | ||||||
app:layout_constraintBottom_toBottomOf="@id/tv_plan_summary_confirmation_map_title" | ||||||
app:layout_constraintStart_toEndOf="@id/tv_plan_summary_confirmation_map_title" | ||||||
app:layout_constraintTop_toTopOf="@id/tv_plan_summary_confirmation_map_title" | ||||||
tools:text="장소 이름" /> | ||||||
|
||||||
<ImageView | ||||||
android:id="@+id/iv_plan_summary_confirmation_recruitment" | ||||||
android:layout_width="wrap_content" | ||||||
android:layout_height="wrap_content" | ||||||
android:layout_marginStart="@dimen/spacing24" | ||||||
android:layout_marginTop="@dimen/spacing20" | ||||||
android:layout_marginBottom="@dimen/spacing30" | ||||||
android:src="@drawable/ic_all_user_24" | ||||||
app:layout_constraintBottom_toBottomOf="parent" | ||||||
app:layout_constraintStart_toStartOf="parent" | ||||||
app:layout_constraintTop_toBottomOf="@id/iv_plan_summary_confirmation_map" /> | ||||||
|
||||||
<TextView | ||||||
android:id="@+id/tv_plan_summary_confirmation_recruitment_title" | ||||||
android:layout_width="wrap_content" | ||||||
android:layout_height="wrap_content" | ||||||
android:text="@string/plan_summary_confirmation_recruitment" | ||||||
android:textAppearance="@style/TextAppearance.Pingle.Body.Semi.14" | ||||||
android:textColor="@color/g_01" | ||||||
app:layout_constraintBottom_toBottomOf="@id/iv_plan_summary_confirmation_recruitment" | ||||||
app:layout_constraintStart_toEndOf="@id/iv_plan_summary_confirmation_recruitment" | ||||||
app:layout_constraintTop_toTopOf="@id/iv_plan_summary_confirmation_recruitment" /> | ||||||
|
||||||
<TextView | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기도 텍스트 최대 길이 확인해주시고 적용해주세요 |
||||||
android:id="@+id/tv_plan_summary_confirmation_recruitment_detail" | ||||||
android:layout_width="0dp" | ||||||
android:layout_height="wrap_content" | ||||||
android:layout_marginStart="26dp" | ||||||
android:textAppearance="@style/TextAppearance.Pingle.Body.Med.14" | ||||||
android:textColor="@color/g_03" | ||||||
app:layout_constraintBottom_toBottomOf="@id/tv_plan_summary_confirmation_recruitment_title" | ||||||
app:layout_constraintStart_toEndOf="@id/tv_plan_summary_confirmation_recruitment_title" | ||||||
app:layout_constraintTop_toTopOf="@id/tv_plan_summary_confirmation_recruitment_title" | ||||||
tools:text="0명" /> | ||||||
</androidx.constraintlayout.widget.ConstraintLayout> | ||||||
|
||||||
<View | ||||||
android:id="@+id/view_plan_summary_confirmation_middle_line" | ||||||
android:layout_width="0dp" | ||||||
android:layout_height="1dp" | ||||||
android:layout_marginHorizontal="21dp" | ||||||
android:background="@color/g_07" | ||||||
app:layout_constraintEnd_toEndOf="parent" | ||||||
app:layout_constraintStart_toStartOf="parent" | ||||||
app:layout_constraintTop_toBottomOf="@id/layout_plan_summary_confirmation_card_top" /> | ||||||
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout> | ||||||
</layout> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,6 +104,13 @@ | |
<!-- construction --> | ||
<string name="construction_title">아직 공사중!</string> | ||
<string name="construction_detail">아직 구현중인 기능이에요\n조금만 기다려주세요</string> | ||
|
||
<!-- plan Summary Confirmation --> | ||
<string name="plan_summary_confirmation_title">핑글을 개최할\n준비 되었나요?</string> | ||
<string name="plan_summary_confirmation_date">일시</string> | ||
<string name="plan_summary_confirmation_location">장소</string> | ||
<string name="plan_summary_confirmation_recruitment">모집인원</string> | ||
<string name="plan_summary_confirmation_recruitment_number">%1$s명</string> | ||
] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이건 뭔가요 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. string 동적으로 넣어줄 때 첫번째 매개변수라는 뜻인데 여기서는 하나밖에 없으니까 그냥 %s로 변경하겠습니당~ |
||
<!-- plan Recruitment --> | ||
<string name="plan_recruitment_title">몇 명의 핑글러들과\n만날까요?</string> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기 복구 시켜주세요