-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from f-lab-edu/feature/ui
Feature/UI
- Loading branch information
Showing
27 changed files
with
705 additions
and
32 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
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
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,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 | ||
) | ||
|
||
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") | ||
} | ||
} |
77 changes: 77 additions & 0 deletions
77
feature/bookmark/src/main/java/kr/co/bookmark/BookmarkScreen.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,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.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
feature/bookmark/src/main/java/kr/co/navigation/BookmarkNavGraph.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,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 | ||
) | ||
} | ||
} |
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,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="feature_bookmark_bookmark">북마크</string> | ||
</resources> |
113 changes: 113 additions & 0 deletions
113
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,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(), | ||
) | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
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,5 @@ | ||
package kr.co.explore | ||
|
||
import androidx.lifecycle.ViewModel | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import javax.inject.Inject |
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
feature/explore/src/main/java/kr/co/navigation/ExploreNavGraph.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,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 | ||
) | ||
} | ||
} |
Oops, something went wrong.