Skip to content

Commit

Permalink
Merge pull request #80 from YAPP-Github/feature/issue-56-manage-plan
Browse files Browse the repository at this point in the history
[ISSUE-56] 약속 관리 UI 구현
  • Loading branch information
jihee-dev authored Jul 6, 2022
2 parents 90761d2 + 324248e commit 826c235
Show file tree
Hide file tree
Showing 14 changed files with 526 additions and 45 deletions.
1 change: 1 addition & 0 deletions buildSrc/src/main/java/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// alphabet 순서대로 정렬
object Versions {
const val ACCOMPANIST_PAGER = "0.12.0"
const val ANDROID_APP_COMPAT = "1.4.1"
const val ANDROID_BUILD_TOOL = "7.2.0"
const val ANDROID_CORE = "1.7.0"
Expand Down
4 changes: 4 additions & 0 deletions buildSrc/src/main/java/app/ModuleDependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ object ModuleDependencies {
DependencyInfo("com.kakao.sdk:v2-user", Versions.KAKAO_SDK, Method.IMPLEMENTATION)
)

val accompanist = arrayOf(
DependencyInfo("com.google.accompanist:accompanist-pager", Versions.ACCOMPANIST_PAGER, Method.IMPLEMENTATION)
)

const val FIREBASE_BOM = "com.google.firebase:firebase-bom:${Versions.FIREBASE_BOM}"
const val FIREBASE_ANALYTICS = "com.google.firebase:firebase-analytics-ktx"
const val FIREBASE_CRASHLYTICS = "com.google.firebase:firebase-crashlytics-ktx"
Expand Down
41 changes: 41 additions & 0 deletions domain/src/main/java/com/yapp/growth/domain/entity/Plan.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.yapp.growth.domain.entity

sealed class Plan(
open val id: Int,
open val title: String,
open val isLeader: Boolean,
open val category: String, // type?
open val members: List<String>,
) {
data class WaitingPlan(
override val id: Int,
override val title: String,
override val isLeader: Boolean = false,
override val category: String,
override val members: List<String>,
val startTime: String,
val endTime: String,
) : Plan(
id = id,
title = title,
isLeader = isLeader,
category = category,
members = members,
)

data class FixedPlan(
override val id: Int,
override val title: String,
override val isLeader: Boolean = false,
override val category: String,
override val members: List<String>,
val place: String,
val date: String,
) : Plan(
id = id,
title = title,
isLeader = isLeader,
category = category,
members = members,
)
}
1 change: 1 addition & 0 deletions presentation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dependencies {
app.ModuleDependencies.hiltAndroid.implement(this)
app.ModuleDependencies.timber.implement(this)
app.ModuleDependencies.materialCalendarView.implement(this)
app.ModuleDependencies.accompanist.implement(this)

implementation(platform(app.ModuleDependencies.FIREBASE_BOM))
implementation(app.ModuleDependencies.FIREBASE_ANALYTICS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.yapp.growth.presentation.ui.main

import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
Expand Down Expand Up @@ -41,8 +40,9 @@ import com.yapp.growth.presentation.ui.main.create.date.DateScreen
import com.yapp.growth.presentation.ui.main.create.theme.ThemeScreen
import com.yapp.growth.presentation.ui.main.create.title.TitleScreen
import com.yapp.growth.presentation.ui.main.home.HomeScreen
import com.yapp.growth.presentation.ui.main.manageplan.ManagePlanScreen
import com.yapp.growth.presentation.ui.main.manage.ManageScreen
import com.yapp.growth.presentation.ui.main.sample.SampleScreen
import timber.log.Timber

@Composable
fun PlanzScreen(
Expand Down Expand Up @@ -140,7 +140,20 @@ fun PlanzScreen(
}

composable(route = PlanzScreenRoute.MANAGE_PLAN.route) {
ManagePlanScreen()
ManageScreen(navigateToCreateScreen = { navController.navigate(PlanzScreenRoute.CREATE_THEME.route) },
navigateToFixPlanScreen = { planId ->
/* TODO: 파티장 - 약속 확정 화면 이동(planId) */
Timber.w("약속 확정 화면 이동: $planId")
},
navigateToMemberResponseScreen = { planId ->
/* TODO: 멤버 - 현재까지의 응답 화면 이동(planId) */
Timber.w("현재까지의 응답 화면 이동: $planId")
},
navigateToInvitationScreen = { planId ->
/* TODO: 확정된 약속 초대장 화면 이동(planId) */
Timber.w("확정된 약속 초대장 화면 이동: $planId")
}
)
}

composable(route = PlanzScreenRoute.SAMPLE.route) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fun ThemeScreen(
.fillMaxWidth()
.fillMaxHeight()) {
Column(
modifier = Modifier.padding(44.dp),
modifier = Modifier.padding(top = 44.dp),
verticalArrangement = Arrangement.spacedBy(12.dp)
) {
PlanThemeType.values().forEach {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.yapp.growth.presentation.ui.main.manage

import com.yapp.growth.base.ViewEvent
import com.yapp.growth.base.ViewSideEffect
import com.yapp.growth.base.ViewState
import com.yapp.growth.domain.entity.Plan

class ManageContract {
data class ManageViewState(
val waitingPlans: List<Plan.WaitingPlan> = emptyList(),
val fixedPlans: List<Plan.FixedPlan> = emptyList(),
) : ViewState

sealed class ManageSideEffect : ViewSideEffect {
object NavigateToCreateScreen : ManageSideEffect()
data class NavigateToFixPlanScreen(val planId: Int) : ManageSideEffect()
data class NavigateToMemberResponseScreen(val planId: Int) : ManageSideEffect()
data class NavigateToInvitationScreen(val planId: Int) : ManageSideEffect()
data class SwitchTab(val tabIndex: Int) : ManageSideEffect()
}

sealed class ManageEvent : ViewEvent {
object OnClickCreateButton : ManageEvent()
data class OnClickWaitingPlan(val planId: Int) : ManageEvent()
data class OnClickFixedPlan(val planId: Int) : ManageEvent()
data class OnClickTab(val tabIndex: Int) : ManageEvent()
}
}
Loading

0 comments on commit 826c235

Please sign in to comment.