Skip to content

Commit

Permalink
Merge pull request #315 from serbelga/develop
Browse files Browse the repository at this point in the history
Release 2023-07-01
  • Loading branch information
serbelga authored Jul 1, 2023
2 parents 44b4425 + 42ea1c4 commit 27f8420
Show file tree
Hide file tree
Showing 111 changed files with 1,270 additions and 1,086 deletions.
2 changes: 0 additions & 2 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ dependencies {
implementation(libs.koin.compose)
implementation(libs.koin.core)

implementation(libs.accompanist.systemUiController)

implementation(libs.androidx.glance.appWidget)
implementation(libs.androidx.glance.glance)
implementation(libs.androidx.glance.material3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.navigation.compose.rememberNavController
import dev.sergiobelda.todometer.common.compose.ui.theme.ToDometerAppTheme
import dev.sergiobelda.todometer.common.domain.preference.AppTheme
import dev.sergiobelda.todometer.common.navigation.Action
import dev.sergiobelda.todometer.ui.theme.ToDometerAppTheme
import org.koin.androidx.compose.getViewModel

@Composable
Expand Down
Binary file modified backend/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion backend/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 4 additions & 1 deletion backend/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
Expand Down
Binary file modified build-logic/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion build-logic/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 4 additions & 1 deletion build-logic/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import androidx.compose.material3.Typography
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.BaselineShift
import androidx.compose.ui.unit.sp

internal expect val quickSandFontFamily: FontFamily
Expand Down Expand Up @@ -65,7 +66,8 @@ object Type {
bodyMedium = TextStyle(
fontFamily = quickSandFontFamily,
fontWeight = FontWeight.Medium,
fontSize = 14.sp
fontSize = 14.sp,
baselineShift = BaselineShift(+0.3f)
),
bodySmall = TextStyle(
fontFamily = quickSandFontFamily,
Expand Down
1 change: 1 addition & 0 deletions common/compose-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ kotlin {

implementation(projects.common.android)

implementation(libs.accompanist.systemUiController)
implementation(libs.androidx.navigation.compose)
implementation(libs.material)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalContext

@Composable
internal actual fun versionName(): String? {
internal actual fun appVersionName(): String? {
val context = LocalContext.current
return context.getVersionName()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Sergio Belda
* Copyright 2023 Sergio Belda
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,10 +14,9 @@
* limitations under the License.
*/

package dev.sergiobelda.todometer.ui.theme
package dev.sergiobelda.todometer.common.compose.ui.theme

import android.os.Build
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.dynamicDarkColorScheme
import androidx.compose.material3.dynamicLightColorScheme
import androidx.compose.runtime.Composable
Expand All @@ -29,14 +28,14 @@ import dev.sergiobelda.todometer.common.compose.ui.designsystem.theme.LightColor
import dev.sergiobelda.todometer.common.compose.ui.designsystem.theme.ToDometerDarkColors
import dev.sergiobelda.todometer.common.compose.ui.designsystem.theme.ToDometerLightColors
import dev.sergiobelda.todometer.common.compose.ui.designsystem.theme.ToDometerTheme
import dev.sergiobelda.todometer.common.compose.ui.designsystem.theme.Type.typography
import dev.sergiobelda.todometer.common.compose.ui.designsystem.theme.Type
import dev.sergiobelda.todometer.common.compose.ui.designsystem.theme.shapes
import dev.sergiobelda.todometer.common.compose.ui.designsystem.theme.todometer_dark_outline
import dev.sergiobelda.todometer.common.compose.ui.designsystem.theme.todometer_light_outline

@Composable
internal fun ToDometerAppTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
actual fun ToDometerAppTheme(
darkTheme: Boolean,
content: @Composable () -> Unit
) {
val toDometerColors = if (darkTheme) ToDometerDarkColors else ToDometerLightColors
Expand Down Expand Up @@ -64,7 +63,7 @@ internal fun ToDometerAppTheme(
ToDometerTheme(
toDometerColors = toDometerColors,
colorScheme = colorScheme,
typography = typography,
typography = Type.typography,
shapes = shapes,
content = content
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ internal fun AboutItemCard(
internal fun AboutAppVersion() {
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.BottomCenter) {
Text(
text = versionName() ?: "",
text = appVersionName() ?: "",
style = MaterialTheme.typography.labelSmall,
modifier = Modifier.padding(bottom = 24.dp)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ package dev.sergiobelda.todometer.common.compose.ui.about
import androidx.compose.runtime.Composable

@Composable
internal expect fun versionName(): String?
internal expect fun appVersionName(): String?
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ private fun AddTaskListTopBar(
Text(
text = stringResource(MR.strings.save),
style = MaterialTheme.typography.bodyMedium,
modifier = Modifier.alignByBaseline(),
color = saveButtonTintColor
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ internal fun SaveActionTopAppBar(
Text(
text = stringResource(MR.strings.save),
style = MaterialTheme.typography.bodyMedium,
modifier = Modifier.alignByBaseline(),
color = saveButtonTintColor
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2023 Sergio Belda
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package dev.sergiobelda.todometer.common.compose.ui.theme

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.runtime.Composable

@Composable
expect fun ToDometerAppTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
content: @Composable () -> Unit
)
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

package dev.sergiobelda.todometer.common.compose.ui.about

internal actual fun versionName(): String? = "1.0.0-beta02"
internal actual fun appVersionName(): String? = "1.0.0-beta02"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Sergio Belda
* Copyright 2023 Sergio Belda
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,28 +14,30 @@
* limitations under the License.
*/

package dev.sergiobelda.todometer.desktop.ui.theme
package dev.sergiobelda.todometer.common.compose.ui.theme

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.runtime.Composable
import dev.sergiobelda.todometer.common.compose.ui.designsystem.theme.DarkColorScheme
import dev.sergiobelda.todometer.common.compose.ui.designsystem.theme.LightColorScheme
import dev.sergiobelda.todometer.common.compose.ui.designsystem.theme.ToDometerDarkColors
import dev.sergiobelda.todometer.common.compose.ui.designsystem.theme.ToDometerLightColors
import dev.sergiobelda.todometer.common.compose.ui.designsystem.theme.ToDometerTheme
import dev.sergiobelda.todometer.common.compose.ui.designsystem.theme.Type.typography
import dev.sergiobelda.todometer.common.compose.ui.designsystem.theme.Type
import dev.sergiobelda.todometer.common.compose.ui.designsystem.theme.shapes

@Composable
internal fun ToDometerAppTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) {
actual fun ToDometerAppTheme(
darkTheme: Boolean,
content: @Composable () -> Unit
) {
val toDometerColors = if (darkTheme) ToDometerDarkColors else ToDometerLightColors
val colorScheme = if (darkTheme) DarkColorScheme else LightColorScheme

ToDometerTheme(
toDometerColors = toDometerColors,
colorScheme = colorScheme,
shapes = shapes,
typography = typography,
typography = Type.typography,
content = content
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright 2023 Sergio Belda
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package dev.sergiobelda.todometer.common.compose.ui.about

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Scaffold
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import dev.sergiobelda.todometer.common.compose.ui.components.ToDometerTitle

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun AboutScreen(
navigateBack: () -> Unit
) {
var privacyPolicyDialogState by remember { mutableStateOf(false) }
Scaffold(
topBar = { AboutTopBar(navigateBack = navigateBack) }
) { paddingValues ->
if (privacyPolicyDialogState) {
PrivacyPolicyDialog { privacyPolicyDialogState = false }
}
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.fillMaxWidth().padding(paddingValues)
) {
ToDometerTitle()
Spacer(modifier = Modifier.height(72.dp))
AboutItemCard(
onCardClick = { privacyPolicyDialogState = true },
AboutItem.PrivacyPolicy
)
}
AboutAppVersion()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

package dev.sergiobelda.todometer.common.compose.ui.about

internal actual fun versionName(): String? = ""
internal actual fun appVersionName(): String? = "1.0.0-dev01"
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

package dev.sergiobelda.todometer.desktop.ui.home
package dev.sergiobelda.todometer.common.compose.ui.addtask

import dev.sergiobelda.todometer.common.navigation.Destination

object HomeDestination : Destination {
override val route: String get() = "home"
object AddTaskDestination : Destination {
override val route: String = "addtask"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright 2022 Sergio Belda
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package dev.sergiobelda.todometer.common.compose.ui.edittask

import dev.sergiobelda.todometer.common.navigation.Destination

object EditTaskDestination : Destination {
const val TaskIdArg = "taskId"
override val route: String = "edittask"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright 2022 Sergio Belda
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package dev.sergiobelda.todometer.common.compose.ui.taskdetails

import dev.sergiobelda.todometer.common.navigation.Destination

object TaskDetailsDestination : Destination {
const val TaskIdArg = "taskId"

override val route: String = "taskdetails"
}
Loading

0 comments on commit 27f8420

Please sign in to comment.