Commit 79a385cd authored by wanglei's avatar wanglei

...

parent 2b0fe71a
...@@ -29,6 +29,7 @@ import com.base.pdfviewerscannerwhite.ui.view.DialogView.showDocumentHomeMoreDia ...@@ -29,6 +29,7 @@ import com.base.pdfviewerscannerwhite.ui.view.DialogView.showDocumentHomeMoreDia
import com.base.pdfviewerscannerwhite.ui.view.PdfDialog.showPdfHomeMoreDialog import com.base.pdfviewerscannerwhite.ui.view.PdfDialog.showPdfHomeMoreDialog
import com.base.pdfviewerscannerwhite.utils.LogEx import com.base.pdfviewerscannerwhite.utils.LogEx
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import java.io.File import java.io.File
import java.util.Locale import java.util.Locale
...@@ -56,6 +57,19 @@ class DocumentPageFragment() : BaseFragment<FragmentDocumentPageBinding>(), Docu ...@@ -56,6 +57,19 @@ class DocumentPageFragment() : BaseFragment<FragmentDocumentPageBinding>(), Docu
isInitialized = true isInitialized = true
} }
override fun setListener() {
super.setListener()
binding.swipeRefreshLayout.setOnRefreshListener {
binding.swipeRefreshLayout.isRefreshing = true
refreshData()
lifecycleScope.launch(Dispatchers.Main) {
delay(1500)
binding.swipeRefreshLayout.isRefreshing = false
}
}
}
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
refreshData() refreshData()
......
...@@ -16,6 +16,11 @@ ...@@ -16,6 +16,11 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipeRefreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv" android:id="@+id/rv"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -23,6 +28,9 @@ ...@@ -23,6 +28,9 @@
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_document" /> tools:listitem="@layout/item_document" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</LinearLayout> </LinearLayout>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment