This commit is contained in:
ocean 2025-12-05 17:35:34 +08:00
parent 83fd2ddfec
commit 8854c1576b

View File

@ -275,7 +275,7 @@ class MainActivity : BaseActivity(), PermissionDialogFragment.PermissionCallback
val promptDialogFragment = PromptDialogFragment.newInstance(
title = title, desc = desc
)
promptDialogFragment.onOkClick ={
promptDialogFragment.onOkClick = {
viewModel.deleteFiles(filesToDelete)
exitAllMultiSelect()
}
@ -364,18 +364,16 @@ class MainActivity : BaseActivity(), PermissionDialogFragment.PermissionCallback
}
private fun updateSelectedNav(fragment: Fragment) {
if (fragment is ToolsFrag) {//工具界面不展示权限与搜索和多选
//有权限隐藏下方的权限提示,反之
if (StoragePermissionHelper.hasBasicStoragePermission(this)) {
binding.pnLayout.visibility = View.GONE
if (fragment is ToolsFrag) {//在有权限的情况下,工具界面不展示搜索和多选
binding.topButtonLayout.visibility = View.GONE
} else {
binding.topButtonLayout.visibility = View.VISIBLE
if (!StoragePermissionHelper.hasBasicStoragePermission(this)) {
binding.pnLayout.visibility = View.VISIBLE
}
}
if (StoragePermissionHelper.hasBasicStoragePermission(this)) {
binding.topButtonLayout.visibility = View.VISIBLE
} else {
binding.pnLayout.visibility = View.VISIBLE
binding.topButtonLayout.visibility = View.GONE
}
when (fragment) {
@ -590,15 +588,13 @@ class MainActivity : BaseActivity(), PermissionDialogFragment.PermissionCallback
override fun onResume() {
super.onResume()
BannerManager.onResume(this,AdsInsUtil.AdPlacement.BAN_AND_HOMEPAGE)
BannerManager.onResume(this, AdsInsUtil.AdPlacement.BAN_AND_HOMEPAGE)
logDebug("main onResume")
if (StoragePermissionHelper.hasBasicStoragePermission(this)) {
// 有授权才初始化文件变化监听器
PRApp.getInstance().startFileChangeObserving()
scanningStrategy()
binding.pnLayout.visibility = View.GONE
} else {
binding.pnLayout.visibility = View.VISIBLE
val dialog = PermissionDialogFragment()
//如果之前展示过授权对话框,则不再展示
if (!appStore.isShowPermissionsDialogPrompt) {
@ -609,12 +605,12 @@ class MainActivity : BaseActivity(), PermissionDialogFragment.PermissionCallback
}
override fun onPause() {
BannerManager.onPause(this,AdsInsUtil.AdPlacement.BAN_AND_HOMEPAGE)
BannerManager.onPause(this, AdsInsUtil.AdPlacement.BAN_AND_HOMEPAGE)
super.onPause()
}
override fun onDestroy() {
BannerManager.onDestroy(this,AdsInsUtil.AdPlacement.BAN_AND_HOMEPAGE)
BannerManager.onDestroy(this, AdsInsUtil.AdPlacement.BAN_AND_HOMEPAGE)
super.onDestroy()
}