clean-architecture-components-boilerplate icon indicating copy to clipboard operation
clean-architecture-components-boilerplate copied to clipboard

BrowseBufferoosViewModelFactory doesn't support multiple ViewModel subclasses

Open vlazzle opened this issue 7 years ago • 2 comments

This is probably not a big deal right now since there's currently just one ViewModel subclass, but it's still worth noting...

Right now BrowseBufferoosViewModelFactory only supports one ViewModel subclass--BrowseBufferoosViewModel. If you define a second subclass of ViewModel, calling ViewModelProviders.of(this, viewModelFactory).get(SecondViewModel::class.java) will throw IllegalArgumentException: Unknown ViewModel class.

One way to address this is to have BrowseBufferoosViewModelFactory fetch a Provider<ViewModel> from the multibound map using modelClass as the key. Further details.

vlazzle avatar Sep 26 '17 07:09 vlazzle

Nice! :) Yea I planned on adding something to support this at some point this week - that looks like a good way of doing so

hitherejoe avatar Sep 26 '17 10:09 hitherejoe

Hi, @hitherejoe this is not an issue but just curiosity. Kindly, could you please let me know what tool was used to create the flow charts below:

architecture

RowlandOti avatar Jan 10 '19 04:01 RowlandOti