-
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
Feature/UI #18
Changes from all commits
128dbaf
e2b22e8
fcb9c75
8980414
de64da6
9e34516
5e2147d
f3ff3f1
f5c714c
1c2f5ac
97f14f6
53501d0
753a0c4
6a7f111
c163f40
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package kr.co.ui.widget | ||
|
||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Arrangement | ||
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.semantics.contentDescription | ||
import androidx.compose.ui.semantics.semantics | ||
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 | ||
fun FileBox( | ||
name: String, | ||
onFileClick: () -> Unit = {}, | ||
) { | ||
Row( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.clickable(onClick = onFileClick) | ||
.padding( | ||
vertical = 12.dp, | ||
horizontal = 8.dp | ||
) | ||
.semantics { | ||
contentDescription = name | ||
}, | ||
verticalAlignment = Alignment.CenterVertically, | ||
horizontalArrangement = Arrangement.spacedBy(24.dp) | ||
) { | ||
Icon( | ||
modifier = Modifier.size(32.dp) | ||
.clearAndSetSemantics { }, | ||
imageVector = SeeDocsIcon.PDF, | ||
contentDescription = null, | ||
tint = Color.Unspecified | ||
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.
|
||
) | ||
|
||
Column( | ||
modifier = Modifier | ||
.clearAndSetSemantics { }, | ||
verticalArrangement = Arrangement.spacedBy(4.dp) | ||
) { | ||
Text( | ||
modifier = Modifier | ||
.clearAndSetSemantics { }, | ||
text = name, | ||
style = Theme.typography.body2sb, | ||
color = Theme.colors.text | ||
) | ||
Text( | ||
modifier = Modifier | ||
.clearAndSetSemantics { }, | ||
text = "2023.01.01", | ||
style = Theme.typography.caption1r, | ||
color = Theme.colors.grayText | ||
) | ||
} | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
private fun Preview() { | ||
SeeDocsTheme { | ||
FileBox("Effective Kotlin") | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package kr.co.bookmark | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.PaddingValues | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.lazy.LazyColumn | ||
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.res.stringResource | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import kr.co.seedocs.feature.bookmark.R | ||
import kr.co.ui.theme.SeeDocsTheme | ||
import kr.co.ui.theme.Theme | ||
import kr.co.ui.widget.FileBox | ||
|
||
@Composable | ||
internal fun BookmarkRoute( | ||
padding: PaddingValues | ||
) { | ||
BookmarkScreen( | ||
padding = padding | ||
) | ||
} | ||
|
||
@Composable | ||
private fun BookmarkScreen( | ||
padding: PaddingValues, | ||
) { | ||
Box( | ||
modifier = Modifier | ||
.fillMaxSize() | ||
.background(Theme.colors.bg) | ||
.padding(padding) | ||
) { | ||
LazyColumn( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(horizontal = 16.dp), | ||
verticalArrangement = Arrangement.spacedBy(24.dp) | ||
) { | ||
item { | ||
Spacer(Modifier.height(32.dp)) | ||
|
||
Text( | ||
text = stringResource(R.string.feature_bookmark_bookmark), | ||
style = Theme.typography.body1sb, | ||
color = Theme.colors.text | ||
) | ||
} | ||
|
||
items(listOf("Effective Kotlin", "Android Developer")) { file -> | ||
FileBox( | ||
name = file | ||
) | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
private fun Preview() { | ||
SeeDocsTheme { | ||
BookmarkScreen( | ||
padding = PaddingValues() | ||
) | ||
} | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package kr.co.navigation | ||
|
||
import androidx.compose.foundation.layout.PaddingValues | ||
import androidx.navigation.NavGraphBuilder | ||
import androidx.navigation.compose.composable | ||
import kr.co.bookmark.BookmarkRoute | ||
|
||
fun NavGraphBuilder.bookmarkNavGraph( | ||
padding: PaddingValues | ||
) { | ||
composable<MainNavigation.Bookmark> { | ||
BookmarkRoute( | ||
padding = padding | ||
) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="feature_bookmark_bookmark">북마크</string> | ||
</resources> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
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.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.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 kr.co.ui.theme.SeeDocsTheme | ||
import kr.co.ui.theme.Theme | ||
import kr.co.ui.widget.FileBox | ||
import kr.co.widget.FolderBox | ||
|
||
@Composable | ||
internal fun ExploreRoute( | ||
padding: PaddingValues, | ||
navigateToPdf: () -> Unit = {} | ||
) { | ||
|
||
ExploreScreen( | ||
padding = padding, | ||
onFileClick = navigateToPdf | ||
) | ||
} | ||
|
||
@Composable | ||
private fun ExploreScreen( | ||
padding: PaddingValues, | ||
onFileClick: () -> Unit = {} | ||
) { | ||
Box( | ||
modifier = Modifier | ||
.fillMaxSize() | ||
.padding(padding) | ||
.background(color = Theme.colors.bg) | ||
) { | ||
LazyVerticalGrid( | ||
contentPadding = PaddingValues( | ||
top = 32.dp, | ||
start = 16.dp, | ||
end = 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, | ||
onFileClick = onFileClick | ||
) | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
private fun Preview() { | ||
SeeDocsTheme { | ||
ExploreScreen( | ||
padding = PaddingValues(), | ||
) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
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. 의미없는 코드는 커밋에 포함되지 않도록 하시는게 좋을 것 같아요. |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package kr.co.navigation | ||
|
||
import androidx.compose.foundation.layout.PaddingValues | ||
import androidx.navigation.NavGraphBuilder | ||
import androidx.navigation.compose.composable | ||
import kr.co.explore.ExploreRoute | ||
|
||
fun NavGraphBuilder.exploreNavGraph( | ||
padding: PaddingValues, | ||
navigateToPdf: () -> Unit = {} | ||
) { | ||
composable<MainNavigation.Explore> { | ||
ExploreRoute( | ||
padding = padding, | ||
navigateToPdf = navigateToPdf | ||
) | ||
} | ||
} |
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.
clearAndSetSemantics
는 어떤 의도로 추가했나요?