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
| 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 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
| @OptIn(ExperimentalMaterial3Api::class) | |
| @Composable | |
| fun DatePickerWithDialog( | |
| value: LocalDate?, | |
| dateFormatter: (LocalDate) -> String, | |
| enabled: Boolean = true, | |
| placeholder: @Composable (() -> Unit)? = null, | |
| dateValidator: (Long) -> Boolean = { true }, | |
| onChange: (LocalDate?) -> Unit |
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 vighnesh153.androidx.exo_player_prototype | |
| import android.net.Uri | |
| import android.os.Build | |
| import android.util.Log | |
| import android.view.ViewGroup | |
| import android.view.accessibility.CaptioningManager.CaptionStyle | |
| import android.widget.FrameLayout | |
| import androidx.annotation.RequiresApi | |
| import androidx.compose.animation.AnimatedVisibility |
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.animation.core.RepeatMode | |
| import androidx.compose.animation.core.animateFloat | |
| import androidx.compose.animation.core.infiniteRepeatable | |
| import androidx.compose.animation.core.rememberInfiniteTransition | |
| import androidx.compose.animation.core.tween | |
| import androidx.compose.foundation.background | |
| import androidx.compose.foundation.layout.Box | |
| import androidx.compose.foundation.layout.fillMaxSize | |
| import androidx.compose.foundation.layout.height | |
| import androidx.compose.foundation.layout.offset |
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.graphics.Matrix | |
| import android.os.Bundle | |
| import androidx.activity.ComponentActivity | |
| import androidx.activity.compose.setContent | |
| import androidx.compose.animation.core.LinearEasing | |
| import androidx.compose.animation.core.RepeatMode | |
| import androidx.compose.animation.core.animateFloat | |
| import androidx.compose.animation.core.infiniteRepeatable | |
| import androidx.compose.animation.core.rememberInfiniteTransition | |
| import androidx.compose.animation.core.tween |
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.animation.core.Animatable | |
| import androidx.compose.animation.core.Spring | |
| import androidx.compose.animation.core.SpringSpec | |
| import androidx.compose.animation.core.spring | |
| import androidx.compose.foundation.Canvas | |
| import androidx.compose.foundation.layout.Box | |
| import androidx.compose.foundation.layout.fillMaxSize | |
| import androidx.compose.foundation.layout.size | |
| import androidx.compose.runtime.Composable | |
| import androidx.compose.runtime.LaunchedEffect |
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
| // Validate numbers that starts with '+98' or '09' and 9 digits after. | |
| // It also works with persian numbers. | |
| const regex = /^((\+98|0|\+۹۸|۰)(9|۹)[0-9-۰-۹]{9})$/; | |
| console.log(regex.test("+989121234567")); // true | |
| console.log(regex.test("۰۹۱۲۱۲۳۴۵۶۷")); // true | |
| console.log(regex.test("۰۹12۱۲34۵۶7")); // true | |
| console.log(regex.test("+۹۸۹۱۲1234567")); // true | |
| console.log(regex.test("+98912123456789")); // false |
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.runtime.* | |
| import kotlinx.coroutines.CoroutineScope | |
| @Stable | |
| internal class Event<T>(val value: T) | |
| class MutableEventQueue<T> | |
| internal constructor(): EventQueue<T>() { | |
| private val events = mutableListOf<Event<T>>() | |
| private val nextEventAsState = mutableStateOf<Event<T>?>(null) |
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
| /* | |
| * Copyright 2020 The Android Open Source Project | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * https://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |