Toggle navigation
Toggle navigation
This project
Loading...
Sign in
신기성
/
WELLO
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Authored by
신기성
2019-10-22 20:15:56 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0da61b06a614d423fe41cd31152aeab7f4645d27
0da61b06
1 parent
45ea988d
rotate activity complete
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
164 additions
and
17 deletions
vip/.idea/codeStyles/Project.xml
vip/.idea/vcs.xml
vip/app/src/main/AndroidManifest.xml
vip/app/src/main/java/com/example/vip/MainActivity.kt
vip/app/src/main/java/com/example/vip/SignInActivity.kt
vip/app/src/main/java/com/example/vip/SignUpActivity.kt
vip/app/src/main/res/layout/activity_signin.xml
vip/app/src/main/res/layout/activity_signup.xml
vip/build.gradle
vip/.idea/codeStyles/Project.xml
View file @
0da61b0
<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>
...
...
vip/.idea/vcs.xml
0 → 100644
View file @
0da61b0
<?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
vip/app/src/main/AndroidManifest.xml
View file @
0da61b0
...
...
@@ -9,6 +9,8 @@
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
>
<activity
android:name=
".SignInActivity"
></activity>
<activity
android:name=
".SignUpActivity"
/>
<activity
android:name=
".MainActivity"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
...
...
vip/app/src/main/java/com/example/vip/MainActivity.kt
View file @
0da61b0
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
()
{
...
...
@@ -13,19 +15,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
(){
...
...
@@ -35,9 +24,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
()
}
}
}
...
...
@@ -47,12 +45,19 @@ 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
)
}
}
}
...
...
vip/app/src/main/java/com/example/vip/SignInActivity.kt
0 → 100644
View file @
0da61b0
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
)
}
}
vip/app/src/main/java/com/example/vip/SignUpActivity.kt
0 → 100644
View file @
0da61b0
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
()
}
}
}
}
vip/app/src/main/res/layout/activity_signin.xml
0 → 100644
View file @
0da61b0
<?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
vip/app/src/main/res/layout/activity_signup.xml
0 → 100644
View file @
0da61b0
<?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
vip/build.gradle
View file @
0da61b0
...
...
@@ -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
...
...
Please
register
or
login
to post a comment