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

Attach fragment in PopupWindow #2

Closed
kanu8 opened this issue Feb 26, 2014 · 19 comments
Closed

Attach fragment in PopupWindow #2

kanu8 opened this issue Feb 26, 2014 · 19 comments
Assignees
Labels

Comments

@kanu8
Copy link

kanu8 commented Feb 26, 2014

Hello,

First of all, congratulations for the library, it's great!

Is it possible to create a PopupWindow with fragment "EmojiconsFragment" to do a layer like whattsapp (to toggle keyboard to emojicons)?
I tried this with the DialogFragment and PopupWindow and there's always the error:

IllegalArgumentException: No view found for id...

If I attach the fragment in the general layout, it works correctly, but not in this case.

Thanks

@rockerhieu
Copy link
Owner

I haven't tried to put EmojiconsFragment into DialogFragment or PopupWindow yet. But shouldn't it be no problem? Would you mind sharing me the source code? I will have a look.

@rockerhieu rockerhieu self-assigned this Feb 27, 2014
@kanu8
Copy link
Author

kanu8 commented Feb 27, 2014

I have just sent you and email with all the source code.

Thanks for your help.

@rockerhieu
Copy link
Owner

Sorry but I can't find any problems related to com.futbee.android:id/emojis_pager (not found in the source code you sent). Would you mind to simplify the source code and send me a compilable project? Otherwise it's too hard for me to help.

02-27 09:16:42.446: E/AndroidRuntime(5372): java.lang.IllegalArgumentException: No view found for id 0x7f080086 (com.futbee.android:id/emojis_pager) for fragment EmojiconGridFragment{42f6f9c8 #1 id=0x7f080086}

@kanu8
Copy link
Author

kanu8 commented Mar 3, 2014

Hello,

I attach the simple project.

Thanks

@rockerhieu
Copy link
Owner

@kanu8 sorry, I don't see the attachment. Did you forget to attach it? Would you mind to check again?

@kanu8
Copy link
Author

kanu8 commented Mar 3, 2014

Hello,

I attach the dropbox link in the e-mail.

Thank you

@rockerhieu
Copy link
Owner

Ok, after researched a little bit, it seems that you can't use Fragment inside PopupWindow: http://stackoverflow.com/questions/8044593/properly-creating-a-fragment-in-a-popupwindow

I can think of 2 options:

  • Use DialogFragment instead of PopupWindow. But you will need to deal with setting anchor point for the
    dialog.
  • Reimplement EmojiconsFragment using PopupWindow. You can at least reuse EmojiAdapter.

Or you can continue using FragmentActivity with EmojiconsFragment included in the main layout, show/hide it accordingly when the keyboard is hidden/shown: http://dev.telnic.org/trac/browser/apps/android/superbook/trunk/src/org/telnic/superbook/LinearLayoutThatDetectsSoftKeyboard.java?rev=839

@kanu8
Copy link
Author

kanu8 commented Mar 5, 2014

Ok, I will try your options.

Thanks for your help.

@kanu8 kanu8 closed this as completed Mar 5, 2014
@drakgoku
Copy link

drakgoku commented May 8, 2014

I have same problem,

Activity - > LayoutXml + emojis "works"
Activity - > Layout - > PopupLayout + emojis- > No view found for id emojis_pager
Activity - > Layout + FragmentLayout + emojis "Work"
Activity - > Layout - > PopupLayout - > FragmentLayout + emojis No view found for id emojis_pager

Why not work with popup ????? is a big problem. How I can fix ?

@rockerhieu
Copy link
Owner

You can follow my suggestions.

@drakgoku
Copy link

drakgoku commented May 8, 2014

I need make this
http://stackoverflow.com/questions/23493588/how-i-can-make-popup-with-emoji-icon
I can't create this effect with dialog.
How I can create this effect ?

@drakgoku
Copy link

drakgoku commented May 9, 2014

I tried 2 forms, not work for me !
How I can contact with creators ?

@nishantrpai
Copy link

Sir i used the layout in which i was making the emoji as Fragment layout but since it has the keyword fragment it's giving an error (i like your library i want to use it, please tell me)

@gio777
Copy link

gio777 commented Jul 23, 2014

I am having the same issue attempting to create an instance of the keyboard inside one of 5 view pager fragments, but I keep getting an error with the inflator. Not sure what is going on. Any help?

Error is: Binary XML file line #:Error inflating class fragment

@rockerhieu
Copy link
Owner

@guseligio could you paste the full stack trace and the layout XML?

@gio777
Copy link

gio777 commented Jul 25, 2014

@rockerhieu any ideas?

@nishantrpai
Copy link

Dude calm down let us analyze the situation and we will find a solution,
you are sooooo on fire

@nishantrpai
Copy link

See basically we are going to expand fragment in a fragment so we need to
deal with it someway

@saket
Copy link

saket commented Jul 27, 2014

You need to convert the Fragment into a ViewGroup and then attach it to a PopupWindow.
For the lazy, I've already implemented it for my app. Here you go: https://gist.github.com/Saketme/cd4d307be660454165e6

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

6 participants