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
8c089b2f
authored
Sep 09, 2018
by
Paktalin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor refactoring
parent
57728fc2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
6 deletions
app/src/main/java/com/paktalin/vocabularynotebook/VocabularyAdapter.kt
app/src/main/java/com/paktalin/vocabularynotebook/WordItem.kt
app/src/main/java/com/paktalin/vocabularynotebook/ui/NewWordFragment.kt
app/src/main/java/com/paktalin/vocabularynotebook/VocabularyAdapter.kt
View file @
8c089b2f
...
@@ -10,7 +10,7 @@ import android.widget.LinearLayout
...
@@ -10,7 +10,7 @@ import android.widget.LinearLayout
import
android.widget.TextView
import
android.widget.TextView
import
com.paktalin.vocabularynotebook.ui.WordItemInfoActivity
import
com.paktalin.vocabularynotebook.ui.WordItemInfoActivity
class
VocabularyAdapter
(
val
wordItems
:
MutableList
<
WordItem
>,
private
val
context
:
Activity
)
:
RecyclerView
.
Adapter
<
VocabularyAdapter
.
ViewHolder
>()
{
class
VocabularyAdapter
(
private
val
wordItems
:
MutableList
<
WordItem
>,
private
val
context
:
Activity
)
:
RecyclerView
.
Adapter
<
VocabularyAdapter
.
ViewHolder
>()
{
private
lateinit
var
recyclerView
:
RecyclerView
private
lateinit
var
recyclerView
:
RecyclerView
...
...
app/src/main/java/com/paktalin/vocabularynotebook/WordItem.kt
View file @
8c089b2f
...
@@ -28,7 +28,5 @@ class WordItem(word: String, translation: String, var id: String, private val vo
...
@@ -28,7 +28,5 @@ class WordItem(word: String, translation: String, var id: String, private val vo
.
addOnFailureListener
{
e
->
Log
.
w
(
TAG
,
"deleteWordWithId $id:failure"
,
e
.
fillInStackTrace
())
}
.
addOnFailureListener
{
e
->
Log
.
w
(
TAG
,
"deleteWordWithId $id:failure"
,
e
.
fillInStackTrace
())
}
}
}
companion
object
{
companion
object
{
private
val
TAG
=
"VN/"
+
WordItem
::
class
.
java
.
simpleName
}
private
val
TAG
=
"VN/"
+
WordItem
::
class
.
java
.
simpleName
}
}
}
app/src/main/java/com/paktalin/vocabularynotebook/ui/NewWordFragment.kt
View file @
8c089b2f
...
@@ -105,10 +105,10 @@ class NewWordFragment : Fragment() {
...
@@ -105,10 +105,10 @@ class NewWordFragment : Fragment() {
etTranslation
.
text
.
clear
()
etTranslation
.
text
.
clear
()
}
}
private
fun
updateRecycleView
(
w
ordItem
:
WordItem
)
{
private
fun
updateRecycleView
(
newW
ordItem
:
WordItem
)
{
(
activity
!!
.
supportFragmentManager
(
activity
!!
.
supportFragmentManager
.
findFragmentById
(
R
.
id
.
fragment_vocabulary
)
as
VocabularyFragment
)
.
findFragmentById
(
R
.
id
.
fragment_vocabulary
)
as
VocabularyFragment
)
.
addWordItem
(
w
ordItem
)
.
addWordItem
(
newW
ordItem
)
}
}
companion
object
{
private
val
TAG
=
"VN/"
+
NewWordFragment
::
class
.
java
.
simpleName
}
companion
object
{
private
val
TAG
=
"VN/"
+
NewWordFragment
::
class
.
java
.
simpleName
}
...
...
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