xxxxxxxxxx
class ConduitClientTests {
private val conduitClient = ConduitClient()
@Test
fun 'GET articles'()
{
val articles = conduitClient.api.getarticles().execute()
asserNotNull(articles.body() ?.articles)
}
}
xxxxxxxxxx
val pfd = context.contentResolver.openFileDescriptor(uri, "w")
val fd = pfd.fileDescriptor
val image = BitmapFactory.decodeFileDescriptor(fd)
pfd.close()
xxxxxxxxxx
/**
* for place API Key
*/
fun getPlaceApiKey(): String {
var placeApiKey = helper.mapKey?.let { it } ?: BuildConfig.MAP_KEY
if (placeApiKey.isEmpty())
placeApiKey = BuildConfig.MAP_KEY
if (BuildConfig.APPLICATION_ID.equals("com.uffizio.trakzee", ignoreCase = true)
|| BuildConfig.APPLICATION_ID.equals("com.uffizio.trakzeelocal", ignoreCase = true)) {
placeApiKey = BuildConfig.TRAKZEE_GOOGLE_KEY
}
return placeApiKey
}
xxxxxxxxxx
import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
@Parcelize
data class Product (
var id : Int? = null,
var name : String? = null,
var price : Int? = null,
var image : String? = null,
var selectedQuantity : Int? = null
) : Parcelable
xxxxxxxxxx
private fun openImagePicker() {
ImagePickerView.Builder()
.setup {
name { RESULT_NAME }
max { 5 }
title { "Image Picker" }
single { false }
}
.start(this)
}
xxxxxxxxxx
import ch.qos.logback.access.tomcat.LogbackValve
import org.springframework.boot.web.embedded.tomcat.TomcatContextCustomizer
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import java.nio.file.Files
@Configuration
open class AccessLogConfiguration {
@Bean
fun addLogbackAccessValve() = TomcatContextCustomizer { context ->
javaClass.getResourceAsStream("/logback-access.xml").use {
Files.createDirectories((context.catalinaBase.toPath()
.resolve(LogbackValve.DEFAULT_CONFIG_FILE)).parent)
Files.copy(it, context.catalinaBase.toPath()
.resolve(LogbackValve.DEFAULT_CONFIG_FILE))
}
LogbackValve().let {
it.isQuiet = true
context.pipeline.addValve(it)
}
}
}
xxxxxxxxxx
private fun setupSmoothBottomMenu() {
val popupMenu = PopupMenu(this, null)
popupMenu.inflate(R.menu.menu_bottom)
val menu = popupMenu.menu
binding.bottomBar.setupWithNavController(menu, navController)
}
xxxxxxxxxx
private fun toggleLeftDrawer() {
if (drawerLayout.isDrawerOpen(leftDrawerMenu)) {
drawerLayout.closeDrawer(leftDrawerMenu)
} else {
drawerLayout.openDrawer(leftDrawerMenu)
}
}
xxxxxxxxxx
private fun toggleLeftDrawer() {
if (drawerLayout.isDrawerOpen(leftDrawerMenu)) {
drawerLayout.closeDrawer(leftDrawerMenu)
} else {
drawerLayout.openDrawer(leftDrawerMenu)
}
}
xxxxxxxxxx
private fun toggleLeftDrawer() {
if (drawerLayout.isDrawerOpen(leftDrawerMenu)) {
drawerLayout.closeDrawer(leftDrawerMenu)
} else {
drawerLayout.openDrawer(leftDrawerMenu)
}
}