Commit 805851f9 authored by wanglei's avatar wanglei

初始化

parent ca2fb258
Pipeline #1291 canceled with stages
......@@ -42,7 +42,8 @@ class DocumentAdapter() : BaseQuickAdapter<DocumentBean, DocumentAdapter.Documen
val file = File(item.path)
runCatching {
binding.tvName.text = file.name
binding.tvInfo.text = file.lastModified().toFormatTime() + " " + file.length().toFormatSize()
binding.tvTime.text = file.lastModified().toFormatTime()
binding.tvSize.text = file.length().toFormatSize()
}
when (item.uiType) {
0 -> {//首页
......
......@@ -68,7 +68,7 @@ class DocumentFragment() : BaseFragment<FragmentDocumentBinding>() {
binding.rv.adapter = adapter
}
private var documentMoreAction: (item: DocumentBean) -> Unit = { item ->
var documentMoreAction: (item: DocumentBean) -> Unit = { item ->
val mainActivity = (requireActivity() as MainActivity)
if (item.type == TYPE_PDF) {
requireContext().showPdfHomeMoreDialog(item, this, documentPresenter)
......
......@@ -16,7 +16,6 @@ import com.base.pdfreader2.bean.ConstObject.BOOKMARK_DATA_TYPE
import com.base.pdfreader2.bean.ConstObject.DOCUMENT_DATA_TYPE
import com.base.pdfreader2.bean.ConstObject.RECENT_DATA_TYPE
import com.base.pdfreader2.bean.DocumentBean
import com.base.pdfreader2.bean.DocumentBean.Companion.TYPE_PDF
import com.base.pdfreader2.databinding.ActivityMainBinding
import com.base.pdfreader2.helper.BaseActivity
import com.base.pdfreader2.ui.view.DialogView.showSortDialog
......@@ -202,7 +201,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
searchAdapter = DocumentAdapter()
binding.rvSearch.adapter = searchAdapter
searchAdapter.moreAction = { item ->
documentMoreAction.invoke(item)
currentPage.documentMoreAction.invoke(item)
}
searchAdapter.itemClick = {
jumpDocument(it)
......@@ -226,19 +225,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
}
var documentMoreAction: (item: DocumentBean) -> Unit = { item ->
if (item.type == TYPE_PDF) {
// showPdfHomeMoreDialog(
// item, mainActivity, documentFragment, this
// )
}
// if (item.type == TYPE_WORD || item.type == TYPE_EXCEL || item.type == TYPE_PPT) {
// requireContext().showDocumentHomeMoreDialog(item, mainActivity, documentFragment, this)
// }
}
fun changeSearchUI(show: Boolean) {
binding.llSearch.setOnClickListener { }
if (show) {
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#C0C0C0" />
</shape>
\ No newline at end of file
......@@ -435,15 +435,13 @@
android:id="@+id/ll_search"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FAF8B9"
android:background="@color/white"
android:orientation="vertical"
android:visibility="gone">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FA1615">
android:layout_height="wrap_content">
<FrameLayout
android:id="@+id/fl_fanhui_2"
......
......@@ -18,7 +18,7 @@
android:id="@+id/iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="15dp"
android:layout_marginVertical="18dp"
android:layout_marginStart="15dp"
android:src="@mipmap/pdficon"
app:layout_constraintBottom_toBottomOf="parent"
......@@ -115,18 +115,53 @@
android:textStyle="bold"
tools:ignore="HardcodedText" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:includeFontPadding="false"
android:textColor="#999999"
android:textSize="14sp"
tools:text="2024-09-10" />
<ImageView
android:layout_width="5dp"
android:layout_height="5dp"
android:layout_gravity="center_vertical"
android:layout_marginHorizontal="8dp"
android:background="@drawable/bg_circle_c0c0c0"
tools:ignore="ContentDescription" />
<TextView
android:id="@+id/tv_info"
android:id="@+id/tv_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_gravity="center_vertical"
android:includeFontPadding="false"
android:textColor="#999999"
android:textSize="14sp"
tools:text="2024-09-10 590.23 KB" />
tools:text="590.23 KB" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="1px"
android:layout_marginEnd="15dp"
android:background="#ECECEC"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/fl_more"
app:layout_constraintStart_toStartOf="@id/iv" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
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