eli-fox / lego-catalog Goto Github PK
View Code? Open in Web Editor NEWA LEGO® Catalog app illustrating current Android Architecture state using Android development best practices.
License: Apache License 2.0
A LEGO® Catalog app illustrating current Android Architecture state using Android development best practices.
License: Apache License 2.0
Can you share a example using sharedprefrence in it?
with this pattern, it is really easy to use, but i have a problem to retry call API when got error, because we already have livedata in repository and calling api in datasource, how we can get retry request with this pattern?
I am following your tutorial and I have implemented only LegoTheme part with only parsing data from remote functionality (Room is not implemented)
I would like to test my LegoThemeViewModel and LegoThemeRepository classes logic
How can i run the test on these classes, Please can you help me
Reproduce steps:
Actual:
Data is presented without loading it from network
Expected:
Data should be loaded from network
When I click on Back button, Activity get destroyed ( but instance of app still exist as I can access it from recent apps). What I expect is a call to refresh cache method when I start the app again, but it never get called.
But when I destroy instance of app by clearing from recent app and start the app, refresh cache method get called.
Isn't it better to refresh cache when Activity create again?
@Eli-Fox , I am having a project in which only network calls are to be made and no use of local DB. So how to follow that approach in this project? How will SingleSourceofTruth file will work?
Please can you more sample
Great project, thanks for sharing!
I have some minor improve suggestion - Result class is currently implemented in Java style and not getting benefits of the Kotlin compiler.
Having Result class implemented as
sealed class Result<out T> {
class loading<T> : Result<T>()
data class error<T>(val message: String) : Result<T>()
data class success<T>(val data: T) : Result<T>()
}
you can avoid excess nullability checks(!!) and possible exceptions in places like
if (responseStatus.status == SUCCESS) {
saveCallResult(responseStatus.data!!)
} else if (responseStatus.status == ERROR) {
emit(Result.error<T>(responseStatus.message!!))
emitSource(source)
}
and have it in more Kotlin way
if (responseStatus is Result.success) {
saveCallResult(responseStatus.data)
} else if (responseStatus is Result.error) {
emit(Result.error<T>(responseStatus.message))
emitSource(source)
}
Hope you find it useful :)
Hi!
Is it possible to substitute livedata on room Dao to use flow and suspend fun?
If yes, can you do it in a separate branch or update this example?
Thanks a lot and nice job
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.