Skip to content
Merged
1 change: 1 addition & 0 deletions feature/employment/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

μ΄κ±°λŠ” μ™œ μΆ”κ°€λœκ±΄κ°€μš”?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

λ‹€λ₯Έ λͺ¨λ“ˆμ—λ„ μΆ”κ°€λ˜μ–΄μžˆμ–΄ ν™•μΈν•΄λ³΄λ‹ˆ libsλ₯Ό μ ‘κ·Όν•  λ•Œ IDEκ°€ μ•ˆμ „ν•˜μ§€ μ•Šλ‹€κ³  νŒλ‹¨λ˜μ–΄ μ‚¬μš©ν•˜λŠ” 것을 μ•Œκ³  λ„£κ²Œ λ˜μ—ˆμŠ΅λ‹ˆλ‹€

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

plugins {
id(libs.plugins.android.library.get().pluginId)
id(libs.plugins.kotlin.android.get().pluginId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.shadow
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
Expand Down Expand Up @@ -128,19 +129,30 @@ private fun CompanyCard(
imageUrl: String,
companyName: String,
) {
Box(
modifier = Modifier
.size(80.dp)
.shadow(elevation = 12.dp)
.clip(RoundedCornerShape(6.dp))
.background(color = JobisTheme.colors.inverseSurface),
Column(
horizontalAlignment = Alignment.CenterHorizontally,
) {
AsyncImage(
Box(
modifier = Modifier
.align(Alignment.Center),
model = imageUrl,
contentDescription = companyName,
contentScale = ContentScale.Crop,
.size(80.dp)
.shadow(elevation = 18.dp)
.clip(RoundedCornerShape(6.dp))
.background(color = JobisTheme.colors.inverseSurface),
) {
AsyncImage(
modifier = Modifier
.align(Alignment.Center),
model = imageUrl,
contentDescription = companyName,
contentScale = ContentScale.Crop,
)
Comment on lines +142 to +148
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Box둜 감싸지 말고 여기에 Modifier둜 μ μš©ν•˜λ©΄ μ•ˆλ˜λ‚˜μš”?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

μ‹œλ„ν•΄λ³΄κ² μŠ΅λ‹ˆλ‹€

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

빈 이미지일 경우 화면을 Boxκ°€ λŒ€μ²΄ν•˜κ³  μžˆμ–΄ μ•ˆλ˜λŠ” κ±° κ°™μŠ΅λ‹ˆλ‹€

}
JobisText(
modifier = Modifier.padding(top = 8.dp),
text = companyName,
style = JobisTypography.Description,
color = JobisTheme.colors.onSurfaceVariant,
textAlign = TextAlign.Center,
)
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package team.retum.employment.ui

import android.util.Log
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.tween
Expand Down Expand Up @@ -61,7 +62,7 @@ internal fun Employment(
fetchEmploymentCount()
}
animatedValue.animateTo(
targetValue = state.rate.toFloat(),
targetValue = state.rate,
animationSpec = tween(durationMillis = 1000, easing = LinearEasing),
)
}
Expand All @@ -79,9 +80,9 @@ internal fun Employment(
private fun EmploymentScreen(
onBackPressed: () -> Unit,
onClassClick: (Long) -> Unit,
rate: Long,
totalStudentCount: Long,
passCount: Long,
rate: Float,
totalStudentCount: String,
passCount: String,
) {
Column(
modifier = Modifier
Expand Down Expand Up @@ -172,9 +173,9 @@ private fun EmploymentScreen(

@Composable
private fun EmploymentRate(
rate: Long,
totalStudentCount: Long,
passCount: Long,
rate: Float,
totalStudentCount: String,
passCount: String,
) {
Column(
modifier = Modifier
Expand Down Expand Up @@ -272,14 +273,14 @@ private fun EmploymentRate(

@Composable
private fun CircleProgress(
percentage: Long,
percentage: Float,
modifier: Modifier = Modifier,
radius: Dp = 120.dp,
strokeWidth: Dp = 24.dp,
primaryColor: Color = JobisTheme.colors.onSecondary,
secondaryColor: Color = JobisTheme.colors.onPrimary,
) {
val animatedValue = remember { Animatable(percentage.toFloat()) }
val animatedValue = remember { Animatable(percentage) }

Box(
contentAlignment = Alignment.Center,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package team.retum.employment.viewmodel

import android.util.Log
import androidx.lifecycle.viewModelScope
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.Dispatchers
Expand All @@ -24,9 +25,9 @@ internal class EmploymentViewModel @Inject constructor(
it.passCount.toFloat() / it.totalStudentCount.toFloat() * 100f
}
state.value.copy(
rate = DecimalFormat("##.#").format(rate).toLong(),
totalStudentCount = it.totalStudentCount,
passCount = it.passCount,
rate = DecimalFormat("##.#").format(rate).toFloat(),
totalStudentCount = it.totalStudentCount.toString(),
passCount = it.passCount.toString(),
)
}
}
Expand All @@ -38,15 +39,15 @@ internal class EmploymentViewModel @Inject constructor(
}

internal data class EmploymentState(
val rate: Long,
val totalStudentCount: Long,
val passCount: Long,
val rate: Float,
val totalStudentCount: String,
val passCount: String,
) {
companion object {
fun getDefaultState() = EmploymentState(
rate = 0,
totalStudentCount = 0,
passCount = 0,
rate = 0F,
totalStudentCount = "",
passCount = "",
)
}
}
Expand Down
Loading