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