pull/32/head
kunfei 5 years ago
parent 37f91e8ed4
commit d224a54e25
  1. 3
      app/src/main/java/io/legado/app/ui/search/SearchActivity.kt
  2. 25
      app/src/main/java/io/legado/app/ui/widget/dynamiclayout/DynamicFrameLayout.kt
  3. 5
      app/src/main/res/layout/activity_search.xml

@ -50,10 +50,11 @@ class SearchActivity : VMBaseActivity<SearchViewModel>(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()
})
}

@ -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()

@ -23,12 +23,15 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/title_bar">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<io.legado.app.ui.widget.anima.RefreshProgressBar
android:id="@+id/refresh_progress_bar"
android:layout_width="match_parent"
android:layout_height="2dp" />
</io.legado.app.ui.widget.dynamiclayout.DynamicFrameLayout>

Loading…
Cancel
Save