Skip to content

Commit

Permalink
v.0.17.1
Browse files Browse the repository at this point in the history
- new translations
- fixes an issue that would show the wrong goal dialog
- fixes category switch button being shown no matter the amount of categories
- code optimisations
  • Loading branch information
pablo03v authored Apr 18, 2024
1 parent 7d381f8 commit cedf94d
Show file tree
Hide file tree
Showing 66 changed files with 1,922 additions and 2,129 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId = "cloud.pablos.overload"
minSdk = 26
targetSdk = 34
versionCode = 170
versionName = "0.17.0"
versionCode = 171
versionName = "0.17.1"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

Expand Down
14 changes: 7 additions & 7 deletions app/src/main/java/cloud/pablos/overload/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ class MainActivity : ComponentActivity() {
val itemEvent = itemViewModel::itemEvent

OverloadApp(
windowSize = windowSize,
displayFeatures = displayFeatures,
categoryState = categoryState,
categoryEvent = categoryEvent,
itemState = itemState,
itemEvent = itemEvent,
filePickerLauncher = filePickerLauncher,
windowSize,
displayFeatures,
categoryState,
categoryEvent,
itemState,
itemEvent,
filePickerLauncher,
)
}
}
Expand Down
114 changes: 42 additions & 72 deletions app/src/main/java/cloud/pablos/overload/ui/OverloadApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@ fun OverloadApp(
}

OverloadNavigationWrapper(
navigationType = navigationType,
contentType = contentType,
navigationContentPosition = navigationContentPosition,
categoryState = categoryState,
categoryEvent = categoryEvent,
itemState = itemState,
itemEvent = itemEvent,
filePickerLauncher = filePickerLauncher,
navigationType,
contentType,
navigationContentPosition,
categoryState,
categoryEvent,
itemState,
itemEvent,
filePickerLauncher,
)
}

