๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๊ณณ๊ฐ„์—์„œ ์ธ์‹ฌ๋‚œ๋‹ค/์‹ค๋ฌด

(20)
[Android][Kotlin] ์‚ฌ์šฉ์ž๊ฐ€ ์„ ํƒํ•œ ํƒญ์˜ ๋ฌธ๊ตฌ์— ๋ณผ๋“œ ์ฒ˜๋ฆฌ ๊ธฐ๋ณธ Tab ๋ณผ๋“œ ์ฒ˜๋ฆฌ fun TabLayout.Tab.setBold() = this.view.children.find { it is TextView }?.let { tv -> (tv as TextView).post { tv.setTypeface(null, Typeface.BOLD) } } ๋‹ค๋ฅธ Typeface๋กœ ๊ต์ฒด ๊ฐ€๋Šฅ https://developer.android.com/reference/android/graphics/Typeface#summary Typeface | Android Developers developer.android.com ์„ ํƒ์ง€๊ฐ€ 4๊ฐ€์ง€ ๋ฐ–์— ์—†๊ธฐ๋Š” ํ•˜๋‹ค. ์‚ฌ์šฉ์ž๊ฐ€ ์„ ํƒํ•œ ํƒญ์˜ ๋ฌธ๊ตฌ ๋ณผ๋“œ ์ฒ˜๋ฆฌ fun TabLayout.setSelectedTabBold() = this.addOnTa..
[Kotlin] BaseUseCase abstract class UseCase where Type : Any { abstract suspend operator fun invoke(params: Params): Type? }
[Android][Kotlin] ๋ฌธ๊ตฌ ๋ถ€๋ถ„ ์ƒ‰ ๋ณ€๊ฒฝ SpannedString ์ข…์† ํ•ญ๋ชฉ ์„ ์–ธ build.gradle ์•ˆ implementation "androidx.core:core-ktx:$core_version" Utility fun String.targetColorSpan( emphasisString: String, @ColorInt colorRes: Int ): SpannedString { if(!this.contains(emphasisString)) return SpannedString(this) val splitStrings = this.split(emphasisString.toRegex()) return buildSpannedString { append(splitStrings[0]) color(colorRes) { append(emphasisString) } appe..
[Android ์‚ฝ์งˆ ๊ตํ›ˆ] ์ด๋ชจ์ง€ ํ•˜๋‚˜๋ฅผ ํ•œ ๊ธ€์ž๋กœ ์„ธ๊ธฐ ์œ„ํ•ด ์ปค์Šคํ…€ InputFilter๋ฅผ ๋งŒ๋“ค์—ˆ์–ด์š”. ์š”์•ฝ ์•ˆ๋“œ๋กœ์ด๋“œ ์ž…๋ ฅ์ฐฝ์—์„œ ์ด๋ชจ์ง€ ํ•˜๋‚˜๋ฅผ ํ•œ ๊ธ€์ž๋กœ ์ธ์‹ํ•˜์ง€ ๋ชปํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ์–ด์š”. ๊ทธ๋ž˜์„œ ์ด๋ชจ์ง€ ํ•˜๋‚˜๋ฅผ ํ•œ ๊ธ€์ž๋กœ ์—ฌ๊ธฐ๊ณ  ๊ธ€์ž ์ˆ˜๋ฅผ ์„ธ๊ธฐ ์œ„ํ•ด์„œ๋Š” ์ž‘์—…์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ์ €๋Š” ์ปค์Šคํ…€ InputFilter๋ฅผ ๋งŒ๋“ค์—ˆ์–ด์š”. ๊ธฐํš์ƒ ์ž…๋ ฅ์ฐฝ์— ๊ธ€์ž์ˆ˜ ์ œํ•œ์ด ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. ์ผ๋ฐ˜ ๊ธ€์ž, ์ˆซ์ž, ๊ธฐํ˜ธ, ์ด๋ชจ์ง€๋ฅผ ํฌํ•จํ•ด์„œ ๊ธ€์ž์ˆ˜ ์ œํ•œ์ด ์žˆ์—ˆ๊ณ , ๋‹น์—ฐํžˆ ์ง๊ด€์ ์œผ๋กœ ์ด๋ชจ์ง€ ํ•˜๋‚˜๋Š” ํ•œ ๊ธ€์ž ์•„๋‹ˆ๊ฒ ์Šต๋‹ˆ๊นŒ. ๋„ˆ๋ฌด๋‚˜ ์‰ฝ๊ฒŒ ์ƒ๊ฐํ•˜๊ณ  ๊ธฐํš๋Œ€๋กœ ์ž‘์—…ํ–ˆ๋‹ค๊ณ  ์ƒ๊ฐํ–ˆ๋Š”๋ฐ, ํ…Œ์ŠคํŠธ๋ฅผ ํ•ด๋ณด๋‹ˆ ์ด๋ชจ์ง€๋ฅผ ๊ธ€์ž ํ•˜๋‚˜ ์ด์ƒ์œผ๋กœ ์„ธ๋”๊ตฐ์š”.๐Ÿ˜ณ ๋Œ€๊ฐœ ์ œ๊ฐ€ ํ…Œ์ŠคํŠธํ–ˆ๋˜ ์ด๋ชจ์ง€๋“ค์€ ํ•œ ์ด๋ชจ์ง€๋‹น 2๊ธ€์ž ์ •๋„๋กœ ์ธ์‹ํ–ˆ์Šต๋‹ˆ๋‹ค. iOS์—์„œ๋Š” ์ด๋ชจ์ง€ ํ•˜๋‚˜๋ฅผ ํ•œ ๊ธ€์ž๋กœ ์ธ์‹ํ•ด์„œ ์ด๊ฒƒ๊ณผ ๊ด€๋ จํ•ด ๋ฌธ์ œ๊ฐ€ ์—†์ด ์‰ฝ๊ฒŒ ๊ฐ€๋Š”๋ฐ, ์•ˆ๋“œ๋กœ์ด๋“œ๋Š” ๊ทธ๋ ‡์ง€ ๋ชปํ•ด์„œ ์†์œผ๋กœ ํˆดํˆด๊ฑฐ๋ฆฌ๊ณ ๐Ÿคจ๐Ÿคจ์™œ ๊ทธ๋Ÿฐ์ง€,..