Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implemented navigation component in checker inbox task module #2197

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ExperimentalFoundationApi::class
)

package com.mifos.feature.checker_inbox_task.checker_inbox.ui
package com.mifos.feature.checker_inbox_task.checker_inbox

import android.widget.Toast
import androidx.activity.compose.BackHandler
Expand Down Expand Up @@ -70,7 +70,7 @@ import com.mifos.core.designsystem.theme.White
import com.mifos.core.objects.checkerinboxandtasks.CheckerTask
import com.mifos.core.ui.components.SelectionModeTopAppBar
import com.mifos.feature.checker_inbox_task.R
import com.mifos.feature.checker_inbox_task.dialog.CheckerInboxTasksFilterDialog
import com.mifos.feature.checker_inbox_task.checker_inbox_dialog.CheckerInboxTasksFilterDialog
import java.sql.Timestamp

@Composable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mifos.feature.checker_inbox_task.checker_inbox.ui
package com.mifos.feature.checker_inbox_task.checker_inbox

import com.mifos.core.objects.checkerinboxandtasks.CheckerInboxSearchTemplate
import com.mifos.core.objects.checkerinboxandtasks.CheckerTask
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mifos.feature.checker_inbox_task.checker_inbox.ui
package com.mifos.feature.checker_inbox_task.checker_inbox

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mifos.feature.checker_inbox_task.dialog
package com.mifos.feature.checker_inbox_task.checker_inbox_dialog

import android.annotation.SuppressLint
import android.widget.Toast
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mifos.feature.checker_inbox_task.dialog
package com.mifos.feature.checker_inbox_task.checker_inbox_dialog

import android.util.Log
import androidx.compose.runtime.mutableStateOf
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mifos.feature.checker_inbox_task.checker_inbox_tasks.ui
package com.mifos.feature.checker_inbox_task.checker_inbox_tasks

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mifos.feature.checker_inbox_task.checker_inbox_tasks.ui
package com.mifos.feature.checker_inbox_task.checker_inbox_tasks


/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mifos.feature.checker_inbox_task.checker_inbox_tasks.ui
package com.mifos.feature.checker_inbox_task.checker_inbox_tasks

import android.util.Log
import androidx.lifecycle.ViewModel
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package com.mifos.feature.checker_inbox_task.navigation

import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
import androidx.navigation.compose.composable
import androidx.navigation.navigation
import com.mifos.feature.checker_inbox_task.checker_inbox.CheckerInboxScreen
import com.mifos.feature.checker_inbox_task.checker_inbox_tasks.CheckerInboxTasksScreen

fun NavGraphBuilder.checkerInboxTaskGraph(
navController: NavController,
) {
navigation(
startDestination = CheckerInboxTaskScreens.CheckerInboxTaskScreen.route,
route = CheckerInboxTaskScreens.CheckerInboxTaskScreenRoute.route
) {
checkerInboxTaskRoute(
onBackPressed = navController::popBackStack,
checkerInbox = navController::navigateCheckerInbox
)
checkerInboxRoute(
onBackPressed = navController::popBackStack
)
}
}

fun NavGraphBuilder.checkerInboxTaskRoute(
onBackPressed: () -> Unit,
checkerInbox: () -> Unit
) {
composable(
route = CheckerInboxTaskScreens.CheckerInboxTaskScreen.route
) {
CheckerInboxTasksScreen(
onBackPressed = onBackPressed,
checkerInbox = checkerInbox
)
}
}

fun NavGraphBuilder.checkerInboxRoute(
onBackPressed: () -> Unit
) {
composable(
route = CheckerInboxTaskScreens.CheckerInboxScreen.route
) {
CheckerInboxScreen(
onBackPressed = onBackPressed
)
}
}

fun NavController.navigateCheckerInbox() {
navigate(CheckerInboxTaskScreens.CheckerInboxScreen.route)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.mifos.feature.checker_inbox_task.navigation

sealed class CheckerInboxTaskScreens(val route: String) {

data object CheckerInboxTaskScreenRoute :
CheckerInboxTaskScreens("checker_inbox_task_screen_route")

data object CheckerInboxTaskScreen : CheckerInboxTaskScreens("checker_inbox_task_screen")

data object CheckerInboxScreen : CheckerInboxTaskScreens("checker_inbox_screen")

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ import androidx.compose.material.icons.rounded.PowerSettingsNew
import androidx.compose.material.icons.rounded.Settings
import androidx.compose.material.icons.rounded.Task
import androidx.compose.ui.graphics.vector.ImageVector
import com.mifos.feature.checker_inbox_task.navigation.CHECKER_INBOX_TASK_SCREEN_ROUTE

import com.mifos.feature.about.navigation.ABOUT_SCREEN_ROUTE
import com.mifos.feature.checker_inbox_task.navigation.CheckerInboxTaskScreens



import com.mifos.feature.groups.navigation.GROUP_LIST_SCREEN_ROUTE
import com.mifos.feature.path_tracking.navigation.PATH_TRACKING_SCREEN_ROUTE
import com.mifos.feature.search.Navigation.SEARCH_SCREEN_ROUTE
Expand Down Expand Up @@ -50,7 +55,7 @@ sealed class HomeDestinationsScreen(

data object CheckerInboxAndTasksScreen : HomeDestinationsScreen(
title = "Checker Inbox & Tasks",
route = CHECKER_INBOX_TASK_SCREEN_ROUTE,
route = CheckerInboxTaskScreens.CheckerInboxTaskScreen.route,
icon = Icons.Rounded.CheckBox
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.mifos.feature.about.navigation.aboutScreen
import com.mifos.feature.activate.navigation.activateScreen
import com.mifos.feature.activate.navigation.navigateToActivateScreen
import com.mifos.feature.center.navigation.centerNavGraph
import com.mifos.feature.checker_inbox_task.navigation.checkerInboxTasksScreen
import com.mifos.feature.checker_inbox_task.navigation.checkerInboxTaskGraph
import com.mifos.feature.client.navigation.clientNavGraph
import com.mifos.feature.document.navigation.documentListScreen
import com.mifos.feature.document.navigation.navigateToDocumentListScreen
Expand Down Expand Up @@ -124,8 +124,8 @@ fun Navigation(
}
)

checkerInboxTasksScreen(
onBackPressed = { navController.popBackStack() },
checkerInboxTaskGraph(
navController = navController
)
pathTrackingScreen(
onBackPressed = { navController.popBackStack() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProviders
import com.mifos.mifosxdroid.R
import com.mifos.mifosxdroid.databinding.DialogFragmentCheckerTaskFilterBinding
import com.mifos.feature.checker_inbox_task.dialog.CheckerInboxViewModel
import com.mifos.feature.checker_inbox_task.checker_inbox_dialog.CheckerInboxViewModel
import com.mifos.feature.checker_inbox_task.dialog.CheckerInboxViewModelFactory
import com.mifos.mifosxdroid.uihelpers.MFDatePicker
import com.mifos.utils.FragmentConstants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.platform.ViewCompositionStrategy
import com.mifos.core.common.utils.Constants
import com.mifos.core.objects.checkerinboxandtasks.CheckerTask
import com.mifos.feature.checker_inbox_task.checker_inbox.ui.CheckerInboxScreen
import com.mifos.feature.checker_inbox_task.checker_inbox.CheckerInboxScreen
import com.mifos.mifosxdroid.core.MifosBaseFragment
import dagger.hilt.android.AndroidEntryPoint
import java.sql.Timestamp


@AndroidEntryPoint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.platform.ViewCompositionStrategy
import androidx.navigation.fragment.findNavController
import com.mifos.feature.checker_inbox_task.checker_inbox_tasks.ui.CheckerInboxTasksScreen
import com.mifos.feature.checker_inbox_task.checker_inbox_tasks.CheckerInboxTasksScreen
import com.mifos.mifosxdroid.R
import com.mifos.mifosxdroid.core.MifosBaseFragment
import dagger.hilt.android.AndroidEntryPoint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.mifos.mifosxdroid.online.checkerinbox
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.mifos.core.network.datamanager.DataManagerCheckerInbox
import com.mifos.feature.checker_inbox_task.dialog.CheckerInboxViewModel
import com.mifos.feature.checker_inbox_task.checker_inbox_dialog.CheckerInboxViewModel
import rx.subscriptions.CompositeSubscription
import javax.inject.Inject

Expand Down
Loading