Code Monkey home page Code Monkey logo

android-clean-architecture-mvi-boilerplate's People

Contributors

akoufa avatar albodelu avatar amrelmasry avatar hitherejoe avatar jawnnypoo avatar ldhnam avatar makovkastar avatar meisolsson avatar ravidsrk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-clean-architecture-mvi-boilerplate's Issues

Migration from RxJava to Flow

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.

Update Gradle version to latest version

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?

How should we use CompletableUseCases in the Processor ?

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!

Unable to get provider android.arch.lifecycle.ProcessLifecycleOwnerInitializer

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) 

Is there two kinds of ViewModel or just one?

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.

  1. BrowsBuferoosViewModel.
  2. BuferooViewModel

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?

ViewModel from View instead of Activity or Fragment

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.

  1. Pass the ViewModelProvider as an argument to the View constructor
  2. Pass the already obtained ViewModel as an argument to the View constructor
  3. Pass a LifecycleOwner as an argument to the View constructor
  4. Hold the ViewModel in the containing Fragment/Activity and expose events from the view and consume states.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.