Skip to content

Commit

Permalink
chore/upgrade (#46)
Browse files Browse the repository at this point in the history
* chore: on open

* chore: gradle update

* chore: update packages

* chore: updates and misc changes

* more misc

* test

* test

* chore: up versions
  • Loading branch information
seamuslowry authored Feb 3, 2024
1 parent addee23 commit 4e06bd8
Show file tree
Hide file tree
Showing 15 changed files with 192 additions and 49 deletions.
123 changes: 123 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/migrations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ spotless {

android {
namespace 'seamuslowry.daytracker'
compileSdk 33
compileSdk 34

defaultConfig {
applicationId "seamuslowry.daytracker"
minSdk 33
targetSdk 33
versionCode 17
versionName "0.23.1"
targetSdk 34
versionCode 18
versionName "0.24.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down Expand Up @@ -71,13 +71,13 @@ dependencies {
implementation 'androidx.compose.material:material-icons-extended'
implementation "androidx.compose.material3:material3:$compose_material_version"

implementation 'androidx.core:core-ktx:1.10.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
implementation 'androidx.activity:activity-compose:1.7.2'
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0'
implementation 'androidx.activity:activity-compose:1.8.2'
implementation "com.google.dagger:hilt-android:$hilt_version"
implementation "androidx.hilt:hilt-work:$hilt_ext_version"
implementation "androidx.hilt:hilt-navigation-compose:1.1.0-alpha01"
implementation 'androidx.work:work-runtime-ktx:2.8.1'
implementation "androidx.hilt:hilt-navigation-compose:1.1.0"
implementation 'androidx.work:work-runtime-ktx:2.9.0'
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.room:room-ktx:$room_version"
implementation 'com.google.accompanist:accompanist-placeholder-material3:0.30.1'
Expand All @@ -100,7 +100,7 @@ dependencies {
debugImplementation "androidx.compose.ui:ui-test-manifest"
}

task printVersionName {
tasks.register('printVersionName') {
doLast {
println android.defaultConfig.versionName
}
Expand Down
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:label="@string/app_name"
android:theme="@style/Theme.DayTracker">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class DayTrackerApplication : Application(), Configuration.Provider {
this.createReminderNotificationChannel()
}

override fun getWorkManagerConfiguration() = Configuration.Builder()
.setWorkerFactory(workerFactory)
.build()
override val workManagerConfiguration: Configuration
get() = Configuration.Builder()
.setWorkerFactory(workerFactory)
.build()
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package seamuslowry.daytracker.ui.navigation

import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Assignment
import androidx.compose.material.icons.automirrored.filled.Assignment
import androidx.compose.material.icons.filled.DateRange
import androidx.compose.material.icons.filled.Settings
import androidx.compose.material3.Icon
Expand All @@ -27,12 +27,12 @@ import seamuslowry.daytracker.ui.screens.settings.SettingsScreen
import java.time.LocalDate

sealed class Screen<DataType>(val identifier: String, private val defaultData: DataType?) {
object Entry : Screen<Long>("entry", LocalDate.now().toEpochDay()) {
const val initialDate = "initialDate"
override fun route(data: Long?) = "$identifier?$initialDate=${data ?: "{$initialDate}"}"
data object Entry : Screen<Long>("entry", LocalDate.now().toEpochDay()) {
const val INITIAL_DATE = "initialDate"
override fun route(data: Long?) = "$identifier?$INITIAL_DATE=${data ?: "{$INITIAL_DATE}"}"
}
object Report : Screen<Unit>("report", Unit)
object Settings : Screen<Unit>("settings", Unit)
data object Report : Screen<Unit>("report", Unit)
data object Settings : Screen<Unit>("settings", Unit)

open fun route(data: DataType? = defaultData) = identifier
}
Expand All @@ -52,7 +52,7 @@ fun Navigation(
val currentRoute = navController.currentBackStackEntryAsState().value?.destination?.route

val navigableScreens = listOf(
NavBarData(Screen.Entry, Icons.Filled.Assignment, stringResource(R.string.entry)),
NavBarData(Screen.Entry, Icons.AutoMirrored.Filled.Assignment, stringResource(R.string.entry)),
NavBarData(Screen.Report, Icons.Filled.DateRange, stringResource(R.string.report)),
NavBarData(Screen.Settings, Icons.Filled.Settings, stringResource(R.string.settings)),
)
Expand Down Expand Up @@ -87,7 +87,7 @@ fun Navigation(
composable(
Screen.Entry.route(null),
arguments = listOf(
navArgument(Screen.Entry.initialDate) {
navArgument(Screen.Entry.INITIAL_DATE) {
type = NavType.LongType
defaultValue = LocalDate.now().toEpochDay()
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,17 @@ fun AddConfigurationButton(
val cardColor by animateColorAsState(
targetValue = if (itemConfiguration != null) MaterialTheme.colorScheme.surfaceVariant else MaterialTheme.colorScheme.primary,
animationSpec = tween(durationMillis = mainDuration),
label = "cardColor",
)
val textColor by animateColorAsState(
targetValue = if (itemConfiguration != null) Color.Transparent else MaterialTheme.colorScheme.onPrimary,
animationSpec = tween(durationMillis = extraDuration, delayMillis = mainDuration),
label = "textColor",
)
val corner by animateIntAsState(
targetValue = if (itemConfiguration != null) 10 else 50,
animationSpec = tween(durationMillis = mainDuration),
label = "corner",
)

Box(
Expand Down Expand Up @@ -315,15 +318,15 @@ fun AddConfigurationContent(
ArrowPicker(
value = itemConfiguration.trackingType.ordinal.toLong(),
onChange = {
onChange(itemConfiguration.copy(trackingType = TrackingType.values()[it.toInt()]))
onChange(itemConfiguration.copy(trackingType = TrackingType.entries[it.toInt()]))
},
range = LongRange(0, (TrackingType.values().size - 1).toLong()),
range = LongRange(0, (TrackingType.entries.size - 1).toLong()),
modifier = Modifier.padding(5.dp),
incrementResource = R.string.change_tracking_type,
decrementResource = R.string.change_tracking_type,
) {
Box(modifier = Modifier.fillMaxWidth(), contentAlignment = Alignment.Center) {
TrackerEntry(trackerType = TrackingType.values()[it.toInt()], enabled = false)
TrackerEntry(trackerType = TrackingType.entries[it.toInt()], enabled = false)
}
}
Button(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.foundation.lazy.grid.items
import androidx.compose.material3.Card
import androidx.compose.material3.Divider
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.FilterChip
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -94,15 +93,15 @@ fun ReportScreen(
}
}

@OptIn(ExperimentalLayoutApi::class, ExperimentalMaterial3Api::class)
@OptIn(ExperimentalLayoutApi::class)
@Composable
fun DisplaySelection(
selected: DisplayOption,
onSelect: (d: DisplayOption) -> Unit,
modifier: Modifier = Modifier,
) {
FlowRow(modifier = modifier, horizontalArrangement = Arrangement.Center) {
DisplayOption.values().forEach {
DisplayOption.entries.forEach {
FilterChip(selected = selected == it, modifier = Modifier.padding(horizontal = 4.dp), onClick = { onSelect(it) }, label = { Text(text = stringResource(it.label)) })
}
}
Expand All @@ -124,7 +123,10 @@ fun DisplayDates(
verticalArrangement = Arrangement.Center,
) {
Text(text = entry.key.name, style = MaterialTheme.typography.titleLarge)
Divider(modifier = Modifier.padding(4.dp), color = MaterialTheme.colorScheme.onSurfaceVariant)
HorizontalDivider(
modifier = Modifier.padding(4.dp),
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
Row(
modifier = Modifier
.fillMaxWidth()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import androidx.compose.animation.slideOutHorizontally
import androidx.compose.animation.togetherWith
import androidx.compose.foundation.layout.Row
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowLeft
import androidx.compose.material.icons.filled.ArrowRight
import androidx.compose.material.icons.automirrored.filled.ArrowLeft
import androidx.compose.material.icons.automirrored.filled.ArrowRight
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.runtime.Composable
Expand All @@ -38,7 +38,7 @@ fun <T> ArrowPicker(
onClick = { onDecrement(value) },
enabled = decrementEnabled,
) {
Icon(Icons.Filled.ArrowLeft, contentDescription = stringResource(incrementResource))
Icon(Icons.AutoMirrored.Filled.ArrowLeft, contentDescription = stringResource(incrementResource))
}
AnimatedContent(
modifier = Modifier.weight(1f),
Expand All @@ -48,14 +48,15 @@ fun <T> ArrowPicker(
val outModifier = -inModifier
slideInHorizontally { height -> height * inModifier } + fadeIn() togetherWith slideOutHorizontally { height -> height * outModifier } + fadeOut() using SizeTransform(clip = false)
},
label = "arrowPickerContent",
) { targetType ->
content(targetType)
}
IconButton(
onClick = { onIncrement(value) },
enabled = incrementEnabled,
) {
Icon(Icons.Filled.ArrowRight, contentDescription = stringResource(decrementResource))
Icon(Icons.AutoMirrored.Filled.ArrowRight, contentDescription = stringResource(decrementResource))
}
}
}
Expand Down
Loading

0 comments on commit 4e06bd8

Please sign in to comment.