-
Notifications
You must be signed in to change notification settings - Fork 0
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 #204 from Project-Unifest/feat/star-image-dialog
[feat] [#205] 연예인 이미지 롱클릭 확대 기능 구현
- Loading branch information
Showing
7 changed files
with
119 additions
and
4 deletions.
There are no files selected for viewing
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
73 changes: 73 additions & 0 deletions
73
feature/home/src/main/kotlin/com/unifest/android/feature/home/StarImageDialog.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,73 @@ | ||
package com.unifest.android.feature.home | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.foundation.layout.width | ||
import androidx.compose.foundation.shape.CircleShape | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material3.BasicAlertDialog | ||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.clip | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.platform.LocalConfiguration | ||
import androidx.compose.ui.text.style.TextAlign | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.unit.min | ||
import androidx.compose.ui.window.DialogProperties | ||
import com.unifest.android.core.designsystem.component.NetworkImage | ||
import com.unifest.android.core.designsystem.theme.Title2 | ||
import com.unifest.android.core.model.StarInfoModel | ||
|
||
@OptIn(ExperimentalMaterial3Api::class) | ||
@Composable | ||
fun StarImageDialog( | ||
onDismissRequest: () -> Unit, | ||
star: StarInfoModel, | ||
modifier: Modifier = Modifier, | ||
) { | ||
val configuration = LocalConfiguration.current | ||
val dialogSize = remember(configuration) { | ||
val screenWidth = configuration.screenWidthDp.dp | ||
val screenHeight = configuration.screenHeightDp.dp | ||
min(screenWidth, screenHeight) - 128.dp | ||
} | ||
|
||
BasicAlertDialog( | ||
onDismissRequest = onDismissRequest, | ||
modifier = modifier | ||
.width(dialogSize) | ||
.height(dialogSize + 96.dp) | ||
.clip(RoundedCornerShape(16.dp)) | ||
.background(Color.Transparent), | ||
properties = DialogProperties( | ||
usePlatformDefaultWidth = false, | ||
), | ||
) { | ||
Column( | ||
horizontalAlignment = Alignment.CenterHorizontally, | ||
) { | ||
NetworkImage( | ||
imgUrl = star.imgUrl, | ||
contentDescription = null, | ||
modifier = Modifier | ||
.size(dialogSize) | ||
.clip(CircleShape), | ||
) | ||
Spacer(modifier = Modifier.height(16.dp)) | ||
Text( | ||
text = star.name, | ||
color = Color.White, | ||
textAlign = TextAlign.Center, | ||
style = Title2, | ||
) | ||
} | ||
} | ||
} |
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