https://kotlinlang.org
Join Slack
Hello Team, I am developing a KIOSK Mode stand alone application for Wear OS(Samsung Watch 4, Wear ...
b

Bhavesh Jethani

almost 3 years ago
Hello Team, I am developing a KIOSK Mode stand alone application for Wear OS(Samsung Watch 4, Wear OS 3.5). For KIOSK mode I am using device owner permission using ADB and used device DevicePolicyManager class to handle hardware button and status bar etc. My Issue is, I am not able to open System WIFI settings which navigate to outside of KIOSK mode. Just for your information I can open system bluetooth settings without disabling KIOSK mode. 1 more information case 3 code work perfectly if your KIOSK mode is disable I tried:- Case1. context.startActivity(Intent("com.google.android.clockwork.settings.connectivity.wifi.ADD_NETWORK_SETTINGS")) Case 2. val intent = Intent(Settings.ACTION_WIFI_SETTINGS) intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK intent.addCategory(Intent.CATEGORY_LAUNCHER) startActivity(intent) Case 3. startActivity(Intent(Settings.ACTION_WIFI_SETTINGS)) If any one have any idea or workaround. Much appreciate your inputs!
b
y
k
  • 3
  • 5
  • 346
Hello folks :wave: Is someone using Quarkus with :kotlin: for a while? I’d like to know about pain-...
l

Luiz Aguiar

about 4 years ago
Hello folks 👋 Is someone using Quarkus with K for a while? I’d like to know about pain-points when comparing to Boot or Micronaut that seems to have better Kotlin support (and more love from the Kotlin community)
l
r
n
  • 3
  • 5
  • 346
I have a `LazyColumn` that displays a `mutableStateListOf(items)`. There are about 100 items in the ...
c

Chris Miller

about 4 years ago
I have a
LazyColumn
that displays a
mutableStateListOf(items)
. There are about 100 items in the list and once populated (loaded from a server) the list doesn't change. Individual items do sometimes mutate however (by making a mutated copy of the item and replacing the previous instance of it in the list). This all works as expected. I now want to add a search/filter TextField, that reduces the items displayed to just those where
item.name.contains(searchText)
. I'm not sure what the best approach to implementing this is: 1. Create a new
mutableStateListOf()
list that contains just the filtered items, clearing and repopulating it from the full list each time the search text changes. It seems tricky to deal with mutating items using this approach though (both lists will need updating). 2. Similar to 1, but convert to a
mutableStateOf(List<Item>)
and create a new list (from the separate full list) each time the search text changes or an item is mutated. 3. Leave things as they are, but make the item @Composable take the search text as a parameter, and display nothing if
contains()
returns false. This seems easy, but also hacky. 4. Something else?
c
t
  • 2
  • 3
  • 346
Trying to integrate this bottom tab code into a new material3 app <https://developer.android.com/de...
c

Colton Idle

about 1 year ago
Trying to integrate this bottom tab code into a new material3 app https://developer.android.com/develop/ui/compose/navigation#bottom-nav Getting this error
NavDestination. hasRoute can only be called from within the same library group (referenced groupId=androidx. navigation from
on this code
selected = currentDestination?.hierarchy?.any { it.hasRoute(topLevelRoute.route::class) } == true,
Am I missing something?
c
c
i
  • 3
  • 8
  • 345
Does anyone have an example of applying detekt inside a precompiled convention plugin for Gradle? Wh...
s

Sebastian Schuberth

almost 3 years ago
Does anyone have an example of applying detekt inside a precompiled convention plugin for Gradle? When I try to follow https://docs.gradle.org/current/samples/sample_convention_plugins.html#compiling_convention_plugins, I'm getting
Unable to load class 'org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension'.

This is an unexpected error. Please file a bug containing the idea.log file.
s
b
e
  • 3
  • 10
  • 345
Does using `externalServices` to mock external services only work for client requests made directly ...
l

Levi

almost 2 years ago
Does using
externalServices
to mock external services only work for client requests made directly with the client provided in
testApplication
? In other words, if in your test you call some of your application code which internally creates a client, will the requests made by that client not use the mock setup?
l
a
a
  • 3
  • 44
  • 344
Hi team. *please: is it possible to disable Kafka during my unit tests?* I’ve created a class with...
a

Alexandre A Barbosa

almost 3 years ago
Hi team. please: is it possible to disable Kafka during my unit tests? I’ve created a class with a method using
@KafkaListener
annotation and when I run the functional tests, I produce a protobuf topic message and the listener works properly to consume that message. But my unit test need to test this method, and I am using this:
@Autowired
lateinit var ingestionListener: IngestionConsumerListener
to inject my listener and I want to test this method but without the Kafka in memory. But the test is trying to load the Kafka because I am getting this:
Could not resolve placeholder 'ingestion.config.topic.name' in value "#{'${ingestion.config.topic.name}'}"
that is used in my implementation:
@KafkaListener(
    id = "ingestionListener",
    topics = ["#{'\${ingestion.config.topic.name}'}"],
    groupId = "#{'\${ingestion.consumer.group.id}'}",
    concurrency = "#{'\${ingestion.config.consumer.concurrency}'}"
)
fun consumeIngestion(ingestionHttpRequest: ConsumerRecord<String, IngestionHttpRequest.HttpRequest>)
I am trying to use this kind of solution for my first unit test using Kotlin and Kafka:
@EnableAutoConfiguration(exclude = [KafkaAutoConfiguration::class])
but I am still struggling with the error above… Please any suggestion to fix that? How to test a kafka listener using Java/Kotlin without Kafka in memory?
😶 2
a
e
  • 2
  • 1
  • 344
Is it possible to make extra padding for content in Scaffold if FAB is showing? Or may be there are ...
p

PHondogo

over 4 years ago
Is it possible to make extra padding for content in Scaffold if FAB is showing? Or may be there are more correct way to handle FAB overlaping?
p
c
+3
  • 5
  • 17
  • 344
Hey guys I am getting this error when trying to build the project.
v

Vivek Modi

over 3 years ago
Hey guys I am getting this error when trying to build the project.
v
e
  • 2
  • 4
  • 344
Hello all, I'm trying to setup SQLDelight for a Compose project (Kotlin). When I follow the <website...
h

Humphrey

about 4 years ago
Hello all, I'm trying to setup SQLDelight for a Compose project (Kotlin). When I follow the website I'm getting stuck at configuring the database. I have done the following: 1. imported the gradle plugin
plugins {
    kotlin("jvm") version "1.5.31"
    id("org.jetbrains.compose") version "1.0.0-beta5"
    id("com.squareup.sqldelight") version "1.5.2"
}
2. added the driver dependency
dependencies {
    implementation(compose.desktop.currentOs)
    implementation("com.squareup.sqldelight:sqlite-driver:1.5.2")

    testImplementation(kotlin("test"))
}
3. now I'm trying to add the configuration for the gradle-plugin
sqldelight {
  Database { // This will be the name of the generated database class.
    packageName = "com.example"
  }
}
But I get error
sqldelight {
    sqldelight.com.squareup.sqlite.migrations.Database {

    }
}
The error:
build.gradle.kts:47:16: Unresolved reference: com
SQLDelight Gradle plugin was applied but there are no databases set up.
Seems like I'm not able to add Database like that (com is pointing out to the package name and marked red in my Intellij). If I remove the package name (sqldelight.
com
.squareup.sqlite.migrations) it does not work. Hope someone can help me out with this?
h
m
s
  • 3
  • 11
  • 344
Previous200201202Next

kotlinlang

A modern programming language that makes developers happier.

Powered by