Skip to content

Commit

Permalink
Merge pull request #634 from igorescodro/fix/small
Browse files Browse the repository at this point in the history
πŸ§‘β€πŸ”§ Small fixes for 3.0.1
  • Loading branch information
igorescodro authored Apr 18, 2024
2 parents 1f25395 + 003ccf1 commit 2056af0
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 71 deletions.
1 change: 1 addition & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@
-keepnames class * implements android.os.Parcelable*

-dontwarn javax.servlet.ServletContainerInitializer
-dontwarn androidx.window.extensions.area.ExtensionWindowAreaPresentation
2 changes: 2 additions & 0 deletions config/filters/lint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@
<!-- Moko Resources is not playing well with Lint -->
<issue id="UnusedResources" severity="ignore" />
<issue id="MissingTranslation" severity="ignore" />

<issue id="ObsoleteLintCustomCheck" severity="ignore" />
</lint>
1 change: 0 additions & 1 deletion data/local/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import extension.setFrameworkBaseName

plugins {
id("com.escodro.multiplatform")
alias(libs.plugins.ksp)
alias(libs.plugins.sqldelight)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ package com.escodro.home.navigation

import androidx.compose.runtime.Composable
import cafe.adriel.voyager.core.screen.Screen
import com.escodro.appstate.AlkaaAppState
import com.escodro.home.presentation.Home

/**
* Alkaa's Home Screen.
*/
class HomeScreen(private val appState: AlkaaAppState) : Screen {
class HomeScreen : Screen {

@Composable
override fun Content() {
Home(appState = appState)
Home()
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.escodro.home.presentation

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.WindowInsetsSides
Expand All @@ -22,13 +21,15 @@ import androidx.compose.material3.NavigationRailItem
import androidx.compose.material3.NavigationRailItemDefaults
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi
import androidx.compose.material3.windowsizeclass.calculateWindowSizeClass
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import com.escodro.appstate.AlkaaAppState
import com.escodro.appstate.rememberAlkaaAppState
import com.escodro.category.presentation.list.CategoryListSection
import com.escodro.preference.presentation.PreferenceSection
import com.escodro.search.presentation.SearchSection
Expand All @@ -41,26 +42,25 @@ import kotlinx.collections.immutable.toImmutableList
* Alkaa Home screen.
*/
@Composable
fun Home(appState: AlkaaAppState) {
fun Home() {
val (currentSection, setCurrentSection) = rememberSaveable { mutableStateOf(HomeSection.Tasks) }
val navItems = remember { HomeSection.values().toList().toImmutableList() }
val navItems = remember { HomeSection.entries.toImmutableList() }

AlkaaHomeScaffold(
appState = appState,
homeSection = currentSection,
navItems = navItems,
setCurrentSection = setCurrentSection,
)
}

@OptIn(ExperimentalLayoutApi::class)
@OptIn(ExperimentalMaterial3WindowSizeClassApi::class)
@Composable
private fun AlkaaHomeScaffold(
appState: AlkaaAppState,
homeSection: HomeSection,
navItems: ImmutableList<HomeSection>,
setCurrentSection: (HomeSection) -> Unit,
) {
val appState = rememberAlkaaAppState(windowSizeClass = calculateWindowSizeClass())
Scaffold(
topBar = { AlkaaTopBar(currentSection = homeSection) },
contentWindowInsets = WindowInsets(0, 0, 0, 0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Search
import androidx.compose.material.icons.outlined.ExitToApp
Expand All @@ -29,9 +31,12 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.unit.dp
import cafe.adriel.voyager.core.registry.ScreenRegistry
Expand Down Expand Up @@ -113,11 +118,16 @@ internal fun SearchScaffold(
}
}

@OptIn(ExperimentalComposeUiApi::class)
@Composable
private fun SearchTextField(text: String, onTextChange: (String) -> Unit) {
val keyboardController = LocalSoftwareKeyboardController.current

TextField(
value = text,
onValueChange = onTextChange,
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Search),
keyboardActions = KeyboardActions(onSearch = { keyboardController?.hide() }),
trailingIcon = {
Icon(
imageVector = Icons.Default.Search,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ internal fun AddTaskBottomSheet(
}
}

private const val FocusDelay = 300L
private const val FocusDelay = 500L
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import androidx.compose.animation.Crossfade
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Description
import androidx.compose.material.icons.outlined.Bookmark
Expand All @@ -18,7 +20,10 @@ import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.TextFieldValue
import com.escodro.alarmapi.AlarmPermission
import com.escodro.categoryapi.presentation.CategoryListViewModel
Expand Down Expand Up @@ -150,9 +155,11 @@ private fun TaskDetailError() {
)
}

@OptIn(ExperimentalComposeUiApi::class)
@Composable
private fun TaskTitleTextField(text: String, onTitleChange: (String) -> Unit) {
val textState = remember { mutableStateOf(TextFieldValue(text)) }
val keyboardController = LocalSoftwareKeyboardController.current

TextField(
modifier = Modifier.fillMaxWidth(),
Expand All @@ -161,7 +168,10 @@ private fun TaskTitleTextField(text: String, onTitleChange: (String) -> Unit) {
onTitleChange(it.text)
textState.value = it
},
maxLines = 1,
textStyle = MaterialTheme.typography.headlineMedium,
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done),
keyboardActions = KeyboardActions(onDone = { keyboardController?.hide() }),
colors = TextFieldDefaults.colors(
focusedContainerColor = MaterialTheme.colorScheme.surface,
unfocusedContainerColor = MaterialTheme.colorScheme.surface,
Expand All @@ -188,6 +198,7 @@ private fun TaskDescriptionTextField(text: String?, onDescriptionChange: (String
textState.value = it
},
textStyle = MaterialTheme.typography.bodyLarge,
maxLines = 8,
colors = TextFieldDefaults.colors(
focusedContainerColor = MaterialTheme.colorScheme.surface,
unfocusedContainerColor = MaterialTheme.colorScheme.surface,
Expand Down
60 changes: 18 additions & 42 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
[versions]
# Project
version_code = "30000"
version_name = "3.0.0"
version_code = "30001"
version_name = "3.0.1"
android_gradle_plugin = "8.3.2"
kotlin = "1.9.20"
kotlin = "1.9.23"
android_sdk_compile = "34"
android_sdk_target = "33"
android_sdk_min = "24"

# Plugins
ksp = "1.9.10-1.0.13"
dependencyanalysis = "1.25.0"

# General dependencies
Expand All @@ -18,43 +17,35 @@ logback = "1.2.11"
logcat = "0.1"

# KotlinX
kotlinx_coroutines = "1.7.3"
kotlinx_coroutines = "1.8.0"
kotlinx_serialization = "1.6.0"
kotlinx_collections_immutable = "0.3.6"
kotlinx_datetime = "0.4.1"
kotlinx_datetime = "0.5.0"

# AndroidX
activity = "1.8.0-rc01"
core = "1.12.0"
activity = "1.9.0"
core = "1.13.0"
appcompat = "1.6.1"
material = "1.10.0"
constraint = "2.0.4"
corektx = "1.12.0"
corektx = "1.13.0"
playcore = "1.10.3"
datastore = "1.1.0-alpha06"
datastore = "1.1.0"
glance = "1.0.0"
workmanager = "2.8.1"
lifecycle_viewmodel = "2.6.2"
workmanager = "2.9.0"
lifecycle_viewmodel = "2.7.0"

# Compose
compose_compiler = "1.5.5"
compose_bom = "2023.10.01"
compose_activity = "1.8.0"
compose_material3 = "1.0.1"
compose_icons = "1.4.2"
jb_compose_compiler = "1.5.11"
compose_windowsizeclass = "0.3.1"
compose_compiler = "1.5.12"
compose_bom = "2024.04.01"
compose_activity = "1.9.0"
jb_compose_compiler = "1.6.2"
compose_windowsizeclass = "0.3.2"

# Koin
koin_core = "3.5.0"
koin_test = "3.5.0"
koin_compose = "3.5.0"
koin_android = "3.5.0"
koin_compose_jb = "1.1.0"

# Accompanist
accompanist = "0.32.0"

# SQLDelight
sqldelight = "2.0.0"

Expand All @@ -68,15 +59,11 @@ moko_permissions = "0.16.0"
atomicfu = "0.22.0"

# Voyager
voyager = "1.0.0"
voyager = "1.1.0-alpha04"

# Test
test_junit = "4.13.2"
test_runner = "1.5.2"
test_core = "1.5.0"
test_mockk = "1.13.8"
test_uiautomator = "2.2.0"
test_junitext = "1.1.5"
test_uiautomator = "2.3.0"
test_barista = "4.3.0"
test_orchestrator = "1.4.2"
test_rules = "1.5.0"
Expand Down Expand Up @@ -112,7 +99,6 @@ kotlinx_datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.
androidx_activity = { module = "androidx.activity:activity", version.ref = "activity" }
androidx_core = { module = "androidx.core:core", version.ref = "core" }
androidx_appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
androidx_material = { module = "com.google.android.material:material", version.ref = "material" }
androidx_corektx = { module = "androidx.core:core-ktx", version.ref = "corektx" }
androidx_playcore = { module = "com.google.android.play:core", version.ref = "playcore" }
androidx_datastore = { module = "androidx.datastore:datastore-preferences-core", version.ref = "datastore" }
Expand All @@ -137,13 +123,9 @@ compose_activity = { module = "androidx.activity:activity-compose", version.ref
#Koin
koin_core = { module = "io.insert-koin:koin-core", version.ref = "koin_core" }
koin_android = { module = "io.insert-koin:koin-android", version.ref = "koin_android" }
koin_compose = { module = "io.insert-koin:koin-androidx-compose", version.ref = "koin_compose" }
koin_test = { module = "io.insert-koin:koin-test", version.ref = "koin_test" }
koin_compose_jb = { module = "io.insert-koin:koin-compose", version.ref = "koin_compose_jb" }

# Accompanist
accompanist_permission = { module = "com.google.accompanist:accompanist-permissions", version.ref = "accompanist" }

# SQLDelight
sqldelight_driver = { module = "app.cash.sqldelight:android-driver", version.ref = "sqldelight" }
sqldelight_native = { module = "app.cash.sqldelight:native-driver", version.ref = "sqldelight" }
Expand All @@ -164,12 +146,7 @@ voyager_bottomsheet = { module = "cafe.adriel.voyager:voyager-bottom-sheet-navig

# Test
test_junit = { module = "junit:junit", version.ref = "test_junit" }
test_runner = { module = "androidx.test:runner", version.ref = "test_runner" }
test_core = { module = "androidx.test:core", version.ref = "test_core" }
test_corektx = { module = "androidx.test:core-ktx", version.ref = "test_core" }
test_uiautomator = { module = "androidx.test.uiautomator:uiautomator", version.ref = "test_uiautomator" }
test_junitext = { module = "androidx.test.ext:junit", version.ref = "test_junitext" }
test_mockk = { module = "io.mockk:mockk", version.ref = "test_mockk" }
test_barista = { module = "com.adevinta.android:barista", version.ref = "test_barista" }
test_orchestrator = { module = "androidx.test:orchestrator", version.ref = "test_orchestrator" }
test_rules = { module = "androidx.test:rules", version.ref = "test_rules" }
Expand All @@ -190,7 +167,6 @@ composetest = ["compose.uitest", "compose.junit4", "compose.manifest"]

[plugins]
kotlin_serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
dependencyanalysis = { id = "com.autonomousapps.dependency-analysis", version.ref = "dependencyanalysis" }
sqldelight = { id = "app.cash.sqldelight", version.ref = "sqldelight" }
compose = { id = "org.jetbrains.compose", version.ref = "jb_compose_compiler" }
Expand Down
8 changes: 4 additions & 4 deletions ios-app/alkaa.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 30000;
CURRENT_PROJECT_VERSION = 30001;
DEVELOPMENT_ASSET_PATHS = "\"alkaa/Preview Content\"";
DEVELOPMENT_TEAM = 5Z3927U4ZC;
ENABLE_PREVIEWS = YES;
Expand All @@ -350,7 +350,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.0.0;
MARKETING_VERSION = 3.0.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-framework",
Expand All @@ -373,7 +373,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 30000;
CURRENT_PROJECT_VERSION = 30001;
DEVELOPMENT_ASSET_PATHS = "\"alkaa/Preview Content\"";
DEVELOPMENT_TEAM = 5Z3927U4ZC;
ENABLE_PREVIEWS = YES;
Expand All @@ -392,7 +392,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.0.0;
MARKETING_VERSION = 3.0.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-framework",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardCapitalization
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp

Expand Down Expand Up @@ -131,7 +132,7 @@ fun AddFloatingButton(
* @param onTextChange function to update text
* @param modifier text field modifier
*/
@OptIn(ExperimentalComposeUiApi::class, ExperimentalMaterial3Api::class)
@OptIn(ExperimentalComposeUiApi::class)
@Composable
fun AlkaaInputTextField(
label: String,
Expand All @@ -145,7 +146,10 @@ fun AlkaaInputTextField(
label = { Text(text = label) },
value = text,
onValueChange = onTextChange,
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done),
keyboardOptions = KeyboardOptions(
capitalization = KeyboardCapitalization.Sentences,
imeAction = ImeAction.Done,
),
keyboardActions = KeyboardActions(onDone = { keyboardController?.hide() }),
modifier = modifier,
)
Expand Down
Loading

0 comments on commit 2056af0

Please sign in to comment.