Add help link for quick actions
This commit is contained in:
parent
92280b3f69
commit
0139f7a7e4
@ -1,7 +1,10 @@
|
|||||||
package de.mm20.launcher2.ui.settings.searchactions
|
package de.mm20.launcher2.ui.settings.searchactions
|
||||||
|
|
||||||
|
import android.net.Uri
|
||||||
import androidx.activity.compose.rememberLauncherForActivityResult
|
import androidx.activity.compose.rememberLauncherForActivityResult
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
|
import androidx.browser.customtabs.CustomTabColorSchemeParams
|
||||||
|
import androidx.browser.customtabs.CustomTabsIntent
|
||||||
import androidx.compose.animation.AnimatedVisibility
|
import androidx.compose.animation.AnimatedVisibility
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.border
|
import androidx.compose.foundation.border
|
||||||
@ -43,6 +46,7 @@ import androidx.compose.material3.FilledIconButton
|
|||||||
import androidx.compose.material3.FilledTonalIconButton
|
import androidx.compose.material3.FilledTonalIconButton
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
|
import androidx.compose.material3.LocalTextStyle
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.OutlinedButton
|
import androidx.compose.material3.OutlinedButton
|
||||||
import androidx.compose.material3.OutlinedCard
|
import androidx.compose.material3.OutlinedCard
|
||||||
@ -62,6 +66,7 @@ import androidx.compose.runtime.setValue
|
|||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
|
import androidx.compose.ui.graphics.toArgb
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.platform.LocalDensity
|
import androidx.compose.ui.platform.LocalDensity
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
@ -73,6 +78,7 @@ import androidx.compose.ui.text.input.OffsetMapping
|
|||||||
import androidx.compose.ui.text.input.TransformedText
|
import androidx.compose.ui.text.input.TransformedText
|
||||||
import androidx.compose.ui.text.input.VisualTransformation
|
import androidx.compose.ui.text.input.VisualTransformation
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
|
import androidx.compose.ui.text.style.TextDecoration
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||||
import de.mm20.launcher2.searchactions.actions.SearchActionIcon
|
import de.mm20.launcher2.searchactions.actions.SearchActionIcon
|
||||||
@ -257,7 +263,9 @@ private fun SelectTypePage(viewModel: EditSearchActionSheetVM) {
|
|||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.create_search_action_type_app),
|
text = stringResource(R.string.create_search_action_type_app),
|
||||||
modifier = Modifier.weight(1f).padding(start = 16.dp),
|
modifier = Modifier
|
||||||
|
.weight(1f)
|
||||||
|
.padding(start = 16.dp),
|
||||||
style = MaterialTheme.typography.labelLarge,
|
style = MaterialTheme.typography.labelLarge,
|
||||||
)
|
)
|
||||||
ExperimentalBadge(modifier = Modifier.padding(start = 16.dp))
|
ExperimentalBadge(modifier = Modifier.padding(start = 16.dp))
|
||||||
@ -413,6 +421,8 @@ fun CustomizeWebSearch(viewModel: EditSearchActionSheetVM) {
|
|||||||
|
|
||||||
val placeholderBackground = MaterialTheme.colorScheme.tertiary
|
val placeholderBackground = MaterialTheme.colorScheme.tertiary
|
||||||
val placeholderColor = MaterialTheme.colorScheme.onTertiary
|
val placeholderColor = MaterialTheme.colorScheme.onTertiary
|
||||||
|
val colorScheme = MaterialTheme.colorScheme
|
||||||
|
val context = LocalContext.current
|
||||||
OutlinedTextField(
|
OutlinedTextField(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth(),
|
.fillMaxWidth(),
|
||||||
@ -426,16 +436,24 @@ fun CustomizeWebSearch(viewModel: EditSearchActionSheetVM) {
|
|||||||
} else {
|
} else {
|
||||||
Column {
|
Column {
|
||||||
Text(stringResource(R.string.search_action_websearch_url_hint))
|
Text(stringResource(R.string.search_action_websearch_url_hint))
|
||||||
/** TODO: Write user guide for this and link it here
|
|
||||||
Text(
|
Text(
|
||||||
stringResource(R.string.more_information),
|
stringResource(R.string.more_information),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(vertical = 4.dp)
|
.padding(vertical = 4.dp)
|
||||||
.clickable { },
|
.clickable {
|
||||||
color = MaterialTheme.colorScheme.secondary,
|
|
||||||
style = LocalTextStyle.current.copy(textDecoration = TextDecoration.Underline)
|
CustomTabsIntent.Builder()
|
||||||
|
.setDefaultColorSchemeParams(
|
||||||
|
CustomTabColorSchemeParams.Builder()
|
||||||
|
.setToolbarColor(colorScheme.primaryContainer.toArgb())
|
||||||
|
.setSecondaryToolbarColor(colorScheme.secondaryContainer.toArgb())
|
||||||
|
.build()
|
||||||
|
)
|
||||||
|
.build().launchUrl(context, Uri.parse("https://kvaesitso.mm20.de/docs/user-guide/search/quickactions#web-search"))
|
||||||
|
},
|
||||||
|
color = MaterialTheme.colorScheme.secondary,
|
||||||
|
style = LocalTextStyle.current.copy(textDecoration = TextDecoration.Underline)
|
||||||
)
|
)
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -586,7 +604,9 @@ fun CustomizeCustomIntent(viewModel: EditSearchActionSheetVM) {
|
|||||||
|
|
||||||
if (action is CustomIntentActionBuilder) {
|
if (action is CustomIntentActionBuilder) {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.verticalScroll(rememberScrollState()).fillMaxWidth()
|
modifier = Modifier
|
||||||
|
.verticalScroll(rememberScrollState())
|
||||||
|
.fillMaxWidth()
|
||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
verticalAlignment = Alignment.Bottom
|
verticalAlignment = Alignment.Bottom
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
package de.mm20.launcher2.ui.settings.searchactions
|
package de.mm20.launcher2.ui.settings.searchactions
|
||||||
|
|
||||||
|
import android.net.Uri
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.browser.customtabs.CustomTabColorSchemeParams
|
||||||
|
import androidx.browser.customtabs.CustomTabsIntent
|
||||||
import androidx.compose.animation.core.animateDpAsState
|
import androidx.compose.animation.core.animateDpAsState
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
@ -12,6 +15,7 @@ import androidx.compose.foundation.lazy.items
|
|||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.rounded.Add
|
import androidx.compose.material.icons.rounded.Add
|
||||||
import androidx.compose.material.icons.rounded.ArrowBack
|
import androidx.compose.material.icons.rounded.ArrowBack
|
||||||
|
import androidx.compose.material.icons.rounded.HelpOutline
|
||||||
import androidx.compose.material3.CenterAlignedTopAppBar
|
import androidx.compose.material3.CenterAlignedTopAppBar
|
||||||
import androidx.compose.material3.FloatingActionButton
|
import androidx.compose.material3.FloatingActionButton
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
@ -25,6 +29,7 @@ import androidx.compose.runtime.getValue
|
|||||||
import androidx.compose.runtime.livedata.observeAsState
|
import androidx.compose.runtime.livedata.observeAsState
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.graphics.toArgb
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
@ -92,6 +97,23 @@ fun SearchActionsSettingsScreen() {
|
|||||||
Icon(imageVector = Icons.Rounded.ArrowBack, contentDescription = "Back")
|
Icon(imageVector = Icons.Rounded.ArrowBack, contentDescription = "Back")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
actions = {
|
||||||
|
IconButton(onClick = {
|
||||||
|
CustomTabsIntent.Builder()
|
||||||
|
.setDefaultColorSchemeParams(
|
||||||
|
CustomTabColorSchemeParams.Builder()
|
||||||
|
.setToolbarColor(colorScheme.primaryContainer.toArgb())
|
||||||
|
.setSecondaryToolbarColor(colorScheme.secondaryContainer.toArgb())
|
||||||
|
.build()
|
||||||
|
)
|
||||||
|
.build().launchUrl(context, Uri.parse("https://kvaesitso.mm20.de/docs/user-guide/search/quickactions"))
|
||||||
|
}) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Rounded.HelpOutline,
|
||||||
|
contentDescription = "Help"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
)
|
)
|
||||||
}) {
|
}) {
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user