Skip to content

Commit

Permalink
Merge pull request #97 from eshc123/feature/mod-club-screen
Browse files Browse the repository at this point in the history
[FEATURE] Modified Club Detail Screen (1)
  • Loading branch information
eshc123 authored Jun 24, 2024
2 parents ef6c51f + 609a425 commit 932066b
Show file tree
Hide file tree
Showing 19 changed files with 936 additions and 232 deletions.
43 changes: 24 additions & 19 deletions app/src/main/java/com/eshc/goonersapp/ui/GnrApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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.shape.RoundedCornerShape
import androidx.compose.material3.Icon
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarDuration
Expand All @@ -17,6 +18,7 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
Expand All @@ -31,6 +33,7 @@ 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.GnrTopLevelTopBar
import com.eshc.goonersapp.core.designsystem.iconpack.IcGridCalender
import com.eshc.goonersapp.core.designsystem.iconpack.IcInfo
import com.eshc.goonersapp.core.designsystem.iconpack.IcNotification
import com.eshc.goonersapp.core.designsystem.iconpack.IcPeople
Expand Down Expand Up @@ -69,9 +72,7 @@ fun GnrApp(

Scaffold(
modifier = Modifier,
snackbarHost = {
SnackbarHost(snackbarHostState)
}
snackbarHost = { SnackbarHost(snackbarHostState) }
) { padding ->
Column(
modifier = Modifier.padding(padding)
Expand All @@ -80,44 +81,44 @@ fun GnrApp(
navController = navController,
onShowSnackbar = { message ->
coroutineScope.launch {
snackbarHostState.showSnackbar(
message
)
snackbarHostState.showSnackbar(message)
}
},
topBar = { topLevelDestination ->
GnrTopLevelBar(
topLevelDestination = topLevelDestination,
icons = {
when (topLevelDestination) {
TopLevelDestination.TEAM -> {
TopLevelDestination.HOME -> {
Icon(
imageVector = IconPack.IcInfo,
imageVector = IconPack.IcNotification,
contentDescription = null,
modifier = Modifier
.padding(horizontal = 8.dp)
.size(24.dp)
.clickable { navController.navigateToClubDetail() },
.clip(RoundedCornerShape(3.dp)),
tint = ColorFF777777
)
Icon(
imageVector = IconPack.IcSearch,
imageVector = IconPack.IcPeople,
contentDescription = null,
modifier = Modifier
.padding(horizontal = 8.dp)
.size(24.dp)
.clickable { navController.navigateToSearch() },
.clip(RoundedCornerShape(3.dp))
.clickable { navController.navigateToLogin() },
tint = ColorFF777777
)
}

TopLevelDestination.HOME -> {
TopLevelDestination.MATCH -> {
Icon(
imageVector = IconPack.IcNotification,
imageVector = IconPack.IcGridCalender,
contentDescription = null,
modifier = Modifier
.padding(horizontal = 8.dp)
.size(24.dp),
.size(24.dp)
.clip(RoundedCornerShape(3.dp)),
tint = ColorFF777777
)
Icon(
Expand All @@ -126,27 +127,31 @@ fun GnrApp(
modifier = Modifier
.padding(horizontal = 8.dp)
.size(24.dp)
.clip(RoundedCornerShape(3.dp))
.clickable { navController.navigateToLogin() },
tint = ColorFF777777
)
}

else -> {
TopLevelDestination.TEAM -> {
Icon(
imageVector = IconPack.IcNotification,
imageVector = IconPack.IcInfo,
contentDescription = null,
modifier = Modifier
.padding(horizontal = 8.dp)
.size(24.dp),
.size(24.dp)
.clip(RoundedCornerShape(3.dp))
.clickable { navController.navigateToClubDetail() },
tint = ColorFF777777
)
Icon(
imageVector = IconPack.IcPeople,
imageVector = IconPack.IcSearch,
contentDescription = null,
modifier = Modifier
.padding(horizontal = 8.dp)
.size(24.dp)
.clickable { navController.navigateToLogin() },
.clip(RoundedCornerShape(3.dp))
.clickable { navController.navigateToSearch() },
tint = ColorFF777777
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ fun RemoteTeamDetail.toModel() = TeamDetail(
fun RemoteTeam.toModel() = Team(
clubId = teamId ?: 0,
clubName = teamName ?: "",
officialName = "",
foundationDate = (founded ?: 0).toString(),
imageUrl = teamImageUrl ?: "",
teamNickname = shortCode ?: "",
managerId = 0,
manager = "",
captainId = 0,
captain = "",
stadiumName = venueName ?:""
clubFoundedYear = founded ?: 0,
clubImgUrl = teamImageUrl ?: "",
clubShortCode = shortCode ?: "",
manager = managerName ?: "",
captain = captainName ?: "",
stadiumName = venueName ?: "",
clubHomeTown = cityName ?: "",
clubNationality = nationality ?: "",
clubNationImgUrl = nationalityImgUrl ?: "",
officialWebUrl = officialWebUrl ?: "",
snsFaceBook = snsFacebook ?: "",
snsX = snsX ?: "",
snsInstagram = snsInstagram ?: ""
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.eshc.goonersapp.core.designsystem.component

import androidx.compose.material3.HorizontalDivider
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.eshc.goonersapp.core.designsystem.theme.ColorFFDCDCDC

@Composable
fun GnrHorizontalDivider(
modifier: Modifier = Modifier,
color: Color = ColorFFDCDCDC,
thickness: Dp = 1.dp
) {
HorizontalDivider(modifier, thickness, color)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
package com.eshc.goonersapp.core.designsystem.iconpack

import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.PathFillType.Companion.NonZero
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.graphics.StrokeCap.Companion.Butt
import androidx.compose.ui.graphics.StrokeJoin.Companion.Miter
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.graphics.vector.ImageVector.Builder
import androidx.compose.ui.graphics.vector.path
import androidx.compose.ui.unit.dp
import com.eshc.goonersapp.core.designsystem.IconPack

public val IconPack.IcGridCalender: ImageVector
get() {
if (_icGridCalender != null) {
return _icGridCalender!!
}
_icGridCalender = Builder(name = "IcGridCalender", defaultWidth = 17.0.dp, defaultHeight =
20.0.dp, viewportWidth = 17.0f, viewportHeight = 20.0f).apply {
path(fill = SolidColor(Color(0xFF777777)), stroke = null, strokeLineWidth = 0.0f,
strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f,
pathFillType = NonZero) {
moveTo(2.5951f, 19.0f)
curveTo(2.1405f, 19.0f, 1.7611f, 18.8478f, 1.4567f, 18.5434f)
curveTo(1.1522f, 18.2389f, 1.0f, 17.8595f, 1.0f, 17.4049f)
verticalLineTo(4.7976f)
curveTo(1.0f, 4.3431f, 1.1522f, 3.9636f, 1.4567f, 3.6592f)
curveTo(1.7611f, 3.3547f, 2.1405f, 3.2025f, 2.5951f, 3.2025f)
horizontalLineTo(4.3417f)
verticalLineTo(1.0f)
horizontalLineTo(5.405f)
verticalLineTo(3.2025f)
horizontalLineTo(12.4685f)
verticalLineTo(1.0f)
horizontalLineTo(13.4558f)
verticalLineTo(3.2025f)
horizontalLineTo(15.2024f)
curveTo(15.6569f, 3.2025f, 16.0364f, 3.3547f, 16.3408f, 3.6592f)
curveTo(16.6453f, 3.9636f, 16.7975f, 4.3431f, 16.7975f, 4.7976f)
verticalLineTo(17.4049f)
curveTo(16.7975f, 17.8595f, 16.6453f, 18.2389f, 16.3408f, 18.5434f)
curveTo(16.0364f, 18.8478f, 15.6569f, 19.0f, 15.2024f, 19.0f)
horizontalLineTo(2.5951f)
close()
moveTo(2.5951f, 18.0127f)
horizontalLineTo(15.2024f)
curveTo(15.3545f, 18.0127f, 15.4938f, 17.9494f, 15.6203f, 17.8228f)
curveTo(15.7469f, 17.6963f, 15.8101f, 17.557f, 15.8101f, 17.4049f)
verticalLineTo(8.7469f)
horizontalLineTo(1.9873f)
verticalLineTo(17.4049f)
curveTo(1.9873f, 17.557f, 2.0506f, 17.6963f, 2.1772f, 17.8228f)
curveTo(2.3037f, 17.9494f, 2.443f, 18.0127f, 2.5951f, 18.0127f)
close()
moveTo(1.9873f, 7.7593f)
horizontalLineTo(15.8101f)
verticalLineTo(4.7976f)
curveTo(15.8101f, 4.6455f, 15.7469f, 4.5062f, 15.6203f, 4.3797f)
curveTo(15.4938f, 4.2531f, 15.3545f, 4.1899f, 15.2024f, 4.1899f)
horizontalLineTo(2.5951f)
curveTo(2.443f, 4.1899f, 2.3037f, 4.2531f, 2.1772f, 4.3797f)
curveTo(2.0506f, 4.5062f, 1.9873f, 4.6455f, 1.9873f, 4.7976f)
verticalLineTo(7.7593f)
close()
moveTo(4.4557f, 11.5949f)
verticalLineTo(10.6076f)
horizontalLineTo(13.3418f)
verticalLineTo(11.5949f)
horizontalLineTo(4.4557f)
close()
moveTo(4.4557f, 15.5443f)
verticalLineTo(14.557f)
horizontalLineTo(10.3798f)
verticalLineTo(15.5443f)
horizontalLineTo(4.4557f)
close()
}
path(fill = SolidColor(Color(0x00000000)), stroke = SolidColor(Color(0xFF777777)),
strokeLineWidth = 0.3f, strokeLineCap = Butt, strokeLineJoin = Miter,
strokeLineMiter = 4.0f, pathFillType = NonZero) {
moveTo(1.9873f, 7.7593f)
horizontalLineTo(15.8101f)
verticalLineTo(4.7976f)
curveTo(15.8101f, 4.6455f, 15.7469f, 4.5062f, 15.6203f, 4.3797f)
curveTo(15.4938f, 4.2531f, 15.3545f, 4.1899f, 15.2024f, 4.1899f)
horizontalLineTo(2.5951f)
curveTo(2.443f, 4.1899f, 2.3037f, 4.2531f, 2.1772f, 4.3797f)
curveTo(2.0506f, 4.5062f, 1.9873f, 4.6455f, 1.9873f, 4.7976f)
verticalLineTo(7.7593f)
close()
moveTo(1.9873f, 7.7593f)
verticalLineTo(4.1899f)
moveTo(2.5951f, 19.0f)
curveTo(2.1405f, 19.0f, 1.7611f, 18.8478f, 1.4567f, 18.5434f)
curveTo(1.1522f, 18.2389f, 1.0f, 17.8595f, 1.0f, 17.4049f)
verticalLineTo(4.7976f)
curveTo(1.0f, 4.3431f, 1.1522f, 3.9636f, 1.4567f, 3.6592f)
curveTo(1.7611f, 3.3547f, 2.1405f, 3.2025f, 2.5951f, 3.2025f)
horizontalLineTo(4.3417f)
verticalLineTo(1.0f)
horizontalLineTo(5.405f)
verticalLineTo(3.2025f)
horizontalLineTo(12.4685f)
verticalLineTo(1.0f)
horizontalLineTo(13.4558f)
verticalLineTo(3.2025f)
horizontalLineTo(15.2024f)
curveTo(15.6569f, 3.2025f, 16.0364f, 3.3547f, 16.3408f, 3.6592f)
curveTo(16.6453f, 3.9636f, 16.7975f, 4.3431f, 16.7975f, 4.7976f)
verticalLineTo(17.4049f)
curveTo(16.7975f, 17.8595f, 16.6453f, 18.2389f, 16.3408f, 18.5434f)
curveTo(16.0364f, 18.8478f, 15.6569f, 19.0f, 15.2024f, 19.0f)
horizontalLineTo(2.5951f)
close()
moveTo(2.5951f, 18.0127f)
horizontalLineTo(15.2024f)
curveTo(15.3545f, 18.0127f, 15.4938f, 17.9494f, 15.6203f, 17.8228f)
curveTo(15.7469f, 17.6963f, 15.8101f, 17.557f, 15.8101f, 17.4049f)
verticalLineTo(8.7469f)
horizontalLineTo(1.9873f)
verticalLineTo(17.4049f)
curveTo(1.9873f, 17.557f, 2.0506f, 17.6963f, 2.1772f, 17.8228f)
curveTo(2.3037f, 17.9494f, 2.443f, 18.0127f, 2.5951f, 18.0127f)
close()
moveTo(4.4557f, 11.5949f)
verticalLineTo(10.6076f)
horizontalLineTo(13.3418f)
verticalLineTo(11.5949f)
horizontalLineTo(4.4557f)
close()
moveTo(4.4557f, 15.5443f)
verticalLineTo(14.557f)
horizontalLineTo(10.3798f)
verticalLineTo(15.5443f)
horizontalLineTo(4.4557f)
close()
}
}
.build()
return _icGridCalender!!
}

private var _icGridCalender: ImageVector? = null
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added core/designsystem/src/main/res/drawable/ic_x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ package com.eshc.goonersapp.core.domain.model.team

data class Team(
val clubId : Int,
val clubName : String = "",
val officialName : String = "",
val foundationDate : String = "",
val imageUrl : String = "",
val teamNickname : String = "",
val managerId : Int = 0,
val manager : String = "",
val captainId : Int = 0,
val captain : String = "",
val stadiumName : String = "",
val clubName: String = "",
val clubFoundedYear: Int = 0,
val clubImgUrl: String = "",
val clubShortCode: String = "",
val manager: String = "",
val captain: String = "",
val stadiumName: String = "",
val clubHomeTown: String = "",
val clubNationality: String = "",
val clubNationImgUrl: String = "",
val officialWebUrl: String = "",
val snsFaceBook: String = "",
val snsX: String = "",
val snsInstagram: String = ""
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,20 @@ import com.eshc.goonersapp.core.domain.model.match.Match
data class TeamDetail(
val team: Team,
val recentlyMatches : List<Match> = emptyList()
)
) {
fun officialWebUrlIsNotEmpty(): Boolean = team.officialWebUrl.isNotEmpty()

fun socialMediaIsNotEmpty(): Boolean {
return !(team.snsX.isEmpty() && team.snsFaceBook.isEmpty() && team.snsInstagram.isEmpty())
}

fun xIsNotEmpty(): Boolean = team.snsX.isNotEmpty()

fun faceBookIsNotEmpty(): Boolean = team.snsFaceBook.isNotEmpty()

fun instagramIsNotEmpty(): Boolean = team.snsInstagram.isNotEmpty()

fun matchesLastIndex(): Int = recentlyMatches.lastIndex

fun matchesIsNotEmpty(): Boolean = recentlyMatches.isNotEmpty()
}
Loading

0 comments on commit 932066b

Please sign in to comment.