From f1aba3f7cfe482e20fe09945d088350eadfe02d6 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 25 Jun 2017 15:12:09 -0700 Subject: Test anko bug [skip ci] --- library/build.gradle | 2 +- .../main/kotlin/ca/allanwang/kau/kpref/KPrefBinder.kt | 16 +++++++--------- .../kotlin/ca/allanwang/kau/searchview/SearchView.kt | 19 ++++++++++--------- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/library/build.gradle b/library/build.gradle index 946dbe2..2c8bb58 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -61,7 +61,7 @@ dependencies { compile "com.jakewharton.timber:timber:${TIMBER}" - compile "org.jetbrains.anko:anko-commons:${ANKO}" +// compile "org.jetbrains.anko:anko-commons:${ANKO}" compile "io.reactivex.rxjava2:rxkotlin:${RX_JAVA}" compile "io.reactivex.rxjava2:rxandroid:${RX_ANDROID}" diff --git a/library/src/main/kotlin/ca/allanwang/kau/kpref/KPrefBinder.kt b/library/src/main/kotlin/ca/allanwang/kau/kpref/KPrefBinder.kt index 5fdb6bc..9503c3a 100644 --- a/library/src/main/kotlin/ca/allanwang/kau/kpref/KPrefBinder.kt +++ b/library/src/main/kotlin/ca/allanwang/kau/kpref/KPrefBinder.kt @@ -6,8 +6,6 @@ import android.support.v7.widget.RecyclerView import ca.allanwang.kau.R import ca.allanwang.kau.kpref.items.* import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter -import org.jetbrains.anko.doAsync -import org.jetbrains.anko.uiThread /** * Created by Allan Wang on 2017-06-08. @@ -24,13 +22,13 @@ fun RecyclerView.setKPrefAdapter(globalOptions: GlobalOptions, builder: KPrefAda val adapter = FastItemAdapter() adapter.withOnClickListener { v, _, item, _ -> item.onClick(v, v.findViewById(R.id.kau_pref_inner_content)) } this.adapter = adapter - doAsync { - val items = KPrefAdapterBuilder(globalOptions) - builder.invoke(items) - uiThread { - adapter.add(items.list) - } - } +// doAsync { +// val items = KPrefAdapterBuilder(globalOptions) +// builder.invoke(items) +// uiThread { +// adapter.add(items.list) +// } +// } return adapter } diff --git a/library/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt b/library/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt index e3931b9..08097de 100644 --- a/library/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt +++ b/library/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt @@ -21,7 +21,6 @@ import com.mikepenz.google_material_typeface_library.GoogleMaterial import com.mikepenz.iconics.typeface.IIcon import io.reactivex.Observable import io.reactivex.schedulers.Schedulers -import org.jetbrains.anko.runOnUiThread /** @@ -122,20 +121,22 @@ class SearchView @JvmOverloads constructor( */ var results: List get() = adapter.adapterItems - set(value) = context.runOnUiThread { - cardTransition() - adapter.setNewList( - if (configs.noResultsFound > 0 && value.isEmpty()) - listOf(SearchItem("", context.string(configs.noResultsFound), null)) - else value) - } + set(value) {} +// set(value) = context.runOnUiThread { +// cardTransition() +// adapter.setNewList( +// if (configs.noResultsFound > 0 && value.isEmpty()) +// listOf(SearchItem("", context.string(configs.noResultsFound), null)) +// else value) +// } /** * Empties the list on the UI thread * Note that this does not include any animations * Use results = listOf() for the animated version */ - internal fun clearResults() = context.runOnUiThread { adapter.clear() } + internal fun clearResults() {} +// = context.runOnUiThread { adapter.clear() } val configs = Configs() //views -- cgit v1.2.3