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

setSelectedContentType does not load correct tab #84

Closed
colorgold opened this issue Sep 9, 2020 · 13 comments
Closed

setSelectedContentType does not load correct tab #84

colorgold opened this issue Sep 9, 2020 · 13 comments

Comments

@colorgold
Copy link

Version: com.giphy.sdk:ui:2.0

I am trying to display the Emojis first, but when I open the giphyDialogFragment, it shows the GIFs in the size of the emojis.

Here is the code I used:

GPHSettings settings;
settings.setMediaTypeConfig(new GPHContentType[]{GPHContentType.recents,GPHContentType.emoji,GPHContentType.gif, GPHContentType.sticker, GPHContentType.text});
settings.setSelectedContentType(GPHContentType.emoji);
giphyDialogFragment = GiphyDialogFragment.Companion.newInstance(settings);

This is how I show the fragment:
giphyDialogFragment.show(chatRadioActivities.getSupportFragmentManager(), getString(R.string.giphy_dialog));

Here is a screenshot of what it looks like:
emoji_load_bug

@ALexanderLonsky
Copy link
Collaborator

@colorgold thanks for flagging the issue, I'll take a look and will get back to you.

@ALexanderLonsky
Copy link
Collaborator

@colorgold please try v2.0.1

@colorgold
Copy link
Author

@ALexanderLonsky It works! Thank you!

@colorgold colorgold reopened this Sep 11, 2020
@colorgold
Copy link
Author

When you open the giphyDialogFragment for the first time, it shows up correctly. However, after that, it shows the GIFs first if not the emojis in the size of the GIFs.

@ALexanderLonsky
Copy link
Collaborator

@colorgold
However, after that, it shows the GIFs first if not the emojis in the size of the GIFs.
does it happen when keyboard is showing up? If yes, then it's correct behaviour as we don't allow to search through emojis. I see now that grid content is not reloading when emoji was gone, this is a bug.

@colorgold
Copy link
Author

@ALexanderLonsky
It happens without the keyboard showing up. But a bigger problem I am having is that if I try to open the keyboard, the fragment closes on its own. This is how you can reproduce the problem I am seeing:

  1. Open the giphyDialogFragment (the emojis load correctly)
  2. Close the giphyDialogFragment without searching for anything.
  3. Open the giphyDialogFragment again:
    -As soon as I try to search for a GIF, the giphyDialogFragment closes on its own and won't let me search for anything unless I restart the activity

@ALexanderLonsky
Copy link
Collaborator

@colorgold to my regret, I can't reproduce it..

I've updated the code for the giphy-android-sdk-ui-example example project:

DemoActivity.kt:

launchGiphyBtn.setOnClickListener {
            settings.mediaTypeConfig = arrayOf(
                GPHContentType.recents,
                GPHContentType.emoji,
                GPHContentType.gif,
                GPHContentType.sticker,
                GPHContentType.text
            )
            settings.selectedContentType = GPHContentType.emoji
            val dialog = GiphyDialogFragment.newInstance(settings)
            dialog.gifSelectionListener = getGifSelectionListener()
            dialog.show(supportFragmentManager, "gifs_dialog")
        }

updated settings with mediaTypeConfig and selectedContentType

And the fragment does not close on its own. The only issue I have now is that grid does keep its content regardless emojis visibility change.
Did you try to run the example project? Do you have the problem there too?

Please find the video attached and correct me if I do that in the wrong way.
video.mov.zip

@ALexanderLonsky
Copy link
Collaborator

@colorgold I've noticed that you are using Java, so I prepared a new Java project.
Please try it out too.

test_project.zip

@colorgold
Copy link
Author

@ALexanderLonsky
I tapped out the way you did, and I can go and search just fine. However, if I slide my finger downwards to close the dialog that is when I have the problem.

@ALexanderLonsky
Copy link
Collaborator

@colorgold I can reproduce only this one when using blur mode.

@colorgold
Copy link
Author

@ALexanderLonsky
I added settings.setUseBlurredBackground(false); and still the problems persists. The tab issue was fixed. It does sometimes goes back and forth between showing GIFs and emojis when opening and closing without searching anything.

Here is a video of the dialog fragment closing on its own after dismissing it by sliding down

device-GIPHY.zip

Here is an example where it shows the emoji as selected even though GIFs are showing:
image

Here the emojis show up in the size of GIFs after various times of opening and closing the dialog fragment
image

@ALexanderLonsky
Copy link
Collaborator

ALexanderLonsky commented Sep 14, 2020

@colorgold finally I came up with a thought you may use the same instance of GiphyDialogFragment and I can reproduce now the issue with the fragment is closing on its own.
As a quick solution, you can create a new instance each time you are opening it.
You can copy the code from here

And here is a hotfix for the grid content issue:
com.giphy.sdk:ui:2.0.1-hotfix

Please let me know if that works for you.

@colorgold
Copy link
Author

@ALexanderLonsky I was using the same instance of the dialog. I followed your example and it worked. Thank you so much for your help.

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