Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
skiko
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuqiang
skiko
Commits
6c1f03c1
Unverified
Commit
6c1f03c1
authored
Nov 27, 2022
by
Clément Beffa
Committed by
GitHub
Nov 27, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add keyboard customisation (iOS) (#622)
parent
7430638e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
8 deletions
+34
-8
getSkikoViewContoller.kt
...otlin/org/jetbrains/skiko/sample/getSkikoViewContoller.kt
+6
-3
SkikoUIView.kt
skiko/src/iosMain/kotlin/org/jetbrains/skiko/SkikoUIView.kt
+28
-5
No files found.
samples/SkiaMultiplatformSample/src/iosMain/kotlin/org/jetbrains/skiko/sample/getSkikoViewContoller.kt
View file @
6c1f03c1
...
...
@@ -8,11 +8,14 @@ import platform.UIKit.*
fun
makeApp
(
skiaLayer
:
SkiaLayer
)
=
IosClocks
(
skiaLayer
)
fun
getSkikoViewContoller
():
UIViewController
=
SkikoViewController
(
SkikoUIView
(
fun
getSkikoViewContoller
():
UIViewController
{
val
view
=
SkikoUIView
(
SkiaLayer
().
apply
{
gesturesToListen
=
SkikoGestureEventKind
.
values
()
skikoView
=
GenericSkikoView
(
this
,
makeApp
(
this
))
}
)
)
//view.currentKeyboardType = UIKeyboardTypePhonePad
//view.currentReturnKeyType = UIReturnKeyType.UIReturnKeyDone
return
SkikoViewController
(
view
)
}
skiko/src/iosMain/kotlin/org/jetbrains/skiko/SkikoUIView.kt
View file @
6c1f03c1
...
...
@@ -21,6 +21,14 @@ class SkikoUIView : UIView, UIKeyInputProtocol, UITextInputProtocol {
private
var
skiaLayer
:
SkiaLayer
?
=
null
private
var
_inputDelegate
:
UITextInputDelegateProtocol
?
=
null
private
var
_currentTextMenuActions
:
TextActions
?
=
null
var
currentKeyboardType
:
UIKeyboardType
=
UIKeyboardTypeDefault
var
currentKeyboardAppearance
:
UIKeyboardAppearance
=
UIKeyboardAppearanceDefault
var
currentReturnKeyType
:
UIReturnKeyType
=
UIReturnKeyType
.
UIReturnKeyDefault
var
currentTextContentType
:
UITextContentType
?
=
null
var
currentIsSecureTextEntry
:
Boolean
=
false
var
currentEnablesReturnKeyAutomatically
:
Boolean
=
false
var
currentAutocapitalizationType
:
UITextAutocapitalizationType
=
UITextAutocapitalizationType
.
UITextAutocapitalizationTypeSentences
var
currentAutocorrectionType
:
UITextAutocorrectionType
=
UITextAutocorrectionType
.
UITextAutocorrectionTypeYes
constructor
(
skiaLayer
:
SkiaLayer
,
frame
:
CValue
<
CGRect
>
=
CGRectNull
.
readValue
())
:
super
(
frame
)
{
this
.
skiaLayer
=
skiaLayer
...
...
@@ -409,20 +417,35 @@ class SkikoUIView : UIView, UIKeyInputProtocol, UITextInputProtocol {
}
override
fun
keyboardType
():
UIKeyboardType
{
return
UIKeyboardTypeDefault
//todo keyboardType
return
currentKeyboardType
}
override
fun
keyboardAppearance
():
UIKeyboardAppearance
{
return
currentKeyboardAppearance
}
override
fun
returnKeyType
():
UIReturnKeyType
{
return
currentReturnKeyType
}
override
fun
textContentType
():
UITextContentType
?
{
return
currentTextContentType
}
override
fun
isSecureTextEntry
():
Boolean
{
return
false
//todo secure text to prevent copy
return
currentIsSecureTextEntry
//todo secure text to prevent copy
}
override
fun
enablesReturnKeyAutomatically
():
Boolean
{
return
currentEnablesReturnKeyAutomatically
}
override
fun
autocapitalizationType
():
UITextAutocapitalizationType
{
return
UITextAutocapitalizationType
.
UITextAutocapitalizationTypeSentences
// return UITextAutocapitalizationType.UITextAutocapitalizationTypeAllCharacters
return
currentAutocapitalizationType
}
override
fun
autocorrectionType
():
UITextAutocorrectionType
{
return
UITextAutocorrectionType
.
UITextAutocorrectionTypeYes
return
currentAutocorrectionType
}
override
fun
dictationRecognitionFailed
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment