-
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.
HomeTopBar App Title 이미지에서 텍스트로 교체 (#146)
* HomeTopBar app title 이미지에서 텍스트로 교체 다국어 지원 및 깜빡거리는 이슈를 해결하기 위함 * style check success * HomeTopBar App Title 다국어 지원 적용 * style check success
- Loading branch information
Showing
10 changed files
with
103 additions
and
24 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 was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
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
74 changes: 74 additions & 0 deletions
74
feature/home/src/main/kotlin/com/nexters/bandalart/android/feature/home/ui/HomeAppTitle.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,74 @@ | ||
package com.nexters.bandalart.android.feature.home.ui | ||
|
||
import android.content.Context | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.platform.LocalContext | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.unit.sp | ||
import com.nexters.bandalart.android.core.designsystem.theme.Gray900 | ||
import com.nexters.bandalart.android.core.designsystem.theme.koronaOneRegular | ||
import com.nexters.bandalart.android.core.designsystem.theme.neurimboGothicRegular | ||
import com.nexters.bandalart.android.core.ui.R | ||
import com.nexters.bandalart.android.core.ui.component.FixedSizeText | ||
import java.util.Locale | ||
|
||
@Composable | ||
fun HomeAppTitle( | ||
modifier: Modifier = Modifier, | ||
) { | ||
val context = LocalContext.current | ||
val currentLocale = context.getCurrentLocale() | ||
|
||
when (currentLocale.language) { | ||
Locale.KOREAN.language -> { | ||
HomeAppKoreanTitle(modifier = modifier) | ||
} | ||
|
||
Locale.ENGLISH.language -> { | ||
HomeAppEnglishTitle(modifier = modifier) | ||
} | ||
|
||
else -> { | ||
HomeAppEnglishTitle(modifier = modifier) | ||
} | ||
} | ||
} | ||
|
||
@Composable | ||
fun HomeAppKoreanTitle( | ||
modifier: Modifier = Modifier, | ||
) { | ||
FixedSizeText( | ||
modifier = modifier, | ||
text = stringResource(R.string.bandalart), | ||
color = Gray900, | ||
fontSize = 28.sp, | ||
fontWeight = FontWeight.W400, | ||
fontFamily = neurimboGothicRegular, | ||
lineHeight = 20.sp, | ||
letterSpacing = (-0.56).sp, | ||
) | ||
} | ||
|
||
@Composable | ||
fun HomeAppEnglishTitle( | ||
modifier: Modifier = Modifier, | ||
) { | ||
FixedSizeText( | ||
modifier = modifier, | ||
text = stringResource(R.string.bandalart), | ||
color = Gray900, | ||
fontSize = 18.sp, | ||
fontWeight = FontWeight.W400, | ||
fontFamily = koronaOneRegular, | ||
lineHeight = 20.sp, | ||
letterSpacing = (-0.36).sp, | ||
) | ||
} | ||
|
||
// TODO core:util 모듈로 옮길 예정 | ||
fun Context.getCurrentLocale(): Locale { | ||
return this.resources.configuration.locales.get(0) | ||
} |
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