Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Lobby Start ( 1 ) #3

Merged
merged 8 commits into from
Dec 9, 2024
Merged

[Feature] Lobby Start ( 1 ) #3

merged 8 commits into from
Dec 9, 2024

Conversation

gjsk132
Copy link
Owner

@gjsk132 gjsk132 commented Dec 9, 2024

1. ๐Ÿ“„ ์ž‘์—…ํ•œ ๋‚ด์šฉ ( ์ด์Šˆ )

#2 ๋กœ๋น„ํ™”๋ฉด ๊ตฌํ˜„ 1์ฐจ ๋””์ž์ธ

๋งต์„ ๋งŒ๋“ค์–ด์„œ ์ €์žฅํ•ด์•ผ ๋ฐฉ ์ƒ์„ฑ๊ณผ ์ฝ”๋“œ ์ž…๋ ฅ์ด ๊ฐ€๋Šฅํ•ด์„œ ์ผ๋‹จ ๋””์ž์ธ๋งŒ.

2. ๐Ÿ“ธ ์Šคํฌ๋ฆฐ์ƒท

image

3. ๋ฉ”๋ชจ

Custom View ๋งŒ๋“ค๊ธฐ

Custom View
๋ฏธ๋ฆฌ ๋งŒ๋“ค์–ด ๋†“์€ ๋ทฐ๊ฐ€ ์•„๋‹ˆ๋ผ ๋‚ด๊ฐ€ ์›ํ•˜๋Š” ๋ชจ์–‘๊ณผ ๊ธฐ๋Šฅ์„ ์ง์ ‘ ์ •์˜ํ•˜์—ฌ ๋งŒ๋“  ๋ทฐ

ํ•ด๋‹น ํ™”๋ฉด์— Custom View๊ฐ€ 2๊ฐœ ์žˆ๋‹ค.

๋น„์Šทํ•œ ๋””์ž์ธ์— ๋‹ค์–‘ํ•œ ๊ณณ์— ์ ์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ Custom View๋ฅผ ์‚ฌ์šฉํ–ˆ๋‹ค.
๋””์ž์ธ์„ ํ†ต์ผ์„ฑ์žˆ๊ฒŒ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๊ณ , ์žฌ์‚ฌ์šฉ์„ฑ์ด ์ข‹์•„ ์ค‘๋ณต ์ฝ”๋“œ๋ฅผ ์ค„์ผ ์ˆ˜ ์žˆ์„ ๊ฒƒ์ด๋‹ค.

  1. ์ž์ฃผ ๋“ฑ์žฅํ•˜๋Š” ์ž‘์€ ๋ฒ„ํŠผ (SmallButton)
  2. Dialog ๊ธฐ๋ฐ˜ (DialogBase)

1 ) SmallButton

image

<declare-styleable name="SmallButton">
    <attr name="text" format="string"/>
    <attr name="text_color" format="color"/>
    <attr name="enable" format="boolean"/>
</declare-styleable>

text : ๋ฒ„ํŠผ ๊ธ€์ž
text_color : ๊ธ€์ž ์ƒ‰
enable : ํ™œ์„ฑํ™” ์—ฌ๋ถ€ ( ํŠน์ • ์กฐ๊ฑด์ด ๋˜์–ด์•ผ ํ„ฐ์น˜ ๊ฐ€๋Šฅํ•˜๋„๋ก ์„ค์ • )

2 ) DialogBase

image

<declare-styleable name="DialogBase">
    <attr name="sub_title" format="string"/>
    <attr name="description" format="string"/>
    <attr name="add_icon_visible" format="boolean"/>
    <attr name="is_buttons" format="boolean"/>
</declare-styleable>

sub_title : ์ƒ๋‹จ ์ œ๋ชฉ
description : ์ขŒ์ƒ๋‹จ ๊ฐ„๋žต ์„ค๋ช…
add_icon_visible : ์˜ค๋ฅธ์ชฝ icon ( ์ผ๋‹จ add ๋ฐ–์— ์—†์–ด์„œ, ํ•˜๋‚˜๋กœ๋งŒ ์„ค์ •ํ•˜๊ณ , ์žˆ๊ณ  ์—†๊ณ ๋กœ ๊ตฌํ˜„ )
is_buttons : ํ•˜๋‹จ์— ๋ฒ„ํŠผ์„ ๋„ฃ์„ ๊ฒƒ์ธ์ง€ ์—ฌ๋ถ€

DialogBase์•ˆ์—๋Š” 2๊ฐœ์˜ layout์„ ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.
dialog_contetns : dialog๋งˆ๋‹ค ๋“ค์–ด๊ฐˆ ์ฃผ์š” ๋‚ด์šฉ๋“ค FrameLayout
button_contents : ๊ฐ์ข… ์ƒํ˜ธ์ž‘์šฉํ•˜๋Š” ๋ฒ„ํŠผ์ด ๋“ค์–ด๊ฐˆ LinearLayout
image

Dialog๋Š” ๊ฐ์ข… ๊ธฐ๊ธฐ ํ™”๋ฉด ๋น„์œจ์— ๋งž์ถฐ์„œ ๋†’์ด๊ฐ€ ์ง€์ •๋œ๋‹ค. ( ๋ฐ˜์‘ํ˜• )

์ด์— ๋งž์ถฐ Dialog ์ƒ๋‹จ Title์ด๋ž‘ ํ•˜๋‹จ ๋ฒ„ํŠผ์ด ๋“ค์–ด๊ฐˆ ๊ณต๊ฐ„์„ ์ œ์™ธํ•˜๊ณ ๋Š” dialog_contents๋ฅผ ์ตœ๋Œ€ ํฌ๊ธฐ๋กœ ๋“ค์–ด๊ฐ„๋‹ค.
dialog์— ๋“ค์–ด๊ฐˆ ๋‚ด์šฉ๋“ค๋งŒ xml๋งŒ ๋”ฐ๋กœ ๊ด€๋ฆฌํ•ด์ฃผ๋ฉด์„œ, ์›ํ•˜๋Š” layout View๋ฅผ ๋„ฃ์„ ์ˆ˜ ์žˆ๋‹ค๋Š” ์žฅ์ ์ด ์žˆ์„ ๊ฒƒ ๊ฐ™์•„์„œ ์‚ฌ์šฉํ•ด๋ณธ๋‹ค.

view binding์„ ๊ธฐ๋ฐ˜์œผ๋กœ ์ฝ”๋“œ๋ฅผ ์งœ๊ณ  ์žˆ๋Š”๋ฐ, ๊ฒฐ๊ตญ findViewId๋ฅผ ์จ์•ผํ•˜๋Š” ๋ถ€๋ถ„์ด ์ƒ๊ธด๋‹ค...
์ด๊ฑธ ์•ˆ ์“ธ ์ˆ˜ ์žˆ๋Š” ๋ฐฉ๋ฒ•์€ ์—†์„๊นŒ...๐Ÿค”

@gjsk132 gjsk132 added the Title label Dec 9, 2024
@gjsk132 gjsk132 linked an issue Dec 9, 2024 that may be closed by this pull request
8 tasks
@gjsk132 gjsk132 merged commit cb28377 into main Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Lobby - start
1 participant