增加内置文件管理器,未完成
This commit is contained in:
@@ -290,6 +290,11 @@
|
|||||||
android:name=".ui.dict.rule.DictRuleActivity"
|
android:name=".ui.dict.rule.DictRuleActivity"
|
||||||
android:configChanges="orientation|screenSize"
|
android:configChanges="orientation|screenSize"
|
||||||
android:hardwareAccelerated="true" />
|
android:hardwareAccelerated="true" />
|
||||||
|
<!-- 文件管理 -->
|
||||||
|
<activity
|
||||||
|
android:name=".ui.document.FileManageActivity"
|
||||||
|
android:configChanges="orientation|screenSize"
|
||||||
|
android:hardwareAccelerated="true" />
|
||||||
<!-- 选择文件 -->
|
<!-- 选择文件 -->
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.document.HandleFileActivity"
|
android:name=".ui.document.HandleFileActivity"
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package io.legado.app.ui.document
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.activity.viewModels
|
||||||
|
import androidx.appcompat.widget.SearchView
|
||||||
|
import io.legado.app.R
|
||||||
|
import io.legado.app.base.VMBaseActivity
|
||||||
|
import io.legado.app.databinding.ActivityFileManageBinding
|
||||||
|
import io.legado.app.lib.theme.primaryTextColor
|
||||||
|
import io.legado.app.utils.applyTint
|
||||||
|
import io.legado.app.utils.viewbindingdelegate.viewBinding
|
||||||
|
|
||||||
|
class FileManageActivity : VMBaseActivity<ActivityFileManageBinding, FileManageViewModel>() {
|
||||||
|
|
||||||
|
|
||||||
|
override val binding by viewBinding(ActivityFileManageBinding::inflate)
|
||||||
|
override val viewModel by viewModels<FileManageViewModel>()
|
||||||
|
private val searchView: SearchView by lazy {
|
||||||
|
binding.titleBar.findViewById(R.id.search_view)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||||
|
initView()
|
||||||
|
initSearchView()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initView() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initSearchView() {
|
||||||
|
searchView.applyTint(primaryTextColor)
|
||||||
|
searchView.onActionViewExpanded()
|
||||||
|
searchView.isSubmitButtonEnabled = true
|
||||||
|
searchView.clearFocus()
|
||||||
|
searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
|
||||||
|
override fun onQueryTextSubmit(query: String?): Boolean {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onQueryTextChange(newText: String?): Boolean {
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package io.legado.app.ui.document
|
||||||
|
|
||||||
|
import android.app.Application
|
||||||
|
import io.legado.app.base.BaseViewModel
|
||||||
|
|
||||||
|
class FileManageViewModel(application: Application) : BaseViewModel(application) {
|
||||||
|
}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<io.legado.app.ui.widget.TitleBar
|
||||||
|
android:id="@+id/titleBar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:contentInsetStartWithNavigation="0dp"
|
||||||
|
app:contentLayout="@layout/view_search" />
|
||||||
|
|
||||||
|
<!--path-->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/lay_top"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/background"
|
||||||
|
android:elevation="1dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:minHeight="36dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="8dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/titleBar">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_path"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:focusable="true"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="@color/secondaryText"
|
||||||
|
android:textSize="13sp"
|
||||||
|
tools:text="/" />
|
||||||
|
|
||||||
|
<io.legado.app.ui.widget.text.StrokeTextView
|
||||||
|
android:id="@+id/tv_go_back"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
|
android:text="@string/go_back"
|
||||||
|
android:textFontWeight="800"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:cornerRadius="5dp"
|
||||||
|
tools:ignore="UnusedAttribute" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<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" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/select_action_bar"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/refresh_progress_bar">
|
||||||
|
|
||||||
|
<io.legado.app.ui.widget.recycler.scroller.FastScrollRecyclerView
|
||||||
|
android:id="@+id/recycler_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:ignore="SpeakableTextPresentCheck" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_empty_msg"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_margin="16dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/empty"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:text="TextView" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<io.legado.app.ui.widget.SelectActionBar
|
||||||
|
android:id="@+id/select_action_bar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
Reference in New Issue
Block a user