refactor(layout): 优化多个布局文件的结构和样式
-调整 TabLayout 属性以改善显示效果 - 移除不必要的 View 组件和布局嵌套 - 优化 ModFragment 中的代码结构 - 修复 UnitsActivity 中的 exitActivity 方法
This commit is contained in:
parent
64af11ffed
commit
1b69f434e8
|
@ -33,6 +33,7 @@ import kotlin.concurrent.thread
|
||||||
class UnitsActivity : BaseActivity<ActivityUnitsBinding>() {
|
class UnitsActivity : BaseActivity<ActivityUnitsBinding>() {
|
||||||
private lateinit var modPageAdapter: ModPageAdapter
|
private lateinit var modPageAdapter: ModPageAdapter
|
||||||
|
|
||||||
|
@Deprecated("Deprecated in Java")
|
||||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
super.onActivityResult(requestCode, resultCode, data)
|
super.onActivityResult(requestCode, resultCode, data)
|
||||||
if (resultCode == RESULT_OK && data != null) {
|
if (resultCode == RESULT_OK && data != null) {
|
||||||
|
@ -190,7 +191,7 @@ class UnitsActivity : BaseActivity<ActivityUnitsBinding>() {
|
||||||
/**
|
/**
|
||||||
* 关闭数据库链接并退出活动
|
* 关闭数据库链接并退出活动
|
||||||
*/
|
*/
|
||||||
fun exitActivity() {
|
private fun exitActivity() {
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@ import android.annotation.SuppressLint
|
||||||
import android.content.res.ColorStateList
|
import android.content.res.ColorStateList
|
||||||
import android.os.*
|
import android.os.*
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration
|
import androidx.recyclerview.widget.DividerItemDecoration
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
@ -21,8 +23,10 @@ import com.coldmint.rust.pro.databinding.FragmentModBinding
|
||||||
import com.coldmint.rust.pro.databinding.ModListItemBinding
|
import com.coldmint.rust.pro.databinding.ModListItemBinding
|
||||||
import com.coldmint.rust.pro.tool.AppSettings
|
import com.coldmint.rust.pro.tool.AppSettings
|
||||||
import com.coldmint.rust.pro.tool.GlobalMethod
|
import com.coldmint.rust.pro.tool.GlobalMethod
|
||||||
|
import com.coldmint.rust.pro.tool.Tools
|
||||||
import com.coldmint.rust.pro.ui.StableLinearLayoutManager
|
import com.coldmint.rust.pro.ui.StableLinearLayoutManager
|
||||||
import com.coldmint.rust.pro.viewmodel.ModViewModel
|
import com.coldmint.rust.pro.viewmodel.ModViewModel
|
||||||
|
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||||
import com.google.android.material.bottomsheet.BottomSheetDialog
|
import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||||
import com.google.android.material.divider.MaterialDividerItemDecoration
|
import com.google.android.material.divider.MaterialDividerItemDecoration
|
||||||
import com.google.android.material.snackbar.Snackbar
|
import com.google.android.material.snackbar.Snackbar
|
||||||
|
@ -41,8 +45,8 @@ class ModFragment : BaseFragment<FragmentModBinding>() {
|
||||||
val needRecycling by lazy {
|
val needRecycling by lazy {
|
||||||
if (GlobalMethod.isActive) {
|
if (GlobalMethod.isActive) {
|
||||||
AppSettings.getValue(
|
AppSettings.getValue(
|
||||||
AppSettings.Setting.EnableRecoveryStation,
|
AppSettings.Setting.EnableRecoveryStation,
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
|
@ -55,15 +59,15 @@ class ModFragment : BaseFragment<FragmentModBinding>() {
|
||||||
* @param modClass ModClass
|
* @param modClass ModClass
|
||||||
*/
|
*/
|
||||||
fun delFile(
|
fun delFile(
|
||||||
handler: Handler,
|
handler: Handler,
|
||||||
modClass: ModClass,
|
modClass: ModClass,
|
||||||
index: Int? = null
|
index: Int? = null
|
||||||
) {
|
) {
|
||||||
val scope = CoroutineScope(Job())
|
val scope = CoroutineScope(Job())
|
||||||
scope.launch {
|
scope.launch {
|
||||||
val targetFile = modClass.modFile
|
val targetFile = modClass.modFile
|
||||||
val errorFolder =
|
val errorFolder =
|
||||||
File(AppSettings.dataRootDirectory + "/modErrorReport/" + modClass.modName)
|
File(AppSettings.dataRootDirectory + "/modErrorReport/" + modClass.modName)
|
||||||
if (errorFolder.exists()) {
|
if (errorFolder.exists()) {
|
||||||
FileOperator.delete_files(errorFolder)
|
FileOperator.delete_files(errorFolder)
|
||||||
}
|
}
|
||||||
|
@ -71,7 +75,7 @@ class ModFragment : BaseFragment<FragmentModBinding>() {
|
||||||
requireActivity().applicationContext.dataDir.absolutePath + "/databases/"
|
requireActivity().applicationContext.dataDir.absolutePath + "/databases/"
|
||||||
} else {
|
} else {
|
||||||
FileOperator.getSuperDirectory(
|
FileOperator.getSuperDirectory(
|
||||||
requireContext().cacheDir
|
requireContext().cacheDir
|
||||||
) + "/databases/"
|
) + "/databases/"
|
||||||
}
|
}
|
||||||
val name = modClass.modName
|
val name = modClass.modName
|
||||||
|
@ -87,8 +91,8 @@ class ModFragment : BaseFragment<FragmentModBinding>() {
|
||||||
val removeFile: File
|
val removeFile: File
|
||||||
if (targetFile.isDirectory) {
|
if (targetFile.isDirectory) {
|
||||||
removePath = AppSettings.getValue(
|
removePath = AppSettings.getValue(
|
||||||
AppSettings.Setting.RecoveryStationFolder,
|
AppSettings.Setting.RecoveryStationFolder,
|
||||||
requireContext().filesDir.absolutePath + "/backup/"
|
requireContext().filesDir.absolutePath + "/backup/"
|
||||||
).toString() + targetFile.name + "/"
|
).toString() + targetFile.name + "/"
|
||||||
removeFile = File(removePath)
|
removeFile = File(removePath)
|
||||||
if (!removeFile.exists()) {
|
if (!removeFile.exists()) {
|
||||||
|
@ -96,8 +100,8 @@ class ModFragment : BaseFragment<FragmentModBinding>() {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
removePath = AppSettings.getValue(
|
removePath = AppSettings.getValue(
|
||||||
AppSettings.Setting.RecoveryStationFolder,
|
AppSettings.Setting.RecoveryStationFolder,
|
||||||
requireContext().filesDir.absolutePath + "/backup/"
|
requireContext().filesDir.absolutePath + "/backup/"
|
||||||
).toString() + targetFile.name
|
).toString() + targetFile.name
|
||||||
removeFile = File(removePath)
|
removeFile = File(removePath)
|
||||||
}
|
}
|
||||||
|
@ -106,24 +110,24 @@ class ModFragment : BaseFragment<FragmentModBinding>() {
|
||||||
}
|
}
|
||||||
handler.post {
|
handler.post {
|
||||||
Snackbar.make(
|
Snackbar.make(
|
||||||
viewBinding.modList,
|
viewBinding.modList,
|
||||||
String.format(
|
String.format(
|
||||||
getString(R.string.recoverying_prompt),
|
getString(R.string.recoverying_prompt),
|
||||||
modClass.modName
|
modClass.modName
|
||||||
),
|
),
|
||||||
Snackbar.LENGTH_INDEFINITE
|
Snackbar.LENGTH_INDEFINITE
|
||||||
).show()
|
).show()
|
||||||
}
|
}
|
||||||
result = FileOperator.removeFiles(targetFile, removeFile)
|
result = FileOperator.removeFiles(targetFile, removeFile)
|
||||||
if (result) {
|
if (result) {
|
||||||
handler.post {
|
handler.post {
|
||||||
Snackbar.make(
|
Snackbar.make(
|
||||||
viewBinding.modList,
|
viewBinding.modList,
|
||||||
String.format(
|
String.format(
|
||||||
requireContext().getString(R.string.recovery_prompt),
|
requireContext().getString(R.string.recovery_prompt),
|
||||||
modClass.modName
|
modClass.modName
|
||||||
),
|
),
|
||||||
Snackbar.LENGTH_SHORT
|
Snackbar.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
if (index != null) {
|
if (index != null) {
|
||||||
modAdapter.removeItem(index)
|
modAdapter.removeItem(index)
|
||||||
|
@ -132,32 +136,32 @@ class ModFragment : BaseFragment<FragmentModBinding>() {
|
||||||
} else {
|
} else {
|
||||||
handler.post {
|
handler.post {
|
||||||
Snackbar.make(
|
Snackbar.make(
|
||||||
viewBinding.modList,
|
viewBinding.modList,
|
||||||
getString(R.string.cut_failed),
|
getString(R.string.cut_failed),
|
||||||
Snackbar.LENGTH_SHORT
|
Snackbar.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
handler.post {
|
handler.post {
|
||||||
Snackbar.make(
|
Snackbar.make(
|
||||||
viewBinding.modList,
|
viewBinding.modList,
|
||||||
String.format(
|
String.format(
|
||||||
getString(R.string.del_moding_tip),
|
getString(R.string.del_moding_tip),
|
||||||
modClass.modName
|
modClass.modName
|
||||||
),
|
),
|
||||||
Snackbar.LENGTH_INDEFINITE
|
Snackbar.LENGTH_INDEFINITE
|
||||||
).show()
|
).show()
|
||||||
}
|
}
|
||||||
FileOperator.delete_files(targetFile)
|
FileOperator.delete_files(targetFile)
|
||||||
handler.post {
|
handler.post {
|
||||||
Snackbar.make(
|
Snackbar.make(
|
||||||
viewBinding.modList,
|
viewBinding.modList,
|
||||||
String.format(
|
String.format(
|
||||||
getString(R.string.del_completed),
|
getString(R.string.del_completed),
|
||||||
modClass.modName
|
modClass.modName
|
||||||
),
|
),
|
||||||
Snackbar.LENGTH_SHORT
|
Snackbar.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
if (index != null) {
|
if (index != null) {
|
||||||
modAdapter.removeItem(index)
|
modAdapter.removeItem(index)
|
||||||
|
@ -198,21 +202,19 @@ class ModFragment : BaseFragment<FragmentModBinding>() {
|
||||||
if (isAdded) {
|
if (isAdded) {
|
||||||
modAdapter = ModAdapter(requireContext(), dataList)
|
modAdapter = ModAdapter(requireContext(), dataList)
|
||||||
FastScrollerBuilder(viewBinding.modList).useMd2Style()
|
FastScrollerBuilder(viewBinding.modList).useMd2Style()
|
||||||
.setPopupTextProvider(modAdapter).build()
|
.setPopupTextProvider(modAdapter).build()
|
||||||
modAdapter.setItemEvent { i, modListItemBinding, viewHolder, modClass ->
|
modAdapter.setItemEvent { i, modListItemBinding, viewHolder, modClass ->
|
||||||
|
|
||||||
modListItemBinding.root.setOnClickListener {
|
modListItemBinding.root.setOnClickListener {
|
||||||
onClickItemWork(modListItemBinding, modClass)
|
onClickItemWork(modListItemBinding, modClass)
|
||||||
}
|
}
|
||||||
|
|
||||||
modListItemBinding.root.setOnLongClickListener {
|
modListItemBinding.root.setOnLongClickListener {
|
||||||
modAdapter.showDeleteItemDialog(
|
modAdapter.showDeleteItemDialog(
|
||||||
modClass.modName,
|
modClass.modName,
|
||||||
viewHolder.adapterPosition,
|
viewHolder.absoluteAdapterPosition,
|
||||||
onClickPositiveButton = { d, b ->
|
onClickPositiveButton = { d, b ->
|
||||||
delFile(handler, modClass, viewHolder.adapterPosition)
|
delFile(handler, modClass, viewHolder.absoluteAdapterPosition)
|
||||||
false
|
false
|
||||||
})
|
})
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -235,16 +237,16 @@ class ModFragment : BaseFragment<FragmentModBinding>() {
|
||||||
fun onClickItemWork(viewBinding: ModListItemBinding, modClass: ModClass) {
|
fun onClickItemWork(viewBinding: ModListItemBinding, modClass: ModClass) {
|
||||||
val context = requireContext()
|
val context = requireContext()
|
||||||
val modDialogBinding =
|
val modDialogBinding =
|
||||||
ModDialogBinding.inflate(LayoutInflater.from(context))
|
ModDialogBinding.inflate(LayoutInflater.from(context))
|
||||||
val bottomSheetDialog =
|
val bottomSheetDialog =
|
||||||
BottomSheetDialog(context)
|
BottomSheetDialog(context)
|
||||||
|
|
||||||
|
|
||||||
modDialogBinding.modNameView.text = viewBinding.modNameView.text
|
modDialogBinding.modNameView.text = viewBinding.modNameView.text
|
||||||
modDialogBinding.modNameDescription.text = viewBinding.modIntroductionView.text
|
modDialogBinding.modNameDescription.text = viewBinding.modIntroductionView.text
|
||||||
val configurationManager = modClass.modConfigurationManager
|
val configurationManager = modClass.modConfigurationManager
|
||||||
val configurationData: ModConfigurationData? =
|
val configurationData: ModConfigurationData? =
|
||||||
configurationManager?.readData()
|
configurationManager?.readData()
|
||||||
val works: MutableList<String> = ArrayList()
|
val works: MutableList<String> = ArrayList()
|
||||||
if (modClass.modFile.isDirectory) {
|
if (modClass.modFile.isDirectory) {
|
||||||
// val developerMode = AppSettings.getValue(AppSettings.Setting.DeveloperMode, false)
|
// val developerMode = AppSettings.getValue(AppSettings.Setting.DeveloperMode, false)
|
||||||
|
@ -266,7 +268,7 @@ class ModFragment : BaseFragment<FragmentModBinding>() {
|
||||||
works.add(getString(R.string.release))
|
works.add(getString(R.string.release))
|
||||||
if (configurationData != null) {
|
if (configurationData != null) {
|
||||||
val title = configurationData.updateTitle
|
val title = configurationData.updateTitle
|
||||||
if (!title.isEmpty()) {
|
if (title.isNotEmpty()) {
|
||||||
works.add(title)
|
works.add(title)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -282,11 +284,11 @@ class ModFragment : BaseFragment<FragmentModBinding>() {
|
||||||
}
|
}
|
||||||
works.add(getString(R.string.share_mod))
|
works.add(getString(R.string.share_mod))
|
||||||
val modActionAdapter = ModActionAdapter(
|
val modActionAdapter = ModActionAdapter(
|
||||||
context,
|
context,
|
||||||
works,
|
works,
|
||||||
modClass.modFile.path,
|
modClass.modFile.path,
|
||||||
this@ModFragment,
|
this@ModFragment,
|
||||||
bottomSheetDialog
|
bottomSheetDialog
|
||||||
)
|
)
|
||||||
if (configurationData != null) {
|
if (configurationData != null) {
|
||||||
modActionAdapter.setModConfigurationData(configurationData)
|
modActionAdapter.setModConfigurationData(configurationData)
|
||||||
|
@ -296,13 +298,13 @@ class ModFragment : BaseFragment<FragmentModBinding>() {
|
||||||
if (modClass.modIcon == null) {
|
if (modClass.modIcon == null) {
|
||||||
val drawable = context.getDrawable(R.drawable.image)
|
val drawable = context.getDrawable(R.drawable.image)
|
||||||
modDialogBinding.modIcon.setImageDrawable(
|
modDialogBinding.modIcon.setImageDrawable(
|
||||||
GlobalMethod.tintDrawable(
|
GlobalMethod.tintDrawable(
|
||||||
drawable, ColorStateList.valueOf(
|
drawable, ColorStateList.valueOf(
|
||||||
GlobalMethod.getColorPrimary(
|
GlobalMethod.getColorPrimary(
|
||||||
requireContext()
|
requireContext()
|
||||||
)
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
Glide.with(requireContext()).load(modClass.modIcon).into(modDialogBinding.modIcon)
|
Glide.with(requireContext()).load(modClass.modIcon).into(modDialogBinding.modIcon)
|
||||||
|
@ -310,16 +312,24 @@ class ModFragment : BaseFragment<FragmentModBinding>() {
|
||||||
} else {
|
} else {
|
||||||
val drawable = context.getDrawable(R.drawable.file)
|
val drawable = context.getDrawable(R.drawable.file)
|
||||||
modDialogBinding.modIcon.setImageDrawable(
|
modDialogBinding.modIcon.setImageDrawable(
|
||||||
GlobalMethod.tintDrawable(
|
GlobalMethod.tintDrawable(
|
||||||
drawable, ColorStateList.valueOf(
|
drawable, ColorStateList.valueOf(
|
||||||
GlobalMethod.getColorPrimary(
|
GlobalMethod.getColorPrimary(
|
||||||
requireContext()
|
requireContext()
|
||||||
)
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
bottomSheetDialog.setContentView(modDialogBinding.root)
|
bottomSheetDialog.setContentView(modDialogBinding.root)
|
||||||
|
val bottomSheet = bottomSheetDialog.findViewById<View>(com.google.android.material.R.id.design_bottom_sheet)
|
||||||
|
if (bottomSheet != null) {
|
||||||
|
val behavior = BottomSheetBehavior.from(bottomSheet)
|
||||||
|
behavior.state = BottomSheetBehavior.STATE_EXPANDED // 默认展开
|
||||||
|
behavior.isFitToContents = true // 使其填满屏幕
|
||||||
|
behavior.peekHeight = ViewGroup.LayoutParams.MATCH_PARENT
|
||||||
|
}
|
||||||
|
|
||||||
bottomSheetDialog.show()
|
bottomSheetDialog.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,11 +351,11 @@ class ModFragment : BaseFragment<FragmentModBinding>() {
|
||||||
override fun whenViewCreated(inflater: LayoutInflater, savedInstanceState: Bundle?) {
|
override fun whenViewCreated(inflater: LayoutInflater, savedInstanceState: Bundle?) {
|
||||||
viewBinding.modList.layoutManager = StableLinearLayoutManager(requireContext())
|
viewBinding.modList.layoutManager = StableLinearLayoutManager(requireContext())
|
||||||
val divider = MaterialDividerItemDecoration(
|
val divider = MaterialDividerItemDecoration(
|
||||||
requireContext(),
|
requireContext(),
|
||||||
MaterialDividerItemDecoration.VERTICAL
|
MaterialDividerItemDecoration.VERTICAL
|
||||||
)
|
)
|
||||||
viewBinding.modList.addItemDecoration(
|
viewBinding.modList.addItemDecoration(
|
||||||
divider
|
divider
|
||||||
)
|
)
|
||||||
viewBinding.swipeRefreshLayout.setOnRefreshListener {
|
viewBinding.swipeRefreshLayout.setOnRefreshListener {
|
||||||
loadModList()
|
loadModList()
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<merge>
|
<merge>
|
||||||
|
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout 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="0dp"
|
android:layout_width="0dp"
|
||||||
|
@ -7,26 +8,9 @@
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="?android:colorBackground">
|
android:background="?android:colorBackground">
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/titleView"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="?android:attr/actionBarSize"
|
|
||||||
android:gravity="center"
|
|
||||||
android:fitsSystemWindows="true"
|
|
||||||
android:background="?android:windowBackground"
|
|
||||||
app:cardElevation="2dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/TextAppearance.Material3.TitleMedium"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/file_manager" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_below="@id/titleView"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
|
|
@ -19,19 +19,10 @@
|
||||||
android:id="@+id/tabLayout"
|
android:id="@+id/tabLayout"
|
||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
app:tabGravity="center"
|
||||||
|
app:tabMode="auto"
|
||||||
<!-- <com.google.android.material.tabs.TabItem-->
|
app:tabMaxWidth="300dp"
|
||||||
<!-- android:layout_width="wrap_content"-->
|
android:layout_height="wrap_content" />
|
||||||
<!-- android:layout_height="wrap_content"-->
|
|
||||||
<!-- android:text="全部" />-->
|
|
||||||
|
|
||||||
<!-- <com.google.android.material.tabs.TabItem-->
|
|
||||||
<!-- android:layout_width="wrap_content"-->
|
|
||||||
<!-- android:layout_height="wrap_content"-->
|
|
||||||
<!-- android:text="最近" />-->
|
|
||||||
|
|
||||||
</com.google.android.material.tabs.TabLayout>
|
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
@ -51,6 +42,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom|end"
|
android:layout_gravity="bottom|end"
|
||||||
android:layout_margin="16dp"
|
android:layout_margin="16dp"
|
||||||
android:src="@drawable/add" />
|
android:importantForAccessibility="no"
|
||||||
|
android:src="@drawable/add" />
|
||||||
|
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<merge>
|
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout 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"
|
||||||
|
@ -7,26 +8,9 @@
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:background="?android:colorBackground">
|
android:background="?android:colorBackground">
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/titleView"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="?android:attr/actionBarSize"
|
|
||||||
android:gravity="center"
|
|
||||||
android:fitsSystemWindows="true"
|
|
||||||
android:background="?android:windowBackground"
|
|
||||||
app:cardElevation="2dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/TextAppearance.Material3.TitleMedium"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/file_manager" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_below="@id/titleView"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
@ -53,6 +37,7 @@
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_margin="16dp"
|
android:layout_margin="16dp"
|
||||||
|
android:importantForAccessibility="no"
|
||||||
android:src="@drawable/add"
|
android:src="@drawable/add"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout 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"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:animateLayoutChanges="true"
|
android:animateLayoutChanges="true"
|
||||||
|
@ -17,9 +18,11 @@
|
||||||
android:id="@+id/modErrorIcon"
|
android:id="@+id/modErrorIcon"
|
||||||
android:layout_width="100dp"
|
android:layout_width="100dp"
|
||||||
android:layout_height="100dp"
|
android:layout_height="100dp"
|
||||||
|
android:importantForAccessibility="no"
|
||||||
android:src="@drawable/empty_content"
|
android:src="@drawable/empty_content"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:tint="?attr/colorControlNormal" />
|
app:tint="?attr/colorControlNormal"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/modError"
|
android:id="@+id/modError"
|
||||||
|
@ -33,10 +36,10 @@
|
||||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
android:id="@+id/swipeRefreshLayout"
|
android:id="@+id/swipeRefreshLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:visibility="gone"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginHorizontal="16dp"
|
android:layout_marginHorizontal="16dp"
|
||||||
android:layout_height="match_parent">
|
android:layout_marginTop="8dp"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
|
Loading…
Reference in New Issue
Block a user