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
| public class ThreeDigitDecimalFormatWatcher implements TextWatcher { | |
| private DecimalFormat df; | |
| private DecimalFormat dfnd; | |
| private boolean hasFractionalPart; | |
| private EditText et; | |
| public ThreeDigitDecimalFormatWatcher(EditText et) { | |
| DecimalFormatSymbols decimalFormatSymbols = DecimalFormatSymbols.getInstance(Locale.US); |
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
| class PriceTextInputLayout @JvmOverloads constructor( | |
| context: Context, | |
| attrs: AttributeSet? = null, | |
| defStyleAttr: Int = R.attr.textInputStyle | |
| ) : TextInputLayout(context, attrs, defStyleAttr) { | |
| val locale = Locale(LOCALE_LANGUAGE_FA) | |
| override fun onAttachedToWindow() { |
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
| // Reference: https://stackoverflow.com/questions/66341823/jetpack-compose-scrollbars/68056586#68056586 | |
| // Modify: LazyListState -> ScrollState | |
| fun Modifier.verticalScrollbar( | |
| scrollState: ScrollState, | |
| scrollBarWidth: Dp = 4.dp, | |
| minScrollBarHeight: Dp = 5.dp, | |
| scrollBarColor: Color = Color.Blue, | |
| cornerRadius: Dp = 2.dp | |
| ): Modifier = composed { |
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
| @ExperimentalMaterialApi | |
| @Composable | |
| fun OverlayBottomSheetScaffold( | |
| sheetContent: @Composable ColumnScope.() -> Unit, | |
| scaffoldState: BottomSheetScaffoldState = rememberBottomSheetScaffoldState(), | |
| sheetPeekHeight: Dp = 0.dp, | |
| maxOverlayAlpha: Float = 0.7f, | |
| overlayColor: Color = Color.Black, | |
| cancelable: Boolean = true, | |
| content: @Composable (PaddingValues) -> 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
| import androidx.compose.animation.core.* | |
| import androidx.compose.foundation.Canvas | |
| import androidx.compose.foundation.background | |
| import androidx.compose.foundation.layout.BoxWithConstraints | |
| import androidx.compose.foundation.layout.fillMaxSize | |
| import androidx.compose.runtime.Composable | |
| import androidx.compose.runtime.getValue | |
| import androidx.compose.ui.Modifier | |
| import androidx.compose.ui.geometry.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
| @OptIn(ExperimentalAnimationApi::class) | |
| @Composable | |
| fun Heart(modifier: Modifier, horizontalPadding: Int, bottomMargin: Int) { | |
| val width = LocalConfiguration.current.screenWidthDp | |
| val height = LocalConfiguration.current.screenHeightDp - bottomMargin | |
| val yRandom = Random.nextInt(0, height / 2) | |
| val xRandom = Random.nextInt(horizontalPadding, (width - horizontalPadding)) | |
| val state = remember { |
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 des.c5inco.material3 | |
| import androidx.compose.animation.core.Animatable | |
| 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.offset | |
| import androidx.compose.foundation.layout.size | |
| import androidx.compose.material3.Surface |
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
| const val MAX_ITERATIONS = 7f | |
| @OptIn(ExperimentalGraphicsApi::class) | |
| @Composable | |
| fun CantorCirclePatternComposable(modifier: Modifier) { | |
| BoxWithConstraints(modifier = Modifier) { | |
| val frame by rememberInfiniteTransition().animateFloat( |
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 des.c5inco.material3 | |
| import android.graphics.Matrix | |
| import android.graphics.Path | |
| import androidx.compose.animation.core.* | |
| import androidx.compose.foundation.Canvas | |
| import androidx.compose.foundation.layout.Box | |
| import androidx.compose.foundation.layout.Column | |
| import androidx.compose.foundation.layout.fillMaxSize | |
| import androidx.compose.foundation.layout.size |