-
Notifications
You must be signed in to change notification settings - Fork 3
feature/91-add-main-view-model #99
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
base: develop
Are you sure you want to change the base?
Conversation
# Conflicts: # app/src/main/java/com/washingtondcsquad/tudee/di/viewModelModule.kt
|
|
||
| import java.util.Locale | ||
|
|
||
| data class MainState( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name of this data class shouble be MainActivityScreenState
or MainActivityUiState
but MainState is inConsistent and not the convention for naming screen state
| import kotlinx.coroutines.launch | ||
| import java.util.Locale | ||
|
|
||
| class MainViewModel( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i suggest to rename this to MainActivityViewModel
| import kotlinx.coroutines.flow.map | ||
| import java.util.Locale | ||
|
|
||
| class AppPreferencesServiceImpl( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where isDarkModelEnabled function ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it exists in this file down below
|
|
||
| init { | ||
| getIsDarkTheme() | ||
| getOnBoardingState() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as the above method
mahmoudkhai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good work but some little things need refactoring
| } | ||
|
|
||
| viewModel { (taskId:Int , onCancel: () -> Unit , onActionResult: (success: Boolean, message: String) -> Unit) -> | ||
| viewModel { (taskId: Int, onCancel: () -> Unit, onActionResult: (success: Boolean, message: String) -> Unit) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we changed type of task id to be TaskId alise name not int
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check domain layer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this concerns the EditTask feature which is out of scope for this pr so I will not be modifying it, as to not affect other's work
| package com.washingtondcsquad.tudee.domain.services | ||
|
|
||
| import kotlinx.coroutines.flow.Flow | ||
| import java.util.Locale |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try to search for kotlin version . it's not recommended to use java libraries in domain layer.
mahmoudkhai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good work
| import kotlinx.coroutines.flow.Flow | ||
| import java.util.Locale | ||
|
|
||
| interface AppPreferencesService { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on multiple lines
omer1998
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great work kareem
| appPreferencesService.isDarkModeEnabled() | ||
| }, | ||
| onSuccess = ::onDarkThemeEnabled, | ||
| onError = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it always a good practice to handle error state, help in debugging and improve user experience
| import kotlinx.coroutines.flow.map | ||
| import java.util.Locale | ||
|
|
||
| class AppPreferencesServiceImpl( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it exists in this file down below
|
|
||
| data class MainState( | ||
| val isDarkTheme: Boolean = false, | ||
| val hasOnBoardingShown: Boolean? = null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't see any need of nullable value for hasOnBoardingShow, because it must be initialize when the app start
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i agree
|
Good job, @mahmoudkhai mentioned a good points. Solve it, and I will give you approve. |
…ng logic and initial value
# Conflicts: # app/src/main/java/com/washingtondcsquad/tudee/MainActivity.kt # app/src/main/java/com/washingtondcsquad/tudee/di/viewModelModule.kt
add main view model and with localization support