-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature/UI #18
Merged
+705
−32
Merged
Feature/UI #18
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
128dbaf
Feat: TopBar 생성
Guri999 e2b22e8
Feat: Explore화면 UI
Guri999 fcb9c75
Chore: 파일 박스 공용으로 이동
Guri999 8980414
Feat: Explore 내비 연결
Guri999 de64da6
Chore: 탑 바텀 바 UI 수정
Guri999 9e34516
Feat: 최근 본 파일 화면 UI
Guri999 5e2147d
Feat: 북마크 화면 UI
Guri999 f3ff3f1
Feat: PDF 화면 UI 작업 및 연결
Guri999 f5c714c
Chore: 메인 화면 바텀 바 탑바 UI 변경
Guri999 1c2f5ac
Chore: 테마 적용
Guri999 97f14f6
Fix: TODO 코멘트
Guri999 53501d0
Fix: contentPadding으로 변경
Guri999 753a0c4
Fix: Semantics contentDescription 그룹화
Guri999 6a7f111
Fix: navigator.navigate(Route.Pdf){null}
Guri999 c163f40
Fix: 하드코딩 텍스트 스트링 리소스로 변경
Guri999 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
115 changes: 115 additions & 0 deletions
115
feature/explore/src/main/java/kr/co/explore/ExploreScreen.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
package kr.co.explore | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.PaddingValues | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.lazy.LazyColumn | ||
import androidx.compose.foundation.lazy.grid.GridCells | ||
import androidx.compose.foundation.lazy.grid.GridItemSpan | ||
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid | ||
import androidx.compose.foundation.lazy.grid.items | ||
import androidx.compose.foundation.lazy.items | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.text.buildAnnotatedString | ||
import androidx.compose.ui.text.withStyle | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import androidx.hilt.navigation.compose.hiltViewModel | ||
import kr.co.ui.theme.SeeDocsTheme | ||
import kr.co.ui.theme.Theme | ||
import kr.co.widget.FileBox | ||
import kr.co.widget.FolderBox | ||
|
||
@Composable | ||
internal fun ExploreRoute( | ||
viewModel: ExploreViewModel = hiltViewModel(), | ||
padding: PaddingValues, | ||
) { | ||
|
||
ExploreScreen( | ||
padding = padding, | ||
) | ||
} | ||
|
||
@Composable | ||
private fun ExploreScreen( | ||
padding: PaddingValues, | ||
) { | ||
Box( | ||
modifier = Modifier | ||
.fillMaxSize() | ||
.padding(padding) | ||
.background(color = Theme.colors.bg) | ||
) { | ||
LazyVerticalGrid( | ||
modifier = Modifier | ||
.padding( | ||
top = 32.dp | ||
) | ||
.padding( | ||
horizontal = 16.dp | ||
), | ||
columns = GridCells.Fixed(2), | ||
horizontalArrangement = Arrangement.spacedBy(12.dp), | ||
verticalArrangement = Arrangement.spacedBy(24.dp) | ||
) { | ||
item( | ||
span = { GridItemSpan(maxLineSpan) } | ||
) { | ||
Column( | ||
verticalArrangement = Arrangement.spacedBy(8.dp) | ||
) { | ||
Text( | ||
text = "파일 탐색", | ||
style = Theme.typography.body1sb, | ||
color = Theme.colors.text | ||
) | ||
Text( | ||
text = buildAnnotatedString { | ||
append("규상의 S24 >") | ||
withStyle( | ||
Theme.typography.caption1r.copy(color = Theme.colors.highlight) | ||
.toSpanStyle() | ||
) { | ||
append("Download") | ||
} | ||
}, | ||
style = Theme.typography.caption1r, | ||
color = Theme.colors.grayText, | ||
) | ||
} | ||
} | ||
|
||
items(listOf("Download", "Documents", "DCIM")) { folder -> | ||
FolderBox( | ||
name = folder | ||
) | ||
} | ||
|
||
items( | ||
items = listOf("Effective Kotlin", "Android Developer"), | ||
span = { GridItemSpan(maxLineSpan) } | ||
) { file -> | ||
FileBox( | ||
name = file | ||
) | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
private fun Preview() { | ||
SeeDocsTheme { | ||
ExploreScreen( | ||
padding = PaddingValues(), | ||
) | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
feature/explore/src/main/java/kr/co/explore/ExploreViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package kr.co.explore | ||
|
||
import androidx.lifecycle.ViewModel | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import javax.inject.Inject | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 의미없는 코드는 커밋에 포함되지 않도록 하시는게 좋을 것 같아요. |
||
|
||
@HiltViewModel | ||
internal class ExploreViewModel @Inject constructor( | ||
|
||
) : ViewModel() { | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package kr.co.widget | ||
|
||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.material3.Text | ||
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.semantics.clearAndSetSemantics | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import kr.co.ui.icon.SeeDocsIcon | ||
import kr.co.ui.icon.seedocsicon.PDF | ||
import kr.co.ui.theme.SeeDocsTheme | ||
import kr.co.ui.theme.Theme | ||
|
||
@Composable | ||
internal fun FileBox( | ||
name: String, | ||
onFileClick: () -> Unit = {}, | ||
) { | ||
Row( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.clickable(onClick = onFileClick) | ||
.padding( | ||
vertical = 12.dp, | ||
horizontal = 8.dp | ||
), | ||
verticalAlignment = Alignment.CenterVertically, | ||
horizontalArrangement = Arrangement.spacedBy(24.dp) | ||
) { | ||
Icon( | ||
modifier = Modifier.size(32.dp) | ||
.clearAndSetSemantics { }, | ||
imageVector = SeeDocsIcon.PDF, | ||
contentDescription = null, | ||
tint = Color.Unspecified | ||
) | ||
|
||
Column( | ||
verticalArrangement = Arrangement.spacedBy(4.dp) | ||
) { | ||
Text( | ||
text = name, | ||
style = Theme.typography.body2sb, | ||
color = Theme.colors.text | ||
) | ||
Text( | ||
text = "2023.01.01", | ||
style = Theme.typography.caption1r, | ||
color = Theme.colors.grayText | ||
) | ||
} | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
private fun Preview() { | ||
SeeDocsTheme { | ||
FileBox("Effective Kotlin") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package kr.co.widget | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.border | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.material3.Text | ||
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.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import kr.co.ui.icon.SeeDocsIcon | ||
import kr.co.ui.icon.seedocsicon.Folder | ||
import kr.co.ui.theme.SeeDocsTheme | ||
import kr.co.ui.theme.Theme | ||
|
||
@Composable | ||
internal fun FolderBox( | ||
name: String, | ||
modifier: Modifier = Modifier, | ||
) { | ||
Box( | ||
modifier = modifier | ||
.border( | ||
width = 1.dp, | ||
color = Theme.colors.grayText, | ||
shape = RoundedCornerShape(8.dp) | ||
) | ||
.padding(8.dp), | ||
contentAlignment = Alignment.CenterStart | ||
) { | ||
Row( | ||
modifier = Modifier.fillMaxWidth(), | ||
verticalAlignment = Alignment.CenterVertically, | ||
horizontalArrangement = Arrangement.spacedBy(12.dp) | ||
) { | ||
Icon( | ||
imageVector = SeeDocsIcon.Folder, | ||
contentDescription = "폴더", | ||
tint = Theme.colors.grayText, | ||
) | ||
|
||
Text( | ||
text = name, | ||
style = Theme.typography.body2r, | ||
color = Theme.colors.text | ||
) | ||
} | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
private fun Preview() { | ||
SeeDocsTheme { | ||
Box( | ||
modifier = Modifier.background(Color.White) | ||
) { | ||
FolderBox( | ||
name = "Download", | ||
modifier = Modifier | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contentPadding을 사용하지 않고 Modifier의 padding을 사용한 이유는 무엇인가요?