mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-10 00:27:45 +00:00
better "add dictionary" button in dictionaries screen
This commit is contained in:
parent
b69ec39539
commit
f0bb541b72
1 changed files with 18 additions and 1 deletions
|
@ -4,9 +4,12 @@ package helium314.keyboard.settings.screens
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Surface
|
import androidx.compose.material3.Surface
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
|
@ -15,8 +18,10 @@ import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.buildAnnotatedString
|
import androidx.compose.ui.text.buildAnnotatedString
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
|
@ -70,7 +75,19 @@ fun DictionaryScreen(
|
||||||
},
|
},
|
||||||
itemContent = { locale ->
|
itemContent = { locale ->
|
||||||
if (locale.language == SubtypeLocaleUtils.NO_LANGUAGE) {
|
if (locale.language == SubtypeLocaleUtils.NO_LANGUAGE) {
|
||||||
Text(stringResource(R.string.add_new_dictionary_title), Modifier.clickable { showAddDictDialog = true })
|
Row(
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
horizontalArrangement = Arrangement.SpaceBetween,
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(vertical = 4.dp, horizontal = 16.dp)
|
||||||
|
.fillMaxWidth()
|
||||||
|
.clickable { showAddDictDialog = true }
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
stringResource(R.string.add_new_dictionary_title),
|
||||||
|
)
|
||||||
|
Icon(painterResource(R.drawable.ic_plus), stringResource(R.string.add_new_dictionary_title))
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Column(
|
Column(
|
||||||
Modifier.clickable { selectedLocale = locale }
|
Modifier.clickable { selectedLocale = locale }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue