Skip to content

Commit

Permalink
Merge pull request #20 from PawWithU/feature/home_main
Browse files Browse the repository at this point in the history
Feature/home_main : 홈화면 & 봉사후기 화면 구현 완료
  • Loading branch information
mjkim1019 authored Nov 11, 2023
2 parents 73a04cf + 3f96266 commit f4769c8
Show file tree
Hide file tree
Showing 149 changed files with 2,391 additions and 183 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package com.kusitms.connectdog.core.data.di
import android.content.Context
import com.kusitms.connectdog.core.data.repository.DefaultExampleRepository
import com.kusitms.connectdog.core.data.repository.ExampleRepository
import com.kusitms.connectdog.core.data.repository.HomeRepository
import com.kusitms.connectdog.core.data.repository.HomeRepositoryImpl
import com.kusitms.connectdog.core.data.repository.LoginRepository
import dagger.Binds
import dagger.Module
Expand All @@ -17,6 +19,9 @@ internal abstract class DataModule {
@Binds
abstract fun bindsExampleRepository(repository: DefaultExampleRepository): ExampleRepository

@Binds
abstract fun bindsHomeRepository(repository: HomeRepositoryImpl): HomeRepository

companion object {
@Provides
fun provideLoginRepository(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.kusitms.connectdog.core.data.repository

import com.kusitms.connectdog.core.model.Announcement
import com.kusitms.connectdog.core.model.Review

interface HomeRepository {
suspend fun getAnnouncementList(): List<Announcement>

suspend fun getReviewList(): List<Review>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.kusitms.connectdog.core.data.repository

import com.kusitms.connectdog.core.data.api.ApiService
import com.kusitms.connectdog.core.model.Announcement
import com.kusitms.connectdog.core.model.Review
import javax.inject.Inject

internal class HomeRepositoryImpl @Inject constructor(
private val api: ApiService
) : HomeRepository {
override suspend fun getAnnouncementList(): List<Announcement> {
TODO("Not yet implemented")
}

override suspend fun getReviewList(): List<Review> {
TODO("Not yet implemented")
}
}
8 changes: 8 additions & 0 deletions core/designsystem/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
alias(libs.plugins.com.android.library)
alias(libs.plugins.org.jetbrains.kotlin.android)
alias(libs.plugins.ktlint)
// alias(libs.plugins.google.relay)
}

android {
Expand Down Expand Up @@ -33,6 +34,8 @@ android {
}

dependencies {
implementation(project(":core:model"))

implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.activity.compose)
Expand All @@ -41,6 +44,7 @@ dependencies {
implementation(libs.androidx.compose.ui.graphics)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.material)

testImplementation(libs.junit)
androidTestImplementation(libs.androidx.test.ext.junit)
Expand All @@ -49,4 +53,8 @@ dependencies {
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
debugImplementation(libs.androidx.compose.ui.tooling)
debugImplementation(libs.androidx.compose.ui.test.manifest)

implementation(libs.landscapist.bom)
implementation(libs.landscapist.coil)
implementation(libs.landscapist.placeholder)
}
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fun ConnectDogBottomButton(
modifier = modifier,
colors = ButtonDefaults.buttonColors(containerColor = color, contentColor = textColor)
) {
Text(text = content, style = Typography.titleSmall)
Text(text = content, style = Typography.titleSmall, color = textColor)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package com.kusitms.connectdog.core.designsystem.component

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.defaultMinSize
import androidx.compose.foundation.layout.width
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.kusitms.connectdog.core.designsystem.theme.ConnectDogTheme
import com.kusitms.connectdog.core.designsystem.theme.Gray2
import com.kusitms.connectdog.core.designsystem.theme.Gray3

@Composable
fun Content(
modifier: Modifier = Modifier,
textStyle: TextStyle,
titleRes1: Int,
titleRes2: Int,
titleRes3: Int,
t1Value: String,
t2Value: String,
t3Value: String
) {
Column(modifier = modifier) {
TitleValue(title = stringResource(id = titleRes1), value = t1Value, style = textStyle)
TitleValue(title = stringResource(id = titleRes2), value = t2Value, style = textStyle)
TitleValue(title = stringResource(id = titleRes3), value = t3Value, style = textStyle)
}
}

@Composable
fun TitleValue(
title: String,
value: String,
style: TextStyle
) {
Row {
Text(
text = title,
style = style,
color = Gray3,
modifier = Modifier.defaultMinSize(minWidth = 35.dp)
)
Spacer(modifier = Modifier.width(12.dp))
Text(
text = value,
style = style,
color = Gray2
)
}
}

@Preview
@Composable
fun ContentPreview() {
ConnectDogTheme {
TitleValue(title = "일정", value = "23.10.19(목)", style = MaterialTheme.typography.labelLarge)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package com.kusitms.connectdog.core.designsystem.component

import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import com.kusitms.connectdog.core.designsystem.R

@Composable
fun AnnouncementContent(
date: String,
organization: String,
hasKennel: Boolean,
style: TextStyle = MaterialTheme.typography.labelLarge
) {
Content(
textStyle = style,
titleRes1 = R.string.date,
titleRes2 = R.string.organization,
titleRes3 = R.string.need_kennel,
t1Value = date,
t2Value = organization,
t3Value = if (hasKennel) stringResource(id = R.string.has_kennel) else stringResource(id = R.string.has_not_kennel)
)
}

@Composable
fun ReviewContent(
date: String,
location: String,
organization: String,
style: TextStyle = MaterialTheme.typography.labelLarge
) {
Content(
textStyle = style,
titleRes1 = R.string.date,
titleRes2 = R.string.location,
titleRes3 = R.string.organization,
t1Value = date,
t2Value = location,
t3Value = organization
)
}

@Composable
fun RecentContent(
date: String,
location: String,
volunteer: String,
style: TextStyle = MaterialTheme.typography.labelLarge
) {
Content(
textStyle = style,
titleRes1 = R.string.date,
titleRes2 = R.string.location,
titleRes3 = R.string.volunteer,
t1Value = date,
t2Value = location,
t3Value = volunteer
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.kusitms.connectdog.core.designsystem.component

import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import com.skydoves.landscapist.ImageOptions
import com.skydoves.landscapist.coil.CoilImage
import com.skydoves.landscapist.components.rememberImageComponent
import com.skydoves.landscapist.placeholder.placeholder.PlaceholderPlugin

@Composable
fun NetworkImage(
imageUrl: String?,
modifier: Modifier = Modifier,
placeholder: Painter? = null,
contentScale: ContentScale = ContentScale.Crop,
contentDescription: String? = null
) {
CoilImage(
imageModel = { imageUrl },
modifier = modifier,
component = rememberImageComponent {
+PlaceholderPlugin.Loading(placeholder)
+PlaceholderPlugin.Failure(placeholder)
},
imageOptions = ImageOptions(
contentScale = contentScale,
alignment = Alignment.Center,
contentDescription = contentDescription
)
)
}

@Preview
@Composable
private fun NetworkImagePreview() {
NetworkImage(
imageUrl = "",
placeholder = painterResource(id = Color(0xFFFFFFFF).toArgb())
)
}
Loading

0 comments on commit f4769c8

Please sign in to comment.