diff --git a/app/build.gradle b/app/build.gradle
index ef8934d..2c92573 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -30,6 +30,10 @@ android {
kotlinOptions {
jvmTarget = '17'
}
+
+ buildFeatures {
+ viewBinding true
+ }
}
dependencies {
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 3b8f448..a9b7e00 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -13,14 +13,19 @@
android:theme="@style/Theme.NOWSOPTAndroid"
tools:targetApi="31">
-
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/sopt/now/LoginActivity.kt b/app/src/main/java/com/sopt/now/LoginActivity.kt
new file mode 100644
index 0000000..7b72f14
--- /dev/null
+++ b/app/src/main/java/com/sopt/now/LoginActivity.kt
@@ -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
+
+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()
+ }
+ }
+
+ binding.btnJoin.setOnClickListener {
+ val intent = Intent(this,SignUpActivity::class.java) // 회원가입 페이지로 이동
+ startActivity(intent)
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/sopt/now/MainActivity.kt b/app/src/main/java/com/sopt/now/MainActivity.kt
index 23e7302..93f1bad 100644
--- a/app/src/main/java/com/sopt/now/MainActivity.kt
+++ b/app/src/main/java/com/sopt/now/MainActivity.kt
@@ -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
+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
}
}
\ No newline at end of file
diff --git a/app/src/main/java/com/sopt/now/SignUpActivity.kt b/app/src/main/java/com/sopt/now/SignUpActivity.kt
new file mode 100644
index 0000000..146bdb0
--- /dev/null
+++ b/app/src/main/java/com/sopt/now/SignUpActivity.kt
@@ -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() {
+ 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 글자
+ // - 닉네임 : 한 글자 이상, 공백으로만 이루어진 닉네임은 불가
+ // - 나머지 조건 : 자유
+ if (binding.etSignUpId.text.length in 6..10 &&
+ binding.etSignUpPw.text.length in 8..12 &&
+ binding.etSignUpName.text.isNotEmpty() &&
+ binding.etSignUpPlace.text.isNotEmpty()) {
+
+ 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())
+ 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()
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml
new file mode 100644
index 0000000..3e6b9ba
--- /dev/null
+++ b/app/src/main/res/layout/activity_login.xml
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 86a5d97..5330e9b 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -8,12 +8,103 @@
tools:context=".MainActivity">
+
+
+
+
+
+
+ app:layout_constraintTop_toBottomOf="@+id/imgMainProfile" />
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_signup.xml b/app/src/main/res/layout/activity_signup.xml
new file mode 100644
index 0000000..4e7ee4e
--- /dev/null
+++ b/app/src/main/res/layout/activity_signup.xml
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file