Skip to content

๐Ÿ€ ์ฃผ๋ณ€์˜ ๋‹ค์–‘ํ•œ ์ƒ๋ฌผ์„ ์ดฌ์˜ํ•˜๊ณ  ์‹๋ณ„ํ•˜์—ฌ ๋‚˜๋งŒ์˜ ์ƒ๋ฌผ ๋„๊ฐ์„ ๋งŒ๋“ค๊ณ , ์ƒ๋ฌผ ์ง€๋„๋ฅผ ์นœ๊ตฌ์™€ ํ•จ๊ป˜ ํ™•์ธํ•ด๋ณด์•„์š”~

Notifications You must be signed in to change notification settings

boostcampwm-2024/refactor-and04-Nature-Album

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๋ถ€์ŠคํŠธ์บ ํ”„ ์›นใƒป๋ชจ๋ฐ”์ผ 9๊ธฐ ๋ฉค๋ฒ„์‹ญ Android : And04_project

๐Ÿ€ Nature Album ๐Ÿ€

์ฃผ๋ณ€์˜ ์ƒ๋ฌผ์„ ์ดฌ์˜ํ•˜๊ณ  ์‹๋ณ„ํ•˜์—ฌ ๋‚˜๋งŒ์˜ ์ƒ๋ฌผ ๋„๊ฐ์„ ๋งŒ๋“ค๊ณ , ์ƒ๋ฌผ ์ง€๋„๋ฅผ ์นœ๊ตฌ๋“ค๊ณผ ๊ณต์œ ํ•  ์ˆ˜ ์žˆ๋Š” ์•ฑ ์„œ๋น„์Šค

Nature Album ๋ฐฐ๋„ˆ ์ด๋ฏธ์ง€

โญ ํ”„๋กœ์ ํŠธ ์†Œ๊ฐœ

  • ์ฃผ๋ณ€ ์ƒ๋ฌผ์„ ์ดฌ์˜ํ•ด ๋„๊ฐ์— ๋“ฑ๋กํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • ์ƒ๋ฌผ ๋„๊ฐ ๋ฟ๋งŒ์•„๋‹ˆ๋ผ ์ƒ๋ฌผ ์ง€๋„์—๋„ ๋“ฑ๋ก๋ฉ๋‹ˆ๋‹ค.
  • ๋น„ํšŒ์›์œผ๋กœ ๋„คํŠธ์›Œํฌ ์—†์ด ์–ด๋””์„œ๋“  ์ƒ๋ฌผ์„ ์ดฌ์˜ํ•ด ๋‚˜๋งŒ์˜ ์ƒ๋ฌผ ๋„๊ฐ์„ ๋งŒ๋“ค์–ด๋ณด์„ธ์š”~!
  • ์ถ”๊ฐ€๋กœ ๋กœ๊ทธ์ธ์„ ํ•˜๋ฉด ์นœ๊ตฌ๋“ค์˜ ์ƒ๋ฌผ ์ง€๋„๋ฅผ ํ•จ๊ป˜ ๋ณผ ์ˆ˜ ์žˆ๋‹ต๋‹ˆ๋‹ค ๐Ÿ˜‰ ํ•จ๊ป˜ ์ฆ๊ฒจ๋ณด์‹œ๋Š” ๊ฒƒ๋„ ์ถ”์ฒœ๋“œ๋ฆฝ๋‹ˆ๋‹ค.

โœจ ์„œ๋น„์Šค ๊ธฐ๋Šฅ ์†Œ๊ฐœ

  • ๐Ÿ“ธ ์ƒ๋ฌผ ์ดฌ์˜ : ์นด๋ฉ”๋ผ๋กœ ์ฃผ๋ณ€์˜ ์ƒ๋ฌผ ์ดฌ์˜
  • ๐Ÿ–ผ๏ธ ์ƒ๋ฌผ ๋„๊ฐ ๋“ฑ๋ก : ๋ผ๋ฒจ๋งํ•˜์—ฌ ๋„๊ฐ์— ์ €์žฅ ๋ฐ ๋„๊ฐ ํ™•์ธ
  • ๐Ÿ—บ๏ธ ์ƒ๋ฌผ ์ง€๋„ ํ™•์ธ : ์ƒ๋ฌผ ๋„๊ฐ์˜ ์œ„์น˜ ๋ณ„๋กœ ํ‘œ์‹œ๋˜๋Š” ์ง€๋„ ํ™•์ธ
  • ๐Ÿคผ ์นœ๊ตฌ์˜ ์ƒ๋ฌผ ์ง€๋„ ๋ณด๊ธฐ : ๋กœ๊ทธ์ธ ํ•˜์—ฌ ์นœ๊ตฌ ์ถ”๊ฐ€ํ•œ ์นœ๊ตฌ๋“ค์˜ ์ƒ๋ฌผ ์ง€๋„ ํ•จ๊ป˜ ๋ณด๊ธฐ


โœจ ์ƒ์„ธ ๊ธฐ๋Šฅ ์š”์•ฝ

04  แ„€แ…ฎแ„Œแ…ฉ


โœจ ์ƒ์„ธ ๊ธฐ๋Šฅ

Nature.Album.-.HD.mp4

๋„๊ฐ ๋“ฑ๋ก
์นด๋ฉ”๋ผ ๊ถŒํ•œ ์ดฌ์˜ & AI ๋ผ๋ฒจ๋ง
permigif aigif
๋„๊ฐ ๋ณด๊ธฐ
๋„๊ฐ ์ƒ์„ธ๋ณด๊ธฐ ๋„๊ฐ ์ด๋ฏธ์ง€ ์•จ๋ฒ”์— ์ €์žฅ ๋„๊ฐ ์ด๋ฏธ์ง€ ์‚ญ์ œ
แ„ƒแ…ฉแ„€แ…กแ†ท แ„‰แ…กแ†ผแ„‰แ…ฆแ„‡แ…ฉแ„€แ…ต แ„‹แ…ขแ†ฏแ„‡แ…ฅแ†ทแ„‹แ…ฆ แ„Œแ…ฅแ„Œแ…กแ†ผ แ„ƒแ…ฉแ„€แ…กแ†ท แ„‰แ…กแ†จแ„Œแ…ฆ
์ง€๋„
๋‚ด ์ง€๋„ ๋ณด๊ธฐ ์นœ๊ตฌ ์ง€๋„ ๋ณด๊ธฐ ๋„คํŠธ์›Œํฌ ์—ฐ๊ฒฐ ํ™•์ธ
๋‚ด ์ง€๋„ ๋ณด๊ธฐ ์นœ๊ตฌ ์ง€๋„ ๋ณด๊ธฐ ๋„คํŠธ์›Œํฌ ์—ฐ๊ฒฐ ํ™•์ธ
๋งˆ์ดํŽ˜์ด์ง€ ๋กœ๊ทธ์ธ ๋ฐ ๋„คํŠธ์›Œํฌ ์—ฐ๊ฒฐ ์ฒ˜๋ฆฌ
๋กœ๊ทธ์ธ ๋„คํŠธ์›Œํฌ ๋งˆ์ดํŽ˜์ด์ง€ ๋™๊ธฐํ™”
๋กœ๊ทธ์ธ ๋„คํŠธ์›Œํฌ ๋งˆ์ดํŽ˜์ด์ง€ ๋™๊ธฐํ™”
๋งˆ์ดํŽ˜์ด์ง€ ์นœ๊ตฌ ๊ธฐ๋Šฅ
์นœ๊ตฌ ๋ชฉ๋ก ์นœ๊ตฌ ๊ฒ€์ƒ‰๊ณผ ๋„คํŠธ์›Œํฌ ๋Œ€์‘
1  ์นœ๊ตฌ ๋ชฉ๋ก 2  ์นœ๊ตฌ ๊ฒ€์ƒ‰ ๋„คํŠธ์›Œํฌ ํฌํ•จ
์นœ๊ตฌ ์š”์ฒญ ๊ฑฐ์ ˆ๊ณผ ์ˆ˜๋ฝ foreground ์นœ๊ตฌ ์š”์ฒญ ์•Œ๋ฆผ
3-4  ์นœ๊ตฌ ์š”์ฒญ ๊ฑฐ์ ˆ๊ณผ ์ˆ˜๋ฝ 3-1  ์นœ๊ตฌ ์š”์ฒญ ํฌ๊ทธ๋ผ์šด๋“œ
background ์นœ๊ตฌ ์š”์ฒญ ์•Œ๋ฆผ ์•ฑ ์ข…๋ฃŒ ์ƒํƒœ์ผ ๋•Œ ์นœ๊ตฌ ์š”์ฒญ ์•Œ๋ฆผ
3-2  ์นœ๊ตฌ ์š”์ฒญ ๋ฐฑ๊ทธ๋ผ์šด๋“œ 3-3  ์นœ๊ตฌ ์š”์ฒญ ์•ฑ ์ข…๋ฃŒ


