This file contains 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
class MainActivity : ComponentActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
WindowCompat.setDecorFitsSystemWindows(window, false) | |
super.onCreate(savedInstanceState) | |
setContent { | |
P2RTheme { | |
// A surface container using the 'background' color from the theme | |
Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) { | |
CompositionLocalProvider( | |
LocalOverscrollConfiguration provides null // Disable overscroll otherwise it consumes the drag before we get the chance |
This file contains 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.animation.core.animateFloatAsState | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.clickable | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.IntrinsicSize | |
import androidx.compose.foundation.layout.fillMaxHeight | |
import androidx.compose.foundation.layout.height | |
import androidx.compose.foundation.layout.padding | |
import androidx.compose.foundation.shape.CircleShape | |
import androidx.compose.material3.MaterialTheme |
This file contains 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
@Suppress("EnumEntryName") | |
@Serializable | |
enum class Currency( | |
val code: String, | |
val symbol: String, | |
) { | |
Australian_dollar("AUD", "$"), | |
Brazilian_real("BRL", "R$"), | |
Bulgarian_lev("BGN", "лв."), | |
Canadian_dollar("CAD", "$"), |
This file contains 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
@file:OptIn(ExperimentalMaterial3Api::class, ExperimentalFoundationApi::class) | |
package de.kuno.listsections | |
import android.os.Bundle | |
import androidx.activity.ComponentActivity | |
import androidx.activity.compose.setContent | |
import androidx.compose.animation.core.animateDpAsState | |
import androidx.compose.animation.core.animateRectAsState | |
import androidx.compose.foundation.ExperimentalFoundationApi |
This file contains 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
Number of contributors: 192 |
This file contains 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
/* | |
Composable DatePicker for Compose Desktop and other platforms. | |
How to use: | |
var showDatePicker by remember { mutableStateOf(false) } | |
var selectedDate by remember { mutableStateOf(Date()) } | |
//implement here the logic to show datepicker and use de return value | |
if (showDatePicker) { | |
DatePicker( |
This file contains 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.foundation.layout.Box | |
import androidx.compose.runtime.Composable | |
import androidx.compose.ui.Modifier | |
import androidx.compose.ui.draw.drawWithContent | |
import androidx.compose.ui.geometry.Offset | |
import androidx.compose.ui.graphics.BlendMode | |
import androidx.compose.ui.graphics.Color | |
import androidx.compose.ui.graphics.nativeCanvas | |
@Composable |
This file contains 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 net.peanuuutz.compose.desktop | |
import androidx.compose.runtime.Immutable | |
import androidx.compose.ui.Modifier | |
@Immutable | |
interface GridScope { | |
fun Modifier.span( | |
span: GridSpanScope.() -> Int | |
): Modifier |
This file contains 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
private val TickerCycleMillis = 150 | |
private object AlphabetMapper { | |
private val Alphabet = " ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789•".toList() | |
val size: Int = Alphabet.size | |
fun getLetterAt(index: Int): Char = Alphabet[index % size] | |
fun getIndexOf(letter: Char, offset: Int = 0): TickerIndex { |
This file contains 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.animation.core.InfiniteRepeatableSpec | |
import androidx.compose.animation.core.RepeatMode | |
import androidx.compose.animation.core.animateFloat | |
import androidx.compose.animation.core.rememberInfiniteTransition | |
import androidx.compose.animation.core.tween | |
import androidx.compose.foundation.Canvas | |
import androidx.compose.foundation.layout.fillMaxSize | |
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.getValue | |
import androidx.compose.ui.Modifier |
NewerOlder