Hello Developers , I am trying to build a bottomsheet in android studio by the help of a YouTube video. But in the video the youtuber use kotlin and I don’t know kotlin. I have already complete the layout part but I stucked in the code section.
For the video click here
Or Use this link https://www.youtube.com/watch?v=3vMtHKniOqI&t=250s&ab_channel=DroidUI
bottomsheetbehavior.from(bottomsheet).apply{
peekheight=200
this.state.bottomsheetbehavior.state_collapsed }
3
Answers
In Java it will look something like this:
Your question is not clear Actually, what help do you want?
But as per my understanding, you should search your project on other sources in java if you find, well and good, or else try to know the basic semantics and syntax of kotlin and follow the same resource, code in kotlin & convert into Java.
.
Steps to convert kotlin into java:
Step-1: Open the Kotlin Class/File which is to be converted into Java.
Step-2: Navigate to Tools Menu
From the topmost toolbar of the Android Studio, select Tools and then navigate to Kotlin > Show Kotlin Bytecode. It will open a window at the right-hand side that will contain the line by line bytecode for the Kotlin file.
Step-3: Decompile Code
In the bytecode window, checkbox the option “JVM 8 target” and click on Decompile. The Android Studio will generate the Java equivalent code for the Kotlin file.
I hope this may be helpful in the last case.
https://blog.mindorks.com/how-to-convert-a-kotlin-source-file-to-a-java-source-file