pull/1903/head
kunfei 3 years ago
parent 3b2865283a
commit f3e46a130f
  1. 2
      app/src/main/java/io/legado/app/ui/book/remote/RemoteBookActivity.kt
  2. 40
      app/src/main/res/layout/activity_remote_book.xml

@ -3,6 +3,7 @@ package io.legado.app.ui.book.remote
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.os.Bundle import android.os.Bundle
import androidx.activity.viewModels import androidx.activity.viewModels
import androidx.core.view.isGone
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import io.legado.app.R import io.legado.app.R
import io.legado.app.base.VMBaseActivity import io.legado.app.base.VMBaseActivity
@ -40,6 +41,7 @@ class RemoteBookActivity : VMBaseActivity<ActivityRemoteBookBinding,RemoteBookVi
launch { launch {
viewModel.dataFlow.conflate().collect { remoteBooks -> viewModel.dataFlow.conflate().collect { remoteBooks ->
binding.refreshProgressBar.isAutoLoading = false binding.refreshProgressBar.isAutoLoading = false
binding.tvEmptyMsg.isGone = remoteBooks.isEmpty()
adapter.setItems(remoteBooks) adapter.setItems(remoteBooks)
} }
} }

@ -2,25 +2,21 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools">
<io.legado.app.ui.widget.TitleBar <io.legado.app.ui.widget.TitleBar
android:id="@+id/titleBar" android:id="@+id/title_bar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:title="远程书籍" /> app:title="远程书籍" />
<!-- <io.legado.app.ui.widget.anima.RefreshProgressBar-->
<!-- android:id="@+id/refresh_progress_bar"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="2dp"-->
<!-- app:layout_constraintTop_toBottomOf="@id/lay_top" />-->
<io.legado.app.ui.widget.anima.RefreshProgressBar <io.legado.app.ui.widget.anima.RefreshProgressBar
android:id="@+id/refresh_progress_bar" android:id="@+id/refresh_progress_bar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="2dp" android:layout_height="2dp"
app:layout_constraintTop_toBottomOf="@id/titleBar" /> app:layout_constraintTop_toBottomOf="@id/title_bar" />
<io.legado.app.ui.widget.dynamiclayout.DynamicFrameLayout <io.legado.app.ui.widget.dynamiclayout.DynamicFrameLayout
android:id="@+id/content_view" android:id="@+id/content_view"
@ -36,11 +32,25 @@
</io.legado.app.ui.widget.dynamiclayout.DynamicFrameLayout> </io.legado.app.ui.widget.dynamiclayout.DynamicFrameLayout>
<!-- <io.legado.app.ui.widget.SelectActionBar--> <!-- <io.legado.app.ui.widget.SelectActionBar-->
<!-- android:id="@+id/select_action_bar"--> <!-- android:id="@+id/select_action_bar"-->
<!-- android:layout_width="match_parent"--> <!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"--> <!-- android:layout_height="wrap_content"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"--> <!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintTop_toBottomOf="@id/content_view"--> <!-- app:layout_constraintTop_toBottomOf="@id/content_view"-->
<!-- />--> <!-- />-->
<TextView
android:id="@+id/tv_empty_msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:gravity="center"
android:visibility="visible"
android:text="webDav book文件夹为空"
app:layout_constraintTop_toBottomOf="@+id/title_bar"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
tools:text="Empty" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
Loading…
Cancel
Save