https://kotlinlang.org
Join Slack
How do I cast a json field to a string in exposed DSL (using postgres db)?
d

dave08

almost 4 years ago
How do I cast a json field to a string in exposed DSL (using postgres db)?
d
b
t
  • 3
  • 11
  • 1405
I’m getting this error message `Polymorphic serializer was not found for class discriminator 'batter...
j

jean

about 3 years ago
I’m getting this error message
Polymorphic serializer was not found for class discriminator 'batteryPercentage', JSON input: {"name":"batteryPercentage","value":70}
@JsonClassDiscriminator("name")
interface DeviceAttribute

@Serializable
data class Device(
    val id: String,
    val name: String,
    val icon: String,
    val iconOptions: List<String>,
    val attributes: List<DeviceAttribute> = emptyList(),
    val profiles: List<ActiveProfileMode>?,
)

@Serializable
@SerialName("batteryPercentage")
data class BatteryPercentage(val value: Int) : DeviceAttribute
What am I missing here?
j
e
+2
  • 4
  • 4
  • 1404
Hi. Is there any possibility to disable dragging in `ModalBottomSheetLayout`? I'm looking for soluti...
d

divid3d

about 4 years ago
Hi. Is there any possibility to disable dragging in
ModalBottomSheetLayout
? I'm looking for solution that would allow to hide bottom sheet only programmatically.
d
d
c
  • 3
  • 9
  • 1402
How can I create a Full Screen dialog? Dialog properties throw an error. Does anyone know of a diffe...
t

Tolga ÇAĞLAYAN

over 2 years ago
How can I create a Full Screen dialog? Dialog properties throw an error. Does anyone know of a different method?
t
z
  • 2
  • 5
  • 1398
I added `@AndroidEntryPoint` to a broadcast receiver, and I seem to be getting the error I posted in...
d

dave08

over 1 year ago
I added
@AndroidEntryPoint
to a broadcast receiver, and I seem to be getting the error I posted in the thread, I tried looking around in Google, but to no avail... is this a known issue? Is there a workaround?
d
s
i
  • 3
  • 7
  • 1397
Hello I am trying to use `"org.jetbrains.compose.components:components-resources:1.3.1-rc01"` to loa...
f

Francis Mariano

over 2 years ago
Hello I am trying to use
"org.jetbrains.compose.components:components-resources:1.3.1-rc01"
to load images images via compose in common module, but the images are not loaded. More info in the thread.
f
j
  • 2
  • 14
  • 1397
I wanted to add shadow to a composable. Shadow should be only applied to the top. (Not required for ...
w

wintersoldier

over 2 years ago
I wanted to add shadow to a composable. Shadow should be only applied to the top. (Not required for left or right). Is there some way to achieve this. Code snippet I already tried,
Box(
  modifier = Modifier
    .background(Color.Yellow)
    .shadow(
      elevation = 2.dp,
    ),
) {
content()
}
w
o
  • 2
  • 12
  • 1394
How can I create LazyColumn in LazyColumn? I get ```java.lang.IllegalStateException: Vertically scro...
c

chanjungskim

over 2 years ago
How can I create LazyColumn in LazyColumn? I get
java.lang.IllegalStateException: Vertically scrollable component was measured with an infinity maximum height constraints, which is disallowed. One of the common reasons is nesting layouts like LazyColumn and Column(Modifier.verticalScroll()). If you want to add a header before the list of items please add a header as a separate item() before the main items() inside the LazyColumn scope. There are could be other reasons for this to happen: your ComposeView was added into a LinearLayout with some weight, you applied Modifier.wrapContentSize(unbounded = true) or wrote a custom layout. Please try to remove the source of infinite constraints in the hierarchy above the scrolling container.
error
c
k
+2
  • 4
  • 16
  • 1392
Compose for Web on Canvas/Skia/Wasm: I have a simple function `BrowserViewportWindow` for the initia...
o

Oliver.O

almost 3 years ago
Compose for Web on Canvas/Skia/Wasm: I have a simple function
BrowserViewportWindow
for the initial window. It is easy to use, supports resizing, fills the entire browser viewport, sets the window title correctly and does not require a stylesheet. Inspired by code in @Tlaster's PreCompose. If you want to try: Code in 🧵
👏🏾 1
👏 11
o
d
+12
  • 14
  • 59
  • 1390
I’m trying to use HILT to inject an implementation of a repository class into the UseCase class (the...
l

lpirro

over 2 years ago
I’m trying to use HILT to inject an implementation of a repository class into the UseCase class (the interface lives in the
domain
module, and the implementation in the
repository
module with the
repository
module depending on the
domain
one) but receiving an error when building the app: DomainModule.kt - lives into
:domain
module
@Module
@InstallIn(SingletonComponent::class)
 object DomainModule {

    @Provides
    fun provideGetUpcomingLaunchesUseCase(repository: SpaceHubRepository): GetUpcomingLaunchesUseCase {
        return GetUpcomingLaunchesUseCaseImpl(repository)
    }

}
SpaceHubRepository.kt - lives into:
:domain
module
interface SpaceHubRepository {
    suspend fun getUpcomingLaunches(): Flow<List<Launch>>
}
RepositoryModule.kt - lives into
:repository
module
@Module
@InstallIn(SingletonComponent::class)
object RepositoryModule {

    @Provides
    fun provideRepository(
        apiService: SpaceHubApiService,
        launchMapper: LaunchMapper
    ): SpaceHubRepository {
        return SpaceHubRepositoryImpl(apiService, launchMapper)
    }

    @Provides
    fun provideLaunchMapper(): LaunchMapper = LaunchMapperImpl()
}
😶 3
🧵 1
l
c
y
  • 3
  • 6
  • 1390
Previous181920Next

kotlinlang

A modern programming language that makes developers happier.

Powered by