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
fc1ee8d4
authored
Sep 07, 2018
by
Paktalin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Button Cancel in AddWordActivity added
parent
4dd660d5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
5 deletions
app/src/main/java/com/paktalin/vocabularynotebook/UserManager.kt
app/src/main/java/com/paktalin/vocabularynotebook/activities/AddWordActivity.kt
app/src/main/java/com/paktalin/vocabularynotebook/UserPojo.java → app/src/main/java/com/paktalin/vocabularynotebook/pojo/UserPojo.java
app/src/main/java/com/paktalin/vocabularynotebook/VocabularyPojo.java → app/src/main/java/com/paktalin/vocabularynotebook/pojo/VocabularyPojo.java
app/src/main/java/com/paktalin/vocabularynotebook/WordPojo.java → app/src/main/java/com/paktalin/vocabularynotebook/pojo/WordPojo.java
app/src/main/res/layout/activity_add_word.xml
app/src/main/java/com/paktalin/vocabularynotebook/UserManager.kt
View file @
fc1ee8d4
...
...
@@ -4,6 +4,8 @@ import android.util.Log
import
com.google.firebase.auth.FirebaseUser
import
com.google.firebase.firestore.FirebaseFirestore
import
com.paktalin.vocabularynotebook.activities.LogInActivity
import
com.paktalin.vocabularynotebook.pojo.UserPojo
import
com.paktalin.vocabularynotebook.pojo.VocabularyPojo
import
java.util.*
class
UserManager
{
...
...
app/src/main/java/com/paktalin/vocabularynotebook/activities/AddWordActivity.kt
View file @
fc1ee8d4
package
com.paktalin.vocabularynotebook.activities
import
android.content.Intent
import
android.os.Bundle
import
android.support.v7.app.AppCompatActivity
import
android.util.Log
...
...
@@ -8,7 +9,7 @@ import com.google.firebase.firestore.FirebaseFirestore
import
com.paktalin.vocabularynotebook.R
import
com.paktalin.vocabularynotebook.Utils
import
com.paktalin.vocabularynotebook.WordPojo
import
com.paktalin.vocabularynotebook.
pojo.
WordPojo
import
kotlinx.android.synthetic.main.activity_add_word.*
class
AddWordActivity
:
AppCompatActivity
()
{
...
...
@@ -25,7 +26,8 @@ class AddWordActivity : AppCompatActivity() {
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_add_word
)
vocabularyId
=
intent
.
getStringExtra
(
"vocabularyId"
)
btnSubmitNewWord
.
setOnClickListener
(
{
addWordToDb
()
})
btnSubmitNewWord
.
setOnClickListener
{
addWordToDb
()
}
btnCancel
.
setOnClickListener
{
cancel
()
}
}
private
fun
addWordToDb
()
{
...
...
@@ -44,6 +46,11 @@ class AddWordActivity : AppCompatActivity() {
}
}
private
fun
cancel
()
{
val
intentMainActivity
=
Intent
(
this
,
MainActivity
::
class
.
java
)
startActivity
(
intentMainActivity
)
}
private
fun
clearFields
()
{
etWord
.
text
.
clear
()
etTranslation
.
text
.
clear
()
...
...
app/src/main/java/com/paktalin/vocabularynotebook/UserPojo.java
→
app/src/main/java/com/paktalin/vocabularynotebook/
pojo/
UserPojo.java
View file @
fc1ee8d4
package
com
.
paktalin
.
vocabularynotebook
;
package
com
.
paktalin
.
vocabularynotebook
.
pojo
;
import
com.google.firebase.firestore.DocumentReference
;
...
...
app/src/main/java/com/paktalin/vocabularynotebook/VocabularyPojo.java
→
app/src/main/java/com/paktalin/vocabularynotebook/
pojo/
VocabularyPojo.java
View file @
fc1ee8d4
package
com
.
paktalin
.
vocabularynotebook
;
package
com
.
paktalin
.
vocabularynotebook
.
pojo
;
public
class
VocabularyPojo
{
...
...
app/src/main/java/com/paktalin/vocabularynotebook/WordPojo.java
→
app/src/main/java/com/paktalin/vocabularynotebook/
pojo/
WordPojo.java
View file @
fc1ee8d4
package
com
.
paktalin
.
vocabularynotebook
;
package
com
.
paktalin
.
vocabularynotebook
.
pojo
;
public
class
WordPojo
{
...
...
app/src/main/res/layout/activity_add_word.xml
View file @
fc1ee8d4
...
...
@@ -38,4 +38,15 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/etTranslation"
/>
<Button
android:id=
"@+id/btnCancel"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"8dp"
android:layout_marginLeft=
"8dp"
android:layout_marginStart=
"8dp"
android:text=
"Cancel"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
/>
</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