bufferapp / android-clean-architecture-mvi-boilerplate Goto Github PK
View Code? Open in Web Editor NEWA fork of our clean architecture boilerplate using the Model-View-Intent pattern
License: MIT License
A fork of our clean architecture boilerplate using the Model-View-Intent pattern
License: MIT License
I would love it if you'll migrate your codebase from RxJava to the Flow library. You are already using Kotlin, and it'll be amazing if you'll migrate your project to the Flow library. It'll make your code cleaner.
I have updated Gradle wrapper version to : 4.10.1
And Gradle version to : 3.3.0
And Kotlin version to : 1.3.11
I receive two Kotlin compiler error :
1 - error: no interface expected here
public class ViewModelFactory extends android.arch.lifecycle.ViewModelProvider.Factory {
2 - error: @BINDS methods must have only one parameter whose type is assignable to the return type
public abstract android.arch.lifecycle.ViewModelProvider.Factory bindViewModelFactory(@org.jetbrains.annotations.NotNull()
Full question can be found at : https://stackoverflow.com/questions/54270912/dagger2-and-architectural-components-kotlin-compiler-error
Could you help to resolve errors?
FlowableUseCases returns a Flowable emiting items, which can be mapped by a processor for it to emit a Result.
I can't find a way to have the Processor react on Completable.complete() returns from a CompletableUseCase and transform that to an emitted Result.
Thanks!
Trying run in Emulator: Nexus 5 with Android 4.4 x86
12-26 10:25:33.999 4036-4036/org.buffer.android.boilerplate.ui E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.buffer.android.boilerplate.ui, PID: 4036
java.lang.RuntimeException: Unable to get provider android.arch.lifecycle.ProcessLifecycleOwnerInitializer: java.lang.ClassNotFoundException: Didn't find class "android.arch.lifecycle.ProcessLifecycleOwnerInitializer" on path: DexPathList[[zip file "/data/app/org.buffer.android.boilerplate.ui-1.apk"],nativeLibraryDirectories=[/data/app-lib/org.buffer.android.boilerplate.ui-1, /vendor/lib, /system/lib]]
at android.app.ActivityThread.installProvider(ActivityThread.java:4793)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4385)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4325)
at android.app.ActivityThread.access$1500(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.arch.lifecycle.ProcessLifecycleOwnerInitializer" on path: DexPathList[[zip file "/data/app/org.buffer.android.boilerplate.ui-1.apk"],nativeLibraryDirectories=[/data/app-lib/org.buffer.android.boilerplate.ui-1, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.app.ActivityThread.installProvider(ActivityThread.java:4778)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4385)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4325)
at android.app.ActivityThread.access$1500(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
I was just working on a similar architecture when I ran into this boilerplate. So far I think it's great and it completes a lot of the thoughts and inner dilemmas I was having.
One particular problem I keep running into comes down to what the responsibility of the ViewModel is. As in here, the architecture component ViewModel (presentation layer *1) is responsible for receiving Ui events and return Ui states. On the other hand, models from other layers get mapped to another kind of ViewModel (UI layer *2) which is only a representation of the data to be displayed.
In my project I'm using databinding and so I bind the UI layer ViewModel to list item layouts, for example. In the case of the whole screen, I bind the activity/fragment instead of the presentation layer ViewModel. But I know a colleague binds the layout directly to the presentation layer ViewModel and might have a RecyclerView adapter directly in the VM.
Would you agree with me that the two kinds of ViewModel I mention are different? Or do you consider them the same? If they are different, shouldn't we find a better naming for one of them?
I am a new learner and I am having a hard time trying to figure of the data flow happening in the presentation layer. A little more explanation would help a beginner greatly.
When trying to encapsulate some behavior in a View instead of an Activity or a Fragment, I do not have access to the ViewModelProvider. What would be the mot appropriate way of having the same architecture when using Views?
I can see at least 4 options.
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.