Skip to content

Instantly share code, notes, and snippets.

View karmicDev's full-sized avatar

karmic karmicDev

View GitHub Profile
import androidx.compose.ui.tooling.preview.datasource.LoremIpsum
import java.util.Locale
import kotlin.math.roundToInt
import kotlin.random.Random
fun loremIpsum(from: Int = 10, until: Int = 20): String {
val wordCount = Random.nextInt(from, until)
val words = LoremIpsum(wordCount).values.first()
val shuffledWords = words.split(" ").shuffled()
return shuffledWords.joinToString(" ")
interface MealApiService {
}
object MealApi {
private const val BASE_URL = "https://www.themealdb.com/api/json/v1/1/"
private val moshi = Moshi.Builder().add(KotlinJsonAdapterFactory()).build()
private val logger = HttpLoggingInterceptor().apply { level = HttpLoggingInterceptor.Level.BODY }
private val client = OkHttpClient.Builder().addInterceptor(logger).build()
private val retrofit = Retrofit.Builder()
import android.content.res.Configuration
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Close
import androidx.compose.material.icons.filled.Email
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.ui.graphics.Color
import kotlin.math.roundToInt
import kotlin.random.Random
fun randomColor(offset: Float = 0f): Color {
return Color(
red = Random.nextFloat() + offset,
green = Random.nextFloat() + offset,
blue = Random.nextFloat() + offset,
alpha = 1f
package de.syntax_institut.jetpack.jpc_live_api_mealdb_04_06.ui.screens
import android.content.res.Configuration
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Email