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

Crouton "destroys" PreferenceFragment #19

Closed
gabrielittner opened this issue Sep 6, 2012 · 17 comments
Closed

Crouton "destroys" PreferenceFragment #19

gabrielittner opened this issue Sep 6, 2012 · 17 comments
Labels
Milestone

Comments

@gabrielittner
Copy link
Contributor

This is how my PreferenceFragment looks like: https://picasaweb.google.com/lh/photo/QbpRCxQHqVATtMqhpP7OPhehlnpMhIUyAwoYnhPIGog?feat=directlink
When showing a Crouton:
https://picasaweb.google.com/lh/photo/MJwaGoIBiO7NNtpmprypnBehlnpMhIUyAwoYnhPIGog?feat=directlink

@keyboardsurfer
Copy link
Owner

From the first look it seems likely that the PreferenceFragment does not like the fact that Crouton is adding itself to the Window of the calling Activitiy.

@gabrielittner
Copy link
Contributor Author

It only happens if the PreferenceActivity is a single pane. On tablets with dual pane it works fine.

@Leandros
Copy link

What Activity are you using?

For me its working fine with SherlockPreferenceActivity.

@gabrielittner
Copy link
Contributor Author

I'm using a normal PreferenceActivity, which overwrites onBuildHeaders() .
I'll try to create a sample project in the nexz two hours.
Am 13.10.2012 18:06 schrieb "Arvid Gerstmann" [email protected]:

What Activity are you using?

For me its working fine with SherlockPreferenceActivity.


Reply to this email directly or view it on GitHubhttps://github.com//issues/19#issuecomment-9405662.

@Leandros
Copy link

Try

Activity mActivity = this;
Croutons.showText(mActivity, "Test", Style.INFO);

@gabrielittner
Copy link
Contributor Author

I call it from my PreferenceFragment and use getActivity().

I first thought the reason is that clicking on a header in singlepane opens
a second instance of the PreferenceActivity, which shows the
PreferenceFragment (because it doesn't happen in multipane). But I couldn't
find any prove for that.

I'm currently on my way back home, I'll test when I'm there.
Am 13.10.2012 18:17 schrieb "Arvid Gerstmann" [email protected]:

Try

Activity mActivity = this;Croutons.showText(mActivity, "Test", Style.INFO);


Reply to this email directly or view it on GitHubhttps://github.com//issues/19#issuecomment-9405770.

@Leandros
Copy link

If I find some time, I'll write a demo app and try to fix the issue.

@gabrielittner
Copy link
Contributor Author

I just wrote a demo app: https://github.com/gabrielittner/CroutonTest

@gabrielittner
Copy link
Contributor Author

What I also noticed is, that the missing views are completly removed, the hierarchy viewer doesn't show them anymore after displaying Crouton.

@keyboardsurfer
Copy link
Owner

Using the workaround I introduced in issue #24 might help.

@HerrVoennchen
Copy link

Hi,

the workaround does not help, since in my case. No stucking messages in queue. I'm calling the crouton from the underlying activity (SherlockPreferenceActivity) of the Fragment (PreferenceFragment) and it messes up my fragment.

Any other suggestions? Using latest version of Courton (1.8.2).

Since the images of the originial poster aren#t available anymore, i can provide some to show how it looks like on my devices.

@keyboardsurfer
Copy link
Owner

Hi @HerrVoennchen, the information you have provided is too vague for me to actually be able to help.

@HerrVoennchen
Copy link

Hier are some screenshots. Based on the description of gabrielittner it appears to be the same problem.

screenshot_2014-01-29-14-47-05

after show a Crouton
screenshot_2014-01-29-14-47-16

If you need anything else to know, let me know.

@HerrVoennchen
Copy link

If it helps, i created a test project yesterday to reproduce this behavior. See https://github.com/HerrVoennchen/CroutonTest

@keyboardsurfer
Copy link
Owner

Yes, the issue can be reproduced with the code you provided.
I'd have to toy around and see what helps solving it.
It might be that the FrameLayout within the PreferenceActivity is causing this behaviour.

Have you tried attaching the Crouton to a specific ViewGroup?

@HerrVoennchen
Copy link

hmm Tested it on test project with ViewGroup.NO:ID and ViewGroup.TEXT_ALIGNMENT_VIEW_START but has no different effect, as far as i can see.

You mentioned the FrameLayout in the PreferenceActivity.. does this layout comes from the android preference view infrastructure?

@keyboardsurfer
Copy link
Owner

See README for further info.

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

No branches or pull requests

4 participants