|
@@ -1,12 +1,19 @@
|
|
|
package io.legado.app.ui.document
|
|
package io.legado.app.ui.document
|
|
|
|
|
|
|
|
import android.os.Bundle
|
|
import android.os.Bundle
|
|
|
|
|
+import android.view.ViewGroup
|
|
|
import androidx.activity.viewModels
|
|
import androidx.activity.viewModels
|
|
|
import androidx.appcompat.widget.SearchView
|
|
import androidx.appcompat.widget.SearchView
|
|
|
|
|
+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
|
|
|
|
|
+import io.legado.app.base.adapter.ItemViewHolder
|
|
|
|
|
+import io.legado.app.base.adapter.RecyclerAdapter
|
|
|
import io.legado.app.databinding.ActivityFileManageBinding
|
|
import io.legado.app.databinding.ActivityFileManageBinding
|
|
|
|
|
+import io.legado.app.databinding.ItemFileBinding
|
|
|
|
|
+import io.legado.app.lib.theme.backgroundColor
|
|
|
import io.legado.app.lib.theme.primaryTextColor
|
|
import io.legado.app.lib.theme.primaryTextColor
|
|
|
|
|
+import io.legado.app.utils.FileDoc
|
|
|
import io.legado.app.utils.applyTint
|
|
import io.legado.app.utils.applyTint
|
|
|
import io.legado.app.utils.viewbindingdelegate.viewBinding
|
|
import io.legado.app.utils.viewbindingdelegate.viewBinding
|
|
|
|
|
|
|
@@ -18,6 +25,9 @@ class FileManageActivity : VMBaseActivity<ActivityFileManageBinding, FileManageV
|
|
|
private val searchView: SearchView by lazy {
|
|
private val searchView: SearchView by lazy {
|
|
|
binding.titleBar.findViewById(R.id.search_view)
|
|
binding.titleBar.findViewById(R.id.search_view)
|
|
|
}
|
|
}
|
|
|
|
|
+ private val adapter by lazy {
|
|
|
|
|
+ FileAdapter()
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
|
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
|
|
initView()
|
|
initView()
|
|
@@ -25,11 +35,14 @@ class FileManageActivity : VMBaseActivity<ActivityFileManageBinding, FileManageV
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private fun initView() {
|
|
private fun initView() {
|
|
|
-
|
|
|
|
|
|
|
+ binding.layTop.setBackgroundColor(backgroundColor)
|
|
|
|
|
+ binding.recyclerView.layoutManager = LinearLayoutManager(this)
|
|
|
|
|
+ binding.recyclerView.adapter = adapter
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private fun initSearchView() {
|
|
private fun initSearchView() {
|
|
|
searchView.applyTint(primaryTextColor)
|
|
searchView.applyTint(primaryTextColor)
|
|
|
|
|
+ searchView.queryHint = getString(R.string.screen) + " • " + getString(R.string.file_manage)
|
|
|
searchView.onActionViewExpanded()
|
|
searchView.onActionViewExpanded()
|
|
|
searchView.isSubmitButtonEnabled = true
|
|
searchView.isSubmitButtonEnabled = true
|
|
|
searchView.clearFocus()
|
|
searchView.clearFocus()
|
|
@@ -45,4 +58,28 @@ class FileManageActivity : VMBaseActivity<ActivityFileManageBinding, FileManageV
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ inner class FileAdapter : RecyclerAdapter<FileDoc, ItemFileBinding>(this@FileManageActivity) {
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ override fun getViewBinding(parent: ViewGroup): ItemFileBinding {
|
|
|
|
|
+ TODO("Not yet implemented")
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ override fun registerListener(holder: ItemViewHolder, binding: ItemFileBinding) {
|
|
|
|
|
+ TODO("Not yet implemented")
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ override fun convert(
|
|
|
|
|
+ holder: ItemViewHolder,
|
|
|
|
|
+ binding: ItemFileBinding,
|
|
|
|
|
+ item: FileDoc,
|
|
|
|
|
+ payloads: MutableList<Any>
|
|
|
|
|
+ ) {
|
|
|
|
|
+ TODO("Not yet implemented")
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|