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

๋นˆ ๊ตฌ๋ฉ ์ฑ„์šฐ๊ธฐ

[Android][View] decor view

๊ณต์‹ ๋ ˆํผ๋Ÿฐ์Šค ๋ฌธ์„œ์—์„œ์˜ ๋“ฑ์žฅ

Window์˜ getDecorView()๋กœ ๋ฐ˜ํ™˜๋˜๋Š” ๊ฐ์ฒด.

 

public abstract View getDecorView()

 

Returns the top-level window decor view. This value cannot be null.

๋ฐœ๋ฒˆ์—ญ

์ตœ์ƒ๋‹จ ์œˆ๋„์šฐ decor view๋ฅผ ๋ฐ˜ํ™˜ํ•จ. null์„ ๋ฐ˜ํ™˜ํ•  ์ˆ˜ ์—†์Œ.

 

Retrieve the top-level window decor view (containing the standard window frame/decorations and the client's content inside of that), which can be added as a window to the window manager.

๋ฐœ๋ฒˆ์—ญ

์ตœ์ƒ๋‹จ ์œˆ๋„์šฐ decor view(๊ธฐ๋ณธ  ์œˆ๋„์šฐ ํ”„๋ ˆ์ž„/์žฅ์‹๊ณผ ์œˆ๋„์šฐ ํ”„๋ ˆ์ž„/์žฅ์‹ ์•ˆ์— ํด๋ผ์ด์–ธํŠธ์˜ ์ฝ˜ํ…์ธ ๋ฅผ ํฌํ•จํ•œ๋‹ค.)๋ฅผ ๋ฐ˜ํ™˜ํ•œ๋‹ค. decor view๋Š” window manager์— window๋กœ ์ถ”๊ฐ€๋  ์ˆ˜ ์žˆ๋‹ค. 

 

์Šคํƒ์˜ค๋ฒ„ํ”Œ๋กœ์šฐ ๋ฐ ๋‹ค๋ฅธ ๋ธ”๋กœ๊ทธ ๊ธ€

์œˆ๋„์šฐ์˜ ํ”„๋ ˆ์ž„? ์œˆ๋„์šฐ์˜ ์žฅ์‹? ๋ˆ„๊ตฐ๊ฐ€๊ฐ€ ์ด๋ฏธ ๋‚˜์™€ ๊ฐ™์€ ์งˆ๋ฌธ์€ ํ•œ ๊ฒƒ์„ ์ฐพ์•˜๋‹ค.

https://stackoverflow.com/questions/23276847/what-is-an-android-decorview

 

What is an Android DecorView?

http://developer.android.com/reference/android/view/Window.html#getDecorView(): Retrieve the top-level window decor view (containing the standard window frame/decorations and the client's

stackoverflow.com

 

์• ์„ํ•˜๊ฒŒ๋„ ๋‹ต๋ณ€์—์„œ ๋งํฌ ๊ฑธ์–ด์ค€ ๋ธ”๋กœ๊ทธ์˜ ๊ธ€์€ ๋” ์ด์ƒ ๋‚จ์•„์žˆ์ง€ ์•Š์€ ๋“ฏ ํ•˜๋‹ค.

 

The DecorView is the view that actually holds the window’s background drawable. Calling getWindow().setBackgroundDrawable() from your Activity changes the background of the window by changing the DecorView‘s background drawable. As mentioned before, this setup is very specific to the current implementation of Android and can change in a future version or even on another device.

๋ฐœ๋ฒˆ์—ญ

DecorView๋Š” ์œˆ๋„์šฐ์˜ ๋ฐฑ๊ทธ๋ผ์šด๋“œ ๋“œ๋Ÿฌ์›Œ๋ธ”์„ ์‹ค์ œ๋กœ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ๋ทฐ์ž…๋‹ˆ๋‹ค. Activity์—์„œ getWindow().setBackgroundDrawable()์„ ํ˜ธ์ถœํ•ด DecorView์˜ ๋ฐฑ๊ทธ๋ผ์šด๋“œ ๋“œ๋กœ์›Œ๋ธ”์„ ๋ฐ”๊ฟˆ์œผ๋กœ์จ ์œˆ๋„์šฐ์˜ ๋ฐฑ๊ทธ๋ผ์šด๋“œ๋ฅผ ๋ฐ”๊ฟ‰๋‹ˆ๋‹ค. ์ „์— ์–ธ๊ธ‰ํ–ˆ๋“ฏ์ด, ์ด ์„ค์ •์€ Android์˜ ํ˜„์žฌ ๊ตฌํ˜„์—๋Š” ์•„์ฃผ ํŠน๋ณ„ํ•ด์„œ ์ฐจํ›„ ๋ฒ„์ „์ด๋‚˜ ๋‹ค๋ฅธ ๋‹จ๋ง์—์„œ๋Š” ๋ฐ”๋€” ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. 

 

the decor view is the true root of the Window's view hierarchy. It contains both the "decor" (i.e. the window's title (action bar?), or a dialog's "frame" (~= the view which draws the actual pixels of the dialog frame, as seen in pre-Holo) and also contains the app-supplied content view. AFAIK it exists entirely within the bounds of the window, and does not surround it, and is not itself a window in any sense. 

๋ฐœ๋ฒˆ์—ญ

decor view๋Š” ์œˆ๋„์šฐ์˜ ๋ทฐ ๊ณ„์ธต์˜ ์ง„์งœ ๋ฃจํŠธ์ž…๋‹ˆ๋‹ค. ์ด๊ฑด "decor"(์ฆ‰, ์œˆ๋„์šฐ์˜ ํƒ€์ดํ‹€(์•ก์…˜๋ฐ”?))๋‚˜ ๋‹ค์ด์–ผ๋กœ๊ทธ์˜ "ํ”„๋ ˆ์ž„"(~=pre Holo์—์„œ ๋ณด์ด๋“ฏ์ด, ๋‹ค์ด์–ผ๋กœ๊ทธ ํ”„๋ ˆ์ž„์˜ ์‹ค์ œ ํ”ฝ์…€์„ ๊ทธ๋ฆฌ๋Š” ๋ทฐ)์„ ํฌํ•จํ•˜๊ณ  ์•ฑ์ด ์ œ๊ณตํ•˜๋Š” ์ฝ˜ํ…์ธ  ๋ทฐ๋„ ๋˜ํ•œ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค. ์ œ๊ฐ€ ์•Œ๊ธฐ๋ก  ์ด๊ฒƒ์€ ์œˆ๋„์šฐ์˜ ๊ฒฝ๊ณ„ ์•ˆ์ชฝ์— ์ „๋ถ€๋ฅผ ์ฐจ์ง€ํ•˜๊ณ  ์žˆ๊ณ , ๊ฒฝ๊ณ„๋ฅผ ๋‘๋ฅด์ง€๋Š” ์•Š์Šต๋‹ˆ๋‹ค. ์–ด๋–ค ์˜๋ฏธ๋กœ๋“  ์œˆ๋„์šฐ ์ž์ฒด๋Š” ์•„๋‹™๋‹ˆ๋‹ค.

 

DecorView๋ฅผ ์„ค๋ช…ํ•ด์ฃผ๋Š” ๋‹ค๋ฅธ ๊ธ€์„ ์ฐพ์•˜๋‹ค.

https://medium.com/@yonghan_89267/android-window-8c2edbcdebe8

 

Android Window

Android Window

medium.com

 

DecorView๋Š” Activity์˜ ์ตœ์ƒ๋‹จ ๋ฃจํŠธ ๋ทฐ๋กœ, ์œˆ๋„์šฐ์˜ ๋ฐฐ๊ฒฝ์„ ๋‹ด๋‹นํ•˜๋Š” ๋“ฏ ํ•˜๋‹ค.

 

์“ฐ์ž„

decor view๋ฅผ ํ†ตํ•ด ์‹œ์Šคํ…œ ๋ฐ”(ํ™”๋ฉด ์ƒ๋‹จ์˜ ์ƒํƒœ ๋ฐ” + ํ™”๋ฉด ํ•˜๋‹จ์˜ ๋„ค๋น„๊ฒŒ์ด์…˜ ๋ฐ”)์˜ ๋…ธ์ถœ, ์ˆจ๊น€ ๋“ฑ์˜ ์ œ์–ด๊ฐ€ ๊ฐ€๋Šฅํ•˜๋‹ค๋Š” ๊ฒƒ์„ ์•Œ์•˜๋‹ค. ๊ณต๋ถ€ํ•˜๋‹ค ๋ณด๋‹ˆ Android R์„ ๊ธฐ์ค€์œผ๋กœ ๊ธฐ๋Šฅ ๊ตฌํ˜„ ๋ฐฉ์‹์ด ๋‹ฌ๋ผ์ง„๋‹ค. ๋‚ด์šฉ์ด ๊ธธ์–ด์ ธ์„œ ๊ด€๋ จ๋œ ์ƒ์„ธ ๋‚ด์šฉ์€ ๋‹ค๋ฅธ ๊ธ€์—์„œ ์ž‘์„ฑํ•˜๋ ค๊ณ  ํ•œ๋‹ค. > ์ž‘์„ฑํ–ˆ๋‹ค. ์‹œ์Šคํ…œ๋ฐ” ์ œ์–ด ๊ธ€ 

 

์ „์ฒด ํ™”๋ฉด ๋ชจ๋“œ ์‚ฌ์šฉ ์„ค์ • ์‹œ

2023๋…„ 2์›” 16์ผ ๊ธฐ์ค€์œผ๋กœ, ์ด ํ•œ๊ตญ์–ด ๋ฒˆ์—ญ ๋ฌธ์„œ๋Š” Android R ์ด์ „ ๋ฐฉ์‹์„ ์„ค๋ช…ํ•œ๋‹ค.

https://developer.android.com/training/system-ui/immersive?hl=ko 

 

์ „์ฒด ํ™”๋ฉด ๋ชจ๋“œ ์‚ฌ์šฉ ์„ค์ •  |  Android ๊ฐœ๋ฐœ์ž  |  Android Developers

์ „์ฒด ํ™”๋ฉด ๋ชจ๋“œ ์‚ฌ์šฉ ์„ค์ • ์ปฌ๋ ‰์…˜์„ ์‚ฌ์šฉํ•ด ์ •๋ฆฌํ•˜๊ธฐ ๋‚ด ํ™˜๊ฒฝ์„ค์ •์„ ๊ธฐ์ค€์œผ๋กœ ์ฝ˜ํ…์ธ ๋ฅผ ์ €์žฅํ•˜๊ณ  ๋ถ„๋ฅ˜ํ•˜์„ธ์š”. ๋™์˜์ƒ, ๊ฒŒ์ž„, ์ด๋ฏธ์ง€ ๊ฐค๋Ÿฌ๋ฆฌ, ์ฑ…, ํ”„๋ ˆ์  ํ…Œ์ด์…˜ ์Šฌ๋ผ์ด๋“œ ๊ฐ™์€ ์ฝ˜ํ…์ธ ๋ฅผ ์ด์šฉํ•˜๊ธฐ

developer.android.com

 

์›๋ฌธ์—์„œ Android R ์ดํ›„ ๋ฒ„์ „ ๋ฐฉ์‹์œผ๋กœ ์ „์ฒด ํ™”๋ฉด ๋ชจ๋“œ ์„ค์ • ๋ฐฉ๋ฒ•์„ ์„ค๋ช…ํ•œ๋‹ค.

https://developer.android.com/develop/ui/views/layout/immersive#kotlin

 

Hide system bars for immersive mode  |  Android Developers

Some content is best experienced in fullscreen without any indicators on the status bar or the navigation bar. Some examples are videos, games, image galleries, books, and presentation slides. This is referred to as immersive mode. This page shows how you

developer.android.com

 

 

์‹œ์Šคํ…œ ์ƒํƒœ ํ‘œ์‹œ์ค„ ์ œ์–ด

Android R ์ด์ „ ๋ฐฉ์‹์„ ์„ค๋ช…ํ•œ๋‹ค.

https://developer.android.com/training/system-ui/dim?hl=ko 

 

์‹œ์Šคํ…œ ํ‘œ์‹œ์ค„ ํ๋ฆฌ๊ฒŒ ํ•˜๊ธฐ  |  Android ๊ฐœ๋ฐœ์ž  |  Android Developers

์‹œ์Šคํ…œ ํ‘œ์‹œ์ค„ ํ๋ฆฌ๊ฒŒ ํ•˜๊ธฐ ์ปฌ๋ ‰์…˜์„ ์‚ฌ์šฉํ•ด ์ •๋ฆฌํ•˜๊ธฐ ๋‚ด ํ™˜๊ฒฝ์„ค์ •์„ ๊ธฐ์ค€์œผ๋กœ ์ฝ˜ํ…์ธ ๋ฅผ ์ €์žฅํ•˜๊ณ  ๋ถ„๋ฅ˜ํ•˜์„ธ์š”. ์ด ๊ณผ์ •์—์„œ๋Š” Android 4.0(API ์ˆ˜์ค€ 14) ์ด์ƒ์—์„œ ์‹œ์Šคํ…œ ํ‘œ์‹œ์ค„(์ฆ‰, ์ƒํƒœ ํ‘œ์‹œ์ค„ ๋ฐ

developer.android.com

 

์‹œ์Šคํ…œ ์ƒํƒœ ํ‘œ์‹œ์ค„ ๋ณ€๊ฒฝ ๋ฆฌ์Šค๋„ˆ ์ œ๊ณต

Android R ์ด์ „ ๋ฐฉ์‹์„ ์„ค๋ช…ํ•œ๋‹ค.

https://developer.android.com/training/system-ui/visibility?hl=ko 

 

UI ๊ฐ€์‹œ์„ฑ ๋ณ€๊ฒฝ์— ์‘๋‹ต  |  Android ๊ฐœ๋ฐœ์ž  |  Android Developers

UI ๊ฐ€์‹œ์„ฑ ๋ณ€๊ฒฝ์— ์‘๋‹ต ์ปฌ๋ ‰์…˜์„ ์‚ฌ์šฉํ•ด ์ •๋ฆฌํ•˜๊ธฐ ๋‚ด ํ™˜๊ฒฝ์„ค์ •์„ ๊ธฐ์ค€์œผ๋กœ ์ฝ˜ํ…์ธ ๋ฅผ ์ €์žฅํ•˜๊ณ  ๋ถ„๋ฅ˜ํ•˜์„ธ์š”. ์ด ๊ณผ์ •์—์„œ๋Š” ์•ฑ์ด ์‹œ์Šคํ…œ UI ๊ฐ€์‹œ์„ฑ ๋ณ€๊ฒฝ์— ๊ด€ํ•œ ์•Œ๋ฆผ์„ ๋ฐ›์„ ์ˆ˜ ์žˆ๋„๋ก ๋ฆฌ์Šค๋„ˆ๋ฅผ ๋“ฑ

developer.android.com