Skip to content

Commit

Permalink
update dependencies (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
yveskalume authored Jun 18, 2024
1 parent 30a3fa3 commit 2d4986c
Show file tree
Hide file tree
Showing 18 changed files with 137 additions and 74 deletions.
4 changes: 1 addition & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ plugins {
alias(libs.plugins.com.google.gms.google.services)
alias(libs.plugins.com.google.firebase.crashlytics)
alias(libs.plugins.org.jetbrains.kotlin.serialization)
alias(libs.plugins.compose.compiler)
}

val keystorePropertiesFile = rootProject.file("key.properties")
Expand Down Expand Up @@ -68,9 +69,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ class EventCademyApplication : Application(), Configuration.Provider {
createNotificationChannel()
}

override fun getWorkManagerConfiguration(): Configuration {
return Configuration.Builder()
override val workManagerConfiguration: Configuration
get() = Configuration.Builder()
.setWorkerFactory(workerFactory)
.build()
}

private fun createNotificationChannel() {
// Create the NotificationChannel, but only on API 26+ because
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/yveskalume/eventcademy/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ class MainActivity : ComponentActivity() {
}
}

override fun onNewIntent(intent: Intent?) {
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
// get destination from intent (destination may come from FCM)
val destination = intent?.getStringExtra("destination")
val destination = intent.getStringExtra("destination")
Log.d("MainActivity", "onNewIntent: $destination")
if (destination != null) {
try {
Expand Down
6 changes: 6 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ plugins {
alias(libs.plugins.com.android.library) apply false
alias(libs.plugins.androidx.benchmark) apply false
alias(libs.plugins.androidTest) apply false
alias(libs.plugins.compose.compiler) apply false

}

subprojects {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=" +
"$rootDir/compose_compiler_config.conf"
)
if (project.findProperty("composeCompilerReports") == "true") {
freeCompilerArgs += listOf(
"-P",
Expand Down
6 changes: 6 additions & 0 deletions compose_compiler_config.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Consider my model classes as stable
com.yveskalume.eventcademy.core.domain.model


java.time.LocalDateTime
kotlin.collections.*
4 changes: 1 addition & 3 deletions core/designsystem/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
plugins {
alias(libs.plugins.com.android.library)
alias(libs.plugins.org.jetbrains.kotlin.android)
alias(libs.plugins.compose.compiler)
}

android {
Expand Down Expand Up @@ -34,9 +35,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fun AdvertisementsItem(
while (true) {
val nextPage =
if (pagerState.currentPage == items.lastIndex) {
pagerState.initialPage
0
} else {
pagerState.currentPage + 1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ fun SelectDateDialog(
onDismissRequest = { },
content = {
DatePicker(
state = state,
dateValidator = {
it > System.currentTimeMillis()
})
state = state
)
},
confirmButton = {
Button(
Expand Down
4 changes: 1 addition & 3 deletions core/ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
plugins {
alias(libs.plugins.com.android.library)
alias(libs.plugins.org.jetbrains.kotlin.android)
alias(libs.plugins.compose.compiler)
}

android {
Expand Down Expand Up @@ -34,9 +35,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}
}

dependencies {
Expand Down
4 changes: 1 addition & 3 deletions feature/auth/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
alias(libs.plugins.com.android.library)
alias(libs.plugins.org.jetbrains.kotlin.android)
kotlin("kapt")
alias(libs.plugins.compose.compiler)
}

android {
Expand Down Expand Up @@ -35,9 +36,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}
}

dependencies {
Expand Down
4 changes: 1 addition & 3 deletions feature/bookmark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
alias(libs.plugins.com.android.library)
alias(libs.plugins.org.jetbrains.kotlin.android)
kotlin("kapt")
alias(libs.plugins.compose.compiler)
}

android {
Expand Down Expand Up @@ -35,9 +36,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}
}

dependencies {
Expand Down
4 changes: 1 addition & 3 deletions feature/createevent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
alias(libs.plugins.com.android.library)
alias(libs.plugins.org.jetbrains.kotlin.android)
kotlin("kapt")
alias(libs.plugins.compose.compiler)
}

android {
Expand Down Expand Up @@ -35,9 +36,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ import androidx.compose.animation.AnimatedContent
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.clickable
import androidx.compose.foundation.combinedClickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.defaultMinSize
import androidx.compose.foundation.layout.fillMaxWidth
Expand All @@ -40,14 +45,19 @@ import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.ProvideTextStyle
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SelectableDates
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.material3.rememberDatePickerState
import androidx.compose.material3.rememberTimePickerState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
Expand All @@ -58,9 +68,13 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.rotate
import androidx.compose.ui.focus.onFocusChanged
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.semantics.role
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -125,7 +139,10 @@ private fun CreateEventScreen(
var showEndTimePicker by remember { mutableStateOf(false) }

val datePickerState =
rememberDatePickerState(initialSelectedDateMillis = System.currentTimeMillis() + 86400000L)
rememberDatePickerState(
initialSelectedDateMillis = System.currentTimeMillis() + 86400000L,
selectableDates = onlyFutureSelectableDates
)

val startTimeState = rememberTimePickerState(is24Hour = true)
val endTimeState = rememberTimePickerState(is24Hour = true)
Expand Down Expand Up @@ -495,4 +512,61 @@ fun CreateEventScreenPreview() {
ThemePreview {
CreateEventScreen(uiState = CreateEventUiState.Initial, onBackClick = {}, onSubmit = {})
}
}
}


@OptIn(ExperimentalFoundationApi::class)
@Composable
fun Button(
onClick: () -> Unit,
onLongClick: () -> Unit,
modifier: Modifier = Modifier,
shape: Shape = ButtonDefaults.shape,
containerColor: Color,
contentColor: Color,
border: BorderStroke? = null,
contentPadding: PaddingValues = ButtonDefaults.ContentPadding,
content: @Composable RowScope.() -> Unit
) {

Surface(
modifier = modifier
.semantics { role = Role.Button }
.combinedClickable(enabled = true, onClick = onClick, onLongClick = onLongClick),
shape = shape,
color = containerColor,
contentColor = contentColor,
border = border,
) {
CompositionLocalProvider(LocalContentColor provides contentColor) {
ProvideTextStyle(value = MaterialTheme.typography.labelLarge) {
Row(
Modifier
.defaultMinSize(
minWidth = ButtonDefaults.MinWidth,
minHeight = ButtonDefaults.MinHeight
)
.padding(contentPadding),
horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically,
content = content
)
}
}
}
}

@OptIn(ExperimentalMaterial3Api::class)
private val onlyFutureSelectableDates = object : SelectableDates {

override fun isSelectableDate(utcTimeMillis: Long): Boolean {
return Calendar.getInstance().timeInMillis < utcTimeMillis
}

override fun isSelectableYear(year: Int): Boolean {
return year >= Calendar.getInstance().get(Calendar.YEAR)
}

}


4 changes: 1 addition & 3 deletions feature/eventdetail/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
alias(libs.plugins.com.android.library)
alias(libs.plugins.org.jetbrains.kotlin.android)
kotlin("kapt")
alias(libs.plugins.compose.compiler)
}

android {
Expand Down Expand Up @@ -35,9 +36,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}
}

dependencies {
Expand Down
4 changes: 1 addition & 3 deletions feature/home/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
alias(libs.plugins.com.android.library)
alias(libs.plugins.org.jetbrains.kotlin.android)
kotlin("kapt")
alias(libs.plugins.compose.compiler)
}

android {
Expand Down Expand Up @@ -35,9 +36,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}
}

dependencies {
Expand Down
4 changes: 1 addition & 3 deletions feature/profile/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
alias(libs.plugins.com.android.library)
alias(libs.plugins.org.jetbrains.kotlin.android)
kotlin("kapt")
alias(libs.plugins.compose.compiler)
}

android {
Expand Down Expand Up @@ -35,9 +36,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}
}

dependencies {
Expand Down
4 changes: 1 addition & 3 deletions feature/setting/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
alias(libs.plugins.com.android.library)
alias(libs.plugins.org.jetbrains.kotlin.android)
kotlin("kapt")
alias(libs.plugins.compose.compiler)
}

android {
Expand Down Expand Up @@ -35,9 +36,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}
}

dependencies {
Expand Down
Loading

0 comments on commit 2d4986c

Please sign in to comment.