soonmyeong2

merge splashScreen and loginNextPage

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