Closed VIkash2601 closed 1 year ago
@VIkash2601 Hey,
I've prepared a demo project where the Giphy dialog is invoked directly from the fragment. Replace YOUR_API_KEY
with your actual key.
Please let me know if there's anything else I can help with.
Hi @ALexanderLonsky thank you for your reply. I will look into it. I have a case where I share the selected gif url to my server to save the chat history and get it in the API. And, currently I am able to render the gif as thumbnail in GPHMediaView but the gif does not play.
Have you successfully compiled your project and run the dialog? You might want to check out our demo project, which allows you to interact with the SDK. In it, you can select media from the dialog and then display it in a list. In your situation, consider sending the GIF's ID instead of its URL, then use the GPHCore.gifById(id) method. Additionally, here's a link to a similar issue that may help.
One last question before I close this thread, is it possible to get the GIF using media.<any url>
?
take a look at this
Sorry that I was unable to explain my question properly as the solution suggested by you is to fetch the URL that I am achieving properly for my Use Case. The concern is if I have the gifUrl from the server, is it possible to set this to GPHMediaView, get the GIF media data from it, and play the GIF.
Usually, in the URL path, the /media
is followed by the ID. You can parse this to retrieve the ID. However, I wouldn't recommend relying on this, and we don't provide mechanisms to pass the URL directly into GPHMediaView.
Though, you can still use com.facebook.drawee.view.SimpleDraweeView
, it should be something like this:
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/my_image_view"
...
binding.myImageView.controller = Fresco.newDraweeControllerBuilder().setImageRequest(ImageRequest.fromUri("url"))
.setAutoPlayAnimations(true)
.build()
Furthermore, you can use Glide to render GIFs by their URLs.
🐛 Bug Report
I am unable to build the app after implementing the Giphy SDK and used it inside the fragment.
To Reproduce
Modify below Dependencies;
And then try to build the app.
(Write your steps here:)
Expected behavior
The app should build properly and on click of the button the Giphy Dialog should open.
Actual Behavior
Build failed with below error; Android resource linking failed error: resource style/ShapeAppearanceOverlay.DifferentCornerSize (aka com.app.spinnr.test:style/ShapeAppearanceOverlay.DifferentCornerSize) not found.
Your Environment
plugins { id 'com.android.application' version '7.2.1' apply false id 'com.android.library' version '7.2.1' apply false id 'org.jetbrains.kotlin.android' version '1.7.10' apply false }
Reproducible Demo