Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ItemData instance creation from XML #37

Closed
fennifith opened this issue Jul 17, 2018 · 2 comments
Closed

ItemData instance creation from XML #37

fennifith opened this issue Jul 17, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@fennifith
Copy link
Owner

This will require extensive modifications to the CLI (or even just replacing it completely - see #36), but I essentially want the XML to be "inflated" similarly to a layout file, where the entire package name of each class is provided in the tag. Sub-tags, like "contributor" or "link" would be unaffected (or even replaced with an ambiguous name, like "item"), and would simply be passed to the constructor of each "main" item (or I could just continue passing an instance of the parser like I am now). This would allow users to add their own functionality to the about screen instead of only being able to override layout files.

@fennifith fennifith added the enhancement New feature or request label Jul 17, 2018
fennifith added a commit that referenced this issue Aug 7, 2018
@fennifith
Copy link
Owner Author

Rather than creating an ambiguous "item" tag inside a class tag, it might be more productive to make another subclass - ListInfoData<T> - which accepts two layout resources (InfoData accepts one for the item itself, the second is for the nested RV that will exist inside of the item). As such, it will also contain two binding methods - bind(Context, ViewHolder) inherited from InfoData and bindItem(Context, ViewHolder, T) to bind the nested RecyclerViews items, which will be called from the item class (T in relation to the method call, ex: in ContributorsItemData, T would be an instance of ContributorItemData).

This is going to be confusing and stupid. Depending on how things go I may also make a subclass for the nested items, making the list info subclass ListInfoData<T extends ListItemData> or something.

@fennifith
Copy link
Owner Author

On second thought, I was right. This was confusing and stupid. It is better to go with a recursive method of nesting ItemDatas instead of having different classes for items that might have items inside them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant