mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-04-19 13:49:13 +00:00
Fix last item on main settings screen.
Fix floating button.
This commit is contained in:
parent
86d4d0dfaf
commit
19cbbae2da
2 changed files with 60 additions and 52 deletions
|
@ -2,8 +2,10 @@
|
|||
package helium314.keyboard.settings.screens
|
||||
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
|
@ -42,59 +44,64 @@ fun MainSettingsScreen(
|
|||
settings = emptyList(),
|
||||
) {
|
||||
val enabledSubtypes = SubtypeSettings.getEnabledSubtypes(true)
|
||||
Column(Modifier.verticalScroll(rememberScrollState())) {
|
||||
Preference(
|
||||
name = stringResource(R.string.language_and_layouts_title),
|
||||
description = enabledSubtypes.joinToString(", ") { it.displayName(ctx) },
|
||||
onClick = onClickLanguage,
|
||||
icon = R.drawable.ic_settings_languages
|
||||
) { NextScreenIcon() }
|
||||
Preference(
|
||||
name = stringResource(R.string.settings_screen_preferences),
|
||||
onClick = onClickPreferences,
|
||||
icon = R.drawable.ic_settings_preferences
|
||||
) { NextScreenIcon() }
|
||||
Preference(
|
||||
name = stringResource(R.string.settings_screen_appearance),
|
||||
onClick = onClickAppearance,
|
||||
icon = R.drawable.ic_settings_appearance
|
||||
) { NextScreenIcon() }
|
||||
Preference(
|
||||
name = stringResource(R.string.settings_screen_toolbar),
|
||||
onClick = onClickToolbar,
|
||||
icon = R.drawable.ic_settings_toolbar
|
||||
) { NextScreenIcon() }
|
||||
if (JniUtils.sHaveGestureLib)
|
||||
Scaffold { innerPadding ->
|
||||
Column(
|
||||
Modifier.verticalScroll(rememberScrollState())
|
||||
.then(Modifier.padding(bottom = innerPadding.calculateBottomPadding()))
|
||||
) {
|
||||
Preference(
|
||||
name = stringResource(R.string.settings_screen_gesture),
|
||||
onClick = onClickGestureTyping,
|
||||
icon = R.drawable.ic_settings_gesture
|
||||
name = stringResource(R.string.language_and_layouts_title),
|
||||
description = enabledSubtypes.joinToString(", ") { it.displayName(ctx) },
|
||||
onClick = onClickLanguage,
|
||||
icon = R.drawable.ic_settings_languages
|
||||
) { NextScreenIcon() }
|
||||
Preference(
|
||||
name = stringResource(R.string.settings_screen_correction),
|
||||
onClick = onClickTextCorrection,
|
||||
icon = R.drawable.ic_settings_correction
|
||||
) { NextScreenIcon() }
|
||||
Preference(
|
||||
name = stringResource(R.string.settings_screen_secondary_layouts),
|
||||
onClick = onClickLayouts,
|
||||
icon = R.drawable.ic_ime_switcher
|
||||
) { NextScreenIcon() }
|
||||
Preference(
|
||||
name = stringResource(R.string.dictionary_settings_category),
|
||||
onClick = onClickDictionaries,
|
||||
icon = R.drawable.ic_dictionary
|
||||
) { NextScreenIcon() }
|
||||
Preference(
|
||||
name = stringResource(R.string.settings_screen_advanced),
|
||||
onClick = onClickAdvanced,
|
||||
icon = R.drawable.ic_settings_advanced
|
||||
) { NextScreenIcon() }
|
||||
Preference(
|
||||
name = stringResource(R.string.settings_screen_about),
|
||||
onClick = onClickAbout,
|
||||
icon = R.drawable.ic_settings_about
|
||||
) { NextScreenIcon() }
|
||||
Preference(
|
||||
name = stringResource(R.string.settings_screen_preferences),
|
||||
onClick = onClickPreferences,
|
||||
icon = R.drawable.ic_settings_preferences
|
||||
) { NextScreenIcon() }
|
||||
Preference(
|
||||
name = stringResource(R.string.settings_screen_appearance),
|
||||
onClick = onClickAppearance,
|
||||
icon = R.drawable.ic_settings_appearance
|
||||
) { NextScreenIcon() }
|
||||
Preference(
|
||||
name = stringResource(R.string.settings_screen_toolbar),
|
||||
onClick = onClickToolbar,
|
||||
icon = R.drawable.ic_settings_toolbar
|
||||
) { NextScreenIcon() }
|
||||
if (JniUtils.sHaveGestureLib)
|
||||
Preference(
|
||||
name = stringResource(R.string.settings_screen_gesture),
|
||||
onClick = onClickGestureTyping,
|
||||
icon = R.drawable.ic_settings_gesture
|
||||
) { NextScreenIcon() }
|
||||
Preference(
|
||||
name = stringResource(R.string.settings_screen_correction),
|
||||
onClick = onClickTextCorrection,
|
||||
icon = R.drawable.ic_settings_correction
|
||||
) { NextScreenIcon() }
|
||||
Preference(
|
||||
name = stringResource(R.string.settings_screen_secondary_layouts),
|
||||
onClick = onClickLayouts,
|
||||
icon = R.drawable.ic_ime_switcher
|
||||
) { NextScreenIcon() }
|
||||
Preference(
|
||||
name = stringResource(R.string.dictionary_settings_category),
|
||||
onClick = onClickDictionaries,
|
||||
icon = R.drawable.ic_dictionary
|
||||
) { NextScreenIcon() }
|
||||
Preference(
|
||||
name = stringResource(R.string.settings_screen_advanced),
|
||||
onClick = onClickAdvanced,
|
||||
icon = R.drawable.ic_settings_advanced
|
||||
) { NextScreenIcon() }
|
||||
Preference(
|
||||
name = stringResource(R.string.settings_screen_about),
|
||||
onClick = onClickAbout,
|
||||
icon = R.drawable.ic_settings_about
|
||||
) { NextScreenIcon() }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import androidx.compose.foundation.layout.Column
|
|||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.systemBarsPadding
|
||||
import androidx.compose.foundation.layout.wrapContentSize
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.material3.ExtendedFloatingActionButton
|
||||
|
@ -176,7 +177,7 @@ fun PersonalDictionaryScreen(
|
|||
onClick = { selectedWord = Word("", null, null) },
|
||||
text = { Text(stringResource(R.string.user_dict_add_word_button)) },
|
||||
icon = { Icon(painter = painterResource(R.drawable.ic_edit), stringResource(R.string.user_dict_add_word_button)) },
|
||||
modifier = Modifier.wrapContentSize(Alignment.BottomEnd).padding(all = 12.dp)
|
||||
modifier = Modifier.wrapContentSize(Alignment.BottomEnd).padding(all = 12.dp).then(Modifier.systemBarsPadding())
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue