From d224a54e252ccca0519db9441b35a7315c91510e Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 10 Sep 2019 14:13:04 +0800 Subject: [PATCH] up --- .../io/legado/app/ui/search/SearchActivity.kt | 3 ++- .../dynamiclayout/DynamicFrameLayout.kt | 25 ------------------- app/src/main/res/layout/activity_search.xml | 5 +++- 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/search/SearchActivity.kt b/app/src/main/java/io/legado/app/ui/search/SearchActivity.kt index d8b9cdf7e..7d206cb43 100644 --- a/app/src/main/java/io/legado/app/ui/search/SearchActivity.kt +++ b/app/src/main/java/io/legado/app/ui/search/SearchActivity.kt @@ -50,10 +50,11 @@ class SearchActivity : VMBaseActivity(R.layout.activity_search) search_view.clearFocus() query?.let { viewModel.search(it, { - content_view.showContentView() + refresh_progress_bar.isAutoLoading = true initData() fb_stop.visible() }, { + refresh_progress_bar.isAutoLoading = false fb_stop.invisible() }) } diff --git a/app/src/main/java/io/legado/app/ui/widget/dynamiclayout/DynamicFrameLayout.kt b/app/src/main/java/io/legado/app/ui/widget/dynamiclayout/DynamicFrameLayout.kt index 00bba86dd..99e0cd702 100644 --- a/app/src/main/java/io/legado/app/ui/widget/dynamiclayout/DynamicFrameLayout.kt +++ b/app/src/main/java/io/legado/app/ui/widget/dynamiclayout/DynamicFrameLayout.kt @@ -4,7 +4,6 @@ import android.content.Context import android.graphics.drawable.Drawable import android.util.AttributeSet import android.view.View -import android.view.ViewGroup import android.widget.FrameLayout import android.widget.ProgressBar import androidx.appcompat.widget.AppCompatButton @@ -61,30 +60,6 @@ class DynamicFrameLayout(context: Context, attrs: AttributeSet?) : FrameLayout(c } } - override fun addView(child: View) { - check(childCount <= 2) { "DynamicFrameLayout can host only one direct child" } - - super.addView(child) - } - - override fun addView(child: View, index: Int) { - check(childCount <= 2) { "DynamicFrameLayout can host only one direct child" } - - super.addView(child, index) - } - - override fun addView(child: View, params: ViewGroup.LayoutParams) { - check(childCount <= 2) { "DynamicFrameLayout can host only one direct child" } - - super.addView(child, params) - } - - override fun addView(child: View, index: Int, params: ViewGroup.LayoutParams) { - check(childCount <= 2) { "DynamicFrameLayout can host only one direct child" } - - super.addView(child, index, params) - } - override fun showErrorView(message: CharSequence) { ensureErrorView() diff --git a/app/src/main/res/layout/activity_search.xml b/app/src/main/res/layout/activity_search.xml index df00899cd..7d74faad8 100644 --- a/app/src/main/res/layout/activity_search.xml +++ b/app/src/main/res/layout/activity_search.xml @@ -23,12 +23,15 @@ app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintTop_toBottomOf="@id/title_bar"> - +