Skip to content

Commit

Permalink
CHANGE folder structure change for easier usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank1234 committed Aug 12, 2024
1 parent 98bdacf commit 417ee4c
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 28 deletions.
10 changes: 5 additions & 5 deletions app/src/main/kotlin/nl/q42/template/navigation/NavGraphs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package nl.q42.template.navigation

import com.ramcosta.composedestinations.spec.DestinationSpec
import com.ramcosta.composedestinations.spec.NavGraphSpec
import nl.q42.template.ui.home.destinations.HomeScreenDestination
import nl.q42.template.ui.home.destinations.HomeSecondScreenDestination
import nl.q42.template.ui.onboarding.start.destinations.OnboardingStartScreenDestination
import nl.q42.template.home.destinations.HomeScreenDestination
import nl.q42.template.home.destinations.HomeSecondScreenDestination
import nl.q42.template.onboarding.ui.start.destinations.OnboardingStartScreenDestination

/**
*
Expand All @@ -16,7 +16,7 @@ object NavGraphs {

val home = object : NavGraphSpec {
override val route = AppGraphRoutes.home

override val startRoute = HomeScreenDestination

override val destinationsByRoute = listOf<DestinationSpec<*>>(
Expand Down Expand Up @@ -45,4 +45,4 @@ object NavGraphs {
home, onboarding
)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.q42.template.presentation.home
package nl.q42.template.home.main.presentation

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
Expand All @@ -16,9 +16,9 @@ import nl.q42.template.actionresult.data.handleAction
import nl.q42.template.domain.user.usecase.FetchUserUseCase
import nl.q42.template.domain.user.usecase.GetUserFlowUseCase
import nl.q42.template.feature.home.R
import nl.q42.template.home.destinations.HomeSecondScreenDestination
import nl.q42.template.navigation.AppGraphRoutes
import nl.q42.template.navigation.viewmodel.RouteNavigator
import nl.q42.template.ui.home.destinations.HomeSecondScreenDestination
import nl.q42.template.ui.presentation.ViewStateString
import javax.inject.Inject

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.q42.template.presentation.home
package nl.q42.template.home.main.presentation

import nl.q42.template.ui.presentation.ViewStateString

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.q42.template.ui.home
package nl.q42.template.home.main.ui

import androidx.compose.foundation.layout.Arrangement.Center
import androidx.compose.foundation.layout.Column
Expand All @@ -9,7 +9,7 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment.Companion.CenterHorizontally
import androidx.compose.ui.Modifier
import nl.q42.template.presentation.home.HomeViewState
import nl.q42.template.home.main.presentation.HomeViewState
import nl.q42.template.ui.compose.get
import nl.q42.template.ui.presentation.toViewStateString
import nl.q42.template.ui.theme.PreviewAppTheme
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package nl.q42.template.ui.home
package nl.q42.template.home.main.ui

import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.ramcosta.composedestinations.annotation.Destination
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
import nl.q42.template.home.main.presentation.HomeViewModel
import nl.q42.template.navigation.viewmodel.InitNavigator
import nl.q42.template.presentation.home.HomeViewModel
import nl.q42.template.presentation.home.HomeViewState
import nl.q42.template.ui.compose.OnLifecycleResume

@Destination
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package nl.q42.template.presentation.home.second
package nl.q42.template.home.second.presentation

import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.ViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package nl.q42.template.home.second.presentation

class HomeSecondViewState(val title: String)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.q42.template.ui.home.second
package nl.q42.template.home.second.ui

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
Expand All @@ -14,8 +14,8 @@ import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.ramcosta.composedestinations.annotation.Destination
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
import nl.q42.template.home.second.presentation.HomeSecondViewModel
import nl.q42.template.navigation.viewmodel.InitNavigator
import nl.q42.template.presentation.home.second.HomeSecondViewModel

@Destination
@Composable
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.q42.template.presentation.home
package nl.q42.template.home.main.presentation

import app.cash.turbine.test
import io.mockk.coEvery
Expand All @@ -10,10 +10,15 @@ import kotlinx.coroutines.test.runTest
import nl.q42.template.actionresult.domain.ActionResult
import nl.q42.template.domain.user.usecase.FetchUserUseCase
import nl.q42.template.domain.user.usecase.GetUserFlowUseCase
import nl.q42.template.presentation.home.MainDispatcherRule
import org.junit.Rule
import org.junit.Test
import kotlin.time.Duration.Companion.seconds

/**
* An example ViewModel test. Weather you want to test ViewModels is up to you. On most projects,
* you probably want to focus on unit testing the Domain layer first.
*/
class HomeViewModelTest {

@get:Rule
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.q42.template.presentation.onboarding.start
package nl.q42.template.onboarding.presentation.start

import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.ViewModel
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package nl.q42.template.onboarding.presentation.start

class OnboardingStartViewState(val title: String)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.q42.template.ui.onboarding.start
package nl.q42.template.onboarding.ui.start

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
Expand All @@ -15,8 +15,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.ramcosta.composedestinations.annotation.Destination
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
import nl.q42.template.navigation.viewmodel.InitNavigator
import nl.q42.template.presentation.onboarding.start.OnboardingStartViewModel
import nl.q42.template.presentation.onboarding.start.OnboardingStartViewState
import nl.q42.template.onboarding.presentation.start.OnboardingStartViewModel

@Destination
@Composable
Expand Down

This file was deleted.

0 comments on commit 417ee4c

Please sign in to comment.