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
splitties
  • i

    ispbox

    09/22/2019, 8:45 AM
    @louiscad What do you think about adding overload for
    view.dip()
    to be able to deal with floating values where needed. Because without that you have to use your own helper or write extra code:
    elevation = dip(4).toFloat()
    l
    • 2
    • 10
  • l

    louiscad

    09/22/2019, 9:24 PM
    dp
    (1️⃣ ),
    dip
    (2️⃣) or both (0️⃣)?
    0️⃣ 3
    2️⃣ 1
    1️⃣ 4
    i
    w
    h
    • 4
    • 10
  • i

    ispbox

    09/23/2019, 3:06 PM
    It is not directly connected with Splitties, but as it is about moving from xml, I'll ask here 🙂 The most common practice to have some set of colors is to put them into
    colors.xml
    file (something like
    <color name="colorBlack">#000000</color>
    ) But is there any better way having in mind that we try to eliminate xml files in our projects? 🙂 I'm thinking about some helper class with constant values:
    const val Black = 0x000000.toInt()
    Does it sound reasonable? Is it somehow better than xml? Or it really doesn't matter in practice? What do you think?
    l
    w
    r
    • 4
    • 7
  • l

    louiscad

    09/25/2019, 1:10 PM
    Here's another one I like better because it allows setting insets for both top and bottom (important as setting a window inset listener replaces any previously set one):
    enum class InsetType { None, Padding, Margin }
    fun View.inset(top: InsetType = None, bottom: InsetType = None)
    • 1
    • 1
  • n

    nickk

    10/08/2019, 3:01 PM
    Hi there. Is there something in Splitties like anko’s
    selector
    ? It was pretty basic, but in many cases it was just what I needed. I do not see something similar. This means I would have to use the RecycleView DSL to create something similar? Actually,
    RecyclerView
    is an overkill. I would go for a custom alert.
    l
    • 2
    • 1
  • j

    jmfayard

    10/26/2019, 5:27 AM
    I got an interesting question from Ben Manes @louiscad https://github.com/jmfayard/buildSrcVersions/pull/117
    l
    • 2
    • 1
  • m

    miha-x64

    11/02/2019, 11:06 PM
    Hello. I was unable to find a shortcut for
    .withStyledAttributes(attr) { getResourceId(it, 0) }
    . Should I create a PR? None of the files below look suitable, should I create a new one? https://github.com/LouisCAD/Splitties/tree/8782cbb5d039a553ed2c5cf795eb53a86146ce91/modules/resources/src/androidMain/kotlin/splitties/resources
    l
    • 2
    • 7
  • m

    miha-x64

    11/12/2019, 5:46 PM
    Looks like View DSL lacks
    space()
    .
    l
    • 2
    • 2
  • s

    Sergio Crespo Toubes

    12/04/2019, 8:48 AM
    Hello #splitties any idea about
    startActivityForResult
    ? I think is not implemented yet
    l
    i
    • 3
    • 7
  • l

    LeoColman

    12/06/2019, 3:09 AM
    Hey, @louiscad! Using splitties for the first time now. Testing on AlertDialogs. Wish me luck xD
    l
    • 2
    • 1
  • m

    miha-x64

    12/10/2019, 9:28 PM
    How can I avoid using
    appctx
    module? Just found it thanks to Analyze APK. For some reason I can't even see it in 'merged manifest' or 'external libraries'. I understand the motivation but don't want Android to create one more component and and to have one more singleton.
    l
    • 2
    • 7
  • h

    Harun

    01/21/2020, 11:20 AM
    Hello, with the permissions on Splitties, is there a way to check if the permissions have been granted on the settings part? For example, location permissions, an app can have the permissions granted but gps not enabled or turned on, is there a way to prompt with the dialog and enable gps?
    l
    • 2
    • 2
  • s

    Sergio Crespo Toubes

    02/11/2020, 3:16 PM
    Is this the correct way using
    start
    and bundle extras with
    BundleSpec
    ?
    start<MyActivity> {
        MyActivity.ExtrasSpec.weight = weight
        MyActivity.ExtrasSpec.height = height
    }
    l
    • 2
    • 3
  • p

    patrickdelconte

    04/04/2020, 3:40 PM
    Is there any way to use the views dsl without constantly invoking
    add()
    for nesting
    verticalLayout {
            add(textView {
                textResource = R.string.some_text
            }, lParams())
    }
    Coming from other dsl’s it feels a bit cumbersome to me, I’d expect to be able to write something like
    verticalLayout {
        textview {
            textResource = R.string.some_text
        }
    }
    Am I missing something? I don’t have much experience with android
    r
    l
    m
    • 4
    • 4
  • l

    louiscad

    05/03/2020, 8:38 PM
    Hello dear Views DSL users, I just submitted a feature request for first-class support of IDE preview in Android Studio, you can star the issue as I'm pretty sure you'd like it: https://issuetracker.google.com/issues/155554920
    ⭐ 6
    m
    • 2
    • 2
  • d

    dimsuz

    06/08/2020, 11:25 AM
    Hello! Is there a DSL for creating
    ColorStateList
    in code? I mean not loading from resources (
    colorSL
    ), but actually specifying states and colors manually.
    l
    • 2
    • 12
  • i

    ispbox

    07/05/2020, 12:00 PM
    @louiscad What is your roadmap to release 3.0 version?
    l
    • 2
    • 2
  • m

    miha-x64

    07/21/2020, 8:24 PM
    dip(value: Int): Int
    dp(value: Int): Float
    This looks counterintuitive to me. Also, I miss (Float) -> Int overload: having Float dp makes much more sense than having Float pixels.
    l
    • 2
    • 3
  • m

    miha-x64

    07/21/2020, 8:37 PM
    And this is just horrible amount of indirection…
    return viewFactory(V::class.java
    l
    • 2
    • 4
  • m

    miha-x64

    07/28/2020, 2:10 PM
    🙀
    s
    l
    • 3
    • 6
  • m

    miha-x64

    07/28/2020, 9:00 PM
    Why do you need an XML layout (which prevents shrinking) and why
    Context.recyclerView()
    and
    View.recyclerView()
    have different behaviour? https://github.com/LouisCAD/Splitties/blob/8782cbb5d039a553ed2c5cf795eb53a86146ce91/modules/views-dsl-recyclerview/src/androidMain/kotlin/splitties/views/dsl/recyclerview/RecyclerView.kt#L27
    l
    • 2
    • 4
  • p

    pawegio

    08/21/2020, 9:02 AM
    Is splitties in version 3.0.0-alpha06 expected to compile without issues with Kotlin 1.4? I am unable to compile project after updating from Kotlin 1.3.70:
    Caused by: java.lang.IllegalStateException: Couldn't obtain compiled function body for public final inline fun <get-progressBar>(): splitties.views.dsl.core.styles.ProgressBarAndroidStyles defined in splitties.views.dsl.core.styles.AndroidStyles[PropertyGetterDescriptorImpl@4d0bbd88]
    	at org.jetbrains.kotlin.codegen.inline.InlineCodegen$Companion.getCompiledMethodNodeInner(InlineCodegen.kt:579)
    	at org.jetbrains.kotlin.codegen.inline.InlineCodegen$Companion.createInlineMethodNode$backend(InlineCodegen.kt:543)
    	at org.jetbrains.kotlin.codegen.inline.InlineCodegen.performInline(InlineCodegen.kt:143)
    	... 74 more
    l
    • 2
    • 3
  • p

    pawegio

    09/15/2020, 12:58 PM
    I have a problem (in both
    3.0.0-dev-105
    and
    3.0.0-beta01
    ) with assembling custom build type. I have alpha build type declared in
    app
    module as follows:
    buildTypes {
        getByName("alpha") {
            applicationIdSuffix = ".alpha"
            versionNameSuffix = "-alpha"
        }
    }
    Untitled
    l
    • 2
    • 18
  • p

    Pierfrancesco Gulinelli

    09/16/2020, 12:45 PM
    I'm not able to see view dsl preview with beta01. So i have reverted alpha07. The design preview remains white.
    l
    • 2
    • 5
  • m

    miha-x64

    09/19/2020, 1:51 PM
    Thanks for
    UnreliableToastApi
    warning. Nice approach!
    😊 1
    l
    • 2
    • 1
  • p

    Pierfrancesco Gulinelli

    10/02/2020, 1:55 PM
    Which is the preferred method / extension to update layoutparams of a view?
    l
    • 2
    • 2
  • s

    Sergio Crespo Toubes

    03/08/2021, 12:19 PM
    Hello, how can i create a pendingIntent with extrasSpecs? Thanks
    l
    • 2
    • 15
  • d

    dimsuz

    04/20/2021, 11:29 AM
    What's the best translation of this into splitties' code?
    android:textAppearance="?attr/textAppearanceSubtitle1"
    Tried to find somthing like
    styledResourceId(R.attr.textAppearanceSubtitle1)
    , but no luck.
    l
    • 2
    • 4
  • i

    ispbox

    04/26/2021, 8:22 PM
    @louiscad Do you have any plans to move from jcenter() repository? It looks like that only few days are left before total shutdown, and I suppose splitties will become unavailable.
    l
    • 2
    • 4
  • r

    ribesg

    06/02/2021, 11:16 AM
    Removing
    splitties-coroutines
    from my Kotlin Native project fixed an error caused by (I think) the difference in kotlinx.coroutines version it was compiled against
    l
    • 2
    • 6
Powered by Linen
Title
r

ribesg

06/02/2021, 11:16 AM
Removing
splitties-coroutines
from my Kotlin Native project fixed an error caused by (I think) the difference in kotlinx.coroutines version it was compiled against
l

louiscad

06/02/2021, 3:00 PM
You might want to compile it yourself (copying what you need) until I can followup with kotlinx.coroutines releases faster 😅 BTW, what were you using in this artifact. And about the error, what was it?
BTW, good to learn that it's used on Kotlin/Native 🙂
r

ribesg

06/07/2021, 10:17 AM
I was only using
repeatWhileActive
and basically copy-pasted both extensions in my project
I don’t know the details but the compiler basically crashes. It’s due to binary incompatibility in native between kotlinx.coroutines
1.4.3-native-mt
and
1.5.0-native-mt
I’m not sure if the
splitties-coroutines
dependency itself was the problem, or if some Gradle magic could have fixed it, but from a Gradle scan I could see that the build was ignoring the
1.4.3-native-mt
version in favor of
1.5.0-native-mt
so I guessed it was the
splitties-coroutines
binary itself
l

louiscad

06/07/2021, 10:22 AM
So compiler crashing, I see. Thanks for the info anyway. Hopefully, I will work on Splitties again soon and setup timely updating 🙂
👍 1
View count: 5