Skip to content
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

[UI/#12] 홈뷰 / 홈 기본 화면 구현 #47

Merged
merged 35 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d6db787
[FEAT/#12] 오늘 마감 공고 아이템 구현
Hyobeen-Park Jul 6, 2024
593b707
[ADD/#12] 스크랩 아이콘 추가
Hyobeen-Park Jul 6, 2024
d23b9b3
[FEAT/#12] 맞춤 공고 아이템 구현
Hyobeen-Park Jul 6, 2024
8eb37ba
[FEAT/#12] string 추출
Hyobeen-Park Jul 6, 2024
5dce0bd
[FEAT/#12] 홈뷰 오늘 마감 공고 타이틀 구현
Hyobeen-Park Jul 6, 2024
4ec2e76
[FEAT/#12] 홈뷰 스크랩 없을 때 오늘 마감 공고 뷰 구현
Hyobeen-Park Jul 6, 2024
e38ec2a
[FEAT/#12] 홈뷰 오늘 마감 없을 때 공고 뷰 구현
Hyobeen-Park Jul 6, 2024
a9a3665
[FEAT/#12] 오늘 마감 공고 뷰 구현
Hyobeen-Park Jul 6, 2024
7a0d58c
[FEAT/#12] 맞춤 공고 타이틀 구현
Hyobeen-Park Jul 6, 2024
0d85002
Merge remote-tracking branch 'origin/develop' into ui/#12-home-view-ui
Hyobeen-Park Jul 9, 2024
0b11124
[FEAT/#12] 오늘 마감 공고 컴포넌트 병합
Hyobeen-Park Jul 9, 2024
659d98a
Merge remote-tracking branch 'origin/develop' into ui/#12-home-view-ui
Hyobeen-Park Jul 9, 2024
8ba4ec0
[CHORE/#12] 임시 탑앱바 삭제
Hyobeen-Park Jul 9, 2024
01d3adb
Merge remote-tracking branch 'origin/develop' into ui/#12-home-view-ui
Hyobeen-Park Jul 9, 2024
0fb9618
[ADD/#12] 필터링 아이콘 추가
Hyobeen-Park Jul 9, 2024
2e49fae
[FEAT/#12] 필터링 ui 구현
Hyobeen-Park Jul 9, 2024
eb770f8
[CHORE/#12] 필터링 패딩 추가
Hyobeen-Park Jul 9, 2024
adb4bf5
[FEAT/#12] 맞춤 공고 ui 구현
Hyobeen-Park Jul 9, 2024
3f4a516
Merge remote-tracking branch 'origin/develop' into ui/#12-home-view-ui
Hyobeen-Park Jul 10, 2024
35a605c
[ADD/#12] 아이콘 추가
Hyobeen-Park Jul 10, 2024
eae5dd3
[Feat/#12] string 추가
Hyobeen-Park Jul 10, 2024
4e3100d
[FEAT/#12] 맞춤 인턴 공고 없을 때 UI 구현
Hyobeen-Park Jul 10, 2024
b7a2fe5
[REFACTOR/#12] 컴포넌트 분리 및 이름 수정
Hyobeen-Park Jul 10, 2024
7d7ddaa
[CHORE/#12] 패딩 위치 수정
Hyobeen-Park Jul 10, 2024
7f9c31a
[MOD/#12] 그림자 수정
Hyobeen-Park Jul 10, 2024
6aa7d30
[DEL/#12] HomeRecommendIntern 삭제
Hyobeen-Park Jul 10, 2024
1d02110
[FEAT/#12] stickyHeader 구현
Hyobeen-Park Jul 10, 2024
356d1da
[CHORE/#12] 코드 정리
Hyobeen-Park Jul 10, 2024
4d15952
Merge remote-tracking branch 'origin/develop' into ui/#12-home-view-ui
Hyobeen-Park Jul 11, 2024
c4dfed4
[CHORE/#12] conflict 수정
Hyobeen-Park Jul 11, 2024
176f5cb
[CHORE/#12] named argument 수정
Hyobeen-Park Jul 11, 2024
0ef202b
[REFACTOR/#12] 패키지 경로 수정
Hyobeen-Park Jul 11, 2024
42d9583
[MOD/#12] 필터링 월 -> 년+월로 수정
Hyobeen-Park Jul 11, 2024
9a833d3
Merge remote-tracking branch 'origin/develop' into ui/#12-home-view-ui
Hyobeen-Park Jul 11, 2024
c5a352a
[CHORE/#12] string 수정
Hyobeen-Park Jul 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 86 additions & 3 deletions feature/src/main/java/com/terning/feature/home/HomeRoute.kt
Original file line number Diff line number Diff line change
@@ -1,19 +1,102 @@
package com.terning.feature.home

import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.HorizontalDivider
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.unit.dp
import com.terning.core.designsystem.theme.Black
import com.terning.core.designsystem.theme.Grey150
import com.terning.core.designsystem.theme.TerningTheme
import com.terning.core.designsystem.theme.White
import com.terning.feature.R
import com.terning.feature.home.component.HomeFilteringScreen
import com.terning.feature.home.component.HomeTodayIntern

@Composable
fun HomeRoute() {
HomeScreen()
}

@OptIn(ExperimentalFoundationApi::class)
@Composable
fun HomeScreen() {
Column(modifier = Modifier.fillMaxSize()) {
Text(text = "홈 스크린")
LazyColumn(
modifier = Modifier
.fillMaxSize()
) {
item {
Column(
modifier = Modifier
.padding(bottom = 16.dp)
) {
Text(
text = stringResource(
id = R.string.home_today_title_start
)
+ "남지우"
+ stringResource(
id = R.string.home_today_title_end
),
modifier = Modifier
.padding(top = 11.dp)
.padding(horizontal = 24.dp),
style = TerningTheme.typography.title1,
color = Black,
)
HomeTodayIntern()
}
}
stickyHeader {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stickyHeader!!! ㄷ ㄷ

Column(
modifier = Modifier
.background(White)
) {
Text(
text = stringResource(id = R.string.home_recommend_sub_title),
style = TerningTheme.typography.detail2,
color = Black,
modifier = Modifier
.padding(top = 25.dp)
.padding(horizontal = 24.dp),
)

Text(
text = stringResource(id = R.string.home_recommend_main_title),
style = TerningTheme.typography.title1,
color = Black,
modifier = Modifier
.padding(top = 5.dp)
.padding(horizontal = 24.dp),
)

HomeFilteringScreen(3, 1, 7)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기 named argument 추가해주세요!!

HorizontalDivider(
thickness = 4.dp,
color = Grey150,
modifier = Modifier
.fillMaxWidth(),
)
}
}

items(10) {
TerningPostItem(
imageUrl = "https://reqres.in/img/faces/7-image.jpg",
title = "[Someone] 콘텐츠 마케터 대학생 인턴 채용",
dateDeadline = "2",
workingPeriod = "2개월",
isScraped = false,
)
}
}
}
}
111 changes: 111 additions & 0 deletions feature/src/main/java/com/terning/feature/home/TerningPostItem.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
package com.terning.feature.home

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.shadow
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import coil.compose.rememberImagePainter
import com.terning.core.designsystem.theme.Black
import com.terning.core.designsystem.theme.Grey400
import com.terning.core.designsystem.theme.TerningMain
import com.terning.core.designsystem.theme.TerningTheme
import com.terning.core.designsystem.theme.White
import com.terning.feature.R

@Composable
fun TerningPostItem(
imageUrl: String,
title: String,
dateDeadline: String,
workingPeriod: String,
isScraped: Boolean,
modifier: Modifier = Modifier,
) {
Row(
modifier
.fillMaxWidth()
.height(92.dp)
.shadow(1.dp)
.background(
color = White,
shape = RoundedCornerShape(10.dp)
)
.padding(start = 10.dp, end = 8.dp),
verticalAlignment = Alignment.CenterVertically,
) {
Image(
painter = rememberImagePainter(imageUrl),
contentDescription = title,
modifier
.fillMaxHeight()
.aspectRatio(1f)
.padding(vertical = 10.dp)
.clip(
RoundedCornerShape(5.dp),
)
)
Column(
modifier
.padding(
top = 10.dp,
bottom = 9.dp,
start = 8.dp
)
.weight(1f),
) {
Text(
text = stringResource(id = R.string.terning_post_d_day) + dateDeadline,
style = TerningTheme.typography.detail0,
color = TerningMain,
)

Text(
text = title,
style = TerningTheme.typography.title5,
color = Black,
softWrap = true,
modifier = modifier.padding(top = 3.dp),
)

Row(
modifier = modifier
.padding(top = 10.dp)
) {
Text(
text = stringResource(R.string.terning_post_working_period),
style = TerningTheme.typography.detail3,
color = Grey400
)

Text(
text = workingPeriod,
style = TerningTheme.typography.detail3,
color = TerningMain,
modifier = modifier.padding(start = 4.dp)
)
}
}
Image(
painter = painterResource(id = R.drawable.ic_home_bookmark_28),
contentDescription = "scrap",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기 하드코딩있어용!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

웁씨 여기를 놓쳤네요!! 근데 이게 컴포넌트로 수정될 예정이라 혹시 적용 안되어있으면 수정할게요!

modifier = modifier
.padding(end = 2.dp, bottom = 8.dp)
.align(Alignment.Bottom),
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
package com.terning.feature.home.component

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.IntrinsicSize
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.material3.VerticalDivider
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.terning.core.designsystem.theme.Black
import com.terning.core.designsystem.theme.Grey300
import com.terning.core.designsystem.theme.TerningMain
import com.terning.core.designsystem.theme.TerningTheme
import com.terning.core.designsystem.theme.White
import com.terning.feature.R

@Composable
fun HomeFilteringScreen(
grade: Int,
period: Int,
month: Int,
modifier: Modifier = Modifier,
) {
Row(
modifier = modifier
.padding(top = 10.dp, bottom = 11.dp)
.padding(horizontal = 24.dp)
.height(IntrinsicSize.Min)
) {
Row(
modifier = modifier
.background(
color = TerningMain,
shape = RoundedCornerShape(5.dp),
)
.align(Alignment.CenterVertically)
) {
Image(
painter = painterResource(id = R.drawable.ic_home_filtering_28),
contentDescription = stringResource(id = R.string.home_recommend_filtering),
modifier = modifier
.padding(horizontal = 2.dp),
)
Text(
text = stringResource(id = R.string.home_recommend_filtering),
style = TerningTheme.typography.button4,
color = White,
modifier = modifier
.padding(vertical = 8.dp)
.padding(end = 8.dp)
)
}

HomeFilteringText(
text = grade.toString() + stringResource(id = R.string.home_recommend_filtering_grade),
modifier = Modifier
.padding(vertical = 7.dp, horizontal = 28.dp),
)
HomeFilteringDivider()
HomeFilteringText(
text = stringResource(
id = when (period) {
1 -> R.string.home_recommend_filtering_working_period_1
2 -> R.string.home_recommend_filtering_working_period_2
3 -> R.string.home_recommend_filtering_working_period_3
else -> R.string.server_failure
}
),
modifier = Modifier
.padding(vertical = 7.dp, horizontal = 25.dp)
)
HomeFilteringDivider()
HomeFilteringText(
text = month.toString() + stringResource(id = R.string.home_recommend_filtering_month),
modifier = Modifier
.padding(vertical = 7.dp)
.padding(start = 34.dp, end = 13.dp)
)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기 뭔가 반복을 줄일 방법이 있우묜,,,,,있을까요....?음!!!!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 진짜 여기가 반복이 너무 심한데 묘하게 패딩 값 등이 달라서 어떻게 해결할 수 있을지 모르겠네요ㅜㅜ 계속 고민해보겠습니다!! 감사해요:)

}

@Composable
private fun HomeFilteringText(
text: String,
modifier: Modifier = Modifier
) {
Text(
text = text,
style = TerningTheme.typography.detail2,
color = Black,
modifier = modifier,
)
}

@Composable
private fun HomeFilteringDivider() {
VerticalDivider(
color = Grey300,
thickness = 2.dp,
modifier = Modifier
.fillMaxHeight()
.padding(vertical = 4.dp),
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package com.terning.feature.home.component

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.terning.core.designsystem.theme.Grey400
import com.terning.core.designsystem.theme.TerningTheme
import com.terning.feature.R

@Composable
fun HomeRecommendEmptyIntern(
modifier: Modifier = Modifier,
) {
Column(
modifier = modifier
.fillMaxSize(),
verticalArrangement = Arrangement.Center,
) {
Image(
painter = painterResource(id = R.drawable.ic_empty_logo),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ic_empty_logo가 저랑 겹치는 아이콘,.! 화긴

contentDescription = stringResource(id = R.string.home_recommend_no_intern_description),
modifier = modifier
.align(Alignment.CenterHorizontally)
)
Text(
text = stringResource(id = R.string.home_recommend_no_intern),
style = TerningTheme.typography.body4,
color = Grey400,
textAlign = TextAlign.Center,
modifier = modifier
.padding(top = 8.dp)
.align(Alignment.CenterHorizontally)
)
}
}
Loading
Loading