๐Ÿ’ซ ์„œ๋น„์Šค ๊ตฌ์กฐ

04  แ„€แ…ฎแ„Œแ…ฉ


โœจ ๊ธฐ์ˆ  ์Šคํƒ

๋ถ„์•ผ ๊ธฐ์ˆ  ์Šคํƒ
OS Android
Launguage Kotlin
UI Compose
Network Retrofit
Asynchronous Coroutine, Flow
image Coil
DI Hilt
Background WorkManager
Database Room, FireStore
Map Naver Map
Firebase Firebase Storage, Firebase Cloud Messaging, Cloud Functions
AI Gemini, Green-Eye
Tooling Notion, Figma, Figjam, Github, Git, Zep


๐Ÿ”‘ ํ•ต์‹ฌ ๊ฒฝํ—˜

1. ๋™๊ธฐํ™”

๐Ÿ” ๋ฌธ์ œ ์ƒํ™ฉ

๋™๊ธฐํ™”๋Š” ๋กœ๊ทธ์ธ ์ƒํƒœ์—์„œ ๋งค์ผ ์ž์ •์— WIFI ์—ฐ๊ฒฐ ์ƒํƒœ์—์„œ๋งŒ ์‹คํ–‰์ด ๋ฉ๋‹ˆ๋‹ค.
๋™๊ธฐํ™”๊ฐ€ ํ•„์š”ํ•œ ์ƒํ™ฉ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

  1. ๋น„ํšŒ์›์œผ๋กœ ์‚ฌ์šฉํ•˜๋‹ค ๋กœ๊ทธ์ธํ•˜๋Š” ๊ฒฝ์šฐ
  2. ๋„คํŠธ์›Œํฌ ์—†์ด ์‚ฌ์šฉํ•˜์—ฌ ์„œ๋ฒ„์™€ ๋กœ์ปฌ์˜ ๋ฐ์ดํ„ฐ๊ฐ€ ์ƒ์ดํ•œ ๊ฒฝ์šฐ
  3. ์•ฑ์„ ์žฌ์„ค์น˜ํ•˜๊ฑฐ๋‚˜ ์•ฑ ๋ฐ์ดํ„ฐ๋ฅผ ์‚ญ์ œํ•˜์—ฌ ๋กœ์ปฌ ๋ฐ์ดํ„ฐ๊ฐ€ ๋‚ ์•„๊ฐ„ ๊ฒฝ์šฐ
  4. ๋„คํŠธ์›Œํฌ๊ฐ€ ์—†๋Š” ์ƒํƒœ์—์„œ ๋„๊ฐ์„ ์‚ญ์ œ ๋˜๋Š” ์ถ”๊ฐ€ํ•œ ๊ฒฝ์šฐ

๐Ÿš€ ํ•ด๊ฒฐ ๊ณผ์ •

๋”ฐ๋ผ์„œ ์„œ๋ฒ„์™€ ๋กœ์ปฌ์˜ ๋ฐ์ดํ„ฐ๋ฅผ ๋ชจ๋‘ ๊ฐ€์ ธ์™€ ๋น„๊ตํ•˜์—ฌ ์„œ๋ฒ„์— ํ•„์š”ํ•œ ๋ฐ์ดํ„ฐ, ๋กœ์ปฌ์— ํ•„์š”ํ•œ ๋ฐ์ดํ„ฐ, ์ƒ์ดํ•œ ๋ฐ์ดํ„ฐ๋กœ ๋ถ„๋ฅ˜ํ•œ ๋’ค ์ €์žฅ ๋ฐ ์ˆ˜์ •์ด ์ด๋ฃจ์–ด์ง€๋„๋ก ๊ตฌํ˜„ํ•˜์˜€์Šต๋‹ˆ๋‹ค.

โš ๏ธ ๋ฌธ์ œ์ 

  • ๋ชจ๋‘ ๊ฐ€์ ธ์™€ ๋น„๊ตํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋ฐ์ดํ„ฐ๊ฐ€ ๋งŽ์•„์ง€๋ฉด ๊ทธ๋งŒํผ ์˜ค๋ž˜๊ฑธ๋ฆฌ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.
  • ๋˜ํ•œ ์ง€๊ธˆ์€ ์„œ๋ฒ„์— ํ•„์š”ํ•œ ๋ฐ์ดํ„ฐ, ๋กœ์ปฌ์— ํ•„์š”ํ•œ ๋ฐ์ดํ„ฐ, ์ƒ์ดํ•œ ๋ฐ์ดํ„ฐ ์„ธ ๊ฐ€์ง€ ๋ชจ๋‘ ๊ฐ๊ฐ ํƒ์ƒ‰ํ•˜์—ฌ ์ถ”์ถœํ•˜๊ธฐ ๋•Œ๋ฌธ์— ํšจ์œจ์— ๋Œ€ํ•œ ๋ฌธ์ œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

๐ŸŒŸ ๊ฐœ์„  ๋ฐฉ์•ˆ

  1. ํƒ์ƒ‰ ๋ฐฉ๋ฒ• ์ตœ์ ํ™”
  • ํ˜„์žฌ ํƒ์ƒ‰ ๋ฐฉ๋ฒ•์„ Filter์™€ none, any ํ™•์žฅ ํ•จ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š”๋ฐ ์ด๋Š” for๋ฌธ์œผ๋กœ ํ•˜๋‚˜์”ฉ ํƒ์ƒ‰ํ•˜๋Š” ๋ฐฉ๋ฒ•์œผ๋กœ ํ•œ ๋ฒˆ ํƒ์ƒ‰ํ•  ๋•Œ๋งˆ๋‹ค O(N)์˜ ์‹œ๊ฐ„ ๋ณต์žก๋„๊ฐ€ ์†Œ์š”๋ฉ๋‹ˆ๋‹ค.
  • ๋”ฐ๋ผ์„œ ์ด์ง„ ํƒ์ƒ‰์œผ๋กœ ํƒ์ƒ‰ํ•˜์—ฌ ํƒ์ƒ‰ ์‹œ๊ฐ„์„ ์ค„์ด๋Š” ๋ฐฉ๋ฒ•์„ ์‚ฌ์šฉ >> ๋‹ค๋งŒ ํ˜„์žฌ ๋ฐ์ดํ„ฐ ๋ฆฌ์ŠคํŠธ๋Š” ๊ฐ๊ฐ์˜ ๊ฐ์ฒด ํƒ€์ž…์œผ๋กœ ์ด๋ฃจ์–ด์ ธ ์žˆ์–ด ์ด๋ฅผ ์–ด๋–ป๊ฒŒ ์ด์ง„ ํƒ์ƒ‰์œผ๋กœ ๊ตฌํ˜„ํ•  ์ง€ ๊ณ ๋ฏผ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
  1. Local DB ์†์„ฑ ์ถ”๊ฐ€
  • ์„œ๋น„์Šค์˜ ํŠน์„ฑ์ƒ ์„œ๋ฒ„๋Š” ๋กœ์ปฌ ๋ฐ์ดํ„ฐ์˜ ๋ณ€ํ™”๋ฅผ ํŒŒ์•…ํ•˜๊ธฐ ์–ด๋ ต์ง€๋งŒ ๋กœ์ปฌ์€ ์„œ๋ฒ„์— ์ €์žฅ ๋œ ๋ฐ์ดํ„ฐ๋ฅผ ํŒŒ์•…ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. Local DB์— ์„œ๋ฒ„ ์ €์žฅ ์œ ๋ฌด์— ๋Œ€ํ•œ ์†์„ฑ์„ ์ถ”๊ฐ€ํ•˜์—ฌ ๋ฏธ๋“ฑ๋ก ๋œ ๋ฐ์ดํ„ฐ๋งŒ ๊ฐ€์ ธ์™€ ๋น„๊ตํ•˜๋Š” ๋ฐฉ๋ฒ•์œผ๋กœ ์‹œ๊ฐ„ ๋‹จ์ถ•์„ ๊ธฐ๋Œ€ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  1. ํ•œ ๋ฒˆ์˜ ํƒ์ƒ‰์œผ๋กœ ๋ฐ์ดํ„ฐ ๋ถ„๋ฅ˜
  • ํ•œ ๋ฒˆ์˜ ํƒ์ƒ‰์œผ๋กœ ์„œ๋ฒ„์— ํ•„์š”ํ•œ ๋ฐ์ดํ„ฐ, ๋กœ์ปฌ์— ํ•„์š”ํ•œ ๋ฐ์ดํ„ฐ, ์ƒ์ดํ•œ ๋ฐ์ดํ„ฐ๋ฅผ ์ถ”์ถœ, ํ˜„์žฌ ๊ฐ™์€ ํƒ์ƒ‰์„ 3๋ฒˆ ๋ฐ˜๋ณตํ•˜์—ฌ ์„œ๋กœ ๋‹ค๋ฅธ ๋ฐ์ดํ„ฐ๋ฅผ ์ถ”์ถœํ•˜๊ณ  ์žˆ๋Š”๋ฐ ์ด๋ฅผ ํ•œ ๋ฒˆ์— 3๊ฐ€์ง€์˜ ๋ฐ์ดํ„ฐ๋ฅผ ์ถ”์ถœํ•˜์—ฌ ์‹œ๊ฐ„ ๋‹จ์ถ•์„ ๊ธฐ๋Œ€ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

2. Recomposition ์ตœ์ ํ™”

๊ธฐ์กด ํ•˜์œ„ ์ปดํฌ์ €๋ธ”์ด ๊ฐ€์ง„ ์ƒํƒœ๋ฅผ ํ˜ธ์ด์ŠคํŒ…ํ•จ์œผ๋กœ์จ ๊ณต์œ ํ•˜๊ณ  ์žฌ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ statelessํ•œ ์ปดํฌ์ €๋ธ”๋กœ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค.

ํ˜ธ์ด์ŠคํŒ…๋œ ์ƒํƒœ๋ฅผ ํ•˜์œ„ ์ปดํฌ์ €๋ธ”์—๊ฒŒ ์ฃผ๊ธฐ ์œ„ํ•ด by remember๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐ”๋กœ ๊ฐ’์— ์ ‘๊ทผํ•˜์—ฌ ๊ฐ’ ์ž์ฒด๋ฅผ ์ƒํƒœ๋ฅผ ํ•„์š”๋กœํ•˜๋Š” ์ปดํฌ์ €๋ธ”์—๊ฒŒ ๋„˜๊ฒจ์ฃผ์—ˆ์Šต๋‹ˆ๋‹ค.

๐Ÿ” ๋ฌธ์ œ ์ƒํ™ฉ

ํ•˜์ง€๋งŒ ์œ„ ์ด๋ฏธ์ง€์ฒ˜๋Ÿผ by remember ๋ฅผ ํ†ตํ•ด ๊ฐ’ ์ž์ฒด๋ฅผ ๋„˜๊ฒจ์ค„ ๋•Œ ์ƒํƒœ๋ฅผ ๋Œ์–ด์˜ฌ๋ฆฐ ์œ„์น˜๊นŒ์ง€ ์ „๋ถ€ ๋ฆฌ์ปดํฌ์ง€์…˜์ด ๋˜๋Š” ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.

ํ•˜์ง€๋งŒ ๋ฐ˜๋Œ€๋กœ = remember ๋ฅผ ์‚ฌ์šฉํ•ด State ํƒ€์ž…์„ ๋„˜๊ฒจ์ฃผ์—ˆ์„ ๋•, ์‹ค์ œ ์ƒํƒœ๋ฅผ ์ด์šฉํ•˜๋Š” ์ปดํฌ์ €๋ธ”๋งŒ ๋ฆฌ์ปดํฌ์ง€์…˜์ด ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.

๐Ÿš€ ์›์ธ๊ณผ ํ•ด๊ฒฐ ๊ณผ์ •

๋‘ ์„ ์–ธ ๋ฐฉ์‹์€ ์–ด๋–ค ์ฐจ์ด๊ฐ€ ์žˆ๊ธธ๋ž˜ ๋ฆฌ์ปดํฌ์ง€์…˜ ์ธก๋ฉด์—์„œ ์ „ํ˜€ ๋‹ค๋ฅธ ๊ฒฐ๊ณผ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋Š”์ง€ ์•Œ์•„๋ณด๊ธฐ ์œ„ํ•ด ๋“ค์–ด๊ฐ„ ๋‚ด๋ถ€ ์ฝ”๋“œ์˜ ์„ค๋ช…์—์„œ ์ •๋‹ต์„ ์ฐพ์„ ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

๋‚ด๋ถ€ ์ฝ”๋“œ์—์„œ๋Š” ์•„๋ž˜์™€ ๊ฐ™์€ ์„ค๋ช…์„ ํ†ตํ•ด ์•ˆ๋‚ดํ•˜๊ณ  ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

A mutable value holder where reads to the value property during the execution of a Composable function, the current RecomposeScope will be subscribed to changes of that value.

When the value property is written to and changed, a recomposition of any subscribed RecomposeScopes will be scheduled.

์ปดํฌ์ €๋ธ” ํ•จ์ˆ˜๊ฐ€ ์‹คํ–‰๋˜๋Š” ๋™์•ˆ .value(getValue) ๋ฅผ ์ฝ์œผ๋ฉด ํ˜„์žฌ ์‹คํ–‰์ค‘์ธ ์ปดํฌ์ €๋ธ”์€ ํ•ด๋‹น ์ƒํƒœ์˜ ๋ณ€๊ฒฝ์‚ฌํ•ญ์„ ๊ตฌ๋…(subscribed)ํ•œ๋‹ค.

value ์†์„ฑ์ด ์ž‘์„ฑ๋˜๊ณ  ๋ณ€๊ฒฝ๋˜๋ฉด ํ•ด๋‹น ์ƒํƒœ๋ฅผ ๊ตฌ๋…ํ•œ ์ปดํฌ์ง€์…˜์€ ๋ฆฌ์ปดํฌ์ง€์…˜์˜ ๋Œ€์ƒ์ด๋œ๋‹ค.


์ฆ‰, ์ƒ์œ„ ์ปดํฌ์ €๋ธ”์—์„œ by remember ๋ฅผ ํ†ตํ•ด ๊ฐ’์— ์ ‘๊ทผํ•  ๋•Œ๋Š” ๋‚ด๋ถ€์ ์œผ๋กœ getValue ๋ฅผ ํ†ตํ•ด value ์†์„ฑ์— ์ ‘๊ทผํ–ˆ๊ธฐ์— ๋ฆฌ์ปดํฌ์ง€์…˜์ด ๋Œ€์ƒ์ด ๋˜์—ˆ๋˜ ๊ฒƒ์ด๊ณ , = remember๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ State ํƒ€์ž…์„ ๋„˜๊ฒจ์ฃผ์—ˆ์„ ๋•Œ๋Š” value ์†์„ฑ์— ์ ‘๊ทผํ•œ ๊ฒƒ์ด ์•„๋‹ˆ๊ธฐ์— ๋ฆฌ์ปดํฌ์ง€์…˜ ๋Œ€์ƒ์ด ๋˜์ง€ ์•Š์•˜๋˜ ๊ฒƒ์ด์—ˆ์Šต๋‹ˆ๋‹ค.

โœ… ๊ฒฐ๊ณผ

๋”ฐ๋ผ์„œ, ์ƒํƒœ๋ฅผ ๋Œ์–ด์˜ฌ๋ฆฐ ์œ„์น˜์˜ ์ปดํฌ์ €๋ธ”์—์„œ๋Š” = remember ๋ฅผ ์‚ฌ์šฉํ•˜๊ณ , ์ƒํƒœ๋ฅผ ํ•„์š”๋กœํ•˜๋Š” ํ•˜์œ„ ์ปดํฌ์ €๋ธ”๊นŒ์ง€ State ํƒ€์ž…์„ ๋„˜๊ฒจ์ฃผ๋Š” ๊ฒƒ์œผ๋กœ ๋ฆฌ์ปดํฌ์ง€์…˜ ์ตœ์ ํ™”๋ฅผ ํ•  ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.



3. FCM ๊ตฌํ˜„: ๋ฐฑ์—”๋“œ ๋ฌธ์ œ ํ•ด๊ฒฐ

๐Ÿ” ๋ฌธ์ œ ์ƒํ™ฉ

FCM(Firebase Cloud Messaging)์œผ๋กœ ์นœ๊ตฌ ์š”์ฒญ ์•Œ๋ฆผ์„ ๊ตฌํ˜„ํ•˜๋ ค ํ–ˆ์œผ๋‚˜, ์„œ๋ฒ„๊ฐ€ ํ•„์š”ํ–ˆ๊ณ , ํŒ€์— ๋ฐฑ์—”๋“œ ๊ฐœ๋ฐœ์ž๊ฐ€ ์—†๋Š” ์ƒํ™ฉ์ด์—ˆ๋‹ค.

๐Ÿš€ ํ•ด๊ฒฐ ๊ณผ์ •

  1. Firebase Cloud Functions ํ™œ์šฉ
    • Spring ์„œ๋ฒ„ ๋Œ€์‹  Firebase Cloud Functions๋กœ ์„œ๋ฒ„ ์—ญํ•  ๋Œ€์ฒด.
    • Firestore ํŠธ๋ฆฌ๊ฑฐ(onCreate)๋ฅผ ํ™œ์šฉํ•ด ์นœ๊ตฌ ์š”์ฒญ ๋ฌธ์„œ ์ƒ์„ฑ ์‹œ FCM ์•Œ๋ฆผ ์ „์†ก ๋กœ์ง ๊ตฌํ˜„.
  2. ๋ฌธ์ œ ํ•ด๊ฒฐ
    • Firebase ์„ค์ • ์˜ค๋ฅ˜๋ฅผ ํ•ด๊ฒฐํ•˜๋ฉฐ, ๋ฐฑ๊ทธ๋ผ์šด๋“œ ๋ฐ ์ข…๋ฃŒ ์ƒํƒœ์—์„œ๋„ ์ •์ƒ ์ž‘๋™ ํ™•์ธ.

โœ… ๊ฒฐ๊ณผ

  • Firebase Functions์™€ Firestore ํŠธ๋ฆฌ๊ฑฐ๋ฅผ ํ†ตํ•ด ์นœ๊ตฌ ์š”์ฒญ ์•Œ๋ฆผ ์ž๋™ ์ „์†ก ์„ฑ๊ณต.
  • ๋ฐฑ์—”๋“œ ํ•™์Šต์„ ํ†ตํ•ด ํด๋ผ์ด์–ธํŠธ ๊ฐœ๋ฐœ์ž๋กœ์„œ ๊ธฐ์ˆ ์  ํ•œ๊ณ„๋ฅผ ๊ทน๋ณต.

๐ŸŒŸ ๋ฐฐ์šด ์  ๋ฐ ์„ฑ์žฅ

  • ๊ธฐ์ˆ  ๊ฒฝ๊ณ„๋ฅผ ๋„˜๋Š” ํƒœ๋„: ๋ฐฑ์—”๋“œ ๋ฌธ์ œ๋ฅผ ์ง์ ‘ ํ•ด๊ฒฐํ•˜๋ฉฐ ๋„์ „ ์ •์‹ ๊ณผ ๋ฌธ์ œ ํ•ด๊ฒฐ ๋Šฅ๋ ฅ์„ ํ‚ค์›€.
  • ๊ธฐ์ˆ  ํ™•์žฅ ๊ฒฝํ—˜: Firebase Cloud Functions์™€ Firestore ํŠธ๋ฆฌ๊ฑฐ๋ฅผ ํ™œ์šฉํ•ด ํด๋ผ์ด์–ธํŠธ-์„œ๋ฒ„ ์—ฐ๋™ ์ดํ•ด๋„ ํ–ฅ์ƒ.

4. MapView์™€ Coil ์ด๋ฏธ์ง€ ๋กœ๋”ฉ ๋ฐ Compose-View ๋ผ์ดํ”„์‚ฌ์ดํด ๊ด€๋ฆฌ

๐Ÿ” ๋ฌธ์ œ ์ƒํ™ฉ

  1. Marker์˜ ์•„์ด์ฝ˜์„ ๋ทฐ๋กœ ์ƒ์„ฑํ• ๋•Œ attach๋ฅผ ํ•˜์ง€ ์•Š๊ณ  ๋ฐ”๋กœ ๋น„ํŠธ๋งต์œผ๋กœ ๋ณ€ํ™˜ํ•ด์„œ ๋‚ด๋ถ€์˜ ์ด๋ฏธ์ง€ ๋น„๋™๊ธฐ ๋กœ๋”ฉ์ด ๋™์ž‘ํ•˜์ง€ ์•Š์Œ.
  2. Compose์—์„œ MapView์˜ ๋ผ์ดํ”„์‚ฌ์ดํด์„ ๊ด€๋ฆฌํ•ด์•ผํ•จ.

๐Ÿš€ ํ•ด๊ฒฐ ๊ณผ์ •

  1. Marker - Coil ์ด๋ฏธ์ง€ ๋กœ๋“œ
    • ๋งˆ์ปค์˜ ์•„์ด์ฝ˜์œผ๋กœ ์‚ฌ์šฉํ•  ์ปค์Šคํ…€ ๋ทฐ ์ œ์ž‘.
    • ์ปค์Šคํ…€ ๋ทฐ์— uri๋ฅผ ์„ค์ •ํ•˜๋Š” ๋ฉ”์†Œ๋“œ๋ฅผ ์ถ”๊ฐ€ํ•ด coil๋กœ ์ด๋ฏธ์ง€ ๋กœ๋“œ.
    • ๋งˆ์ปค๋ฅผ invisible์ธ ์ƒํƒœ๋กœ ๋งต๋ทฐ์— add
    • ImageView.load์˜ ์ด๋ฏธ์ง€ ๋กœ๋“œ ์ƒํƒœ ๋ฆฌ์Šค๋„ˆ์—์„œ ๋งˆ์ปค์˜ ์•„์ด์ฝ˜์„ ์—…๋ฐ์ดํŠธํ•˜๋Š” ์ฝœ๋ฐฑ ์‹คํ–‰
  2. Compose-View ๋ผ์ดํ”„์‚ฌ์ดํด ๋™๊ธฐํ™”
    • DisposableEffect์™€ LifecycleObserver๋ฅผ ํ™œ์šฉํ•ด MapView์™€ Compose ์ƒ๋ช…์ฃผ๊ธฐ๋ฅผ ํ†ตํ•ฉ ๊ด€๋ฆฌ.
    • onDispose์—์„œ ๋ฉ”๋ชจ๋ฆฌ ์ •๋ฆฌ

โœ… ๊ฒฐ๊ณผ

  • Coil๋กœ Marker์— ์ •์ƒ์ ์œผ๋กœ ์ด๋ฏธ์ง€ ๋กœ๋”ฉ.
  • ๋งˆ์ปค์˜ ์ด๋ฏธ์ง€ ๋กœ๋“œ ์‹œ์ž‘, ์‹คํŒจ์‹œ ์•„์ด์ฝ˜ ๋ณ€๊ฒฝ
  • Compose์™€ MapView๋ฅผ ์•ˆ์ •์ ์œผ๋กœ ํ†ตํ•ฉ ๊ด€๋ฆฌ.

๐ŸŒŸ ๋ฐฐ์šด ์  ๋ฐ ์„ฑ์žฅ

  • ์ƒ๋ช…์ฃผ๊ธฐ ๊ด€๋ฆฌ ์ดํ•ด: Compose์™€ View์˜ ๋…๋ฆฝ์  ๋ผ์ดํ”„์‚ฌ์ดํด์„ ํ†ตํ•ฉ ๊ด€๋ฆฌํ•˜๋Š” ๋ฐฉ๋ฒ• ํ•™์Šต.
  • ๋น„๋™๊ธฐ ์ฒ˜๋ฆฌ ์ตœ์ ํ™”: ์ •์ ์ธ UI์™€ ๋น„๋™๊ธฐ๋กœ ๋™์ž‘๋˜๋Š” UI์˜ ์—ฐ๋™๋ฐฉ๋ฒ• ํ•™์Šต.
  • ํ†ตํ•ฉ ๊ด€๋ฆฌ ๊ฒฝํ—˜: Compose์™€ ๊ธฐ์กด View๋ฅผ ํ•จ๊ป˜ ์‚ฌ์šฉํ•˜๋Š” ๊ธฐ์ˆ ์  ์ž์‹ ๊ฐ ํ™•๋ณด.

๐Ÿ“” ๋ฌธ์„œ

Nature Album Wiki์—์„œ ์šฐ๋ฆฌ์˜ ๋ชจ๋“  ์—ฌ์ •์„ ํ™•์ธํ•˜์„ธ์š”!
์•„์ด๋””์–ด๋ถ€ํ„ฐ ๊ฐœ๋ฐœ, ๊ทธ๋ฆฌ๊ณ  ํ•ด๊ฒฐ ๊ณผ์ •๊นŒ์ง€, ๋ชจ๋“  ์ด์•ผ๊ธฐ๊ฐ€ ๋‹ด๊ฒจ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ถ๊ธˆํ•˜์‹œ๋‹ค๋ฉด ์ง€๊ธˆ ๋ฐ”๋กœ ํ™•์ธํ•ด๋ณด์„ธ์š”! ๐Ÿš€



๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ ์ „๊ตญ๊ตฌ ํŒ€ ๊ตฌ์„ฑ

์ •์œ ์ง„ ์ž„ํ˜•์ค€ ๊น€๋„์œค ๋…ธ์ง„ํ™˜ ๊น€์ •ํ˜ธ

About

๐Ÿ€ ์ฃผ๋ณ€์˜ ๋‹ค์–‘ํ•œ ์ƒ๋ฌผ์„ ์ดฌ์˜ํ•˜๊ณ  ์‹๋ณ„ํ•˜์—ฌ ๋‚˜๋งŒ์˜ ์ƒ๋ฌผ ๋„๊ฐ์„ ๋งŒ๋“ค๊ณ , ์ƒ๋ฌผ ์ง€๋„๋ฅผ ์นœ๊ตฌ์™€ ํ•จ๊ป˜ ํ™•์ธํ•ด๋ณด์•„์š”~

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published