This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(" ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |