diff options
author | Allan Wang <me@allanwang.ca> | 2017-06-26 14:54:07 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-06-26 14:54:07 -0700 |
commit | 6270c060e4d33db12903e476146456569d260261 (patch) | |
tree | 828eb1d6da7ea1dae7b4e08c40cbb7fc08c88846 /app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewSearch.kt | |
parent | a95107d0d10583bfd95495bdc84cc23022b56000 (diff) | |
download | frost-6270c060e4d33db12903e476146456569d260261.tar.gz frost-6270c060e4d33db12903e476146456569d260261.tar.bz2 frost-6270c060e4d33db12903e476146456569d260261.zip |
Test dependencies
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewSearch.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewSearch.kt | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewSearch.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewSearch.kt index 6c9ee9d5..d42ea33e 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewSearch.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewSearch.kt @@ -6,6 +6,7 @@ import android.view.View import android.webkit.JavascriptInterface import android.webkit.WebView import android.webkit.WebViewClient +import ca.allanwang.kau.searchview.SearchItem import ca.allanwang.kau.utils.gone import com.pitchedapps.frost.facebook.FbTab import com.pitchedapps.frost.facebook.USER_AGENT_BASIC @@ -68,11 +69,11 @@ class FrostWebViewSearch(context: Context, val contract: SearchContract) : WebVi .subscribe { content: List<Pair<List<String>, String>> -> saveResultFrame(content) - content.forEach { + contract.emitSearchResponse(content.map { (texts, href) -> L.d("Search element $texts $href") - } - contract.emitSearchResponse() + SearchItem(href, texts[0], texts.getOrNull(1)) + }) } reload() } @@ -138,8 +139,7 @@ class FrostWebViewSearch(context: Context, val contract: SearchContract) : WebVi interface SearchContract { fun searchOverlayError() - //todo add args - fun emitSearchResponse() + fun emitSearchResponse(items: List<SearchItem>) } } |