feat: Allow opening Apps/Files editors while hidden
Remove the blanket HIDDEN-state guards that blocked opening the app picker and adding folders when files are hidden. The per-app grey-out in the picker still protects hidden apps from being un-managed.
This commit is contained in:
@@ -30,7 +30,6 @@ import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.hilt.navigation.compose.hiltViewModel
|
||||
import deltazero.amarok.R
|
||||
import deltazero.amarok.core.Hider
|
||||
import deltazero.amarok.ui.theme.AmarokTheme
|
||||
import deltazero.amarok.utils.SDCardUtil
|
||||
import java.io.File
|
||||
@@ -73,13 +72,7 @@ fun FilesScreen(viewModel: FilesViewModel = hiltViewModel()) {
|
||||
folders = folders,
|
||||
hiddenFolders = hiddenFolders,
|
||||
processingFolders = processingFolders,
|
||||
onAddFolder = {
|
||||
if (Hider.getState() == Hider.State.HIDDEN) {
|
||||
Toast.makeText(context, R.string.setting_not_ava_when_hidden, Toast.LENGTH_SHORT).show()
|
||||
return@FilesScreen
|
||||
}
|
||||
dirLauncher.launch(null)
|
||||
},
|
||||
onAddFolder = { dirLauncher.launch(null) },
|
||||
onToggleAllFolders = { viewModel.toggleAllFolders() },
|
||||
onToggleFolder = { path ->
|
||||
val isHidden = hiddenFolders.contains(path)
|
||||
|
||||
@@ -3,7 +3,6 @@ package deltazero.amarok.ui
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.widget.Toast
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.activity.viewModels
|
||||
import androidx.compose.animation.core.tween
|
||||
@@ -72,20 +71,7 @@ class MainActivity : AmarokActivity() {
|
||||
DashboardScreen(onChangeStatus = { changeStatus() })
|
||||
}
|
||||
composable(AmarokRoute.APPS.route) {
|
||||
AppsScreen(
|
||||
onOpenEditor = {
|
||||
if (Hider.getState() == Hider.State.HIDDEN) {
|
||||
Toast.makeText(
|
||||
this@MainActivity,
|
||||
R.string.setting_not_ava_when_hidden,
|
||||
Toast.LENGTH_SHORT,
|
||||
)
|
||||
.show()
|
||||
return@AppsScreen
|
||||
}
|
||||
navController.navigate(AmarokRoutes.APP_PICKER)
|
||||
}
|
||||
)
|
||||
AppsScreen(onOpenEditor = { navController.navigate(AmarokRoutes.APP_PICKER) })
|
||||
}
|
||||
composable(AmarokRoute.FILES.route) { FilesScreen() }
|
||||
composable(AmarokRoutes.APP_PICKER) {
|
||||
|
||||
Reference in New Issue
Block a user