https://kotlinlang.org
Join Slack
Hello all. Just getting starting with compose navigation, trying to set my general app structure. ...
b

Billy Newman

over 3 years ago
Hello all. Just getting starting with compose navigation, trying to set my general app structure. I will have some main screens to handle app setup for the user and authentication. Once authenticated I would like to navigate to the home screen, which has a bottom navigation in a scaffold. I am trying to do this with 2 NavHosts, which means I need to nav controllers. Everything works fine from the main screen to the home screen, but upon navigation from home back to main (simulated logout), if I try and go back to the home screen I get
ViewModelStore should be set before setGraph call
Code in comments
b
c
+4
  • 6
  • 30
  • 800
Can I mark my `ViewModel` as `@Stable` ? What wud be the conditions to do that? (learning about Com...
t

theapache64

about 3 years ago
Can I mark my
ViewModel
as
@Stable
? What wud be the conditions to do that? (learning about Compose Stability)
t
d
a
  • 3
  • 20
  • 799
Hi guys, how can I add `stickyHeader` in `LazyVerticalGrid` ?
r

Ruben Quadros

almost 4 years ago
Hi guys, how can I add
stickyHeader
in
LazyVerticalGrid
?
r
f
c
  • 3
  • 2
  • 799
I'm struggling with providing instances of Beans for SpringBoot tests, can anyone see what I'm doing...
d

dr.dreigh

over 5 years ago
I'm struggling with providing instances of Beans for SpringBoot tests, can anyone see what I'm doing wrong please:
@SpringBootApplication
class DemoApplication

fun main(args: Array<String>) {
    runApplication<DemoApplication>(*args)
}

@Component
class NormalComponent() {
    fun value() = "Hi"
}
Test:
@TestConfiguration
class TestConfig {

	@Bean
	fun normalComponentMock(): NormalComponent {
		val mock =  mock(NormalComponent::class.java)
		`when`(mock.value()).thenReturn("I AM A MOCK!")
		return mock
	}
}

@SpringBootTest
@Import(TestConfig::class)
class DemoApplicationTests(
	@Autowired val norm: NormalComponent
) {
	@Test
	fun normInjectedIntoTest() {
		assertEquals("I AM A MOCK!", norm.value())
	}
}
The error:
org.junit.jupiter.api.extension.ParameterResolutionException: Failed to resolve parameter [com.example.demo.NormalComponent norm] in constructor [public com.example.demo.DemoApplicationTests(com.example.demo.NormalComponent)]: No qualifying bean of type 'com.example.demo.NormalComponent' available: expected single matching bean but found 2: normalComponent,normalComponentMock
I know I could use
@MockBean
- this is just a simple example where the bean I want to inject to the instance. Bit confused why the mock conflict is happening when I have using the
@TestConfiguration
and the
@Import
annotation - thanks in advance 🙏
d
k
+2
  • 4
  • 19
  • 798
Hello, is the KMP toolchain compatible with xcode 16 and the latest mac os release?
r

Rene Gens

about 1 year ago
Hello, is the KMP toolchain compatible with xcode 16 and the latest mac os release?
r
f
+2
  • 4
  • 18
  • 794
I’ve been investigating alternatives to `runBlocking {}`in Kotlin/JS, and I’m wondering something. C...
a

Adam S

over 2 years ago
I’ve been investigating alternatives to `runBlocking {}`in Kotlin/JS, and I’m wondering something. Correct me if I’m wrong, but the restriction is basically because in JS bridging between blocking/non-blocking requires using
await
, which is only possible inside
async
functions. This is incongruous with JVM and Native, where it’s always possible to block the thread, and no
async function
keyword is required. So, I was thinking. would it be possible for a Kotlin compiler plugin to edit the Kotlin/JS compiler so it generates a
async function
instead of a regular function wherever
runBlocking {}
is used in a Kotlin/JS function?
a
e
c
  • 3
  • 73
  • 794
Hi can anyone help with this. `Getting Undefined symbol for architecture x86_64: _OBJC_CLASS_$` , ...
s

Sunny

about 3 years ago
Hi can anyone help with this.
Getting Undefined symbol for architecture x86_64: _OBJC_CLASS_$
, trying to integrate Snowplow library
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_SPGlobalContext", referenced from:
      objc-class-ref in Felix(result.o)
  "_OBJC_CLASS_$_SPStructured", referenced from:
      objc-class-ref in Felix(result.o)
  "_OBJC_CLASS_$_SPSnowplow", referenced from:
      objc-class-ref in Felix(result.o)
  "_OBJC_CLASS_$_SPGlobalContextsConfiguration", referenced from:
      objc-class-ref in Felix(result.o)
  "_OBJC_CLASS_$_SPSelfDescribingJson", referenced from:
      objc-class-ref in Felix(result.o)
  "_OBJC_CLASS_$_SPEmitterConfiguration", referenced from:
      objc-class-ref in Felix(result.o)
  "_OBJC_CLASS_$_SPSessionConfiguration", referenced from:
      objc-class-ref in Felix(result.o)
  "_OBJC_CLASS_$_SPTrackerConfiguration", referenced from:
      objc-class-ref in Felix(result.o)
  "_OBJC_CLASS_$_SPNetworkConfiguration", referenced from:
      objc-class-ref in Felix(result.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
https://youtrack.jetbrains.com/issue/KTIJ-23233/Getting-Undefined-symbol-for-architecture-x8664-OBJCCLASS-when-trying-to-compile-iOS-app
s
k
  • 2
  • 3
  • 794
Hey guys, I am getting weird issue when running on my unit test. I have this function ```internal ...
v

Vivek Modi

over 3 years ago
Hey guys, I am getting weird issue when running on my unit test. I have this function
internal fun getPendingStatusAction(
status: XYZ
): (() -> Unit)? {
    var action: (() -> Unit)? = null
    this.yo = yo
    if (isAwaitingIdVerification(status)) {
        action = {
            <http://router.xyz|router.xyz>()
        }
    } else if (status == XYZ.PURCHASE) {
        action = {
            <http://router.xyz|router.xyz>()
        }
    }
    return action
}
When I run single unit test it complete fine, but when I run whole file unit test it failed.
v
d
k
  • 3
  • 12
  • 794
M3 has a "Segmented Button" (<https://m3.material.io/components/segmented-buttons/overview>), but I'...
t

Travis Griggs

over 2 years ago
M3 has a "Segmented Button" (https://m3.material.io/components/segmented-buttons/overview), but I'm not seeing that anywhere in Compose. Does it go by another name in the Compose material3 package? Only "Segment" stuff I see has to do with animation.
t
f
+2
  • 4
  • 6
  • 793
Anyone got any recommendations for graph libraries in kotlin? Google’s <guava>.<graph> seems enticin...
x

xxfast

about 5 years ago
Anyone got any recommendations for graph libraries in kotlin? Google’s guava.graph seems enticing, but lack of first class support for kotlin seems less appealing
x
m
n
  • 3
  • 2
  • 793
Previous676869Next

kotlinlang

A modern programming language that makes developers happier.

Powered by