Skip to content

Commit

Permalink
Merge pull request #88 from eshc123/dev
Browse files Browse the repository at this point in the history
[RELEASE]
  • Loading branch information
eshc123 authored Jun 4, 2024
2 parents 3adb6ed + 7f2e772 commit 0812473
Show file tree
Hide file tree
Showing 63 changed files with 2,432 additions and 395 deletions.
52 changes: 52 additions & 0 deletions .idea/androidTestResultsUserPreferences.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 17 additions & 12 deletions app/src/main/java/com/eshc/goonersapp/navigation/GnrNavHost.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import com.eshc.goonersapp.feature.team.navigation.clubDetailScreen
import com.eshc.goonersapp.feature.match.navigation.navigateToMatchDetail
import com.eshc.goonersapp.feature.team.navigation.navigateToPlayerDetail
import com.eshc.goonersapp.feature.team.navigation.playerDetailScreen
import com.eshc.goonersapp.feature.team.navigation.teamHistoryScreen
import com.eshc.goonersapp.feature.team.navigation.teamSearchScreen
import com.eshc.goonersapp.feature.team.navigation.teamScreen

const val mainNavigationRoute = "main_route"
Expand Down Expand Up @@ -71,35 +71,40 @@ fun GnrNavHost(
}

playerDetailScreen(
onBackIconClick = { navController.popBackStack() },
onShowSnackbar = onShowSnackbar
)

matchDetailScreen(
onClickChat = {
navController.navigateToChatRoom(it)
},
onClickChat = { navController.navigateToChatRoom(it) },
onBackIconClick = { navController.popBackStack() },
onShowSnackbar = onShowSnackbar
)
teamHistoryScreen(
onPlayerClick = {
navController.navigateToPlayerDetail(it)
},

teamSearchScreen(
onPlayerClick = { navController.navigateToPlayerDetail(it) },
onBackIconClick = { navController.popBackStack() },
onShowSnackbar = onShowSnackbar
)

chatRoomScreen(
onShowSnackbar = onShowSnackbar
)

clubDetailScreen(
onBackIconClick = { navController.popBackStack() },
onShowSnackbar = onShowSnackbar
)

loginScreen(
onShowSnackbar = onShowSnackbar,
onClickSignUp = {
navController.navigateToSignUp()
}
onClickSignUp = { navController.navigateToSignUp() },
onBackIconClick = { navController.popBackStack() }
)

signUpScreen(
onShowSnackbar = onShowSnackbar
onShowSnackbar = onShowSnackbar,
onBackIconClick = { navController.popBackStack() }
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import com.eshc.goonersapp.feature.home.R as home
import com.eshc.goonersapp.feature.match.R as match
import com.eshc.goonersapp.feature.team.R as team

val topLevelDestinationSet = TopLevelDestination.entries.map {
it.route
}.toSet()
val topLevelDestinationSet = TopLevelDestination.entries
.map { destination -> destination.route }
.toSet()

enum class TopLevelDestination(
val selectedIcon: ImageVector,
Expand Down
70 changes: 48 additions & 22 deletions app/src/main/java/com/eshc/goonersapp/ui/GnrApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.widthIn
import androidx.compose.material3.Icon
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarDuration
Expand All @@ -18,7 +17,6 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
Expand All @@ -32,18 +30,21 @@ import com.eshc.goonersapp.core.data.util.NetworkConnectivityManager
import com.eshc.goonersapp.core.designsystem.IconPack
import com.eshc.goonersapp.core.designsystem.component.GnrNavigationBar
import com.eshc.goonersapp.core.designsystem.component.GnrNavigationBarItem
import com.eshc.goonersapp.core.designsystem.component.TopLevelTopBar
import com.eshc.goonersapp.core.designsystem.component.GnrTopLevelTopBar
import com.eshc.goonersapp.core.designsystem.iconpack.IcInfo
import com.eshc.goonersapp.core.designsystem.iconpack.IcNotification
import com.eshc.goonersapp.core.designsystem.iconpack.IcPeople
import com.eshc.goonersapp.core.designsystem.iconpack.IcSearch
import com.eshc.goonersapp.core.designsystem.iconpack.IcUser
import com.eshc.goonersapp.core.designsystem.theme.ColorFF181818
import com.eshc.goonersapp.core.designsystem.theme.ColorFF777777
import com.eshc.goonersapp.core.designsystem.theme.ColorFF9E9E9E
import com.eshc.goonersapp.core.designsystem.theme.GnrTypography
import com.eshc.goonersapp.feature.home.navigation.navigateToHome
import com.eshc.goonersapp.feature.login.navigation.navigateToLogin
import com.eshc.goonersapp.feature.match.navigation.navigateToMatch
import com.eshc.goonersapp.feature.team.navigation.navigateToClubDetail
import com.eshc.goonersapp.feature.team.navigation.navigateToTeam
import com.eshc.goonersapp.feature.team.navigation.navigateToTeamHistory
import com.eshc.goonersapp.feature.team.navigation.navigateToSearch
import com.eshc.goonersapp.navigation.GnrNavHost
import com.eshc.goonersapp.navigation.TopLevelDestination
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -96,37 +97,58 @@ fun GnrApp(
modifier = Modifier
.padding(horizontal = 8.dp)
.size(24.dp)
.clickable {
navController.navigateToClubDetail()
}
.clickable { navController.navigateToClubDetail() },
tint = ColorFF777777
)
Icon(
imageVector = IconPack.IcSearch,
contentDescription = null,
modifier = Modifier
.padding(horizontal = 8.dp)
.size(24.dp)
.clickable {
navController.navigateToTeamHistory()
}
.clickable { navController.navigateToSearch() },
tint = ColorFF777777
)
}

TopLevelDestination.HOME -> {
Icon(
imageVector = IconPack.IcUser,
imageVector = IconPack.IcNotification,
contentDescription = null,
modifier = Modifier
.padding(horizontal = 8.dp)
.size(24.dp),
tint = ColorFF777777
)
Icon(
imageVector = IconPack.IcPeople,
contentDescription = null,
modifier = Modifier
.padding(horizontal = 8.dp)
.size(24.dp)
.clickable {
navController.navigateToLogin()
}
.clickable { navController.navigateToLogin() },
tint = ColorFF777777
)
}

else -> {

Icon(
imageVector = IconPack.IcNotification,
contentDescription = null,
modifier = Modifier
.padding(horizontal = 8.dp)
.size(24.dp),
tint = ColorFF777777
)
Icon(
imageVector = IconPack.IcPeople,
contentDescription = null,
modifier = Modifier
.padding(horizontal = 8.dp)
.size(24.dp)
.clickable { navController.navigateToLogin() },
tint = ColorFF777777
)
}
}
}
Expand Down Expand Up @@ -172,9 +194,9 @@ fun GnrTopLevelBar(
topLevelDestination: TopLevelDestination,
icons: @Composable () -> Unit
) {
TopLevelTopBar(
GnrTopLevelTopBar(
modifier = Modifier.padding(horizontal = 8.dp),
title = topLevelDestination.name
title = stringResource(id = topLevelDestination.titleTextId)
) {
icons()
}
Expand All @@ -200,15 +222,19 @@ fun GnrBottomBar(
},
icon = {
Icon(
modifier = Modifier.padding(bottom = 4.dp).heightIn(max = 18.dp),
modifier = Modifier
.padding(bottom = 4.dp)
.heightIn(max = 18.dp),
imageVector = destination.unselectedIcon,
tint = Color(0xFF888888),
tint = ColorFF9E9E9E,
contentDescription = null,
)
},
selectedIcon = {
Icon(
modifier = Modifier.padding(bottom = 4.dp).heightIn(max = 18.dp),
modifier = Modifier
.padding(bottom = 4.dp)
.heightIn(max = 18.dp),
imageVector = destination.selectedIcon,
contentDescription = null,
)
Expand All @@ -217,7 +243,7 @@ fun GnrBottomBar(
Text(
text = stringResource(id = destination.iconTextId),
style = GnrTypography.body2Regular.copy(
color = if(selected) ColorFF181818 else Color(0xFF888888)
color = if(selected) ColorFF181818 else ColorFF9E9E9E
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,56 @@ package com.eshc.goonersapp.core.common.util
import java.time.LocalDate
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.util.Locale

const val DefaultDatePattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"

object DateUtil {
private val defaultDateFormat = DateTimeFormatter.ofPattern(DefaultDatePattern)

fun getYearAndMonthString(date : String ) : String {
if(date.isBlank()) return date
return LocalDate.parse(date, defaultDateFormat).format(DateTimeFormatter.ofPattern("yyyy.MM"))
fun getYearAndMonthString(date: String): String {
if (date.isBlank()) return date
return LocalDate.parse(date, defaultDateFormat)
.format(DateTimeFormatter.ofPattern("yyyy.MM"))
}

fun getYearAndMonthAndDateString(date: String): String {
if (date.isBlank()) return date
return LocalDate.parse(date, defaultDateFormat)
.format(DateTimeFormatter.ofPattern("yyyy.MM.dd"))
}

fun getYearAndMonthAndDateString(date : String ) : String {
if(date.isBlank()) return date
return LocalDate.parse(date, defaultDateFormat).format(DateTimeFormatter.ofPattern("yyyy.MM.dd"))
fun getYearAndMonthAndDateAndTimeString(date: String): String {
if (date.isBlank()) return date
return LocalDateTime.parse(date, defaultDateFormat)
.format(DateTimeFormatter.ofPattern("yyyy.MM.dd HH:mm"))
}

fun getYearAndMonthAndDateAndTimeString(date : String ) : String {
if(date.isBlank()) return date
return LocalDateTime.parse(date, defaultDateFormat).format(DateTimeFormatter.ofPattern("yyyy.MM.dd HH:mm"))
fun getYearAndMonthAndDateAndDayAndTimeString(date: String): String {
if (date.isBlank()) return date
return LocalDateTime.parse(date, defaultDateFormat).format(
DateTimeFormatter.ofPattern(
"yyyy.MM.dd E HH:mm",
Locale.US
)
).uppercase()
}

fun getYearAndMonthAndDateAndDayAndTimeString(date : String ) : String {
if(date.isBlank()) return date
return LocalDateTime.parse(date, defaultDateFormat).format(DateTimeFormatter.ofPattern("yyyy.MM.dd E HH:mm")).uppercase()
fun getMonthAndDateAndDayString(date: String): String {
if (date.isBlank()) return date
return LocalDateTime.parse(date, defaultDateFormat)
.format(DateTimeFormatter.ofPattern("MM.dd E", Locale.US)).uppercase()
}

fun getYearAndMonthAndDateLocalDate(date : String ) : LocalDate {
if(date.isBlank()) return LocalDate.now()
fun getYearAndMonthAndDateLocalDate(date: String): LocalDate {
if (date.isBlank()) return LocalDate.now()
return LocalDate.parse(date, defaultDateFormat)
}

fun getTimeString(date: String) : String {
if(date.isBlank()) return date
fun getTimeString(date: String): String {
if (date.isBlank()) return date
return LocalDateTime.parse(date, defaultDateFormat).let {
"${it.hour}:" + "${it.minute}".padStart(2,'0')
"${it.hour}:" + "${it.minute}".padStart(2, '0')
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ package com.eshc.goonersapp.core.data.di
import com.eshc.goonersapp.core.data.repository.ChatRepositoryImpl
import com.eshc.goonersapp.core.data.repository.MatchRepositoryImpl
import com.eshc.goonersapp.core.data.repository.PlayerRepositoryImpl
import com.eshc.goonersapp.core.data.repository.SeasonRepositoryImpl
import com.eshc.goonersapp.core.data.repository.TeamRepositoryImpl
import com.eshc.goonersapp.core.data.repository.UserRepositoryImpl
import com.eshc.goonersapp.core.data.util.NetworkConnectivityManager
import com.eshc.goonersapp.core.data.util.NetworkConnectivityManagerImpl
import com.eshc.goonersapp.core.domain.repository.ChatRepository
import com.eshc.goonersapp.core.domain.repository.MatchRepository
import com.eshc.goonersapp.core.domain.repository.PlayerRepository
import com.eshc.goonersapp.core.domain.repository.SeasonRepository
import com.eshc.goonersapp.core.domain.repository.TeamRepository
import com.eshc.goonersapp.core.domain.repository.UserRepository
import dagger.Binds
Expand Down Expand Up @@ -41,6 +43,11 @@ abstract class DataModule {
teamRepository: TeamRepositoryImpl,
): TeamRepository

@Binds
abstract fun bindsSeasonRepository(
seasonRepository: SeasonRepositoryImpl
): SeasonRepository

@Binds
abstract fun bindsUserRepository(
userRepository: UserRepositoryImpl,
Expand Down
Loading

0 comments on commit 0812473

Please sign in to comment.