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

์ „์ฒด ๊ธ€

(377)
[Android] Custom View ์ƒํƒœ ์ €์žฅ + ์ปค์Šคํ…€ ์บ˜๋ฆฐ๋”๋ทฐ ์ œ์ž‘ ๊ธฐ๋ก https://www.charlezz.com/?p=29013 Android์—์„œ View์˜ ์ƒ๋ช…์ฃผ๊ธฐ | ์ฐฐ์Šค์˜ ์•ˆ๋“œ๋กœ์ด๋“œ https://proandroiddev.com/the-life-cycle-of-a-view-in-android-6a2c4665b95e์„ ๋ฒˆ์—ญํ•œ ๋‚ด์šฉ์ž…๋‹ˆ๋‹ค. ์•ˆ๋“œ๋กœ์ด๋“œ ์•ฑ์„ ์‹คํ–‰ํ•  ๋•Œ ์šฐ๋ฆฌ๊ฐ€ ๊ฐ€์žฅ ๋จผ์ € ์Šคํฌ๋ฆฐ์—์„œ ๋ณผ ์ˆ˜ ์žˆ๋Š” ๊ฒƒ์ด View๋ผ๊ณ  ๋งํ•  ์ˆ˜ ์žˆ๋‹ค. View ํด๋ž˜์Šค๋Š” ์‚ฌ www.charlezz.com ์œ„ ๋ธ”๋กœ๊ทธ์˜ ์ƒํƒœ ์ €์žฅ๊ณผ ๋ณต๊ตฌ ์˜ˆ์‹œ ์ฝ”๋“œ๋ฅผ ์ž˜ ํ™œ์šฉํ–ˆ๋‹ค. ์ฐฐ์Šค๋‹˜ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค๐Ÿ‘ ์ปค์Šคํ…€๋ทฐ๋กœ ๋‹ฌ๋ ฅ์„ ๋งŒ๋“ค์—ˆ๋‹ค. ๋””์ž์ธ ๊ฐ€์ด๋“œ๋ฅผ ์ ์šฉํ•˜๊ณ  ์•ฑ ์„ฑ๋Šฅ์„ ์œ„ํ•ด์„œ๋Š” ์ปค์Šคํ…€๋ทฐ๋กœ ๊ตฌํ˜„ํ•˜๋Š” ๊ฒƒ์ด ์ ํ•ฉํ•˜๋‹ค๋Š” ๊ฒƒ์„ ์ธ์ •ํ•  ์ˆ˜ ๋ฐ–์— ์—†์—ˆ๋‹ค. ๋‹ฌ๋ ฅ์—์„œ ์ดˆ๊ธฐํ™”๋กœ ์„ ํƒ๋˜๊ฑฐ๋‚˜(์˜ค๋Š˜ ๋‚ ์งœ๊ฐ€ ์„ ํƒ๋จ), ์‚ฌ์šฉ์ž๊ฐ€ ์„ ํƒํ•œ..
[Retrofit2] Body๋กœ ZonedDateTime ๋ณด๋‚ด๊ธฐ ์„œ๋ฒ„ ๊ฐœ๋ฐœ์ž๋ถ„์ด api์˜ body ๊ฐ’์œผ๋กœ ZonedDateTime๋ฅผ ๋ณ€ํ™˜์—†์ด ๊ทธ๋ƒฅ ๋ณด๋‚ด๋ฉด ๋œ๋‹ค๊ณ  ํ•ด์„œ ์‘??? ํ–ˆ๋Š”๋ฐ... ์—ญ์‹œ๋‚˜. https://jinseongsoft.tistory.com/191 (Java) Gson ์‚ฌ์šฉ์‹œ ZonedDateTime JSON Serialize/Deserialize ๋ฐฉ๋ฒ• ๋“ค์–ด๊ฐ€๋ฉฐ Gson์„ ์‚ฌ์šฉํ•˜์—ฌ ZonedDateTime ๊ฐ์ฒด๋ฅผ Serialize/Deserialize ํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋‹ค. public void test() { String json = new GsonBuilder().create().toJson(ZonedDateTime.now()); ZonedDateTime dateTim.. jinseongsoft.tistory.com 1) ZonedDateTime์˜ Se..
[Android] LayoutInflater inflate ํ•  ๋•Œ viewGroup ์ง€์ • ์•ˆํ•ด์„œ ๋‚˜์˜จ ์ด์Šˆ ๋ฆฌ์‚ฌ์ดํด๋Ÿฌ๋ทฐ์˜ ์•„์ดํ…œ ์‚ฌ์ด์ฆˆ๊ฐ€ ์ด์ƒํ–ˆ๋‹ค. ๊ฐ ์•„์ดํ…œ ๋ ˆ์ด์•„์›ƒ์€ ConstraintLayout ์•ˆ์— ๊ตฌ์„ฑ๋˜์–ด ์žˆ์—ˆ๋‹ค. ์ตœ์ƒ์œ„ ๋ ˆ์ด์•„์›ƒ์˜ android:layout_width="match_parent" ๊ฐ€ ๋จนํžˆ์ง€ ์•Š์•„์„œ ๋ง๊ฐ€์ง€๋Š” ๊ฒƒ์œผ๋กœ ์ถ”์ธกํ–ˆ๋‹ค. ํ…์ŠคํŠธ๋งŒ ๋ฐ›๋Š” ์•„์ดํ…œ, ์ธ๋„ค์ผ๋„ ๋ฐ›๋Š” ์•„์ดํ…œ ์ด ๋‘ ๊ฐ€์ง€ ํƒ€์ž…์˜ ๋ทฐํ™€๋”๊ฐ€ ์žˆ๋Š”๋ฐ ์™œ ์ธ๋„ค์ผ ๋ฐ›๋Š” ์•„์ดํ…œ๋งŒ ์ด๋Ÿฌ๋Š” ๊ฑด์ง€ ๊ณ ๋ฏผ. ๋‹ต์„ ์ฐพ์Œ. override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) : ViewHolder { val inflater = LayoutInflater.from(parent.context) return when(viewType) { VIEW_TEXT -> TextHolder( Item..
[Android]Message: 2์€(๋Š”) 3๋ฐ”์ดํŠธ UTF-8 ์‹œํ€€์Šค์— ๋Œ€ํ•ด ๋ถ€์ ํ•ฉํ•œ ๋ฐ”์ดํŠธ์ž…๋‹ˆ๋‹ค. ๋นŒ๋“œ ์—๋Ÿฌ ๋ฉ”์‹œ์ง€๋กœ ์ž๊พธ Message: 2์€(๋Š”) 3๋ฐ”์ดํŠธ UTF-8 ์‹œํ€€์Šค์— ๋Œ€ํ•ด ๋ถ€์ ํ•ฉํ•œ ๋ฐ”์ดํŠธ์ž…๋‹ˆ๋‹ค. ๊ฐ€ ๋–ด๋‹ค. layout xml ํŒŒ์ผ์˜ TextView์˜ tools:text์˜ ๊ฐ’์œผ๋กœ ๐Ÿ’œ ์š” ์ด๋ชจํ‹ฐ์ฝ˜ ๋„ฃ์„ ๊ฒƒ์„ ์ง€์šฐ๋‹ˆ ํ•ด๋‹น ์—๋Ÿฌ๊ฐ€ ํ•ด๊ฒฐ๋๋‹ค.
[Android] LocalDate, LocalTime, LocaleDateTime ์“ฐ๊ณ  ์‹ถ์€๋ฐ Android API version์— ๊ฑธ๋ ค์„œ ๋‚ด ํ”„๋กœ์ ํŠธ์˜ minSdkVersion์ด 24์—ฌ์„œ ํŽธํ•˜๊ฒŒ LocalDate๋ฅผ ์“ฐ๊ธฐ์— ๋ฌด๋ฆฌ๊ฐ€ ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ์•Œ์•˜๋‹ค. Joda-Time ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์“ฐ๊ธฐ์—๋Š” ๋ฌด๊ฑฐ์šด ๋“ฏํ•ด์„œ ๊ณ ๋ฏผํ•˜๋‹ค๊ฐ€ ๋ฌธ์ œ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์„ ์ฐพ์•˜๋‹ค. https://developer.android.com/studio/write/java8-support#library-desugaring ์ž๋ฐ” 8 ์–ธ์–ด ๊ธฐ๋Šฅ ๋ฐ API ์‚ฌ์šฉ | Android ๊ฐœ๋ฐœ์ž | Android Developers ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” Java 8 ์–ธ์–ด ๊ธฐ๋Šฅ, ์ด๋Ÿฌํ•œ ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•  ํ”„๋กœ์ ํŠธ๋ฅผ ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ๊ตฌ์„ฑํ•˜๋Š” ๋ฐฉ๋ฒ• ๋ฐ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ๋Š” ์•Œ๋ ค์ง„ ๋ฌธ์ œ๋ฅผ ์•Œ์•„๋ด…๋‹ˆ๋‹ค. developer.android.com ๋„ˆ๋ฌด ํŽธํ•˜๋‹ค. ๊ทธ๋Ÿฐ๋ฐ desugar๋Š” ๋ฌด์—‡์ธ๊ฐ€ >https://datalibrary.tist..
[Android]DownloadManager ๊ฐœ์š” : https://developer.android.com/reference/android/app/DownloadManager ์žฅ์‹œ๊ฐ„ HTTP ๋‹ค์šด๋กœ๋“œ๋ฅผ ์ฒ˜๋ฆฌํ•˜๋Š” ์‹œ์Šคํ…œ ์„œ๋น„์Šค ํด๋ผ์ด์–ธํŠธ๋Š” ํŠน์ • ๋ชฉ์ ์ง€์ธ ํŒŒ์ผ์„ ๋‹ค์šด๋กœ๋“œํ•  URI๋ฅผ ์š”์ฒญํ•ด์•ผ ํ•œ๋‹ค. ๋‹ค์šด๋กœ๋“œ ๋งค๋‹ˆ์ €๋Š” HTTP ์ƒํ˜ธ ์ž‘์šฉ์„ ์ฒ˜๋ฆฌํ•˜๊ณ  ์‹คํŒจ ํ›„ ๋˜๋Š” ์—ฐ๊ฒฐ ๋ณ€๊ฒฝ ๋ฐ ์‹œ์Šคํ…œ ์žฌ๋ถ€ํŒ… ์ „๋ฐ˜์— ๊ฑธ์ณ ๋‹ค์šด๋กœ๋“œ๋ฅผ ์žฌ์‹œ๋„ํ•˜๋ฉด์„œ ๋ฐฑ๊ทธ๋ผ์šด๋“œ์—์„œ ๋‹ค์šด๋กœ๋“œ๋ฅผ ์ˆ˜ํ–‰ํ•œ๋‹ค. ACTION_NOTIFICATION_CLICKED์— ๋Œ€ํ•ด ๋ธŒ๋กœ๋“œ์บ์ŠคํŠธ ๋ฆฌ์‹œ๋ฒ„๋ฅผ ๋“ฑ๋กํ•ด์„œ ์‚ฌ์šฉ์ž๊ฐ€ ๋…ธํ‹ฐํ”ผ์ผ€์ด์…˜์ด๋‚˜ ๋‹ค์šด๋กœ๋“œ UI๋กœ ์ง„ํ–‰ ์ค‘์ธ ๋‹ค์šด๋กœ๋“œ๋ฅผ ํด๋ฆญํ•  ๊ฒฝ์šฐ์— ์ ์ ˆํ•œ ์ฒ˜๋ฆฌ๋ฅผ ํ•˜๋„๋ก ํ•  ์ˆ˜ ์žˆ๋‹ค. Manifest.permission.INTERNET ํผ๋ฏธ์…˜์ด ํ•„์š”ํ•˜๋‹ค. ๋ถˆํ•„์š”ํ•œ ๋ฐฑ๊ทธ๋ผ์šด๋“œ ๋ชจ๋ฐ”์ผ ..
[Android] TabLayout, TabItem ์›ํ•˜๋Š” UI ๋งŒ๋“ค๊ธฐ ์‚ฝ์งˆํ•˜๋ฉด์„œ ๊ฒฐ๊ตญ์—” ์›ํ•˜๋Š” UI๋ฅผ ๋งŒ๋“ค์—ˆ๋‹ค. ์‚ฝ์งˆํ•˜๋ฉฐ ์•Œ๊ฒŒ๋œ ๊ฒƒ๋“ค์„ ๊ธฐ๋กํ•œ๋‹ค. ์›ํ•˜๋˜ ๋ชจ์Šต 1. ํƒญ๋“ค ๋ฐ”๋‹ฅ์—๋Š” ๋ผ์ธ์ด ๊น”๋ ค์žˆ๋‹ค. 2. ์ธ๋””์ผ€์ดํ„ฐ ๊ธธ์ด๊ฐ€ ํƒญ ํ•˜๋‚˜์˜ ๋„“์ด๋ณด๋‹ค๋Š” ์ข์ง€๋งŒ ํ…์ŠคํŠธ ๋„ˆ๋น„๋ณด๋‹ค๋Š” ํฌ๋‹ค 3. ํƒญ ๊ฐ„ ๋””๋ฐ”์ด๋”๊ฐ€ ์žˆ๋‹ค. ๊ฒฐ๊ณผ ์ฝ”๋“œ ์€์ธ : https://ovso.github.io/blog/2018/11/06/tablayout_divider/ TabLayout์— ๊ตฌ๋ถ„์„ (Divider) ๋„ฃ๊ธฐ TabLayout์— ๊ตฌ๋ถ„์„  ๋„ฃ๊ธฐ ovso.github.io ์‚ฌ์šฉ๋œ drawable ํŒŒ์ผ๋“ค 1) ํฐ ๋ฐฐ๊ฒฝ์— ๋ฐ”๋‹ฅ ์ค„ ํฐ ๋ฐฐ๊ฒฝ์— ๋ฐ”๋‹ฅ ์ค„ ๊ทธ๋ฆฌ๋Š” ๋ฐฉ์‹์œผ๋กœ, ํฐ ๋ฐฐ๊ฒฝ์— ํ…Œ๋‘๋ฆฌ ์ƒ‰์„ ๋„ฃ์€ ์‚ฌ๊ฐํ˜• shape์˜ ์œ„์™€ ์˜† ๋งˆ์ง„ ๊ฐ’์„ ๋งˆ์ด๋„ˆ์Šค ๊ฐ’์„ ์ฃผ๋Š” ๋ฐฉ์‹๋„ ์žˆ๋‹ค. ์ •๋ง ์ด๋ ‡๊ฒŒ ๋ฐ–์— ๊ทธ๋ฆฌ์ง€ ๋ชปํ•˜๋Š”๊ฐ€... ๊ตฌ๊ธ€๋งํ•ด๋„ ๋”ฑํžˆ..
[Android] ๋ ˆ์ด์•„์›ƒ ์—…๋ฐ์ดํŠธ ์ž๋™ ์• ๋‹ˆ๋ฉ”์ด์…˜ ์ฒ˜๋ฆฌ https://developer.android.com/training/animation/layout?hl=ko ๋ ˆ์ด์•„์›ƒ ์—…๋ฐ์ดํŠธ ์ž๋™ ์• ๋‹ˆ๋ฉ”์ด์…˜ ์ฒ˜๋ฆฌ | Android ๊ฐœ๋ฐœ์ž | Android Developers ๋ ˆ์ด์•„์›ƒ ์—…๋ฐ์ดํŠธ ์ž๋™ ์• ๋‹ˆ๋ฉ”์ด์…˜ ์ฒ˜๋ฆฌ Android์—์„œ๋Š” ๊ฐœ๋ฐœ์ž๊ฐ€ ๋ ˆ์ด์•„์›ƒ์„ ๋ณ€๊ฒฝํ•  ๋•Œ๋งˆ๋‹ค ์‹œ์Šคํ…œ์—์„œ ์‹คํ–‰๋˜๋Š” ๋ฏธ๋ฆฌ ๋กœ๋“œ๋œ ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ๊ฐœ๋ฐœ์ž๋Š” ๋ ˆ์ด์•„์›ƒ์— ์†์„ฑ์„ ์„ค์ •ํ•˜์—ฌ developer.android.com