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
ff9ecbc2
Unverified
Commit
ff9ecbc2
authored
Jul 04, 2023
by
dima.avdeev
Committed by
GitHub
Jul 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iOS TextField add keyboard options (#743)
* iOS TextField add keyboard options * Simplify lateinit vars
parent
52c586f9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
48 deletions
+52
-48
RELEASE.md
skiko/RELEASE.md
+7
-7
SkikoUIView.kt
skiko/src/iosMain/kotlin/org/jetbrains/skiko/SkikoUIView.kt
+14
-41
UIKitKeyboardOptions.kt
...in/kotlin/org/jetbrains/skiko/ios/UIKitKeyboardOptions.kt
+31
-0
No files found.
skiko/RELEASE.md
View file @
ff9ecbc2
...
...
@@ -20,33 +20,33 @@ build configuration.
## Publishing
##### Publish JVM target to Maven local
```
```
bash
./gradlew publishToMavenLocal
```
##### Publish all targets to Maven Local
```
```
bash
./gradlew publishToMavenLocal
-Pskiko
.native.enabled
=
true
-Pskiko
.wasm.enabled
=
true
-Pskiko
.android.enabled
=
true
```
##### Publish to `build/repo` directory
```
```
bash
./gradlew publishToBuildRepo
```
##### Publish to Compose repo
Set up environment variables
`COMPOSE_REPO_USERNAME`
and
`COMPOSE_REPO_KEY`
.
```
```
bash
./gradlew publishToComposeRepo
```
##### Publish to all repositories
```
```
bash
./gradlew publish
```
##### Publish local version
```
```
bash
./gradlew <PUBLISH_TASK>
-Pdeploy
.version
=
0.2.0
-Pdeploy
.release
=
true
```
...
...
@@ -54,7 +54,7 @@ Set up environment variables `COMPOSE_REPO_USERNAME` and `COMPOSE_REPO_KEY`.
macOS for Apple Silicon builds aimed for distribution require mandatory code signing,
so use command like
```
```
bash
./gradlew
-Psigner
=
"Apple Distribution: Nikolay Igotti (N462MKSJ7M)"
<PUBLISH_TASK>
```
to codesign the JNI library.
...
...
skiko/src/iosMain/kotlin/org/jetbrains/skiko/SkikoUIView.kt
View file @
ff9ecbc2
...
...
@@ -3,6 +3,7 @@ package org.jetbrains.skiko
import
kotlinx.cinterop.*
import
org.jetbrains.skia.Point
import
org.jetbrains.skia.Rect
import
org.jetbrains.skiko.ios.UIKitKeyboardOptions
import
platform.CoreGraphics.*
import
platform.Foundation.*
import
platform.UIKit.*
...
...
@@ -29,25 +30,20 @@ class SkikoUIView : UIView, UIKeyInputProtocol, UITextInputProtocol,
}
private
var
skiaLayer
:
SkiaLayer
?
=
null
private
lateinit
var
_pointInside
:
(
Point
,
UIEvent
?)
->
Boolean
private
var
_pointInside
:
(
Point
,
UIEvent
?)
->
Boolean
=
{
_
,
_
->
true
}
private
var
_keyboardOptions
:
UIKitKeyboardOptions
=
object
:
UIKitKeyboardOptions
{}
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
(),
pointInside
:
(
Point
,
UIEvent
?)
->
Boolean
=
{
_
,
_
->
true
}
pointInside
:
(
Point
,
UIEvent
?)
->
Boolean
=
{
_
,
_
->
true
},
keyboardOptions
:
UIKitKeyboardOptions
=
object
:
UIKitKeyboardOptions
{},
)
:
super
(
frame
)
{
this
.
skiaLayer
=
skiaLayer
_pointInside
=
pointInside
_keyboardOptions
=
keyboardOptions
}
/**
...
...
@@ -492,37 +488,14 @@ class SkikoUIView : UIView, UIKeyInputProtocol, UITextInputProtocol,
else
->
false
}
override
fun
keyboardType
():
UIKeyboardType
{
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
currentIsSecureTextEntry
//todo secure text to prevent copy
}
override
fun
enablesReturnKeyAutomatically
():
Boolean
{
return
currentEnablesReturnKeyAutomatically
}
override
fun
autocapitalizationType
():
UITextAutocapitalizationType
{
return
currentAutocapitalizationType
}
override
fun
autocorrectionType
():
UITextAutocorrectionType
{
return
currentAutocorrectionType
}
override
fun
keyboardType
():
UIKeyboardType
=
_keyboardOptions
.
keyboardType
()
override
fun
keyboardAppearance
():
UIKeyboardAppearance
=
_keyboardOptions
.
keyboardAppearance
()
override
fun
returnKeyType
():
UIReturnKeyType
=
_keyboardOptions
.
returnKeyType
()
override
fun
textContentType
():
UITextContentType
?
=
_keyboardOptions
.
textContentType
()
override
fun
isSecureTextEntry
():
Boolean
=
_keyboardOptions
.
isSecureTextEntry
()
override
fun
enablesReturnKeyAutomatically
():
Boolean
=
_keyboardOptions
.
enablesReturnKeyAutomatically
()
override
fun
autocapitalizationType
():
UITextAutocapitalizationType
=
_keyboardOptions
.
autocapitalizationType
()
override
fun
autocorrectionType
():
UITextAutocorrectionType
=
_keyboardOptions
.
autocorrectionType
()
override
fun
dictationRecognitionFailed
()
{
//todo may be useful
...
...
skiko/src/iosMain/kotlin/org/jetbrains/skiko/ios/UIKitKeyboardOptions.kt
0 → 100644
View file @
ff9ecbc2
package
org.jetbrains.skiko.ios
import
platform.UIKit.*
interface
UIKitKeyboardOptions
{
fun
keyboardType
():
UIKeyboardType
=
UIKeyboardTypeDefault
fun
keyboardAppearance
():
UIKeyboardAppearance
=
UIKeyboardAppearanceDefault
fun
returnKeyType
():
UIReturnKeyType
=
UIReturnKeyType
.
UIReturnKeyDefault
fun
textContentType
():
UITextContentType
?
=
null
fun
isSecureTextEntry
():
Boolean
=
false
fun
enablesReturnKeyAutomatically
():
Boolean
=
false
fun
autocapitalizationType
():
UITextAutocapitalizationType
=
UITextAutocapitalizationType
.
UITextAutocapitalizationTypeSentences
fun
autocorrectionType
():
UITextAutocorrectionType
=
UITextAutocorrectionType
.
UITextAutocorrectionTypeYes
}
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