Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("wottrich.github.io.smartchecklist.android.app")
id("wottrich.github.io.smartchecklist.compose")
alias(libs.plugins.ksp)
}

Expand All @@ -19,13 +20,7 @@ android {
}
}

buildFeatures {
compose = true
buildConfig = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}
android.buildFeatures.buildConfig = true

packaging {
resources.excludes.apply {
Expand All @@ -45,10 +40,10 @@ dependencies {
implementation(libs.kotlin.stdlib)
implementation(libs.android.core.ktx)
implementation(libs.android.app.compat)
implementation(libs.compose.accompanist.system.ui.controller)
implementation(libs.bundles.compose.default)
implementation(libs.bundles.koin.default)
implementation(libs.bundles.compose.navigation.default)
implementation(libs.android.activity.ktx)
implementation(project(path = ":baseui"))
implementation(project(path = ":datasource"))
implementation(project(path = ":infrastructure:extensions:intent"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,18 @@ package wottrich.github.io.smartchecklist.presentation.activity
import android.content.Intent
import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.layout.windowInsetsBottomHeight
import androidx.compose.foundation.layout.windowInsetsTopHeight
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Surface
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.rememberNavController
Expand All @@ -16,10 +25,11 @@ import com.google.accompanist.navigation.material.ModalBottomSheetLayout
import com.google.accompanist.navigation.material.rememberBottomSheetNavigator
import kotlinx.coroutines.InternalCoroutinesApi
import org.koin.android.ext.android.inject
import wottrich.github.io.smartchecklist.baseui.ui.ApplicationTheme
import wottrich.github.io.smartchecklist.baseui.ui.Dimens
import wottrich.github.io.smartchecklist.baseui.ui.pallet.SmartChecklistTheme
import wottrich.github.io.smartchecklist.navigation.AppNavigator
import wottrich.github.io.smartchecklist.navigation.NavigationHome
import wottrich.github.io.smartchecklist.presentation.ui.StatusBarColor

@InternalCoroutinesApi
@OptIn(ExperimentalMaterialNavigationApi::class)
Expand All @@ -29,21 +39,29 @@ class MainHostActivity : AppCompatActivity() {
private var sharedNavHostController: NavHostController? = null

override fun onCreate(savedInstanceState: Bundle?) {
enableEdgeToEdge()
super.onCreate(savedInstanceState)
setContent {
val navController = rememberNavController().also {
sharedNavHostController = it
}
val bottomSheetNavigator = rememberBottomSheetNavigator()
navController.navigatorProvider += bottomSheetNavigator
BottomSheetNavigator(bottomSheetNavigator = bottomSheetNavigator) {
AppNavigator(navHostController = navController)
ApplicationTheme {
Surface(color = SmartChecklistTheme.colors.background) {
Column {
Spacer(modifier = Modifier.windowInsetsTopHeight(WindowInsets.systemBars))
BottomSheetNavigator(bottomSheetNavigator = bottomSheetNavigator) {
AppNavigator(navHostController = navController)
}
Spacer(modifier = Modifier.windowInsetsBottomHeight(WindowInsets.systemBars))
}
}
}
StatusBarColor()
}
}

override fun onNewIntent(intent: Intent?) {
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
sharedNavHostController?.handleDeepLink(intent)
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package wottrich.github.io.smartchecklist.presentation.ui.content

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.material.DrawerState
import androidx.compose.material.FabPosition
import androidx.compose.material.Icon
Expand All @@ -10,12 +12,16 @@ import androidx.compose.material.MaterialTheme
import androidx.compose.material.Scaffold
import androidx.compose.material.ScaffoldState
import androidx.compose.material.SnackbarHostState
import androidx.compose.material.Surface
import androidx.compose.material.TopAppBar
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Menu
import androidx.compose.material.primarySurface
import androidx.compose.material.rememberScaffoldState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch
import wottrich.github.io.smartchecklist.baseui.ui.pallet.SmartChecklistTheme
Expand All @@ -42,7 +48,11 @@ fun HomeScaffold(
drawerContent()
},
bottomBar = {
HomeTopBar(coroutineScope, drawerState, onTitleContent, actionContent)
Surface(color = MaterialTheme.colors.primarySurface) {
Box(modifier = Modifier.navigationBarsPadding()) {
HomeTopBar(coroutineScope, drawerState, onTitleContent, actionContent)
}
}
}
) { innerPadding ->
content(innerPadding)
Expand Down Expand Up @@ -75,6 +85,7 @@ private fun HomeTopBar(
title = {
onTitleContent()
},
actions = actionContent
actions = actionContent,
elevation = 0.dp
)
}
3 changes: 1 addition & 2 deletions baseui/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
plugins {
id("wottrich.github.io.smartchecklist.android.lib")
id("wottrich.github.io.smartchecklist.compose")
}

android {
buildFeatures.compose = true
composeOptions.kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
namespace = "wottrich.github.io.smartchecklist.baseui"
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
package wottrich.github.io.smartchecklist.baseui.components.completable

import androidx.compose.material.LocalRippleConfiguration
import androidx.compose.material.RippleConfiguration
import androidx.compose.material.RippleDefaults
import androidx.compose.material.ripple.LocalRippleTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import wottrich.github.io.smartchecklist.baseui.behaviour.ripple.RippleStatusColor
import wottrich.github.io.smartchecklist.baseui.ui.pallet.SmartChecklistTheme

@Composable
internal fun CompletableComponentRippleLayer(isCompleted: Boolean, content: @Composable () -> Unit) {
val rippleConfiguration = getRippleConfiguration(isPositive = !isCompleted)
CompositionLocalProvider(
LocalRippleTheme provides RippleStatusColor(!isCompleted),
LocalRippleConfiguration provides rippleConfiguration,
content = content
)
}

@Composable
private fun getRippleConfiguration(isPositive: Boolean): RippleConfiguration {
return RippleConfiguration(
color = if (isPositive) {
SmartChecklistTheme.colors.status.positive
} else {
SmartChecklistTheme.colors.status.negative
},
rippleAlpha = RippleDefaults.rippleAlpha(
contentColor = SmartChecklistTheme.colors.secondary,
lightTheme = SmartChecklistTheme.colors.isLight
)
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package wottrich.github.io.smartchecklist.baseui.icons
import androidx.compose.foundation.clickable
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
Expand All @@ -29,7 +29,7 @@ fun ArrowBackIcon(
) {
VectorIcon(
modifier = modifier,
imageVector = Icons.Default.ArrowBack,
imageVector = Icons.AutoMirrored.Default.ArrowBack,
contentDescription = contentDescription,
tint = SmartChecklistTheme.colors.onSurface
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ fun ApplicationTheme(

fun SmartChecklistColors.toMaterialTheme(): Colors {
return Colors(
primary,
primaryVariant,
secondary,
secondaryVariant,
background,
surface,
error,
onPrimary,
onSecondary,
onBackground,
onSurface,
onError,
isLight
primary = primary,
primaryVariant = primaryVariant,
secondary = secondary,
secondaryVariant = secondaryVariant,
background = background,
surface = surface,
error = error,
onPrimary = onPrimary,
onSecondary = onSecondary,
onBackground = onBackground,
onSurface = onSurface,
onError = onError,
isLight = isLight
)
}

Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ plugins {
alias(libs.plugins.jetbrains.kotlin.jvm) apply false
alias(libs.plugins.jetbrains.kotlin.parcelize) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.compose.compiler) apply false
}
1 change: 1 addition & 0 deletions features/checklist/impl/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("wottrich.github.io.smartchecklist.feature.impl")
id("wottrich.github.io.smartchecklist.compose")
}

android {
Expand Down
1 change: 1 addition & 0 deletions features/newchecklist/impl/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("wottrich.github.io.smartchecklist.feature.impl")
id("wottrich.github.io.smartchecklist.compose")
}

android {
Expand Down
1 change: 1 addition & 0 deletions features/quicklychecklist/impl/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("wottrich.github.io.smartchecklist.feature.impl")
id("wottrich.github.io.smartchecklist.compose")
}

android {
Expand Down
1 change: 1 addition & 0 deletions features/task/impl/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("wottrich.github.io.smartchecklist.feature.impl")
id("wottrich.github.io.smartchecklist.compose")
}

android {
Expand Down
5 changes: 1 addition & 4 deletions gradle-conventions/conventions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@ repositories {
}

dependencies {
// Make version catalogs accessible from precompiled script plugins
// https://github.com/gradle/gradle/issues/15383
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))

implementation(libs.kotlin.gradle.plugin)
implementation(libs.gradlePlugins.compose.compiler)
implementation("com.android.tools.build:gradle:${libs.versions.gradle.get()}")
}

Expand Down
Loading
Loading