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
bb6016cf
authored
Sep 12, 2018
by
Paktalin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor refactoring
parent
f33592da
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
8 deletions
app/src/main/java/com/paktalin/vocabularynotebook/ui/AddWordFragment.kt
app/src/main/java/com/paktalin/vocabularynotebook/ui/EditWordFragment.kt
app/src/main/java/com/paktalin/vocabularynotebook/ui/WordFragment.kt
app/src/main/java/com/paktalin/vocabularynotebook/ui/AddWordFragment.kt
View file @
bb6016cf
...
@@ -18,8 +18,8 @@ class AddWordFragment : WordFragment() {
...
@@ -18,8 +18,8 @@ class AddWordFragment : WordFragment() {
override
fun
saveToFirestore
(
wordPojo
:
WordItem
.
Pojo
,
vocabularyId
:
String
)
{
override
fun
saveToFirestore
(
wordPojo
:
WordItem
.
Pojo
,
vocabularyId
:
String
)
{
ConfiguredFirestore
.
instance
ConfiguredFirestore
.
instance
.
collection
(
VOCABULARIES
).
document
(
vocabularyId
)
.
collection
(
vocabularies
).
document
(
vocabularyId
)
.
collection
(
WORDS
).
add
(
wordPojo
)
.
collection
(
words
).
add
(
wordPojo
)
.
addOnSuccessListener
{
.
addOnSuccessListener
{
Log
.
i
(
TAG
,
"Successfully added a new word"
)
Log
.
i
(
TAG
,
"Successfully added a new word"
)
clearFields
()
clearFields
()
...
...
app/src/main/java/com/paktalin/vocabularynotebook/ui/EditWordFragment.kt
View file @
bb6016cf
...
@@ -53,8 +53,8 @@ class EditWordFragment : WordFragment() {
...
@@ -53,8 +53,8 @@ class EditWordFragment : WordFragment() {
override
fun
saveToFirestore
(
wordPojo
:
WordItem
.
Pojo
,
vocabularyId
:
String
)
{
override
fun
saveToFirestore
(
wordPojo
:
WordItem
.
Pojo
,
vocabularyId
:
String
)
{
ConfiguredFirestore
.
instance
ConfiguredFirestore
.
instance
.
collection
(
VOCABULARIES
).
document
(
vocabularyId
)
.
collection
(
vocabularies
).
document
(
vocabularyId
)
.
collection
(
WORDS
).
document
(
wordItem
.
id
).
set
(
wordPojo
)
.
collection
(
words
).
document
(
wordItem
.
id
).
set
(
wordPojo
)
.
addOnSuccessListener
{
.
addOnSuccessListener
{
Log
.
i
(
TAG
,
"Successfully updated the word"
)
Log
.
i
(
TAG
,
"Successfully updated the word"
)
hideSubmitButton
()
hideSubmitButton
()
...
@@ -71,5 +71,4 @@ class EditWordFragment : WordFragment() {
...
@@ -71,5 +71,4 @@ class EditWordFragment : WordFragment() {
}
}
companion
object
{
private
val
TAG
=
"VN/"
+
EditWordFragment
::
class
.
java
.
simpleName
}
companion
object
{
private
val
TAG
=
"VN/"
+
EditWordFragment
::
class
.
java
.
simpleName
}
}
}
\ No newline at end of file
app/src/main/java/com/paktalin/vocabularynotebook/ui/WordFragment.kt
View file @
bb6016cf
...
@@ -12,8 +12,8 @@ import com.paktalin.vocabularynotebook.WordItem
...
@@ -12,8 +12,8 @@ import com.paktalin.vocabularynotebook.WordItem
import
kotlinx.android.synthetic.main.fragment_new_word.*
import
kotlinx.android.synthetic.main.fragment_new_word.*
abstract
class
WordFragment
:
Fragment
()
{
abstract
class
WordFragment
:
Fragment
()
{
protected
val
VOCABULARIES
=
"vocabularies"
protected
val
vocabularies
=
"vocabularies"
protected
val
WORDS
=
"words"
protected
val
words
=
"words"
private
var
wordEmpty
:
Boolean
=
true
private
var
wordEmpty
:
Boolean
=
true
set
(
value
)
{
field
=
value
;
updateButtons
()
}
set
(
value
)
{
field
=
value
;
updateButtons
()
}
...
...
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