Skip to content

Instantly share code, notes, and snippets.

View renanboni's full-sized avatar

Renan Boni renanboni

  • Berlin, Germany
View GitHub Profile
private const val REVIEW_ITEMS_COUNT = 10
fun List<MyVocabListItemModel>.getNextSession(
dateHelpers: DateHelpers
): List<MyVocabListItemModel> {
return filter { it -> it.lastReviewAt?.let { dateHelpers.isToday(it) } == false }
.ifEmpty { sortedBy { it.lastReviewAt } }
.take(REVIEW_ITEMS_COUNT)
}
shimmerOnPrimary = if (isDarkMode) ShimmerOnPrimaryDark else ShimmerOnPrimaryLight,
bottomSheetBackground = if (isDarkMode) BottomSheetBackgroundDark else BottomSheetBackgroundLight,
cursorOnPrimary = if (isDarkMode) CursorOnPrimaryDark else CursorOnPrimaryLight,
tertiaryCardBackground = if (isDarkMode) TertiaryCardBackgroundDark else TertiaryCardBackgroundLight,
inputLabelOnBackground = if (isDarkMode) InputLabelOnBackgroundDark else InputLabelOnBackgroundLight,
)
}
package br.com.motivapp.motiva.ui.theme
import androidx.compose.ui.graphics.Color
val PrimaryLight = Color(0xFF3E6FE5)
val PrimaryDark = Color.Black
val SecondaryLight = Color(0xFF3E6FE5)
val SecondaryDark = Color(0xFF2CD0B2)
data class Spacing(
val default: Dp = 0.dp,
val extraSmall: Dp = 4.dp,
val small: Dp = 8.dp,
val medium: Dp = 16.dp,
val large: Dp = 32.dp,
val extraLarge: Dp = 64.dp
)
data class QuivonTypography(
val tinyText: TextStyle = TextStyle(
fontFamily = Montserrat,
fontSize = 10.sp,
lineHeight = 18.sp
),
val smallText: TextStyle = TextStyle(
fontFamily = Montserrat,
fontSize = 12.sp,
lineHeight = 18.sp
@Immutable
data class QuivonColors(
val primary: Color = Color.Unspecified,
val secondary: Color = Color.Unspecified,
val textOnPrimary: Color = Color.Unspecified,
val textOnBackground: Color = Color.Unspecified,
val icon: Color = Color.Unspecified,
val iconOnPrimary: Color = Color.Unspecified,
val background: Color = Color.Unspecified,
val cardBackground: Color = Color.Unspecified,
@renanboni
renanboni / RootNav.kt
Created August 3, 2022 15:24
RootNav
@Composable
fun RootNav(navController: NavHostController) {
NavHost(
navController = navController,
route = Graph.ROOT,
startDestination = Graph.AUTHENTICATION
) {
authGraph(navController)
}
}
@renanboni
renanboni / AuthGraph.kt
Created August 3, 2022 15:16
AuthGraph
fun NavGraphBuilder.authGraph(navController: NavController) {
navigation(
startDestination = AuthScreens.Login.route,
route = Graph.AUTHENTICATION
) {
composable(AuthScreens.Login.route) {
LoginScreen(navController = navController)
}
composable(AuthScreens.SignUp.route) {
@renanboni
renanboni / MainActivity.kt
Created August 3, 2022 15:08
Main Activity
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
NestedNavigationTheme {
val navController = rememberNavController()
RootNav(navController = navController)
}
}
@renanboni
renanboni / RootNav.kt
Created August 3, 2022 15:03
RootNav
@Composable
fun RootNav(navController: NavHostController) {
NavHost(
navController = navController,
route = Graph.ROOT,
startDestination = Graph.AUTHENTICATION
) {
}
}