Make plugin screen scrollable

This commit is contained in:
MM20 2025-03-25 19:56:41 +01:00
parent b4056df5c2
commit 1315ae39b8
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -3,6 +3,7 @@ package de.mm20.launcher2.ui.settings.plugins
import android.app.Activity import android.app.Activity
import android.app.PendingIntent import android.app.PendingIntent
import android.content.Intent import android.content.Intent
import androidx.activity.compose.LocalActivity
import androidx.activity.compose.rememberLauncherForActivityResult import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
@ -19,6 +20,7 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.rounded.ArrowBack import androidx.compose.material.icons.automirrored.rounded.ArrowBack
import androidx.compose.material.icons.automirrored.rounded.InsertDriveFile import androidx.compose.material.icons.automirrored.rounded.InsertDriveFile
@ -77,7 +79,7 @@ import de.mm20.launcher2.ui.locals.LocalNavController
@Composable @Composable
fun PluginSettingsScreen(pluginId: String) { fun PluginSettingsScreen(pluginId: String) {
val navController = LocalNavController.current val navController = LocalNavController.current
val activity = LocalContext.current as AppCompatActivity val activity = LocalActivity.current
val context = LocalContext.current val context = LocalContext.current
val viewModel: PluginSettingsScreenVM = viewModel() val viewModel: PluginSettingsScreenVM = viewModel()
LaunchedEffect(pluginId) { LaunchedEffect(pluginId) {
@ -322,7 +324,9 @@ fun PluginSettingsScreen(pluginId: String) {
) )
} }
AnimatedVisibility(pluginPackage?.enabled == true && hasPermission == true) { AnimatedVisibility(pluginPackage?.enabled == true && hasPermission == true) {
Column { Column(
modifier = Modifier.verticalScroll(rememberScrollState())
) {
if (filePlugins.isNotEmpty()) { if (filePlugins.isNotEmpty()) {
PreferenceCategory( PreferenceCategory(
stringResource(R.string.plugin_type_filesearch), stringResource(R.string.plugin_type_filesearch),