-
Notifications
You must be signed in to change notification settings - Fork 0
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
[1주차/필수/XML] Android UI 구현 기초 : 회원가입 및 로그인 #3
Changes from all commits
97d1ed6
4021751
7cc1f2c
139008c
a398735
8ac5f99
193b102
883bbc3
4381c77
6b8b859
ee67423
12f4f26
7b6b12f
f8788c5
a0dc149
d5d97de
fee0317
d55ae28
d7674bb
306d55a
13a3d6f
894acd9
dfb7350
e2c9a64
f92dc51
70139b8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,10 @@ android { | |
kotlinOptions { | ||
jvmTarget = '17' | ||
} | ||
|
||
buildFeatures { | ||
viewBinding true | ||
} | ||
} | ||
|
||
dependencies { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.sopt.now | ||
|
||
import android.content.Intent | ||
import android.os.Bundle | ||
import android.util.Log | ||
import android.widget.Toast | ||
import androidx.appcompat.app.AppCompatActivity | ||
import com.sopt.now.databinding.ActivityLoginBinding | ||
import com.sopt.now.databinding.ActivityMainBinding | ||
SYAAINN marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
class LoginActivity: AppCompatActivity() { | ||
private lateinit var binding: ActivityLoginBinding | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
binding = ActivityLoginBinding.inflate(layoutInflater) | ||
setContentView(binding.root) | ||
|
||
val userId = intent.getStringExtra("ID") | ||
val userPw = intent.getStringExtra("PW") | ||
val userName = intent.getStringExtra("Name") | ||
val userPlace = intent.getStringExtra("Place") | ||
|
||
binding.btnSignIn.setOnClickListener { | ||
if (binding.etSignInId.text.toString()== userId) { | ||
if (binding.etSignInPw.text.toString() == userPw) { | ||
Toast.makeText(this, "로그인 되었습니다!", Toast.LENGTH_SHORT).show() | ||
|
||
val intent = Intent(this,MainActivity::class.java) // 메인 페이지로 이동 | ||
intent.putExtra("ID",userId) | ||
intent.putExtra("PW",userPw) | ||
intent.putExtra("Name",userName) | ||
intent.putExtra("Place",userPlace) | ||
startActivity(intent) | ||
} | ||
else | ||
Toast.makeText(this, "비밀번호가 잘못되었습니다", Toast.LENGTH_SHORT).show() | ||
} | ||
else { | ||
Toast.makeText(this, "아이디가 잘못되었습니다!", Toast.LENGTH_SHORT).show() | ||
SYAAINN marked this conversation as resolved.
Show resolved
Hide resolved
Comment on lines
+23
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 각 기능마다 함수로 분리하는 것도 좋은 방법이예요! 그렇게 하면 가독성이 좋아지고 유지 보수하기 수월해지거든요. 함수명은 이름만 보더라도 어떤 기능을 수행하는 메서드인지 명확하게 알 수 있어야 좋습니당. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 그러면 isIdValid(), isPwValid() 같은 유효성 검증 메서드들로 분리해서 작성하면setOnClickListener() 블럭 안쪽 가독성을 높일 수 있겠네요! |
||
} | ||
Comment on lines
+24
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 객체 지향 생활 체조 원칙 제 2항 : else 예약어를 쓰지 않는다 위 링크 참고하시면 좋을거같아요 👍👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 링크 참고하니까 로그인 유효성을 검증하는 함수 isValidId() 등을 만들어서 return 문을 이용하면 훨씬 간결한 코드로 작성 가능하다는게 확 와닿네요! |
||
} | ||
|
||
binding.btnJoin.setOnClickListener { | ||
val intent = Intent(this,SignUpActivity::class.java) // 회원가입 페이지로 이동 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 개발의 세계에서는 '주석이 필요한 코드는 나쁜 코드이다' 라는 말도 있답니다?! 충분히 의도를 알 수 있는 코드라면 주석을 지워주시는 편이 좋습니다~~!!!! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 앞으로는 주석으로 설명하기보단 딱 봐도 아는 코드를 작성하기 위해 노력해야겠습니다! |
||
startActivity(intent) | ||
} | ||
Comment on lines
+43
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 요 친구도 함수로 분리해내면 좋을 것 같아요! btnJoin 버튼을 클릭했을 때 수행되는 함수! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 회원가입 페이지로 이동하는 2줄 함수말고는 별다른 추가사항이 없을 듯한데 그래도 함수로 분리해내서 가독성을 높여주는게 더 좋을까요? 아니면 페이지 이동 기능을 가진 함수를 작성해서 재사용을 하라는 뜻,,? 어떻게 분리해내야 될 지 궁금합니다..! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 흠 현재 구현되어 있는 부분에서는 SignUpActivity로 이동할 때는 result를 사용해야 하니 전자가 맞다고 생각해요! 몇 줄 없는 코드일지라도 함수로 분리해내면 어떤 역할을 하는지 확실하게 알 수 있어서 좋습니다! 확장성에서도 좋구요~ 버튼 클릭 기능별로 함수화 해주는게 일반적인 것 같아요! |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,24 @@ import androidx.activity.enableEdgeToEdge | |
import androidx.appcompat.app.AppCompatActivity | ||
import androidx.core.view.ViewCompat | ||
import androidx.core.view.WindowInsetsCompat | ||
import com.sopt.now.databinding.ActivityLoginBinding | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 파일에도 이 import가 사용되는 부분이 있을까요? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 로그인 시 받은 정보를 메인화면으로 가져와야해서 혹시 LoginActivity databinding 도 해줘야하지 않을까 싶었는데 지워도 잘 구동하네요 (무분별한 alt+enter 사례 2,,!) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MainActivity에서는 ActivityMainBinding만 사용하니까요! |
||
import com.sopt.now.databinding.ActivityMainBinding | ||
|
||
class MainActivity : AppCompatActivity() { | ||
private lateinit var binding: ActivityMainBinding | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_main) | ||
binding = ActivityMainBinding.inflate(layoutInflater) | ||
setContentView(binding.root) | ||
|
||
val userId = intent.getStringExtra("ID") | ||
val userPw = intent.getStringExtra("PW") | ||
val userName = intent.getStringExtra("Name") | ||
val userPlace = intent.getStringExtra("Place") | ||
|
||
binding.tvMainName.text = userName | ||
binding.tvMainShowId.text = userId | ||
binding.tvMainShowPw.text = userPw | ||
binding.tvMainShowPlace.text = userPlace | ||
Comment on lines
+23
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 요기 제가 준서님한테 리뷰받았는데 같이 참고해주시면 좋을 듯 합니다 ㅎㅎ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아린님 PR 읽어보시면서 with(binding)을 찾아보세요!! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. with(binding) 블럭으로 묶는거 잘 보고왔습니다 ^^
Comment on lines
+23
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 요롷게 textView 값을 넣는 함수로 빼내면 좋을 것 같습니다. |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.sopt.now | ||
|
||
import android.content.Intent | ||
import android.os.Bundle | ||
import android.view.View | ||
import android.widget.Toast | ||
import androidx.appcompat.app.AppCompatActivity | ||
import com.google.android.material.snackbar.Snackbar | ||
import com.sopt.now.databinding.ActivitySignupBinding | ||
class SignUpActivity : AppCompatActivity() { | ||
Comment on lines
+9
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Control + Alt + L 단축어를 사용하면 코드를 자동으로 정리하는 기능이 적용될거예요! 아마 안드로이드 스튜디오의 기본 값으로 설정되어 있을겁니당 ㅎvㅎ 누구나 보기 좋은 코드가 좋잖아요 ㅎㅎ! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ctrl + alt + L 꿀팁 기억하겠습니다! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 맥북으로 넘어와서 저 단축키가 맞는지 가물가물하지만.. 오늘 준서님의 미미나 들었다면 잘 배우셨을거라 믿습니당 ㅎ.ㅎ |
||
private lateinit var binding: ActivitySignupBinding | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
binding = ActivitySignupBinding.inflate(layoutInflater) | ||
setContentView(binding.root) | ||
|
||
binding.btnSignUp.setOnClickListener { | ||
// 1. 모든 정보 입력되지 않았을 시, 회원 가입 불가 (snackbar , toast 등으로 메세지 표시) | ||
// 2. 성공 시 LoginActivity로 화면 전환, 정보도 함께 전달, 회원가입 성공 메세지 표시 | ||
// <회원가입 성공조건> | ||
// - ID : 6~10 글자 | ||
// - Password : 8~12 글자 | ||
// - 닉네임 : 한 글자 이상, 공백으로만 이루어진 닉네임은 불가 | ||
// - 나머지 조건 : 자유 | ||
Comment on lines
+18
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이친구도 이슈와 피알에서 다 명시가 되어있죠?! 꼼꼼하게 체크하는 모습 좋습니다~~👍 벗 불필요해진 주석은 지워주세요!! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 불필요한 주석 지양하겠습니다! |
||
if (binding.etSignUpId.text.length in 6..10 && | ||
binding.etSignUpPw.text.length in 8..12 && | ||
Comment on lines
+25
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 6, 8, 10, 12와 같은 상수는 다른 사람들이 어떤 뜻인지 알아보기 어려워요! const val이 뭔지 아시나요? 아린님 PR 코드리뷰처럼, 미리 컴파일하는 상수를 정해두는 방식이죠~~ 상수마다 이름이 붙어있기 때문에 가독성을 높일 수 있어요!! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. const val을 이용해서 이 상수들이 왜 나왔는지 MIN_LENGTH_ID 등으로 의미를 알게 해준걸 보고왔어요! 이런 비즈니스 로직들을 분리해서 따로 관리하게 하면 나중에 수정하기도 더 용이할 것 같다는 생각이 들었는데 어떻게 생각하세요? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 크 엄청나게 예리하시군요~~ 2주차때 배운 viewModel을 더욱 잘 활용하시게 된다면 가능하실거예요 👍 |
||
binding.etSignUpName.text.isNotEmpty() && | ||
binding.etSignUpPlace.text.isNotEmpty()) { | ||
Comment on lines
+25
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 조건문 너무 길어지면 함수로 빼는게 가독성면에서 보기 좋아욥! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 다음 과제부턴 함수를 적극 활용해서 가독성을 높여보겠습니다! |
||
|
||
Toast.makeText(this,"회원가입 성공", Toast.LENGTH_SHORT).show() | ||
|
||
val intent = Intent(this,LoginActivity::class.java) // 회원가입 성공 시, 로그인 화면으로 이동 | ||
// 회원가입 정보 넘기기 | ||
intent.putExtra("ID",binding.etSignUpId.text.toString()) | ||
intent.putExtra("PW",binding.etSignUpPw.text.toString()) | ||
intent.putExtra("Name",binding.etSignUpName.text.toString()) | ||
intent.putExtra("Place",binding.etSignUpPlace.text.toString()) | ||
Comment on lines
+34
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이친구도 with으로 묶이는거 아시나요?
Comment on lines
+32
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 전 intent에 apply와 bundle을 사용해서 간편하게 묶었어욤. with, apply, run, ... 등등 kotlin에는 함수형 프로그래밍을 열심히 도와주는 친구들이 있습니다! https://medium.com/@fatihcoskun/kotlin-scoping-functions-apply-vs-with-let-also-run-816e4efb75f5 한 번 읽어보시면 좋을 것 같네요 ㅎㅎ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 사실 data class나 bundle을 이용하시는게 좋긴 한데!! 현재 이해가 안가신다면 일단 보류하셔도 좋아요~~!!!! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 맞아요 천천히 리팩하시면 됩니당~ 저는 뚜드려 맞으면서 배워야 머리에 들어와서 ㅜㅜ |
||
startActivity(intent) | ||
} | ||
else if (binding.etSignUpId.text.isEmpty() || binding.etSignUpPw.text.isEmpty() || | ||
binding.etSignUpName.text.isEmpty() || binding.etSignUpPlace.text.isEmpty() ) { | ||
Toast.makeText(this, "입력하지 않은 정보가 있습니다.", Toast.LENGTH_SHORT).show() | ||
} | ||
|
||
else | ||
Toast.makeText(this,"회원가입 실패",Toast.LENGTH_SHORT).show() | ||
Comment on lines
+42
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 하드코딩된 문자열을 사용하면 어떤 문제가 있을까요? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 다국어 번역 등 유지보수에 관한 문제점, 나아가 보안성 문제까지..! 직관적이라는 장점이 있긴 하지만 사용에 유의할 점이 굉장히 많네요! |
||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:id="@+id/main" | ||
SYAAINN marked this conversation as resolved.
Show resolved
Hide resolved
|
||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<TextView | ||
android:id="@+id/tvSignInTitle" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 흠 저라면 파일명인 login을 따를지 내부 코드에서 사용한 signin을 따를지 정해서 네이밍을 통일할 것 같네요! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 실습 때 Login으로 해놓고 과제 명세를 보고 난 후에는 SignIn으로 혼용해서 썼더니 헷갈릴 수 있겠네요.. Join 이랑 SignUp도 같은 맥락인 것 같은데 다음부턴 신경써야겠습니다! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 결국 나중엔 자잘한 부분에서 헷갈려서 수정하게 되고.. 번거로워지기 때문에 파일명이나 변수명, 함수명 같은게 별거 아니게 느껴지더라도 확실하게 정해서 통일하는게 편합니닷! |
||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="50dp" | ||
android:gravity="center" | ||
android:text="Welcome to SOPT" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 하드코딩 된 text는 string value로 빼는 습관을 들여두는 거 어떨까여! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 텍스트 위에 살짝 마우스 올리면 스트링으로 뺄 수 있게 뜰거예용!! 그렇게 추가하면 됩니당 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 하드코딩 된 문자열에 alt+shift+enter를 눌렀더니 strings.xml로 추출이 되네요! 확실하게 배워갑니다! |
||
android:textSize="30sp" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 코드를 작성하면서 한 번씩 Ctrl + Alt + L 을 눌러주시면 좋을 것 같아요. 커밋하기 전에도 파일마다 한 번씩 눌러주면 좋구요! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 커밋하기 전 1. 불필요한 import 확인 2. ctrl+alt+l 은 루틴으로 가져가겠습니다..! 혹시 불필요한 import문 확인은 꿀팁이 있을까요?!?! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아마 해당 단축키 쓰면 사용하지 않는 import 코드도 사라지는 걸루 아는데.. 준서님 미미나에서 배웠을거라 믿습니다 ㅎㅎ |
||
|
||
<TextView | ||
android:id="@+id/tvSignInId" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="50dp" | ||
android:layout_marginStart="30dp" | ||
android:gravity="center" | ||
android:text="아이디" | ||
android:textSize="25sp" | ||
app:layout_constraintTop_toBottomOf="@id/tvSignInTitle" | ||
app:layout_constraintStart_toStartOf="parent" | ||
/> | ||
|
||
<EditText | ||
android:id="@+id/etSignInId" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginHorizontal="30dp" | ||
android:hint="아이디를 입력해주세요" | ||
app:layout_constraintTop_toBottomOf="@id/tvSignInId" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
/> | ||
|
||
<TextView | ||
android:id="@+id/tvSignInPw" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="30dp" | ||
android:layout_marginStart="30dp" | ||
android:gravity="center" | ||
android:text="비밀번호" | ||
android:textSize="25sp" | ||
app:layout_constraintTop_toBottomOf="@id/etSignInId" | ||
app:layout_constraintStart_toStartOf="parent" | ||
/> | ||
|
||
<EditText | ||
android:id="@+id/etSignInPw" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginHorizontal="30dp" | ||
android:hint="비밀번호를 입력해주세요" | ||
android:inputType="textPassword" | ||
app:layout_constraintTop_toBottomOf="@id/tvSignInPw" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
/> | ||
|
||
<Button | ||
android:id="@+id/btnSignIn" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginHorizontal="30dp" | ||
android:text="로그인 하기" | ||
android:layout_marginBottom="80dp" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
/> | ||
|
||
<Button | ||
android:id="@+id/btnJoin" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 보통 id명은 [view name][where][what]으로 많이 씁니다! 이 친구는 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. id명 짓는 법 확실히 배우고 갑니다! SignUpActivity 에 회원가입 버튼이랑 헷갈릴까 걱정했는데 [where]을 넣으면 해결되는 문제였네요! |
||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginHorizontal="30dp" | ||
android:layout_marginBottom="30dp" | ||
android:text="회원가입" | ||
app:layout_constraintTop_toBottomOf="@id/btnSignIn" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
/> | ||
|
||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,103 @@ | |
tools:context=".MainActivity"> | ||
|
||
<TextView | ||
android:id="@+id/tvMainSopt" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="Hello World!" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
android:text="SOPT에 온 걸 환영해!" | ||
android:textSize="30dp" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
android:layout_marginTop="40dp"/> | ||
|
||
<ImageView | ||
android:id="@+id/imgMainProfile" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. imageView의 경우에는 iv~로 많이 씁니당. 보통 뷰 네임의 대문자를 따서 지어요! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아 뭐로 줄여야할지 고민했었는데 뷰 네임 대문자가 기준이였군요!!! 막힌 혈이 뜷렸습니다 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 사소하게라도 헷갈리거나 궁금한게 있다면 바로 오비한테 물어보세욧~~! |
||
android:layout_width="wrap_content" | ||
android:layout_height="0dp" | ||
android:layout_marginTop="110dp" | ||
android:layout_marginStart="20dp" | ||
app:layout_constraintTop_toTopOf="@+id/tvMainSopt" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:srcCompat="@drawable/ic_launcher_background" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 원하시는 사진으로 drawable에 추가해서 교체해주면 좋을 것 같네요! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 실은 사진 추가하는 것까지는 아직 엄두를 못냈었는데 2주차 세미나를 통해 drawable 부분을 이용하는 법을 알게돼서 이제는 추가해볼 수 있을거 같습니다! |
||
app:layout_constraintDimensionRatio="2:1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 호오 2:1 비율을 원하신건가요? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 과제 명세때문에 사용해본다고 이 숫자 저 숫자 집어넣어보면서 바뀌는건 확인했는데 아직 추가 학습이 필요할 것 같습니다 ! 😂 |
||
/> | ||
|
||
<TextView | ||
android:id="@+id/tvMainName" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:textSize="25sp" | ||
app:layout_constraintTop_toTopOf="@+id/tvMainSopt" | ||
app:layout_constraintStart_toEndOf="@+id/imgMainProfile" | ||
android:layout_marginTop="125dp" | ||
android:layout_marginStart="20dp" | ||
/> | ||
|
||
<TextView | ||
android:id="@+id/tvMainId" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="30dp" | ||
android:layout_marginStart="50dp" | ||
android:text="아이디" | ||
android:textSize="20sp" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
app:layout_constraintTop_toBottomOf="@+id/imgMainProfile" /> | ||
|
||
<TextView | ||
android:id="@+id/tvMainShowId" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="50dp" | ||
android:layout_marginTop="10dp" | ||
android:textSize="15dp" | ||
app:layout_constraintTop_toBottomOf="@+id/tvMainId" | ||
app:layout_constraintStart_toStartOf="parent"/> | ||
|
||
<TextView | ||
android:id="@+id/tvMainPw" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="50dp" | ||
android:layout_marginTop="30dp" | ||
android:text="비밀번호" | ||
android:textSize="20sp" | ||
app:layout_constraintTop_toBottomOf="@+id/tvMainShowId" | ||
app:layout_constraintStart_toStartOf="parent"/> | ||
|
||
<TextView | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 인풋타입 패스워드 써보시면 ..!🤩 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 과제 조건에도 있었답니다?! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MainActivity 에는 비밀번호가 안보이게 하라는 과제 명세가 없었던거 같아서 로그인과 회원가입 시에만 구현을 해놨네요! 생각해보니까 비밀번호 그냥 보여주는게 이상한거 같기도..? |
||
android:id="@+id/tvMainShowPw" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="10dp" | ||
android:layout_marginStart="50dp" | ||
android:textSize="15dp" | ||
app:layout_constraintTop_toBottomOf="@+id/tvMainPw" | ||
app:layout_constraintStart_toStartOf="parent"/> | ||
|
||
<TextView | ||
android:id="@+id/tvMainPlace" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
app:layout_constraintTop_toBottomOf="@+id/tvMainShowPw" | ||
app:layout_constraintStart_toStartOf="parent" | ||
android:layout_marginTop="30dp" | ||
android:layout_marginStart="50dp" | ||
android:text="거주지" | ||
android:textSize="20sp" | ||
tools:layout_editor_absoluteX="42dp" | ||
tools:layout_editor_absoluteY="433dp" /> | ||
Comment on lines
+96
to
+97
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 지워주세용 :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 꼼꼼히 확인하겠습니다 😂
Comment on lines
+96
to
+97
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오잉 tools는 실제로 동작했을 때는 적용되어 보이지 않아요 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 꼼꼼히 확인하겠습니다 2..!😂 |
||
|
||
<TextView | ||
android:id="@+id/tvMainShowPlace" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
app:layout_constraintTop_toBottomOf="@+id/tvMainPlace" | ||
app:layout_constraintStart_toStartOf="parent" | ||
android:layout_marginTop="10dp" | ||
android:layout_marginStart="50dp" | ||
android:textSize="15sp" /> | ||
|
||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
배운대로 야무지게 false 설정까지..크!!