Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
likorn
/
vocabulary_notebook
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6d0def63
authored
Sep 06, 2018
by
Paktalin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed views initialization in Kotlin SignInActivity
parent
f0b97423
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
35 deletions
.idea/kotlinc.xml
app/build.gradle
app/src/main/java/com/paktalin/vocabularynotebook/SignInActivity.kt
app/src/main/res/layout/activity_sign_in.xml
.idea/kotlinc.xml
0 → 100644
View file @
6d0def63
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"KotlinCommonCompilerArguments"
>
<option
name=
"errors"
>
<ArgumentParseErrors
/>
</option>
</component>
</project>
\ No newline at end of file
app/build.gradle
View file @
6d0def63
...
...
@@ -22,7 +22,7 @@ dependencies {
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
implementation
'com.android.support:appcompat-v7:28.0.0-rc02'
implementation
'com.android.support.constraint:constraint-layout:1.1.3'
implementation
"org.jetbrains.kotlin:kotlin-reflect:
1.2.30
"
implementation
"org.jetbrains.kotlin:kotlin-reflect:
$kotlin_version
"
implementation
'com.google.firebase:firebase-core:16.0.3'
implementation
'com.google.firebase:firebase-database:16.0.1'
...
...
@@ -36,3 +36,4 @@ dependencies {
apply
plugin:
'com.google.gms.google-services'
apply
plugin:
'kotlin-android'
apply
plugin:
'kotlin-android-extensions'
\ No newline at end of file
app/src/main/java/com/paktalin/vocabularynotebook/SignInActivity.kt
View file @
6d0def63
...
...
@@ -5,31 +5,23 @@ import android.support.v7.app.AppCompatActivity
import
android.os.Bundle
import
android.text.TextUtils
import
android.util.Log
import
android.view.View
import
android.widget.Button
import
android.widget.EditText
import
android.widget.Toast
import
com.google.android.gms.signin.SignIn
import
com.google.firebase.auth.FirebaseAuth
import
kotlinx.android.synthetic.main.activity_sign_in.*
class
SignInActivity
:
AppCompatActivity
()
{
private
var
mEmailEt
:
EditText
?
=
null
private
var
mPasswordEt
:
EditText
?
=
null
private
var
mSignInBtn
:
Button
?
=
null
private
var
mSignUpBtn
:
Button
?
=
null
private
var
mAuth
:
FirebaseAuth
?
=
null
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_sign_in
)
initializeViews
()
mAuth
=
FirebaseAuth
.
getInstance
()
mSignInBt
n
!!
.
setOnClickListener
({
signIn
()
})
mSignUpBtn
!!
.
setOnClickListener
({
signUp
()
})
btnSignI
n
!!
.
setOnClickListener
({
signIn
()
})
btnSignUp
!!
.
setOnClickListener
({
signUp
()
})
}
override
fun
onStart
()
{
...
...
@@ -38,16 +30,9 @@ class SignInActivity : AppCompatActivity() {
if
(
currentUser
!=
null
)
startUserActivity
()
}
private
fun
initializeViews
()
{
mEmailEt
=
findViewById
(
R
.
id
.
email
)
mPasswordEt
=
findViewById
(
R
.
id
.
password
)
mSignInBtn
=
findViewById
(
R
.
id
.
btn_sign_in
)
mSignUpBtn
=
findViewById
(
R
.
id
.
btn_sign_up
)
}
private
fun
signIn
()
{
val
email
=
mEmailEt
!!
.
text
.
toString
()
val
password
=
mPasswordEt
!!
.
text
.
toString
()
val
email
=
etEmail
!!
.
text
.
toString
()
val
password
=
etPassword
!!
.
text
.
toString
()
if
(
fieldsNotEmpty
(
email
,
password
))
{
mAuth
!!
.
signInWithEmailAndPassword
(
email
,
password
)
...
...
@@ -64,8 +49,8 @@ class SignInActivity : AppCompatActivity() {
}
private
fun
signUp
()
{
val
email
=
mEmailEt
!!
.
text
.
toString
()
val
password
=
mPasswordEt
!!
.
text
.
toString
()
val
email
=
etEmail
!!
.
text
.
toString
()
val
password
=
etPassword
!!
.
text
.
toString
()
if
(
fieldsNotEmpty
(
email
,
password
))
{
mAuth
!!
.
createUserWithEmailAndPassword
(
email
,
password
)
...
...
app/src/main/res/layout/activity_sign_in.xml
View file @
6d0def63
...
...
@@ -8,7 +8,7 @@
tools:context=
".SignInActivity"
>
<EditText
android:id=
"@+id/email"
android:id=
"@+id/e
tE
mail"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"8dp"
...
...
@@ -20,14 +20,14 @@
android:ems=
"10"
android:hint=
"@string/email_hint"
android:inputType=
"textEmailAddress"
app:layout_constraintBottom_toTopOf=
"@+id/
p
assword"
app:layout_constraintBottom_toTopOf=
"@+id/
etP
assword"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_chainStyle=
"packed"
/>
<EditText
android:id=
"@+id/
p
assword"
android:id=
"@+id/
etP
assword"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"8dp"
...
...
@@ -39,13 +39,13 @@
android:ems=
"10"
android:hint=
"@string/password_hint"
android:inputType=
"textPassword"
app:layout_constraintBottom_toTopOf=
"@+id/btn
_sign_i
n"
app:layout_constraintBottom_toTopOf=
"@+id/btn
SignI
n"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/email"
/>
app:layout_constraintTop_toBottomOf=
"@+id/e
tE
mail"
/>
<Button
android:id=
"@+id/btn
_sign_i
n"
android:id=
"@+id/btn
SignI
n"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"8dp"
...
...
@@ -56,13 +56,13 @@
android:layout_marginTop=
"8dp"
android:text=
"@string/sign_in_text"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@id/btn
_sign_u
p"
app:layout_constraintEnd_toStartOf=
"@id/btn
SignU
p"
app:layout_constraintHorizontal_chainStyle=
"packed"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/
p
assword"
/>
app:layout_constraintTop_toBottomOf=
"@+id/
etP
assword"
/>
<Button
android:id=
"@+id/btn
_sign_u
p"
android:id=
"@+id/btn
SignU
p"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"8dp"
...
...
@@ -70,8 +70,8 @@
android:layout_marginRight=
"8dp"
android:layout_marginStart=
"8dp"
android:text=
"Sign Up"
app:layout_constraintBottom_toBottomOf=
"@+id/btn
_sign_i
n"
app:layout_constraintBottom_toBottomOf=
"@+id/btn
SignI
n"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@+id/btn
_sign_i
n"
app:layout_constraintTop_toTopOf=
"@+id/btn
_sign_i
n"
/>
app:layout_constraintStart_toEndOf=
"@+id/btn
SignI
n"
app:layout_constraintTop_toTopOf=
"@+id/btn
SignI
n"
/>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment