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 be.motti.uzb; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.os.Handler; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.Button; |
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
@OptIn(ExperimentalFoundationApi::class) | |
fun Modifier.bounceClickable( | |
dampingRatio: Float = 0.85f, | |
enabled: Boolean = true, | |
onClick: () -> Unit = {}, | |
onDoubleClick: (() -> Unit)? = null, | |
onLongClick: (() -> Unit)? = null, | |
shape: Shape = RectangleShape, | |
useHapticFeedback: Boolean = true, | |
) = composed { |
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
fun Modifier.shimmerEffect(): Modifier = composed { | |
var size by remember { | |
mutableStateOf(IntSize.Zero) | |
} | |
val transition = rememberInfiniteTransition() | |
val startOffsetX by transition.animateFloat( | |
initialValue = -2 * size.width.toFloat(), | |
targetValue = 2 * size.width.toFloat(), | |
animationSpec = infiniteRepeatable( | |
animation = tween(2000) |
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 com.example.jetpackcomposeplayground | |
import androidx.compose.foundation.Image | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.layout.Arrangement | |
import androidx.compose.foundation.layout.Column | |
import androidx.compose.foundation.layout.Row | |
import androidx.compose.foundation.layout.fillMaxWidth | |
import androidx.compose.foundation.layout.height | |
import androidx.compose.foundation.layout.padding |
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.material.TextField | |
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.mutableStateOf | |
import androidx.compose.runtime.remember | |
import androidx.compose.ui.text.SpanStyle | |
import androidx.compose.ui.text.buildAnnotatedString | |
import androidx.compose.ui.text.font.FontWeight | |
import androidx.compose.ui.text.input.OffsetMapping | |
import androidx.compose.ui.text.input.TextFieldValue | |
import androidx.compose.ui.text.input.TransformedText |
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
sealed class Screens(val route : String) { | |
object Dashboard : Screens("dashboard") | |
object Home : Screens("home"){ | |
object Login : Screens("login") | |
object Register : Screens("register") | |
} | |
} |
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
dependencies { | |
val nav_version = "2.7.0" | |
implementation("androidx.navigation:navigation-compose:$nav_version") | |
} |
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
@OptIn(ExperimentalMaterial3Api::class) | |
@Composable | |
fun DashboardScreen(navigateTo: (route: String) -> Unit) { | |
Scaffold(topBar = { | |
TopAppBar( | |
title = { Text(text = "Dashboard") }, | |
colors = TopAppBarDefaults.topAppBarColors(containerColor = MaterialTheme.colorScheme.primary) | |
) | |
}) { | |
Box( |
OlderNewer