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

Exception in XML layout preview when using the space navigation #7

Closed
roschlau opened this issue Aug 31, 2016 · 4 comments
Closed

Exception in XML layout preview when using the space navigation #7

roschlau opened this issue Aug 31, 2016 · 4 comments

Comments

@roschlau
Copy link

When I use the space navigation in a layout file the preview window will throw an Exception:

java.lang.NullPointerException: Your space item count must be greater than 1 , your current items count is : 0

This makes the preview basically unsuable. Is there a way you could just show dummy items when in the preview, or can you provide items directly in the xml?

@armcha
Copy link
Owner

armcha commented Aug 31, 2016

@Hikaru755 Unfortunately there is no way to add items from xml, you should add items programatically from activity or fragment .

@roschlau
Copy link
Author

@armcha Alright, then would it be possible to add a check by using View.isInEditMode() inside the SpaceNavigationView, to display dummy items when the view is shown in the preview, instead of throwing an exception?

@armcha
Copy link
Owner

armcha commented Aug 31, 2016

@Hikaru755 It's probably will be available in next version

@roschlau
Copy link
Author

@armcha Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants