Skip to content

Lee hyungjun/step.01#5

Open
LEE-HYUNGJUN wants to merge 3 commits intoStep.01-Solution-Databinding-Start_use_local_valuefrom
LEE-HYUNGJUN/Step.01
Open

Lee hyungjun/step.01#5
LEE-HYUNGJUN wants to merge 3 commits intoStep.01-Solution-Databinding-Start_use_local_valuefrom
LEE-HYUNGJUN/Step.01

Conversation

@LEE-HYUNGJUN
Copy link
Copy Markdown

step01 ์™„๋ฃŒ

jinsu4755 and others added 3 commits December 31, 2020 14:03
๊ทธ๋ƒฅ ์–ด๋–ป๊ฒŒ ์“ฐ๋Š”์ง€ ๊ฐ•์˜ํ•˜๋ ค๊ณ  ๋„ฃ์Œ
step01์˜ todo๋ฅผ ๋ชจ๋‘ ์ฒ˜๋ฆฌํ–ˆ์Šต๋‹ˆ๋‹ค.

Related to #3
@LEE-HYUNGJUN LEE-HYUNGJUN added the ํ˜•์ค€ ๋‹ด๋‹น์ž: ํ˜•์ค€ label Dec 31, 2020
@LEE-HYUNGJUN LEE-HYUNGJUN self-assigned this Dec 31, 2020
Copy link
Copy Markdown
Author

@LEE-HYUNGJUN LEE-HYUNGJUN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ง„์ˆ˜์˜ ํ•จ์ˆ˜ ๋งค๊ฐœ๋ณ€์ˆ˜์™€ ์ œ๊ฐ€ ์‚ฌ์šฉํ•œ ํ•จ์ˆ˜์˜ ๋งค๊ฐœ๋ณ€์ˆ˜๊ฐ€ ๋‹ฌ๋ž์Šต๋‹ˆ๋‹น

val binding: ActivityMainBinding =
DataBindingUtil.setContentView(this, R.layout.activity_main)
initProfileImage(binding.imageProfileImage)
setProfileName(binding.textProfileName, DEFAULT_USER_NAME)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ €๊ฐ™์€ ๊ฒฝ์šฐ๋Š” ์ „์—ญ๋ณ€์ˆ˜๋กœ binding์„ ์„ ์–ธํ–ˆ๊ณ , ํ•จ์ˆ˜์˜ ๋งค๊ฐœ๋ณ€์ˆ˜๊ฐ€ ๋‹ค๋ฅธ ๊ฒƒ ๋ง๊ณ ๋Š” ์ง„ํ–‰ ์ƒํ™ฉ์€ ๊ฐ™์•˜์Šต๋‹ˆ๋‹ค

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์•„์ฃผ ์ข‹์•„!
์ด๊ฑด ๋‚ด ๊ฐœ์ธ์ ์ธ ์ƒ๊ฐ์ด์—ˆ๋Š”๋ฐ binding value๋ฅผ ์ „์—ญ์œผ๋กœ ์„ ์–ธํ•  ํ•„์š”๊ฐ€ ์žˆ์„๊นŒ? ์ƒ๊ฐํ–ˆ์—ˆ์–ด.
Activity๋Š” ๋ทฐ์—์„œ ์ผ์–ด๋‚  ์–ด๋–ค ํ™œ๋™๋“ค? ๊ทธ์ค‘์—์„œ๋„ ์ƒ๋ช…์ฃผ๊ธฐ์™€ ์—ฐ๊ฒฐ์ด ๊ฐ•ํ•œ ํ™œ๋™๋“ค์ด ์ผ์–ด๋‚˜๋Š” ์ฑ…์ž„์ด๋ผ๊ณ  ์ƒ๊ฐํ–ˆ๊ธฐ์—
๊ฒฐ๊ตญ binding value๋Š” ๋‚ด๊ฐ€ ๋ทฐ๋ฅผ ์ปจํŠธ๋กค ํ•˜๋ฉด์„œ ์ƒ๊ธฐ๋Š” ์ผ์ด๋ผ ์ „์—ญ์œผ๋กœ ์“ฐ๊ธฐ๋ณด๋‹ค๋Š” ๋ฒ”์œ„๋ฅผ ์ค„์—ฌ์„œ ๋ทฐ์— ๊ด€๋ จ๋œ ์ผ๋งŒ ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ด์•ผ๊ฒ ๋‹ค ์ƒ๊ฐํ•˜๊ณ  ๊ฐ ๋ทฐ๋กœ binding value๋ฅผ ์ด์ค€๊ฑฐ์•ผ

์ด ๋ถ€๋ถ„์€ ํฌ๊ฒŒ ์ •ํ•ด์ง„๊ฑด ์—†์œผ๋‹ˆ ์˜ณ๋‹ค๊ณ  ์ƒ๊ฐํ•˜๋Š” ๋ถ€๋ถ„์œผ๋กœ, ๋˜๋Š” Activity๋งˆ๋‹ค ์œ ๋™์ ์œผ๋กœ ์ ์–ด์ฃผ๋ฉด ๋˜๋Š” ๋ถ€๋ถ„์ด์•ผ~

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋ฌด์Šจ๋ง์ธ์ง€ ์ดํ•ดํ–ˆ์–ด!! ์‚ฌ์‹ค ๊ทธ๋ ‡๊ฒŒ ๊นŒ์ง€ ์ƒ๊ฐํ•˜์ง€ ์•Š๊ณ , ์ „์—ญ๋ณ€์ˆ˜๋กœ ์“ฐ๋Š” ๊ฒƒ์ด ๋” ํŽธํ•˜๋‹ค๊ณ ๋งŒ ์ƒ๊ฐํ–ˆ์–ด์„œ ๋จผ์ € ์ „์—ญ๋ณ€์ˆ˜๋กœ
์„ ์–ธํ•ด๋†“๊ณ  ์ฝ”๋“œ๋ฅผ ์ง„ํ–‰ํ–ˆ๋˜๊ฒƒ ๊ฐ™์•„!! ์ฐธ๊ณ ํ• ๊ฒŒ~

Copy link
Copy Markdown
Member

@jinsu4755 jinsu4755 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋„ˆ๋ฌด๋„ˆ๋ฌด ๊ณ ์ƒํ–ˆ๊ณ  ์‹ค์ „์—์„œ๋„ ํ™งํŒ…!

Comment thread app/build.gradle
Comment on lines +35 to 37
dataBinding{
enabled = true
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด ๋ถ€๋ถ„์€ ์•„๋งˆ Gradle ๋นŒ๋“œ ๋Œ๋ฆฌ๋ฉด ์•„๋งˆ ์›Œ๋‹์œผ๋กœ ๋œฐํƒ ๋ฐ ์ž์„ธํžˆ ์ฝ์–ด๋ณด๋ฉด

Suggested change
dataBinding{
enabled = true
}
buildFeatures{
dataBinding = true
}

๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋ณ€๊ฒฝ๋˜์—ˆ์œผ๋‹ˆ ์ ์–ด๋‹ฌ๋ผ๊ณ  ๋œฐ๊บผ์•ผ

val binding: ActivityMainBinding =
DataBindingUtil.setContentView(this, R.layout.activity_main)
initProfileImage(binding.imageProfileImage)
setProfileName(binding.textProfileName, DEFAULT_USER_NAME)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์•„์ฃผ ์ข‹์•„!
์ด๊ฑด ๋‚ด ๊ฐœ์ธ์ ์ธ ์ƒ๊ฐ์ด์—ˆ๋Š”๋ฐ binding value๋ฅผ ์ „์—ญ์œผ๋กœ ์„ ์–ธํ•  ํ•„์š”๊ฐ€ ์žˆ์„๊นŒ? ์ƒ๊ฐํ–ˆ์—ˆ์–ด.
Activity๋Š” ๋ทฐ์—์„œ ์ผ์–ด๋‚  ์–ด๋–ค ํ™œ๋™๋“ค? ๊ทธ์ค‘์—์„œ๋„ ์ƒ๋ช…์ฃผ๊ธฐ์™€ ์—ฐ๊ฒฐ์ด ๊ฐ•ํ•œ ํ™œ๋™๋“ค์ด ์ผ์–ด๋‚˜๋Š” ์ฑ…์ž„์ด๋ผ๊ณ  ์ƒ๊ฐํ–ˆ๊ธฐ์—
๊ฒฐ๊ตญ binding value๋Š” ๋‚ด๊ฐ€ ๋ทฐ๋ฅผ ์ปจํŠธ๋กค ํ•˜๋ฉด์„œ ์ƒ๊ธฐ๋Š” ์ผ์ด๋ผ ์ „์—ญ์œผ๋กœ ์“ฐ๊ธฐ๋ณด๋‹ค๋Š” ๋ฒ”์œ„๋ฅผ ์ค„์—ฌ์„œ ๋ทฐ์— ๊ด€๋ จ๋œ ์ผ๋งŒ ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ด์•ผ๊ฒ ๋‹ค ์ƒ๊ฐํ•˜๊ณ  ๊ฐ ๋ทฐ๋กœ binding value๋ฅผ ์ด์ค€๊ฑฐ์•ผ

์ด ๋ถ€๋ถ„์€ ํฌ๊ฒŒ ์ •ํ•ด์ง„๊ฑด ์—†์œผ๋‹ˆ ์˜ณ๋‹ค๊ณ  ์ƒ๊ฐํ•˜๋Š” ๋ถ€๋ถ„์œผ๋กœ, ๋˜๋Š” Activity๋งˆ๋‹ค ์œ ๋™์ ์œผ๋กœ ์ ์–ด์ฃผ๋ฉด ๋˜๋Š” ๋ถ€๋ถ„์ด์•ผ~

Comment on lines +6 to +10
<data>
<variable
name="main"
type="sotp.semina.practicegitanddatabinding.MainActivity" />
</data>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด๊ฑด ๋ณ€์ˆ˜๋ช…์— ๊ด€ํ•œ๊ฑด๋ฐ main์ด๋ž€ ์ด๋ฆ„์€ ๋ญ”๊ฐ€ ๊ฐœ์ธ์ ์ธ ์ƒ๊ฐ์œผ๋กœ ๋งŽ์ด ์ถ•์•ฝ์ด๋‹ค ์ƒ๊ฐ์ด ๋“ค์–ด!

๋ฐ”๋กœ ์•„๋ž˜ ํƒ€์ž…์ด ์ ํ˜€์žˆ์–ด ํฐ ๋ฌธ์ œ๋Š” ์—†์ง€๋งŒ ๋ทฐ๊ฐ€ ๋ณต์žกํ•ด์ง€๊ณ  ๊ธธ์–ด์ง€๊ณ , variable์ด ๋งŽ์•„์ง€๋ฉด main์ด ์—‘ํ‹ฐ๋น„ํ‹ฐ์ธ์ง€, ๋ทฐ๋ชจ๋ธ์ธ์ง€, data class์ธ์ง€ ํŒ๋ณ„ํ•˜๊ธฐ ํž˜๋“ค ๊ฒƒ ๊ฐ™๋‹ค ์ƒ๊ฐํ–ˆ๊ธฐ ๋•Œ๋ฌธ์ด์•ผ

@jinsu4755 jinsu4755 added the Good ๊ณผ์ œ ์™„๋ฃŒ label Jan 1, 2021
@jinsu4755 jinsu4755 mentioned this pull request Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Good ๊ณผ์ œ ์™„๋ฃŒ ํ˜•์ค€ ๋‹ด๋‹น์ž: ํ˜•์ค€

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants