Add notice for when built in voice input is disabled

This commit is contained in:
Aleksandras Kostarevas 2024-05-12 18:26:57 -05:00
parent 790f90622f
commit ef1860b8d0

View File

@ -26,6 +26,7 @@ import androidx.navigation.NavHostController
import androidx.navigation.compose.rememberNavController import androidx.navigation.compose.rememberNavController
import org.futo.inputmethod.latin.BuildConfig import org.futo.inputmethod.latin.BuildConfig
import org.futo.inputmethod.latin.R import org.futo.inputmethod.latin.R
import org.futo.inputmethod.latin.uix.USE_SYSTEM_VOICE_INPUT
import org.futo.inputmethod.latin.uix.settings.NavigationItem import org.futo.inputmethod.latin.uix.settings.NavigationItem
import org.futo.inputmethod.latin.uix.settings.NavigationItemStyle import org.futo.inputmethod.latin.uix.settings.NavigationItemStyle
import org.futo.inputmethod.latin.uix.settings.ScreenTitle import org.futo.inputmethod.latin.uix.settings.ScreenTitle
@ -100,6 +101,7 @@ fun HomeScreen(navController: NavHostController = rememberNavController()) {
NavigationItem( NavigationItem(
title = "Voice Input", title = "Voice Input",
style = NavigationItemStyle.HomeSecondary, style = NavigationItemStyle.HomeSecondary,
subtitle = if(useDataStoreValueBlocking(USE_SYSTEM_VOICE_INPUT)) { "Built-in voice input is disabled!" } else { null },
navigate = { navController.navigate("voiceInput") }, navigate = { navController.navigate("voiceInput") },
icon = painterResource(id = R.drawable.mic_fill) icon = painterResource(id = R.drawable.mic_fill)
) )