Commit a419bbf5 by Paktalin

Refactoring

parent c882a289
......@@ -28,7 +28,6 @@ class VocabularyAdapter(private val vocabulary: VocabSet, private val mainActivi
private lateinit var recyclerView: RecyclerView
private lateinit var viewHolder: ViewHolder
private var tracker: SelectionTracker<Long>? = null
private var menu = true
init {
setHasStableIds(true)
......@@ -68,7 +67,6 @@ class VocabularyAdapter(private val vocabulary: VocabSet, private val mainActivi
}
private fun showPopupMenu(v: View, position: Int) {
if (menu) {
val popup = PopupMenu(mainActivity, v)
popup.menuInflater.inflate(R.menu.word_item_menu, popup.menu)
popup.setOnMenuItemClickListener {
......@@ -83,18 +81,9 @@ class VocabularyAdapter(private val vocabulary: VocabSet, private val mainActivi
// if not edit mode, then start EditFragment
if (mainActivity.supportFragmentManager.findFragmentByTag("edit_fragment") == null)
popup.show()
} else {
Log.d(TAG, "not menu!")
}
}
fun refresh() {
/*displayedVocabulary.clear()
FirestoreManager().extractVocabulary { documents ->
displayedVocabulary.addWordsAsDocuments(documents)
this.notifyDataSetChanged()
}*/
}
fun refresh() {}
private fun deleteWord(wordPojo: WordPojo, position: Int) {
vocabulary.deleteWord(wordPojo)
......
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