Mark app search actions as experimental

This commit is contained in:
MM20 2022-11-19 14:26:22 +01:00
parent a2e6302cd3
commit 727a1a6002
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389
3 changed files with 23 additions and 1 deletions

View File

@ -705,4 +705,5 @@
<string name="search_action_websearch_url">URL template</string>
<string name="search_action_websearch_url_hint">The URL template that is used to construct the web search URL. Use ${1} as a placeholder for the actual search term, e.g. https://google.com?q=${1}.</string>
<string name="more_information">More information</string>
<string name="experimental_feature">Experimental</string>
</resources>

View File

@ -0,0 +1,19 @@
package de.mm20.launcher2.ui.component
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import de.mm20.launcher2.ui.R
@Composable
fun ExperimentalBadge(modifier: Modifier = Modifier) {
Box(modifier = modifier.background(MaterialTheme.colorScheme.primary, MaterialTheme.shapes.small).padding(4.dp)) {
Text(stringResource(id = R.string.experimental_feature), color = MaterialTheme.colorScheme.onPrimary, style = MaterialTheme.typography.labelSmall)
}
}

View File

@ -82,6 +82,7 @@ import de.mm20.launcher2.searchactions.builders.CustomizableSearchActionBuilder
import de.mm20.launcher2.searchactions.builders.WebsearchActionBuilder
import de.mm20.launcher2.ui.R
import de.mm20.launcher2.ui.component.BottomSheetDialog
import de.mm20.launcher2.ui.component.ExperimentalBadge
import de.mm20.launcher2.ui.component.SearchActionIcon
import de.mm20.launcher2.ui.ktx.toPixels
@ -256,9 +257,10 @@ private fun SelectTypePage(viewModel: EditSearchActionSheetVM) {
)
Text(
text = stringResource(R.string.create_search_action_type_app),
modifier = Modifier.padding(start = 16.dp),
modifier = Modifier.weight(1f).padding(start = 16.dp),
style = MaterialTheme.typography.labelLarge,
)
ExperimentalBadge(modifier = Modifier.padding(start = 16.dp))
}
}
OutlinedCard(