https://kotlinlang.org logo
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
benchmarks
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
confetti
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
lincheck
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by
Title
p

Pablo Caviglia

11/07/2020, 2:09 AM
does exists any port guide to korge 2 ? or maybe it isnt necessary ?
r

RezMike

11/07/2020, 7:50 AM
We're planning to write it soon
p

Pablo Caviglia

11/09/2020, 4:37 PM
i've some questions maybe before writing the docs you can help me out
com.soywiz.korge.view.Fonts
doesn't exists anymore
override suspend fun init(injector: AsyncInjector): Unit = injector.run
i have this in my module definition, but looks like the method init cannot be overriden anymore
r

RezMike

11/09/2020, 4:54 PM
Check something like
fun AsyncInjector.init()
p

Pablo Caviglia

11/09/2020, 5:44 PM
i have this:
val graphics = mainGraphics.graphics {
    fill(Colors[if(lives[i]) "#00D4A9" else "#AAAAAA"]) {
        roundRect(liveX, liveY, liveWidth, liveHeight, 30.0, 30.0)
    }
}
but the extension function of Graphics to add a new Graphics instance to itself doesn't work anymore
can it be that Graphics is not a component anymore ?
r

RezMike

11/09/2020, 5:45 PM
not a container?
p

Pablo Caviglia

11/09/2020, 5:45 PM
sorry, container
r

RezMike

11/09/2020, 5:45 PM
maybe
well, you shouldn't use Graphics instance as a container anyway
p

Pablo Caviglia

11/09/2020, 5:46 PM
ok, got it, will refactor that
text(text = if(valid) "GREAT" else "WRONG") {
    resultTextView = this
    format = Html.Format(align = Html.Alignment.MIDDLE_CENTER, color = colorState, size = 40, face = Html.FontFace.Bitmap(fontLoader[FontLoader.Font.NORMAL_FONT]))
    xy(circleResult.x + circleResult.width / 2 - width / 2, circleResult.y + circleResult.height * 1.1)
}
format attribute doesn't exists anymore on Text ?
r

RezMike

11/09/2020, 9:22 PM
You should use TextAlignment instead
p

Pablo Caviglia

11/09/2020, 9:30 PM
perfect, that works
when upgrade to korge 2 the font rendering is quite different. Anything I should know about it to change ?
this is the font definition i'm using
@Deactivated User sorry, can you help me with this? what can have happened that the font definition that previosuly worked fine now it looks weird ?
d

Deactivated User

11/10/2020, 6:55 PM
I have fixed the text rendering a few hours ago not in rc2
will be in the next release
you can try it by downloading korge-next repo, changing version to 2.0.0-rc2 on the gradle.properties, and ./gradlew publishToMavenLocal
it should be fixed by now
p

Pablo Caviglia

11/10/2020, 6:57 PM
i've this one configured as buildscript dependency:
"com.soywiz.korlibs.korge.plugins:korge-gradle-plugin:$korgePluginVersion"
and this repo:
maven { url = uri("<https://dl.bintray.com/korlibs/korlibs>") }
korgePluginVersion=2.0.0.1-rc2
d

Deactivated User

11/10/2020, 7:08 PM
korgePluginVersion=2.0.0.2-rc2
is the latest
that uses 2.0.0-rc2 artifacts
p

Pablo Caviglia

11/10/2020, 7:08 PM
what about the repo ? is my configuration ok ?
d

Deactivated User

11/10/2020, 7:08 PM
the 2.0.0.2-rc2 is the version of the gradle plugin
these are the repositories you should have
p

Pablo Caviglia

11/10/2020, 7:09 PM
perfect
trying it now
thx
d

Deactivated User

11/10/2020, 7:09 PM
👍
p

Pablo Caviglia

11/10/2020, 7:15 PM
i've also defined this project dependencies:
dependencies {
    add("commonMainApi", "com.soywiz.korlibs.korvi:korvi:2.0.0-rc2")
    add("commonMainApi", "com.soywiz.korlibs.korgw:korgw:2.0.0-rc2")
}
should I change these versions ?
d

Deactivated User

11/10/2020, 7:19 PM
they are probably published
korgw is already included with korge
p

Pablo Caviglia

11/10/2020, 7:20 PM
they are, and they work fine, but not sure if your font fix is in that version because i'm getting the same result
d

Deactivated User

11/10/2020, 7:20 PM
and gradle.properties --> version=2.0.0-rc2
and: ./gradlew publishToMavenLocal
?
p

Pablo Caviglia

11/10/2020, 7:21 PM
oooh gotcha, you havent published it yet to the mvn repo
ok, i'll have to wait because whenever i push my code i'll have the build server to fail because it will go search the dependencies remotely
i can wait if you tell me that you'll release the next version later
when are you planning to actually release that version ?
d

Deactivated User

11/10/2020, 7:29 PM
we are waiting for the final release of Kotlin 1.4.20
there are still a couple of issues I have to fix before the final release, but probably that will happen in the next days
p

Pablo Caviglia

11/10/2020, 7:29 PM
oh ok, that's soon
d

Deactivated User

11/10/2020, 7:29 PM
yeah, if Kotlin 1.4.20 is not released this week, I will release rc3 using the 1.4.20-rc version that is already on central
p

Pablo Caviglia

11/10/2020, 7:30 PM
do you know if expect/actual wil lbe part of 1.4.20 as a stable functionality ?
d

Deactivated User

11/10/2020, 7:30 PM
what do you mean by expect/actual?
korge requires 1.4.20 because 1.4.10 had some nasty bugs with the js backend
p

Pablo Caviglia

11/10/2020, 7:31 PM
the kotlin functionality to define an interface common to all platforms by using 'expect' keyword, and the actual implementation
d

Deactivated User

11/10/2020, 7:31 PM
multiplatform projects are 1.4.x is still experimental
but it works fine
p

Pablo Caviglia

11/10/2020, 7:32 PM
when I try to compile with gradle a korge's project using that syntax I get an error message indicating that I should enable explicitly multiplatform
d

Deactivated User

11/10/2020, 7:32 PM
uhm?
p

Pablo Caviglia

11/10/2020, 7:32 PM
and i weren't able to find yet the place to let the kotlin compiler to know that I do want to use the experimental api
d

Deactivated User

11/10/2020, 7:32 PM
can you put the error?
p

Pablo Caviglia

11/10/2020, 7:32 PM
sure, one sec
ok, for some reason, probably because I've updated to korge 2, the error has changed and looks simpler to fix
the weird thing is that I actually have defined the Video implementation for jvm...
d

Deactivated User

11/10/2020, 7:42 PM
that's because jvm and android source sets are different
jvmAndroidMain or androidMain
p

Pablo Caviglia

11/10/2020, 7:43 PM
uhhhm, yes, in fact I'm getting this only when trying to build androidAar task
when I run runJvm task it doesn't complain
does it have something to do with android build variants ?
I see there's a well known nomenclature on the error message: C:\devel\projects\tool_framework_multi_platform\src\commonMain\kotlin\com\senaptec\toolframework\ui\Video.kt: (3, 14): Expected class 'Video' has no actual declaration in module <tool_framework_multi_platform_debug> for JVM that _debug at the end of the module name seems to be the debug variant of an android project
d

Deactivated User

11/10/2020, 7:50 PM
have you tried to put the actual on a folder called jvmAndroidMain so it works for both jvm and android?
p

Pablo Caviglia

11/10/2020, 7:50 PM
didnt know that target exists
let me try
should I define something else on build.gradle or only by adding that extra folder should be enough ?
d

Deactivated User

11/10/2020, 7:55 PM
is not a target, but a source set, both the android and the jvm targets include that folder to read the kotlin files from there
if you are using the korge plugin, that plugin configures those folders automatically
p

Pablo Caviglia

11/10/2020, 7:56 PM
using it
d

Deactivated User

11/10/2020, 7:56 PM
uhm
maybe the plugin not
p

Pablo Caviglia

11/10/2020, 7:56 PM
let me check if there's a way to list the sourcesets with some gradle task
d

Deactivated User

11/10/2020, 7:56 PM
only korge-next when building the projects
you can try to just copy the jvmMain files into androidMain
p

Pablo Caviglia

11/10/2020, 7:58 PM
actually there's no implementation at all in that only class, they are defined exactly the same on both androidMain and jvmMain as this:
package com.senaptec.toolframework.ui

actual class Video {
}
and then in commonMain as this:
package com.senaptec.toolframework.ui

expect class Video {
}
d

Deactivated User

11/10/2020, 8:09 PM
then if it fails, the androidMain folder is not being loaded as part of the android source set
p

Pablo Caviglia

11/10/2020, 8:12 PM
i'm using this flag on korge's plugin, will try without it to trace if that's causing it... not probable, but let's give it a try
androidLibrary = true
d

Deactivated User

11/10/2020, 8:13 PM
the build/platforms/android/build.gradle doesn't reference the ../../../src/androidMain folder?
p

Pablo Caviglia

11/10/2020, 8:13 PM
let me check
looks like not
d

Deactivated User

11/10/2020, 8:42 PM
wtf, looks like!
then that's a bug
There is a
build.extra.gradle
you can add that manually
android
    sourceSets {
        main {
            java.srcDirs += ["C:\\devel\\projects\\tool_framework_multi_platform\\src\\androidMain\\kotlin"]
     }
}
at least to try if that way it works
p

Pablo Caviglia

11/10/2020, 9:19 PM
trying it now
@Deactivated User man, sorry it took this long to get back to you. The android sourcesets fix on build.extra.gradle worked perfectly
now the expect/actual declarations works as expected
how can I write into that file in 'the normal way', because it's on the build folder and after a clean it'll get deleted
d

Deactivated User

11/11/2020, 2:26 PM
well, it is a bug, should not be required, I'm going to fix that in the next release hopefully
p

Pablo Caviglia

11/11/2020, 2:26 PM
oh great, i'll wait then until its officially released
thx man
d

Deactivated User

11/11/2020, 2:26 PM
👍 thanks for trying!
👍 1
p

Pablo Caviglia

11/11/2020, 2:28 PM
everything is getting a great shape, congrats for all the hard work man, really appreciate all of this
:tnx: 1
1
😒imple_smile: 1
i've convinced my boss to stay on korge instead of unity
👍 1
d

Deactivated User

11/11/2020, 2:29 PM
oh, that's great news 😄 cool
p

Pablo Caviglia

11/11/2020, 2:29 PM
made my first demo on multiplatform with android and ios
👍 1
everything run as expected on both platforms
💯 1