https://kotlinlang.org
Join Slack
Are `ViewModel`s a thing in Compose Desktop world? Or are we using <https://github.com/arkivanov/Dec...
k

Kirill Grouchnikov

almost 5 years ago
Are `ViewModel`s a thing in Compose Desktop world? Or are we using https://github.com/arkivanov/Decompose for something simple like an observable list of data items?
k
j
+3
  • 5
  • 7
  • 390
I'm receiving `java.lang.AbstractMethodError: abstract method "void android.os.Parcelable.writeToPar...
g

Guilherme Krzisch

almost 6 years ago
I'm receiving
java.lang.AbstractMethodError: abstract method "void android.os.Parcelable.writeToParcel(android.os.Parcel, int)"
when putting the app in background, after saving a parcelable (using
Parcelize
) in
onSaveInstanceState
:
override fun onSaveInstanceState(outState: Bundle) {
    outState.putParcelable("test", Test())
    super.onSaveInstanceState(outState)
}

@Parcelize
data class Test(val test: String = "test"): Parcelable
It does not occur on configuration changes though. I'm using AS 4.0 Canary 4, with kotlin
1.3.60-eap-25
. Any idea of what am I doing wrong here?
g
d
  • 2
  • 2
  • 390
Funky issue I've got. I'm using `AndroidView` with a `SurfaceView` If I have an `if` statement to ...
c

Colton Idle

over 2 years ago
Funky issue I've got. I'm using
AndroidView
with a
SurfaceView
If I have an
if
statement to show/hide the AndroidView... it renders the first time, but if the if statement flips to false and true again, the AndroidView won't render. 🧵
c
j
v
  • 3
  • 24
  • 389
A bit of a blasphemous question here. I love the `Raise` DSL over the older `either` one, moving fro...
e

Emanuel Moecklin

over 2 years ago
A bit of a blasphemous question here. I love the
Raise
DSL over the older
either
one, moving from something like
suspend fun findUser(userId: Int): Either<UserNotFound, User> = either {
    // success case
    anotherFunction(userId).bind()
    User(1)
    // failure case
    UserNotFound(userId).left().bind<User>()
}
to
context(Raise<UserNotFound>)
suspend fun findUser(userId: Int): User {
    // success case
    anotherFunction(userId)
    User(1)
    // failure case
    raise(UserNotFound(userId))
}
Looking at the the latter it's pretty much the syntax you'd use when using good old fashioned exceptions like
@Throws(UserNotFoundException::class)
suspend fun findUser(userId: Int): User {
    // success case
    anotherFunction(userId)
    return User(1)
    // failure case
    throw UserNotFoundException(userId)
}
Now at the top level I need to deal with the exception instead of dealing with an Either but using
runCatching
makes that fairly simple. So how is the
Raise
solution better than the throws solution? I need to convince a large team of engineers that the former has advantages so need good arguments but tbh I haven't had any convincing ideas yet. Any suggestions?
👍 1
e
s
+4
  • 6
  • 20
  • 389
I'm a little confused on how the Modifier.imePadding() is supposed to work. What I've discovered thr...
t

Travis Griggs

over 2 years ago
I'm a little confused on how the Modifier.imePadding() is supposed to work. What I've discovered through poking around with it, is that if I add that modifier to any node at the TextField or above in the hierarhcy of the compose tree, when my TextField takes focus and the keyboard pops up, the entire app will slide upwards so that the TextField baseline is at the top of the keyboard and then return when the keyboard is dismissed. In my case, I'm using a BasicTextField and have some decoration around it, but it ends up clipping out the decoration and containing row/card, which is kind of ugly. The effect I want, is to scroll the containing list upwards if necessary until the entire card/row that contains my text field is exposed, and then to scroll back the same amount when the keyboard is complete/closed. Is that possible at all? I'm guessing I'll need to do more of that work myself... but I'm a little unclear where to even start throwing darts.
t
a
  • 2
  • 3
  • 389
how to add hover to property using `org.jetbrains.compose.web.css.StyleScope` ? ex: ```Span({ styl...
d

dvdandroid

almost 4 years ago
how to add hover to property using
org.jetbrains.compose.web.css.StyleScope
? ex:
Span({
  style { // this is org.jetbrains.compose.web.css.StyleScope, not org.jetbrains.compose.web.css.CSSBuilder
    property("color", "#fff") // <-- hover??
  }
})
compose
1.1.0-alpha05
d
o
d
  • 3
  • 9
  • 389
Anyone using moko -resources for colors with compose/swiftui? Their colour resource does not have re...
b

Boris Yordanov

about 4 years ago
Anyone using moko -resources for colors with compose/swiftui? Their colour resource does not have resourceID, similarly to how we get strings - MR.strings.my_atring.resourceId
b
w
  • 2
  • 4
  • 389
I am setting credentials in my build.gradle.kts file. But I want to read the credentials from a json...
m

Mutlu Celep

almost 6 years ago
I am setting credentials in my build.gradle.kts file. But I want to read the credentials from a json or gradle file, because I want to integrate with Jenkins. I am also open other solutions.
repositories {
    maven { setUrl("<https://urbanairship.bintray.com/android>") }
    maven { setUrl("<https://clojars.org/repo/>") }
    maven {
        setUrl("<https://jfrog.io/>...")
        credentials {
            username = "..."
            password = "...."
        }
    }
    mavenCentral()
}
m
c
  • 2
  • 2
  • 389
Hi, When I try to build my kmp-project, iOS XCode fails with an error: ```/System/Library/Frameworks...
a

Alex

9 months ago
Hi, When I try to build my kmp-project, iOS XCode fails with an error:
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)
  	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
  	from /usr/local/bin/pod:25:in `<main>'
  	from /usr/local/bin/ruby_executable_hooks:22:in `eval'
  	from /usr/local/bin/ruby_executable_hooks:22:in `<main>'
I think the problem is XCode uses the wrong version of Ruby. I don't understand why because I installed ruby 3.3.5. Command "_ruby -v_"prints "_ruby 3.3.5 (2024-09-03 revision ef084cc8f4) [arm64-darwin23]"._ I installed cocoapods:
sudo gem install -n /usr/local/bin cocoapods -v 1.16.2;       
sudo gem install -n /usr/local/bin cocoapods-generate -v 2.2.5
My environment: Macbook M3 Max, MacOS 14.7.3, XCode 15.2.
a
f
+2
  • 4
  • 63
  • 388
Hi Everyone. Does KMP currently support previewing in Android Studio? I created a function with @Pre...
z

Zhang Zihan

over 1 year ago
Hi Everyone. Does KMP currently support previewing in Android Studio? I created a function with @Preview annotation, but the preview does not appear on the right side of the IDE. Do I need additional configuration?
z
p
m
  • 3
  • 3
  • 388
Previous174175176Next

kotlinlang

A modern programming language that makes developers happier.

Powered by