soonmyeong2

merge splashScreen and loginNextPage

# WELLO project
\ No newline at end of file
# WELLO project
## description
\ No newline at end of file
......
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<AndroidXmlCodeStyleSettings>
<option name="ARRANGEMENT_SETTINGS_MIGRATED_TO_191" value="true" />
</AndroidXmlCodeStyleSettings>
<JetCodeStyleSettings>
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file
......@@ -11,7 +11,13 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<<<<<<< HEAD
<activity android:name=".SplashActivity" android:theme="@style/SplashTheme">
=======
<activity android:name=".SignInActivity"></activity>
<activity android:name=".SignUpActivity" />
<activity android:name=".MainActivity">
>>>>>>> 30e9555883e1f0d8a1af31b839e6ed410407101f
<intent-filter>
<action android:name="android.intent.action.MAIN" />
......
package com.example.vip
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Toast
import com.google.firebase.auth.FirebaseAuth
import kotlinx.android.synthetic.main.activity_main.*
import org.w3c.dom.Node
class MainActivity : AppCompatActivity() {
......@@ -12,19 +14,6 @@ class MainActivity : AppCompatActivity() {
private val firebaseAuth = FirebaseAuth.getInstance()
// EmailCreate
private fun createEmail(){
firebaseAuth!!.createUserWithEmailAndPassword(edit_email.text.toString(), edit_password.text.toString())
.addOnCompleteListener(this) {
if (it.isSuccessful) {
// Sign in success, update UI with the signed-in user's information
val user = firebaseAuth?.currentUser
Toast.makeText(this, "Authentication success.",Toast.LENGTH_SHORT).show()
} else {
// If sign in fails, display a message to the user.
Toast.makeText(this, "Authentication failed.",Toast.LENGTH_SHORT).show()
}
}
}
// Email SignIn
private fun loginEmail(){
......@@ -34,9 +23,18 @@ class MainActivity : AppCompatActivity() {
// Sign in success, update UI with the signed-in user's information
Toast.makeText(this, "signInWithEmail success.",Toast.LENGTH_SHORT).show()
val user = firebaseAuth?.currentUser
if (user!=null){
var intent = Intent(this, SignInActivity::class.java)
startActivity(intent)
}
} else {
// If sign in fails, display a message to the user.
Toast.makeText(this, "signInWithEmail failed.",Toast.LENGTH_SHORT).show()
}
}
}
......@@ -46,11 +44,18 @@ class MainActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
emailSignupBtn.setOnClickListener{
createEmail()
}
emailSigninBtn.setOnClickListener{
loginEmail()
}
emailSignupBtn.setOnClickListener {
var intent = Intent(this, SignUpActivity::class.java)
startActivity(intent)
}
}
}
......
package com.example.vip
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
class MainMenuActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main_menu)
}
}
package com.example.vip
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
class Policy : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_policy)
}
}
package com.example.vip
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
class SignInActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_signin)
}
}
package com.example.vip
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Toast
import com.google.firebase.auth.FirebaseAuth
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.activity_signup.*
class SignUpActivity : AppCompatActivity() {
private val RC_SIGN_IN = 9001
private val firebaseAuth = FirebaseAuth.getInstance()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_signup)
signupBtn.setOnClickListener{
createEmail()
var intent = Intent(this, MainActivity::class.java)
startActivity(intent)
}
}
private fun createEmail(){
firebaseAuth!!.createUserWithEmailAndPassword(edit_email_sign_up.text.toString(), edit_password_sign_up.text.toString())
.addOnCompleteListener(this) {
if (it.isSuccessful) {
// Sign in success, update UI with the signed-in user's information
val user = firebaseAuth?.currentUser
Toast.makeText(this, "회원가입 완료!", Toast.LENGTH_SHORT).show()
} else {
// If sign in fails, display a message to the user.
Toast.makeText(this, "회원가입 실패", Toast.LENGTH_SHORT).show()
}
}
}
}
<?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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainMenuActivity">
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Policy">
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SignInActivity">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="로그인완료"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SignUpActivity">
<EditText
android:id="@+id/edit_email_sign_up"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:ems="10"
android:hint="Email"
android:inputType="textEmailAddress"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="@+id/edit_password_sign_up"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:ems="10"
android:hint="Password"
android:inputType="textPassword"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/edit_email_sign_up" />
<Button
android:id="@+id/signupBtn"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:background="@color/colorPrimary"
android:text="Sign Up"
android:textColor="@color/common_google_signin_btn_text_dark_default"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/edit_password_sign_up" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -8,7 +8,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:3.5.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.2'
// NOTE: Do not place your application dependencies here; they belong
......