Breaks ConstraintLayout preview rendering in Android Studio
If I add a dependency on this library to a project in Android Studio, it will prevent Android Studio's preview rendering of layouts using ConstraintLayout from working.
They do still seem to work fine at runtime, however.
Tested using Android Studio 2.3 Beta 1.
This can be seen with a brand new project.
- Create a layout using ConstraintLayout.
- Add
maven { url 'https://jitpack.io' }to the Project's build.gradle file'srepositoriessection. - Add
compile 'com.github.AndroidDeveloperLB:MaterialPreferenceLibrary:9'to the app module's build.gradle file'sdependenciessection.
At this point the layout preview will break.
I don't think It has anything to do with ConstraintLayout . The IDE cannot preview my preferences, just because they are customized. There is nothing I can do about it, except for reporting about it to Google, so this is what I did now: https://code.google.com/p/android/issues/detail?id=232320 Please star/comment about it, if you wish it to get more attention.
Thank you very much for jumping on this so quickly!
I think this is a different issue. Apologies if I was too vague.
It is not that your custom preferences aren't shown in the preview, it is that including this library in a project (even if you do nothing with it) causes Android Studio to fail to preview ConstraintLayouts - it displays a (or several) 'No Such Field Error'(s).
Steps to reproduce:
- Create a new project (it should include ConstraintLayout & AppCompat by default now), with a default blank activity.
- View the layout xml file in Design view - note that it is displaying correctly.
- Add
maven { url 'https://jitpack.io' }to the Project's build.gradle file'srepositoriessection. - Add
compile 'com.github.AndroidDeveloperLB:MaterialPreferenceLibrary:9'to the app module's build.gradle file'sdependenciessection. - Sync the project.
- Go back to view the layout xml file in design view, and it will not display anything, giving the render.
- Comment out
compile 'com.github.AndroidDeveloperLB:MaterialPreferenceLibrary:9'in the app module's build.gradle file - the design mode springs back into life.

OK, I will need to check it out. Maybe I just need to update the libraries my library use (supoprt library stuff).
BTW, if you have minSdk set to 14 or above, you should consider using Google's solution: https://plus.google.com/+AndroidDevelopers/posts/9kZ3SsXdT2T Currently, it has the same issue of not animating the switchPreference, as I've got here. No idea why. I think it will solve your issue here, though.
I've succeeded reproducing this issue, but it says that it's a known issue:

Anyway, I've reported about this issue too: https://code.google.com/p/android/issues/detail?id=232553