Expand All @@ -162,7 +162,7 @@ private fun OverloadNavigationWrapper(
itemEvent: (ItemEvent) -> Unit,
filePickerLauncher: ActivityResultLauncher<Intent>,
) {
val drawerState = rememberDrawerState(initialValue = DrawerValue.Closed)
val drawerState = rememberDrawerState(DrawerValue.Closed)
val scope = rememberCoroutineScope()

val navController = rememberNavController()
Expand Down Expand Up @@ -198,7 +198,7 @@ private fun OverloadNavigationWrapper(

OverloadNavigationType.NAVIGATION_RAIL -> {
ModalNavigationDrawer(
drawerContent = {
{
ModalNavigationDrawerContent(
selectedDestination = selectedDestination,
navigationContentPosition = navigationContentPosition,
Expand Down Expand Up @@ -274,14 +274,14 @@ fun OverloadAppContent(
Row(modifier = modifier.fillMaxSize()) {
AnimatedVisibility(visible = navigationType == OverloadNavigationType.NAVIGATION_RAIL) {
OverloadNavigationRail(
selectedDestination = selectedDestination,
navigationContentPosition = navigationContentPosition,
navigateToTopLevelDestination = navigateToTopLevelDestination,
onDrawerClicked = onDrawerClicked,
categoryEvent = categoryEvent,
categoryState = categoryState,
itemState = itemState,
itemEvent = itemEvent,
selectedDestination,
navigationContentPosition,
navigateToTopLevelDestination,
onDrawerClicked,
categoryEvent,
categoryState,
itemState,
itemEvent,
)
}
Column(
Expand All @@ -294,11 +294,6 @@ fun OverloadAppContent(
navigationType = navigationType,
contentType = contentType,
navController = navController,
categoryState = categoryState,
categoryEvent = categoryEvent,
itemState = itemState,
itemEvent = itemEvent,
filePickerLauncher = filePickerLauncher,
modifier =
Modifier
.weight(1f)
Expand All @@ -313,31 +308,36 @@ fun OverloadAppContent(
Modifier
},
),
categoryState = categoryState,
categoryEvent = categoryEvent,
itemState = itemState,
itemEvent = itemEvent,
filePickerLauncher = filePickerLauncher,
)
AnimatedVisibility(visible = navigationType == OverloadNavigationType.BOTTOM_NAVIGATION) {
AnimatedVisibility(navigationType == OverloadNavigationType.BOTTOM_NAVIGATION) {
OverloadBottomNavigationBar(
selectedDestination = selectedDestination,
navigateToTopLevelDestination = navigateToTopLevelDestination,
categoryState = categoryState,
categoryEvent = categoryEvent,
itemState = itemState,
itemEvent = itemEvent,
navController = navController,
selectedDestination,
navigateToTopLevelDestination,
categoryState,
categoryEvent,
itemState,
itemEvent,
navController,
)
}
}
}
if (forgotDialogState) {
ForgotToStopDialog(
onClose = { itemEvent(ItemEvent.SetForgotToStopDialogShown(false)) },
onDismiss = { itemEvent(ItemEvent.SetForgotToStopDialogShown(false)) },
categoryState,
itemEvent,
)
}

if (adjustEndDialogState) {
AdjustEndDialog(
onClose = { itemEvent(ItemEvent.SetAdjustEndDialogShown(false)) },
onDismiss = { itemEvent(ItemEvent.SetAdjustEndDialogShown(false)) },
categoryState,
itemState,
itemEvent,
Expand All @@ -346,7 +346,7 @@ fun OverloadAppContent(

if (spreadAcrossDaysDialogState) {
SpreadAcrossDaysDialog(
onClose = { itemEvent(ItemEvent.SetSpreadAcrossDaysDialogShown(false)) },
onDismiss = { itemEvent(ItemEvent.SetSpreadAcrossDaysDialogShown(false)) },
categoryState,
itemState,
itemEvent,
Expand All @@ -368,54 +368,24 @@ private fun OverloadNavHost(
filePickerLauncher: ActivityResultLauncher<Intent>,
) {
NavHost(
modifier = modifier,
navController = navController,
startDestination = OverloadRoute.HOME,
navController,
OverloadRoute.HOME,
modifier,
) {
composable(OverloadRoute.HOME) {
HomeTab(
navigationType = navigationType,
categoryEvent = categoryEvent,
categoryState = categoryState,
itemState = itemState,
itemEvent = itemEvent,
)
HomeTab(navigationType, categoryEvent, categoryState, itemState, itemEvent)
}
composable(OverloadRoute.CALENDAR) {
CalendarTab(
contentType = contentType,
categoryState = categoryState,
categoryEvent = categoryEvent,
itemState = itemState,
itemEvent = itemEvent,
onNavigate = { navController.navigate(OverloadRoute.DAY) },
)
CalendarTab(contentType, categoryState, categoryEvent, itemState, itemEvent, { navController.navigate(OverloadRoute.DAY) })
}
composable(OverloadRoute.CATEGORY) {
CategoryScreen(
categoryState = categoryState,
categoryEvent = categoryEvent,
itemState = itemState,
itemEvent = itemEvent,
)
CategoryScreen(categoryState, categoryEvent, itemState, itemEvent)
}
composable(OverloadRoute.DAY) {
DayScreen(
categoryState = categoryState,
categoryEvent = categoryEvent,
itemState = itemState,
itemEvent = itemEvent,
)
DayScreen(categoryState, categoryEvent, itemState, itemEvent)
}
composable(OverloadRoute.CONFIGURATIONS) {
ConfigurationsTab(
categoryState = categoryState,
categoryEvent = categoryEvent,
itemState = itemState,
itemEvent = itemEvent,
filePickerLauncher = filePickerLauncher,
navController = navController,
)
ConfigurationsTab(categoryState, categoryEvent, itemState, itemEvent, filePickerLauncher, navController)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,21 @@ class OverloadNavigationActions(private val navController: NavHostController) {
val TOP_LEVEL_DESTINATIONS =
listOf(
OverloadTopLevelDestination(
route = OverloadRoute.HOME,
selectedIcon = Icons.Filled.CalendarToday,
unselectedIcon = Icons.Outlined.CalendarToday,
iconTextId = R.string.home,
OverloadRoute.HOME,
Icons.Filled.CalendarToday,
Icons.Outlined.CalendarToday,
R.string.home,
),
OverloadTopLevelDestination(
route = OverloadRoute.CALENDAR,
selectedIcon = Icons.Filled.CalendarMonth,
unselectedIcon = Icons.Outlined.CalendarMonth,
iconTextId = R.string.calendar,
OverloadRoute.CALENDAR,
Icons.Filled.CalendarMonth,
Icons.Outlined.CalendarMonth,
R.string.calendar,
),
OverloadTopLevelDestination(
route = OverloadRoute.CONFIGURATIONS,
selectedIcon = Icons.Filled.Settings,
unselectedIcon = Icons.Outlined.Settings,
iconTextId = R.string.configurations,
OverloadRoute.CONFIGURATIONS,
Icons.Filled.Settings,
Icons.Outlined.Settings,
R.string.configurations,
),
)
Loading

0 comments on commit cedf94d

Please sign in to comment.