1Select the src/main/java folder in the project and choose
2 Code->"Convert Java File to Kotlin File”
1import ch.qos.logback.access.tomcat.LogbackValve
2import org.springframework.boot.web.embedded.tomcat.TomcatContextCustomizer
3import org.springframework.context.annotation.Bean
4import org.springframework.context.annotation.Configuration
5import java.nio.file.Files
6
7@Configuration
8open class AccessLogConfiguration {
9
10 @Bean
11 fun addLogbackAccessValve() = TomcatContextCustomizer { context ->
12
13 javaClass.getResourceAsStream("/logback-access.xml").use {
14 Files.createDirectories((context.catalinaBase.toPath()
15 .resolve(LogbackValve.DEFAULT_CONFIG_FILE)).parent)
16
17 Files.copy(it, context.catalinaBase.toPath()
18 .resolve(LogbackValve.DEFAULT_CONFIG_FILE))
19 }
20
21 LogbackValve().let {
22 it.isQuiet = true
23 context.pipeline.addValve(it)
24 }
25 }
26
27}
1import android.os.Parcelable
2import kotlinx.android.parcel.Parcelize
3
4@Parcelize
5data class Product (
6 var id : Int? = null,
7 var name : String? = null,
8 var price : Int? = null,
9 var image : String? = null,
10 var selectedQuantity : Int? = null
11) : Parcelable
1 private fun setupSmoothBottomMenu() {
2 val popupMenu = PopupMenu(this, null)
3 popupMenu.inflate(R.menu.menu_bottom)
4 val menu = popupMenu.menu
5 binding.bottomBar.setupWithNavController(menu, navController)
6 }
7
1 private fun openImagePicker() {
2 ImagePickerView.Builder()
3 .setup {
4 name { RESULT_NAME }
5 max { 5 }
6 title { "Image Picker" }
7 single { false }
8 }
9 .start(this)
10 }