Commit 8c089b2f by Paktalin

Minor refactoring

parent 57728fc2
...@@ -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
......
...@@ -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
}
} }
...@@ -105,10 +105,10 @@ class NewWordFragment : Fragment() { ...@@ -105,10 +105,10 @@ class NewWordFragment : Fragment() {
etTranslation.text.clear() etTranslation.text.clear()
} }
private fun updateRecycleView(wordItem: WordItem) { private fun updateRecycleView(newWordItem: WordItem) {
(activity!!.supportFragmentManager (activity!!.supportFragmentManager
.findFragmentById(R.id.fragment_vocabulary) as VocabularyFragment) .findFragmentById(R.id.fragment_vocabulary) as VocabularyFragment)
.addWordItem(wordItem) .addWordItem(newWordItem)
} }
companion object { private val TAG = "VN/" + NewWordFragment::class.java.simpleName } companion object { private val TAG = "VN/" + NewWordFragment::class.java.simpleName }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment