Skip to content

Commit

Permalink
Merge pull request #111 from Nexters/feature/image-create-text-change
Browse files Browse the repository at this point in the history
[FEAT] [#12] 이미지 생성 화면 내에 텍스트 갱신 구현
  • Loading branch information
easyhooon authored Mar 10, 2024
2 parents 893fa2c + 56bcecf commit 1197129
Show file tree
Hide file tree
Showing 25 changed files with 357 additions and 245 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ internal object ApplicationConfig {
const val MinSdk = 26
const val TargetSdk = 34
const val CompileSdk = 34
const val VersionCode = 4
const val VersionName = "1.0.3"
const val VersionCode = 5
const val VersionName = "1.0.4"
val JavaVersion = org.gradle.api.JavaVersion.VERSION_17
const val JavaVersionAsInt = 17
}
8 changes: 2 additions & 6 deletions core/designsystem/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,8 @@

<!-- create image-->
<string name="creating_image_title">이미지 생성 중…</string>
<string name="creating_image_wait_part1_description1_prefix">최대</string>
<string name="creating_image_wait_part1_description1_time_value">&#160;30초</string>
<string name="creating_image_wait_part1_description1_suffix">&#160;정도 소요됩니다.</string>
<string name="creating_image_wait_part1_description2">잠시만 기다려주시면 작업이 완료됩니다.</string>
<string name="creating_image_wait_part2_description1">조금만 더 기다려주세요!</string>
<string name="creating_image_wait_part2_description2">열심히 작업 중입니다.</string>
<string name="creating_image_wait_part1_description">최대 30초 정도 소요됩니다.\n잠시만 기다려주시면 작업이 완료됩니다.</string>
<string name="creating_image_wait_part2_description">조금만 더 기다려주세요!\n열심히 작업 중입니다.</string>
<string name="creating_image_exit_warning_prefix">화면 이탈시 이미지 생성이</string>
<string name="creating_image_exit_warning_suffix">&#160;종료됩니다.</string>
<string name="creating_image_stop_confirmation">정말 중단하시겠어요?</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.nexters.ilab.android.core.designsystem.theme.ILabTheme
import com.nexters.ilab.core.ui.ComponentPreview

@Composable
Expand Down Expand Up @@ -117,17 +118,19 @@ fun ILabButtonPreview() {
@ComponentPreview
@Composable
fun ILabButtonWithLeadingIconPreview() {
ILabButton(
onClick = {},
text = {
Text("Button")
},
leadingIcon = {
Icon(
imageVector = Icons.Filled.Check,
contentDescription = "Navigation icon",
tint = Color.White,
)
},
)
ILabTheme {
ILabButton(
onClick = {},
text = {
Text("Button")
},
leadingIcon = {
Icon(
imageVector = Icons.Filled.Check,
contentDescription = "Navigation icon",
tint = Color.White,
)
},
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import com.nexters.ilab.android.core.designsystem.R
import com.nexters.ilab.android.core.designsystem.theme.Contents2
import com.nexters.ilab.android.core.designsystem.theme.ILabTheme
import com.nexters.ilab.android.core.designsystem.theme.Subtitle2
import com.nexters.ilab.android.core.designsystem.theme.Title2
import com.nexters.ilab.core.ui.ComponentPreview
Expand Down Expand Up @@ -179,47 +180,53 @@ fun CreateImageStopDialogPreview() {
@ComponentPreview
@Composable
fun DeleteAccountDialogPreview() {
ILabDialog(
titleResId = R.string.setting_delete_account,
iconResId = R.drawable.ic_warning,
iconDescription = "Warning Icon",
firstDescriptionResId = R.string.setting_delete_account_description,
secondDescriptionResId = null,
cancelTextResId = R.string.setting_delete_account_cancel,
confirmTextResId = R.string.setting_delete_account_confirm,
onCancelClick = {},
onConfirmClick = {},
)
ILabTheme {
ILabDialog(
titleResId = R.string.setting_delete_account,
iconResId = R.drawable.ic_warning,
iconDescription = "Warning Icon",
firstDescriptionResId = R.string.setting_delete_account_description,
secondDescriptionResId = null,
cancelTextResId = R.string.setting_delete_account_cancel,
confirmTextResId = R.string.setting_delete_account_confirm,
onCancelClick = {},
onConfirmClick = {},
)
}
}

@ComponentPreview
@Composable
fun ServerErrorDialogPreview() {
ILabDialog(
titleResId = R.string.server_error_title,
iconResId = R.drawable.ic_server_error,
iconDescription = "Network Error Icon",
firstDescriptionResId = R.string.server_error_description1,
secondDescriptionResId = R.string.server_error_description2,
confirmTextResId = R.string.retry,
cancelTextResId = null,
onCancelClick = {},
onConfirmClick = {},
)
ILabTheme {
ILabDialog(
titleResId = R.string.server_error_title,
iconResId = R.drawable.ic_server_error,
iconDescription = "Network Error Icon",
firstDescriptionResId = R.string.server_error_description1,
secondDescriptionResId = R.string.server_error_description2,
confirmTextResId = R.string.retry,
cancelTextResId = null,
onCancelClick = {},
onConfirmClick = {},
)
}
}

@ComponentPreview
@Composable
fun NetworkErrorDialogPreview() {
ILabDialog(
titleResId = R.string.network_error_title,
iconResId = R.drawable.ic_network_error,
iconDescription = "Network Error Icon",
firstDescriptionResId = R.string.network_error_description1,
secondDescriptionResId = R.string.network_error_description2,
confirmTextResId = R.string.retry,
cancelTextResId = null,
onCancelClick = {},
onConfirmClick = {},
)
ILabTheme {
ILabDialog(
titleResId = R.string.network_error_title,
iconResId = R.drawable.ic_network_error,
iconDescription = "Network Error Icon",
firstDescriptionResId = R.string.network_error_description1,
secondDescriptionResId = R.string.network_error_description2,
confirmTextResId = R.string.retry,
cancelTextResId = null,
onCancelClick = {},
onConfirmClick = {},
)
}
}
69 changes: 41 additions & 28 deletions core/ui/src/main/kotlin/com/nexters/ilab/core/ui/component/Image.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import coil.decode.ImageDecoderDecoder
import coil.request.ImageRequest
import com.nexters.ilab.android.core.designsystem.R
import com.nexters.ilab.android.core.designsystem.theme.Contents2
import com.nexters.ilab.android.core.designsystem.theme.ILabTheme
import com.nexters.ilab.core.ui.ComponentPreview

@Composable
Expand Down Expand Up @@ -209,57 +210,69 @@ fun LoadingImage(
@ComponentPreview
@Composable
fun ExampleImagePreview() {
ExampleImage(
resId = 0,
contentDescription = "Example Image Icon",
)
ILabTheme {
ExampleImage(
resId = 0,
contentDescription = "Example Image Icon",
)
}
}

@ComponentPreview
@Composable
fun NetworkImagePreview() {
NetworkImage(
imageUrl = "",
contentDescription = "Network Image Icon",
)
ILabTheme {
NetworkImage(
imageUrl = "",
contentDescription = "Network Image Icon",
)
}
}

@ComponentPreview
@Composable
fun BackgroundImagePreview() {
BackgroundImage(
resId = 0,
contentDescription = "Loading Image Icon",
)
ILabTheme {
BackgroundImage(
resId = 0,
contentDescription = "Loading Image Icon",
)
}
}

@ComponentPreview
@Composable
fun LoadingImagePreview() {
LoadingImage(
resId = 0,
contentDescription = "Background Image Icon",
)
ILabTheme {
LoadingImage(
resId = 0,
contentDescription = "Background Image Icon",
)
}
}

@ComponentPreview
@Composable
fun UnSelectedStyleImagePreview() {
StyleImage(
imageUrl = "",
styleName = "#스타일",
contentDescription = "Style Image",
isSelectedIndex = false,
)
ILabTheme {
StyleImage(
imageUrl = "",
styleName = "#스타일",
contentDescription = "Style Image",
isSelectedIndex = false,
)
}
}

@ComponentPreview
@Composable
fun SelectedStyleImagePreview() {
StyleImage(
imageUrl = "",
styleName = "#스타일",
contentDescription = "Style Image",
isSelectedIndex = true,
)
ILabTheme {
StyleImage(
imageUrl = "",
styleName = "#스타일",
contentDescription = "Style Image",
isSelectedIndex = true,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.nexters.ilab.android.core.common.extension.noRippleClickable
import com.nexters.ilab.android.core.designsystem.R
import com.nexters.ilab.android.core.designsystem.theme.ILabTheme
import com.nexters.ilab.core.ui.ComponentPreview

@Composable
Expand All @@ -28,5 +29,7 @@ fun LoadingIndicator(modifier: Modifier = Modifier) {
@ComponentPreview
@Composable
fun LoadingIndicatorPreview() {
LoadingIndicator(modifier = Modifier.fillMaxSize())
ILabTheme {
LoadingIndicator(modifier = Modifier.fillMaxSize())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.nexters.ilab.android.core.designsystem.theme.ILabTheme
import com.nexters.ilab.core.ui.ComponentPreview
import kotlin.math.absoluteValue

Expand Down Expand Up @@ -78,11 +79,13 @@ fun PagerIndicator(
@ComponentPreview
@Composable
internal fun PagerIndicatorPreview() {
val pagerState = rememberPagerState(pageCount = { 4 })
PagerIndicator(
pageCount = pagerState.pageCount,
currentPage = pagerState.currentPage,
targetPage = pagerState.currentPage,
currentPageOffsetFraction = pagerState.currentPageOffsetFraction,
)
ILabTheme {
val pagerState = rememberPagerState(pageCount = { 4 })
PagerIndicator(
pageCount = pagerState.pageCount,
currentPage = pagerState.currentPage,
targetPage = pagerState.currentPage,
currentPageOffsetFraction = pagerState.currentPageOffsetFraction,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.unit.dp
import com.nexters.ilab.android.core.designsystem.R
import com.nexters.ilab.android.core.designsystem.theme.ILabTheme
import com.nexters.ilab.android.core.designsystem.theme.Subtitle1
import com.nexters.ilab.core.ui.ComponentPreview

Expand Down Expand Up @@ -102,30 +103,36 @@ enum class TopAppBarNavigationType { Back, Close, Setting }
@ComponentPreview
@Composable
fun ILabTopAppBarBackPreview() {
ILabTopAppBar(
titleRes = android.R.string.untitled,
navigationType = TopAppBarNavigationType.Back,
navigationIconContentDescription = "Navigation back icon",
)
ILabTheme {
ILabTopAppBar(
titleRes = android.R.string.untitled,
navigationType = TopAppBarNavigationType.Back,
navigationIconContentDescription = "Navigation back icon",
)
}
}

@ComponentPreview
@Composable
fun ILabTopAppBarClosePreview() {
ILabTopAppBar(
titleRes = android.R.string.untitled,
navigationType = TopAppBarNavigationType.Close,
navigationIconContentDescription = "Navigation close icon",
)
ILabTheme {
ILabTopAppBar(
titleRes = android.R.string.untitled,
navigationType = TopAppBarNavigationType.Close,
navigationIconContentDescription = "Navigation close icon",
)
}
}

@ComponentPreview
@Composable
fun ILabTopAppBarSettingPreview() {
ILabTopAppBar(
titleRes = android.R.string.untitled,
navigationType = TopAppBarNavigationType.Setting,
navigationIconContentDescription = "Navigation Setting icon",
isTextLogo = true,
)
ILabTheme {
ILabTopAppBar(
titleRes = android.R.string.untitled,
navigationType = TopAppBarNavigationType.Setting,
navigationIconContentDescription = "Navigation Setting icon",
isTextLogo = true,
)
}
}
Loading

0 comments on commit 1197129

Please sign in to comment.