https://kotlinlang.org
Join Slack
Whats the preferred way to use native File chooser dialog on Compose desktop applications. `java.awt...
s

suresh

over 4 years ago
Whats the preferred way to use native File chooser dialog on Compose desktop applications.
java.awt.FileDialog
seems to be working fine. Is that the recommended way?
👀 5
s
i
m
  • 3
  • 6
  • 1079
what's the right way to change the TopAppBar title (or any other prop for that matter) dynamically f...
o

oday

over 1 year ago
what's the right way to change the TopAppBar title (or any other prop for that matter) dynamically from each screen? So right now I have 1 Scaffold which use and inside is the NavHost, passed to each
composable
inside is
scaffoldState
where I go
scaffoldstate.value.title = { Text("Screen A" }
and the primary Scaffold just populates its own topAppBar with MyAppBar(title = scaffoldState.title) but this causes a lot of jank when switching between bottom bar destinations and sometimes one screen ends up with the title of the other and it's just bad having 2 Scaffolds causes a visual effect where you can see them being swapped out, Now In Android does it really well but the code is so convoluted I couldn't really pin down even where the switch was happening
o
y
f
  • 3
  • 16
  • 1075
> 'capitalize(): String' is deprecated. Use replaceFirstChar instead what is the thinking here? `...
j

Jonathan Ellis

almost 3 years ago
'capitalize(): String' is deprecated. Use replaceFirstChar instead
what is the thinking here?
replaceFirstChar { if (it.isLowerCase()) it.titlecase() else it.toString() }
is a lot clunkier
😕 1
j
m
+3
  • 5
  • 18
  • 1075
Is there any way to make the clickable region larger than the icon without making the icon size bigg...
s

Sergey Y.

almost 5 years ago
Is there any way to make the clickable region larger than the icon without making the icon size bigger? I want to achieve a borderless ripple effect and easier clicking. Maybe some modifier? Is there an analogy to the 
selectableItemBackgroundBorderless
 attribute? Thanks.
s
f
+5
  • 7
  • 24
  • 1074
I'm trying to configure a ktor application using the configuration file, as described here: <https:/...
s

Serafeim Papastefanos

over 2 years ago
I'm trying to configure a ktor application using the configuration file, as described here: https://ktor.io/docs/configurations.html#configuration-file ... I've put a file on my
src/main/resources/application.conf
and works great. However, to deploy the app I create a fat jar. Is there a way to override some configuration options when I deploy that fat jar ? I know that I can use env vars but there are too many options that would need overriding. is it possible to pass another configuration file to the fatjar that would be used to override configuration options ? i.e run it like
java -jar ktor-fat.jar -c local.conf
; when trying to read a configuration value, it will first check
local.conf
, if not found then go to
resources/application.conf
inside the jar
s
a
l
  • 3
  • 7
  • 1073
Hi everyone, I want to migrate to Kotlin `1.9.0` from `1.8.22` . It all works well on my machine but...
d

dawidhyzy

almost 2 years ago
Hi everyone, I want to migrate to Kotlin
1.9.0
from
1.8.22
. It all works well on my machine but fails during a build on CI with:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':kotlinStoreYarnLock'.
> yarn.lock was changed. Run the `kotlinUpgradeYarnLock` task to actualize yarn.lock file
I tried running
kotlinUpgradeYarnLock
on my machine but there is no change to yarn lock.
d
h
+3
  • 5
  • 25
  • 1071
What could cause this exception? (thread)
j

Jan

almost 3 years ago
What could cause this exception? (thread)
j
n
  • 2
  • 6
  • 1069
Can we use lottie animations in compose KMM.
f

Farhazul Mullick

over 1 year ago
Can we use lottie animations in compose KMM.
f
h
a
  • 3
  • 4
  • 1068
Hey guys, I keep on getting `viewModelFactory lateinit has not been initialized errpr` when injectin...
j

Jabez Magomere

about 5 years ago
Hey guys, I keep on getting
viewModelFactory lateinit has not been initialized errpr
when injecting a dagger view model factory into a fragment and initialising the viewmodel using viewmodel lazy delegate property, here is a snippet of my code.. Error :
Fatal Exception: kotlin.UninitializedPropertyAccessException
lateinit property viewModelFactory has not been initialized
Code:
class DeliveriesFragment() : Fragment(){

    @Inject
    lateinit var daggerViewModelFactory: DaggerViewModelFactory
    private val upcomingDeliveriesViewModel : UpcomingDeliveriesViewModel by viewModels { daggerViewModelFactory }

    override fun onAttach(context: Context) {
        SalesApplication.salesComponent().inject(this)
        super.onAttach(context)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        observeDeliveries()
    }

    private fun observeDeliveries(){
        upcomingDeliveriesViewModel.loadUpcomingUserDeliveries("").observe(viewLifecycleOwner, Observer {
            //displayList()
        })
    }
}
j
s
+4
  • 6
  • 6
  • 1068
Heyy, can I use JPA in Ktor? I tried many orms like Exposed or Ktorm, I didn't like any of them like...
o

Okan Yıldırım

about 3 years ago
Heyy, can I use JPA in Ktor? I tried many orms like Exposed or Ktorm, I didn't like any of them like Spring Data JPA. I was just simply creating a class with annotations and a repository, thats all. I am looking for something similar for Ktor
o
f
+5
  • 7
  • 15
  • 1067
Previous323334Next

kotlinlang

A modern programming language that makes developers happier.

Powered by