Closed meruiden closed 4 years ago
Looks good.
a couple of final thins:
Before addressing the next bullets, pull from develop branch, I've made local changes before your PR and pushed them a few hours ago, after that address the issues below.
I know I wrote it but on seconds thought, change class UnsupportedClassException(msg: String = "Class must implement Diffable interface") : Throwable(msg) to class UnsupportedClassException(msg: String = "") : Throwable(msg) and move the msg "Class must implement Diffable interface" to the throw site. it's more understandable when reading the code to see the actual message.
Why is fun getItemViewTypeFromClass(clazz: Class<*>): Int? returning Int? ? getCreatorUniqueIndex returns Int, it will never be nullable.
add this documentation below /**
Note that there are some validations that need to be implemented now that the getItemViewType and getCreatorUniqueIndex are publicly accessible, but I will add them after this PR will be merged.
Why is fun getItemViewTypeFromClass(clazz: Class<*>): Int? returning Int? ? getCreatorUniqueIndex returns Int, it will never be nullable.
Whoops that shouldn't be nullable indeed. I'll remove this
Looks good.
a couple of final thins:
- Before addressing the next bullets, pull from develop branch, I've made local changes before your PR and pushed them a few hours ago, after that address the issues below.
- I know I wrote it but on seconds thought, change class UnsupportedClassException(msg: String = "Class must implement Diffable interface") : Throwable(msg) to class UnsupportedClassException(msg: String = "") : Throwable(msg) and move the msg "Class must implement Diffable interface" to the throw site. it's more understandable when reading the code to see the actual message.
- Why is fun getItemViewTypeFromClass(clazz: Class<*>): Int? returning Int? ? getCreatorUniqueIndex returns Int, it will never be nullable.
add this documentation below /**
- Retrieves the view type of an item with a given class.
- Note that this class must implement the Diffable interface and the adapter must contain items of that class.
- @throws UnsupportedClassException if the class does not implement the Diffable interface. / fun getItemViewTypeFromClass(clazz: Class<>): Int?
Note that there are some validations that need to be implemented now that the getItemViewType and getCreatorUniqueIndex are publicly accessible, but I will add them after this PR will be merged.
I pulled the latest changes from develop and changed the stuff you requested, merged all in to master and pushed.
merged your PR, thanks! will be released as a minor version in a few days after il check everything is good.
Example usage:
See #15