https://kotlinlang.org logo
Join the conversationJoin Slack
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
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
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
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 Linen
kmdc
  • r

    rnentjes

    07/23/2020, 3:20 PM
    Hi, atm I am using kotlinx-html, and a virtual dom with that would be really helpful. So purely out of self interest I was wondering why you choose not to use that dsl for html (dom) generation but choose to create your own?
    b
    • 2
    • 31
  • b

    Big Chungus

    07/27/2020, 8:29 AM
    M2 is nearly there, you can have a look on the feature branch now https://gitlab.com/lt.petuska/kvdom/-/tree/feature/MPE_DOM_REWORK This milestone brings back wasm support and also adds kotlinx-html dsl support via KVDOMBuilder function (note that currently it's using forked kotlinx-html from lt.petuska bintray repo, will be raising a PR into the main repo to bring required wasm support) as requested by @rnentjes. I plan on releasing M2 later this week after I finish code cleanup. Give it a go if you're curious. kvdom-sample has been updated to showcase both dsls
    r
    • 2
    • 2
  • r

    Robert Jaros

    07/28/2020, 6:51 PM
    another thing I would need is something like https://github.com/appcues/snabbdom-virtualize - converter/parser from String (html text) to virtual node
    b
    • 2
    • 12
  • r

    Robert Jaros

    07/28/2020, 6:56 PM
    there is no event handling inside VElement
    b
    • 2
    • 24
  • r

    rnentjes

    08/02/2020, 10:47 AM
    Hi, I played with kvdom a bit and it works pretty good. I notice that wasm vs js doesn't seem to make much difference with regards to performance. @Big Chungus did you do any comparisons on that yet? Some remarks: • It seems to me that adding hashes to the nodes could improve update performance a lot. • If you have hashes it's also easier to detects inserts and removal of children so you only add/remove those The next step is probably something with components, is that something you want to do with this?
    b
    • 2
    • 16
  • g

    Greg Steckman

    01/10/2022, 4:09 AM
    Notes on running the sandbox on windows - see thread:
    b
    • 2
    • 9
  • t

    Tim Ortel

    01/12/2022, 3:33 PM
    So, I just wanted to try out this library as it looks promising. I installed it but when i jsDevelopmentRun this error happens:
    2022-01-12T16:31:40.212+0100 [ERROR] [org.gradle.api.Task] Module parse failed: Unexpected token (8:0)
    You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See <https://webpack.js.org/concepts#loaders>
    |  * found in the LICENSE file at <https://github.com/material-components/material-components-web/blob/master/LICENSE>
    |  */
    > .mdc-touch-target-wrapper {
    |   display: inline;
    | }
    2022-01-12T16:31:40.212+0100 [ERROR] [org.gradle.api.Task]
    This suggests that I am missing out on additional setup steps. What can I do?
    b
    • 2
    • 4
  • t

    Tim Ortel

    01/13/2022, 4:20 PM
    What is the best way to theme the application right now? In Android/Desktop we have a Composable called MaterialTheme that sets compositionLocal variables automatically used by the components. Is this already supported or is this going to be supported in a similar fashion in kmdc? What can I do right now to theme my web application?
    b
    • 2
    • 1
  • r

    Rohan Maity

    01/16/2022, 12:41 PM
    am trying to make evenly spread three input text with 
    MDCTextField
    But is not getting evenly spread But with core 
    TextInput
      got evenly spread
    Div(
                attrs = {
                    style {
                        display(DisplayStyle.Flex)
                        width(100.percent)
                        justifyContent(JustifyContent.SpaceBetween)
                        flexFlow(FlexDirection.Row, FlexWrap.Nowrap)
                    }
                }
            ) {
    
                val annualCtcState = remember { mutableStateOf("") }
                MDCTextField(
                    annualCtcState.value,
                    {
                        type = MDCTextFieldCommonOpts.Type.Outlined
                        label = "Annual CTC"
                    },
                    {
                        style {
                            margin(8.px)
                            width(33.percent)
                            title("Annual CTC")
    
                        }
                        onInput {
                            annualCtcState.value = it.value
                        }
                    }
                )
    😕
    b
    c
    • 3
    • 24
  • b

    Big Chungus

    03/15/2022, 8:08 PM
    Hi all. I'm curious to hear your thoughts on these two design choices: 1. KMDC API to match MDC api (component/element wise) 1:1 with occasional and few exceptions to be more idiomatic for kotlin consumption 2. KMDC API to introduce its own components that makes some assumptions on the structure and only matches and extends the top-level MDC component to better utilise the fact that it's rendered by Kotlin and not direct HTML. 3. Full support for #1 with DSL to get #2
    k
    g
    • 3
    • 7
  • r

    rnett

    07/15/2022, 6:42 AM
    @Big Chungus are you planning to release a new version w/ Kotlin 1.7.0 anytime soon? This is the last thing holding me back from upgrading
    b
    • 2
    • 13
  • b

    Big Chungus

    01/17/2023, 2:25 AM
    https://s01.oss.sonatype.org/content/repositories/snapshots/dev/petuska/kmdc/0.1.0-SNAPSHOT/ is now available with kotlin 1.8 and CfD 1.3.0-rc02
  • b

    Big Chungus

    02/10/2023, 1:46 PM
    kmdc@0.1.0 is out with kotlin 1.8.0 and compose 1.3.0 🎉 Enjoy!
  • b

    Big Chungus

    02/11/2023, 6:32 PM
    Given that kmdc is finally feature-complete and linked against a stable CfW, I'd like to ask each one of you that if you do try it out, please report any bug no matter how trivial it might be. I'd also appreciate any feedback or suggestions you have regarding the API and developer UX.
  • b

    Big Chungus

    03/06/2023, 8:09 AM
    @YentaBot
  • y

    YentaBot

    03/06/2023, 8:09 AM
    Hello! I'm a bot which answers questions based on historical messages in Slack Now that I've been added to this channel, I'll begin reading all the history and you can ask me questions, which I'll try my best to answer. Ask me a question by beginning a message with
    @yentabot
    You can also emoji-react to a message with ❓ or 🤖. Feel free to give me feedback by replying to my answers in a thread or leaving emoji-reacts to my answers.
  • s

    Sebastien Leclerc Lavallee

    03/14/2023, 4:02 PM
    @YentaBot How do we get a number textfield?
    y
    r
    b
    • 4
    • 4
  • r

    rocketraman

    03/23/2023, 8:28 PM
    @Big Chungus I'm trying to use a
    MDCDialog
    in an MVI application. I have a view model which has an
    open
    state for the dialog. The dialog may be: a) closed by some button press by the user, in which case the dialog is closed when it sees the
    open
    state of the VM change to false, or b) closed on scrim or escape, in which case I need to send an event to the VM (using the
    onClosed
    hook seems appropriate) The problem I have is when the dialog is closed via (a), my view model receives two inputs: the button press and the event from the
    onClosed
    hook, which causes issues. Is there a way to trigger a callback only for the scrim/escape case?
    b
    • 2
    • 14
Powered by Linen
Title
r

rocketraman

03/23/2023, 8:28 PM
@Big Chungus I'm trying to use a
MDCDialog
in an MVI application. I have a view model which has an
open
state for the dialog. The dialog may be: a) closed by some button press by the user, in which case the dialog is closed when it sees the
open
state of the VM change to false, or b) closed on scrim or escape, in which case I need to send an event to the VM (using the
onClosed
hook seems appropriate) The problem I have is when the dialog is closed via (a), my view model receives two inputs: the button press and the event from the
onClosed
hook, which causes issues. Is there a way to trigger a callback only for the scrim/escape case?
b

Big Chungus

03/23/2023, 8:40 PM
Dunno, but I don't think so. Have you checked mdc docs for mdc-dialog yet?
r

rocketraman

03/23/2023, 8:42 PM
Yeah,
closing
and
closed
are documented as "Indicates when the dialog begins/finishes its closing animation." I'm checking the
action
value received in the event right now, they don't document what that is.
b

Big Chungus

03/23/2023, 8:43 PM
Looks like acrimClickAction is what you need? https://github.com/material-components/material-components-web/tree/master/packages/mdc-dialog#dialog-actions
r

rocketraman

03/23/2023, 8:45 PM
Ah, so the string just gets set to something else so I can distinguish it. Got it!
b

Big Chungus

03/23/2023, 8:45 PM
Let me know if you manage to get it working
r

rocketraman

03/23/2023, 8:48 PM
Yep, it works. I don't even need to use
scrimClickAction
and
escapeKeyAction
because the close event action is
undefined
(null in Kotlin) if I close the popup through state, and `scrimClickAction`/`escapeKeyAction` (which defaults to
close
) if done via the scrim/esc.
b

Big Chungus

03/23/2023, 8:48 PM
I'd be curious to check out the website you're building once you have something to show
(assuming it's oss ofc)
r

rocketraman

03/23/2023, 8:51 PM
Not oss, but the site is already live: https://sell.diyoffer.com/. You have to login to see most of it -- feel free to create an account on the test site: https://test.diyoffer.com/home.
b

Big Chungus

03/23/2023, 8:51 PM
Thanks
Did you theme it with css variables or scss mixins?
Looks neat, btw!
r

rocketraman

03/23/2023, 8:55 PM
A small amount of scss but mostly css variables
Looks neat, btw!
Thanks!
View count: 2