Commit 51570a31 by Paktalin

hopefully fixed the bug with latinit searchView

parent 103df8c5
...@@ -24,7 +24,6 @@ class MainActivity : AppCompatActivity() { ...@@ -24,7 +24,6 @@ class MainActivity : AppCompatActivity() {
lateinit var vocabularyFragment: VocabularyFragment lateinit var vocabularyFragment: VocabularyFragment
lateinit var searchView: SearchView lateinit var searchView: SearchView
lateinit var optionsMenu: Menu
var inEditMode = false var inEditMode = false
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
...@@ -35,13 +34,14 @@ class MainActivity : AppCompatActivity() { ...@@ -35,13 +34,14 @@ class MainActivity : AppCompatActivity() {
swipeRefresh.setColorSchemeResources(R.color.colorAccent) swipeRefresh.setColorSchemeResources(R.color.colorAccent)
hideKeyboard() hideKeyboard()
setUpNavigationView() setUpNavigationView()
extractVocabularyData()
} }
override fun onCreateOptionsMenu(menu: Menu?): Boolean { override fun onCreateOptionsMenu(menu: Menu?): Boolean {
optionsMenu = menu!!
menuInflater.inflate(R.menu.options_menu, menu) menuInflater.inflate(R.menu.options_menu, menu)
searchView = menu.findItem(R.id.search).actionView as SearchView searchView = menu!!.findItem(R.id.search).actionView as SearchView
// extract vocabulary data only after searchView is initialized,
// since it needs to be called in the VocabularyFragment initialization
extractVocabularyData()
return true return true
} }
......
...@@ -12,6 +12,6 @@ class LockableLayoutManager(context: Context) : LinearLayoutManager(context) { ...@@ -12,6 +12,6 @@ class LockableLayoutManager(context: Context) : LinearLayoutManager(context) {
} }
companion object { companion object {
private val TAG = "VN/" + VocabularyFragment::class.simpleName private val TAG = "VN/" + LockableLayoutManager::class.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