-
Notifications
You must be signed in to change notification settings - Fork 28
Mani: QuotifyApp - Remote call #38
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: main
Are you sure you want to change the base?
Conversation
- lambda func like CopyText & ShareAction events moved into MainEvents
- state passed into screens instead data
- Toast handled with extension func and event
- Remote call implementation
Mani-Quotify/app/build.gradle.kts
Outdated
@@ -63,6 +63,8 @@ dependencies { | |||
implementation(libs.androidx.ui.navigation) | |||
implementation(libs.androidx.room.runtime) | |||
implementation(libs.androidx.room.ktx) | |||
implementation(libs.retrofit) | |||
implementation(libs.converter.gson) |
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.
can we use kotlin serialization?
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.
Resolved
|
||
import com.mani.quotify007.domain.model.Quote | ||
|
||
val quotesDataList = mutableListOf( |
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.
do we still need these?
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.
Resolved
viewModel.copyTextEvent.observe(this) { quote -> | ||
onCopyText(this, quote) | ||
} | ||
viewModel.shareClickEvent.observe(this) { quote -> | ||
shareQuote(this, quote) | ||
} | ||
viewModel.showToast.observe(this) { message -> | ||
message?.let { showToast(it) } | ||
} |
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.
more better approach? looks repetative
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.
Resolved
private val _copyTextEvent = MutableLiveData<Quote>() | ||
val copyTextEvent: LiveData<Quote> = _copyTextEvent | ||
|
||
private val _shareClickEvent = MutableLiveData<Quote>() | ||
val shareClickEvent: LiveData<Quote> = _shareClickEvent | ||
|
||
private val _showToast = MutableLiveData<String>() | ||
val showToast: LiveData<String> = _showToast | ||
|
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.
can't we use just MainEvent
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.
Alos, why livedata, why not stateflow?
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.
Resolved
-Removed GSON converter -Used Kotlin Serialization -Manual dependency items simplified
@anandwana001 Addressed comments, please review. |
…ests and responses
_state.value = | ||
_state.value.copy(favoriteQuotes = quotes) | ||
_state.value = _state.value.copy( | ||
quotes = useCase.result().results.map { quote -> |
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.
why multiple, why not one statement?
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.
Resolved
@anandwana001 Comment addressed. Please review. |
Pull Request
Description
Lambda func like CopyText & ShareAction events moved into MainEvents(Prev MR comment addressed)
State passed into screens instead data(Prev MR comment addressed)
Toast handled with extension func and event
Remote call implementation with retrofit
(Updated)
Removed GSON converter
Kotlin Serialization technique implemented
Manual dependency items simplified
Removed static data list
Handled the repetative livedata approach into sharedflow with Event.
Added Okhttp loggin interceptor for logs of HTTP requests and responses
Checklist
README.md
file with a brief overview of the project, how to set it up, and any relevant information.Screenshots
Project README
Please ensure that your project's
README.md
is detailed and includes:Additional Notes
Thank you for your contribution!