diff options
author | Allan Wang <me@allanwang.ca> | 2017-06-26 20:06:24 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-06-26 20:06:24 -0700 |
commit | ed3efcef75bdcea962c1e281039d8bd96639e6a1 (patch) | |
tree | 59bff9ce9743cf6979d239750064a941187331c6 /app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt | |
parent | cddb866441d04814a13a0cedb7e1e3da4908ebf4 (diff) | |
download | frost-ed3efcef75bdcea962c1e281039d8bd96639e6a1.tar.gz frost-ed3efcef75bdcea962c1e281039d8bd96639e6a1.tar.bz2 frost-ed3efcef75bdcea962c1e281039d8bd96639e6a1.zip |
Update kau
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt index 2103a8ee..5cc5cfe8 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt @@ -69,7 +69,6 @@ class MainActivity : BaseActivity(), FrostWebViewSearch.SearchContract { field = value if (value && hiddenSearchView == null) { hiddenSearchView = FrostWebViewSearch(this, this) - currentFragment.frostWebView.addView(hiddenSearchView) } } var searchView: SearchView? = null @@ -321,10 +320,11 @@ class MainActivity : BaseActivity(), FrostWebViewSearch.SearchContract { toolbar.tint(Prefs.iconColor) setMenuIcons(menu, Prefs.iconColor, R.id.action_settings to GoogleMaterial.Icon.gmd_settings) - searchView = coordinator.bindSearchView(menu, R.id.action_search) { + searchView = bindSearchView(menu, R.id.action_search) { textObserver = { observable, _ -> - observable.subscribe { + observable.observeOn(AndroidSchedulers.mainThread()).subscribe { + L.d("Input $it") hiddenSearchView?.query(it) } } @@ -336,6 +336,10 @@ class MainActivity : BaseActivity(), FrostWebViewSearch.SearchContract { closeListener = { hiddenSearchView?.pauseLoad = true } + onItemClick = { + position, key, content, searchView -> + launchWebOverlay(key) + } } return true } @@ -367,6 +371,7 @@ class MainActivity : BaseActivity(), FrostWebViewSearch.SearchContract { } override fun onBackPressed() { + if (searchView?.onBackPressed() ?: false) return if (currentFragment.onBackPressed()) return super.onBackPressed() } |