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

Layout In which this group is used does not show a preview #15

Closed
Mr-Ramzan opened this issue Jul 13, 2019 · 11 comments
Closed

Layout In which this group is used does not show a preview #15

Mr-Ramzan opened this issue Jul 13, 2019 · 11 comments

Comments

@Mr-Ramzan
Copy link

I have implemented this library in my project no doubt it is awesome.
But the issue I am facing is the preview of the layout does not show up on android studio.
Below is the preview while segmented group Code is commented.
image
And below is preview while not commented:
image
It does not cause any error but really slows down the designing process.
Kindly solve the issue Cheers.

@addisonElliott
Copy link
Owner

I understand your frustrations with it not showing in designer.

Do you have an example project I can test this out on?

Are there any sort of errors within designer that says the component can't be instantiated?

I've messed around with issues like this before and it can be extremely difficult to fix in designer because there is no "knobs" or adjustable parameters to fix it.

@addisonElliott
Copy link
Owner

But, also try to clear cache in Android Studio, restart your machine and Android studio.

It may do nothing and all, but I just want to make sure that there's not some relic that is causing issues.

@Mr-Ramzan
Copy link
Author

Mr-Ramzan commented Jul 13, 2019 via email

@Mr-Ramzan
Copy link
Author

As many people suggest on StackOverflow changing SDK version or changing Theme.App.......... to Base.Theme.App.... may work...
no use...

@addisonElliott
Copy link
Owner

Hmm, very odd. The sample project shows up on designer for me (I think). Let me do a bit of experimentation and get back to you. Maybe the latest Android SDK is causing issues or something?

@addisonElliott
Copy link
Owner

I've discovered that the sample project is not displaying correctly for me either. I'm assuming some sort of change occurred in Android Studio to cause this because it did work at one point.

The exception I receive is: java.lang.ClassNotFoundException: codetail.graphics.drawables.LollipopDrawable. I've been debugging it but haven't had much success. Will keep my progress posted here.

@Mr-Ramzan
Copy link
Author

Thank You Mr.Addison I Really appreciate.

@addisonElliott
Copy link
Owner

No problem. I'll start with I can't really get you an ETA for when this will be completed. It's a very odd and specific bug since it's a problem with Android Studio itself.

Here's the line of code that "offends" Android Studio: https://github.com/addisonElliott/SegmentedButton/blob/master/library/src/main/java/com/addisonelliott/segmentedbutton/SegmentedButton.java#L1308

Disabling that will make it work. I have no idea why it has a problem with this. I might even go the route of creating a brand new RippleDrawable class with a new package name to see if that's causing the issue.

@addisonElliott
Copy link
Owner

I've debugged this for quite awhile and I have not the slightest idea what is going on. I submitted a bug report to Google and we'll see what happens.

https://issuetracker.google.com/issues/138310608

addisonElliott added a commit that referenced this issue Aug 20, 2019
Fix odd bug with Android Studio not showing layout preview due to RippleDrawable library.

Add rounded button GIF to README and update rounded property description to further detail it's purpose.
@addisonElliott
Copy link
Owner

Was able to resolve this with a workaround, should be fixed in 3.1.5

@Mr-Ramzan
Copy link
Author

Really Appreciate it as it works like a charm.
Admire your work Thank you

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

No branches or pull requests

2 participants