Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
6bcbc38a
Commit
6bcbc38a
authored
3 months ago
by
Aleksandras Kostarevas
Browse files
Options
Downloads
Patches
Plain Diff
Fix touch typing mode
parent
88ecbf11
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/org/futo/inputmethod/latin/uix/BasicThemeProvider.kt
+23
-14
23 additions, 14 deletions
.../src/org/futo/inputmethod/latin/uix/BasicThemeProvider.kt
with
23 additions
and
14 deletions
java/src/org/futo/inputmethod/latin/uix/BasicThemeProvider.kt
+
23
−
14
View file @
6bcbc38a
...
...
@@ -15,7 +15,6 @@ import androidx.compose.ui.unit.Dp
import
androidx.compose.ui.unit.dp
import
androidx.datastore.preferences.core.Preferences
import
androidx.datastore.preferences.core.booleanPreferencesKey
import
androidx.datastore.preferences.core.floatPreferencesKey
import
org.futo.inputmethod.keyboard.internal.KeyboardIconsSet
import
org.futo.inputmethod.latin.R
import
org.futo.inputmethod.latin.uix.actions.AllActions
...
...
@@ -23,7 +22,7 @@ import org.futo.inputmethod.latin.uix.actions.AllActionsMap
import
org.futo.inputmethod.v2keyboard.KeyVisualStyle
val
KeyBordersSetting
=
SettingsKey
(
booleanPreferencesKey
(
"keyBorders"
),
true
)
val
HiddenKeysSetting
=
SettingsKey
(
booleanPreferencesKey
(
"hiddenKeys"
),
false
)
val
HiddenKeysSetting
=
SettingsKey
(
booleanPreferencesKey
(
"hiddenKeys
1
"
),
false
)
val
KeyHintsSetting
=
SettingsKey
(
booleanPreferencesKey
(
"keyHints"
),
false
)
fun
<
T
>
Preferences
.
get
(
key
:
SettingsKey
<
T
>):
T
{
...
...
@@ -279,25 +278,35 @@ class BasicThemeProvider(val context: Context, val colorScheme: KeyboardColorSch
}
keyStyles
=
mapOf
(
KeyVisualStyle
.
Action
to
VisualStyleDescriptor
(
backgroundDrawable
=
coloredRoundedRectangle
(
colorScheme
.
primary
.
toArgb
(),
dp
(
128
.
dp
)),
foregroundColor
=
colorScheme
.
onPrimary
.
toArgb
(),
KeyVisualStyle
.
Action
to
if
(
expertMode
)
{
VisualStyleDescriptor
(
backgroundDrawable
=
coloredRoundedRectangle
(
colorScheme
.
outline
.
copy
(
alpha
=
0.1f
).
toArgb
(),
dp
(
128
.
dp
)),
foregroundColor
=
colorScheme
.
onSurface
.
copy
(
alpha
=
0.6f
).
toArgb
(),
backgroundDrawablePressed
=
coloredRoundedRectangle
(
colorScheme
.
secondaryContainer
.
toArgb
(),
dp
(
128
.
dp
)),
foregroundColorPressed
=
colorScheme
.
onSecondaryContainer
.
toArgb
()
),
backgroundDrawablePressed
=
coloredRoundedRectangle
(
colorScheme
.
outline
.
copy
(
alpha
=
0.6f
).
toArgb
(),
dp
(
128
.
dp
)),
foregroundColorPressed
=
colorScheme
.
onSurface
.
toArgb
()
)
}
else
{
VisualStyleDescriptor
(
backgroundDrawable
=
coloredRoundedRectangle
(
colorScheme
.
primary
.
toArgb
(),
dp
(
128
.
dp
)),
foregroundColor
=
colorScheme
.
onPrimary
.
toArgb
(),
backgroundDrawablePressed
=
coloredRoundedRectangle
(
colorScheme
.
secondaryContainer
.
toArgb
(),
dp
(
128
.
dp
)),
foregroundColorPressed
=
colorScheme
.
onSecondaryContainer
.
toArgb
()
)
},
KeyVisualStyle
.
Normal
to
if
(
keyBorders
)
{
makeVisualStyle
(
keyColor
,
onKeyColor
,
if
(
expertMode
)
transparent
else
onKeyColor
,
highlight
,
keyCornerRadius
)
}
else
{
makeVisualStyle
(
transparent
,
onBackground
,
if
(
expertMode
)
transparent
else
onKeyColor
,
highlight
,
keyCornerRadius
)
...
...
@@ -314,14 +323,14 @@ class BasicThemeProvider(val context: Context, val colorScheme: KeyboardColorSch
KeyVisualStyle
.
Functional
to
if
(
keyBorders
)
{
makeVisualStyle
(
functionalKeyColor
,
onKeyColor
,
if
(
expertMode
)
Color
(
onKeyColor
).
copy
(
alpha
=
0.2f
).
toArgb
()
else
onKeyColor
,
highlight
,
keyCornerRadius
)
}
else
{
makeVisualStyle
(
transparent
,
onBackground
,
if
(
expertMode
)
Color
(
onKeyColor
).
copy
(
alpha
=
0.2f
).
toArgb
()
else
onKeyColor
,
highlight
,
keyCornerRadius
)
...
...
@@ -330,14 +339,14 @@ class BasicThemeProvider(val context: Context, val colorScheme: KeyboardColorSch
KeyVisualStyle
.
StickyOff
to
if
(
keyBorders
)
{
makeVisualStyle
(
keyColor
,
onKeyColor
,
if
(
expertMode
)
Color
(
onKeyColor
).
copy
(
alpha
=
0.2f
).
toArgb
()
else
onKeyColor
,
highlight
,
keyCornerRadius
)
}
else
{
makeVisualStyle
(
transparent
,
onBackground
,
if
(
expertMode
)
Color
(
onKeyColor
).
copy
(
alpha
=
0.2f
).
toArgb
()
else
onKeyColor
,
highlight
,
keyCornerRadius
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment