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

Feature/#136 refactor home UI #139

Merged
merged 3 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="28"
tools:ignore="ScopedStorage" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<application
android:name=".RecordyApplication"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fun RecordyDialog(
Column(
modifier = Modifier
.fillMaxWidth()
.background(color = RecordyTheme.colors.gray08, shape = shape)
.background(color = RecordyTheme.colors.gray10, shape = shape)
.padding(horizontal = 16.dp)
.padding(bottom = 24.dp, top = 28.dp),
horizontalAlignment = Alignment.CenterHorizontally,
Expand Down Expand Up @@ -76,8 +76,8 @@ fun RecordyDialog(
text = negativeButtonLabel,
shape = RoundedCornerShape(8.dp),
enabled = true,
backgroundColor = RecordyTheme.colors.gray06,
textColor = RecordyTheme.colors.gray01,
backgroundColor = RecordyTheme.colors.gray07,
textColor = RecordyTheme.colors.gray03,
textStyle = RecordyTheme.typography.button2,
onClick = { onDismissRequest() },
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ fun RecordyVideoText(
onNicknameClick: () -> Unit = {},
onBookmarkClick: () -> Unit = {},
onDeleteClick: () -> Unit = {},
onMoreClick: () -> Unit = {},
) {
var boxSize by remember { mutableStateOf(IntSize.Zero) }
var expanded by remember { mutableStateOf(false) }
Expand Down Expand Up @@ -128,6 +129,14 @@ fun RecordyVideoText(
style = RecordyTheme.typography.body2M,
color = RecordyTheme.colors.gray01,
)
Spacer(modifier = Modifier.height(8.dp))
Icon(
modifier = Modifier
.customClickable { onMoreClick() },
painter = painterResource(id = R.drawable.ic_seemore),
contentDescription = "see more",
tint = RecordyTheme.colors.gray01,
)
Spacer(modifier = Modifier.height(if (isMyVideo) 16.dp else 20.dp))
if (isMyVideo) {
Icon(
Expand Down
15 changes: 15 additions & 0 deletions core/designsystem/src/main/res/drawable/ic_seemore.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="40dp"
android:height="40dp"
android:viewportWidth="40"
android:viewportHeight="40">
<path
android:pathData="M12,20m-2,0a2,2 0,1 1,4 0a2,2 0,1 1,-4 0"
android:fillColor="#ffffff"/>
<path
android:pathData="M20,20m-2,0a2,2 0,1 1,4 0a2,2 0,1 1,-4 0"
android:fillColor="#ffffff"/>
<path
android:pathData="M28,20m-2,0a2,2 0,1 1,4 0a2,2 0,1 1,-4 0"
android:fillColor="#ffffff"/>
</vector>
30 changes: 30 additions & 0 deletions core/designsystem/src/main/res/drawable/ic_viskit_logo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="76dp"
android:height="23dp"
android:viewportWidth="76"
android:viewportHeight="23">
<path
android:pathData="M31.219,10.831L37.033,8.712L35.843,4.858L24.645,8.903V14.509C24.645,14.509 31.46,14.272 34.441,15.943C34.862,16.181 34.854,16.823 34.422,17.039C33.265,17.621 30.596,18.473 24.875,18.473V22.591C24.875,22.591 39.111,22.973 39.111,16.617C39.111,16.617 40.003,12.332 31.216,10.834L31.219,10.831Z"
android:fillColor="#EEDA24"/>
<path
android:pathData="M11.07,5.942C11.776,12.355 11.138,14.983 10.654,16.542C10.517,16.976 10.025,17.155 9.796,16.765C7.682,13.147 6.766,5.245 6.766,5.245L0.432,7.428L0,11.719L2.207,10.956C2.398,10.889 2.603,11.002 2.661,11.204L3.448,13.917C6.295,24.586 10.889,22.903 10.889,22.903C17.885,22.044 15.908,4.43 15.908,4.43L11.07,5.945V5.942Z"
android:fillColor="#EEDA24"/>
<path
android:pathData="M18.073,22.594H22.624V7.252L18.073,8.631V22.594Z"
android:fillColor="#EEDA24"/>
<path
android:pathData="M20.348,0C18.844,0 17.627,1.29 17.627,2.877C17.627,4.464 18.847,5.754 20.348,5.754C21.85,5.754 23.069,4.464 23.069,2.877C23.069,1.29 21.853,0 20.348,0Z"
android:fillColor="#EEDA24"/>
<path
android:pathData="M55.702,22.594H60.253V7.252L55.702,8.631V22.594Z"
android:fillColor="#EEDA24"/>
<path
android:pathData="M47.113,13.373L47.674,13.171L53.898,10.944L52.708,7.09L44.189,10.137V0.893H40.137V22.594H44.189V18.101L51.538,22.701L55.443,20.049L46.995,14.414C46.604,14.154 46.675,13.532 47.113,13.376V13.373Z"
android:fillColor="#EEDA24"/>
<path
android:pathData="M57.978,0C56.474,0 55.257,1.29 55.257,2.877C55.257,4.464 56.477,5.754 57.978,5.754C59.479,5.754 60.699,4.464 60.699,2.877C60.699,1.29 59.479,0 57.978,0Z"
android:fillColor="#EEDA24"/>
<path
android:pathData="M73.451,15.889C69.119,15.889 66.754,18.144 66.754,18.144V12.971L71.799,11.106L70.609,7.252L66.754,8.709V4.441H62.701V22.591H66.754C70.508,19.584 75.042,19.566 75.042,19.566L73.451,15.889Z"
android:fillColor="#EEDA24"/>
</vector>
1 change: 1 addition & 0 deletions feature/home/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ dependencies {
implementation(projects.domain.keyword)
implementation(libs.lottie.compose)
implementation(libs.collapsing.toolbar)
implementation(libs.google.location)
}
3 changes: 2 additions & 1 deletion feature/home/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
</manifest>
12 changes: 12 additions & 0 deletions feature/home/src/main/java/com/record/home/Exhibition.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.record.home

import com.record.video.model.VideoData
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.toImmutableList

data class Exhibition(
val location: String,
val name: String,
val exhibitionCount: Int,
val userVideo: ImmutableList<VideoData> = emptyList<VideoData>().toImmutableList(),
)
14 changes: 6 additions & 8 deletions feature/home/src/main/java/com/record/home/HomeContract.kt
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
package com.record.home

import com.record.model.VideoType
import com.record.ui.base.SideEffect
import com.record.ui.base.UiState
import com.record.video.model.VideoData
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.toImmutableList

data class HomeState(
val chipList: ImmutableList<String> = listOf("์ „์ฒด").toImmutableList(),
val popularList: ImmutableList<VideoData> = emptyList<VideoData>().toImmutableList(),
val recentList: ImmutableList<VideoData> = emptyList<VideoData>().toImmutableList(),
val selectedChipIndex: Int? = 0,
val exhibitionList: ImmutableList<Exhibition> = emptyList<Exhibition>().toImmutableList(),
val isLoading: Boolean = false,
val location: Location = Location(0.0, 0.0),
val showLocationPermissionDialog: Boolean = true,
) : UiState

sealed interface HomeSideEffect : SideEffect {
data object navigateToUpload : HomeSideEffect
data class navigateToVideo(val id: Long, val type: VideoType, val keyword: String?) : HomeSideEffect
data object collapseToolbar : HomeSideEffect
data class navigateToVideo(val id: Long, val location: String) : HomeSideEffect
data class navigateToDetail(val id: Long) : HomeSideEffect
data object launchSettingIntent : HomeSideEffect
}
Loading