Jun 7, 2015 Replies: 12 Hello All, Continuing to have a a bit of fun with libraries, I'm making a GIF View available for your use. The goal of GIF View is to allow you to embed animated GIF in your apps. As things stand, I couldn't find any over here so I wrapped up a popular library that does this for us. This library is authored by Flipboard guys and is very robust and efficient(or so its fame is). One of my main design goals is to make the GIF View as similar to the standard ImageView that you guys would have used in B4i as possible. The usage is pretty simple: Code: Copy Dim hh As HHAnimatedGifView hh.Initialize("gif") iv = hh.GetAnimatedGifView("http://raphaelschaad.com/static/nyan.gif") Page1.RootPanel.AddView(iv, 10,10, 300, 300) Currently, the HHAnimatedGifView object doesn't support click events but am going to update this library so watch this space for updates. I need to do a bit of work so that it works exactly like the standard ImageView click event. Attached is the zip containing the library files. Copy the .h and .a files in your local mac builder's Libs folder and copy the .xml file to your B4i Libraries folder on your Windows box. A sample project is also attached. EDIT: Version 1.1 adds another method that takes as input the file name(without .gif) of the GIF file. This is required because loading gifs using the file:// URL doesn't work in release. See posts 7 onward for details Cheers, Harris Attachments GifViewer.zip GifViewer.zip 1.1 KB · Views: 72 HHGifView.zip HHGifView.zip 52.7 KB · Views: 69 GifViewer_1.1.zip GifViewer_1.1.zip 97.1 KB · Views: 152 HHGifView_1.1.zip HHGifView_1.1.zip 53.6 KB · Views: 163 Last edited: Jun 15, 2015 Click to expand...
Hello All, Continuing to have a a bit of fun with libraries, I'm making a GIF View available for your use. The goal of GIF View is to allow you to embed animated GIF in your apps. As things stand, I couldn't find any over here so I wrapped up a popular library that does this for us. This library is authored by Flipboard guys and is very robust and efficient(or so its fame is). One of my main design goals is to make the GIF View as similar to the standard ImageView that you guys would have used in B4i as possible. The usage is pretty simple: Code: Copy Dim hh As HHAnimatedGifView hh.Initialize("gif") iv = hh.GetAnimatedGifView("http://raphaelschaad.com/static/nyan.gif") Page1.RootPanel.AddView(iv, 10,10, 300, 300) Currently, the HHAnimatedGifView object doesn't support click events but am going to update this library so watch this space for updates. I need to do a bit of work so that it works exactly like the standard ImageView click event. Attached is the zip containing the library files. Copy the .h and .a files in your local mac builder's Libs folder and copy the .xml file to your B4i Libraries folder on your Windows box. A sample project is also attached. EDIT: Version 1.1 adds another method that takes as input the file name(without .gif) of the GIF file. This is required because loading gifs using the file:// URL doesn't work in release. See posts 7 onward for details Cheers, Harris
JohnC Expert Licensed User Longtime User Jun 7, 2015 #2 Excellent! This could add some really cool looking animations to our apps.
Erel B4X founder Staff member Licensed User Longtime User Jun 8, 2015 #3 Thank you for sharing this. I've uploaded it to the hosted builders.
A Albi Active Member Licensed User Longtime User Jun 14, 2015 #4 This is very cool! Is there also a way to use local files instead of urls? I tried Code: Copy iv = hh.GetAnimatedGifView(file.Combine(file.DirAssets, "giftest.gif")) but that didn't work...
This is very cool! Is there also a way to use local files instead of urls? I tried Code: Copy iv = hh.GetAnimatedGifView(file.Combine(file.DirAssets, "giftest.gif")) but that didn't work...
H Haris Hafeez Active Member Licensed User Longtime User Jun 14, 2015 #5 Try: Code: Copy iv = hh.GetAnimatedGifView("file://" & file.Combine(file.DirAssets, "giftest.gif"))
A Albi Active Member Licensed User Longtime User Jun 14, 2015 #7 In debug mode it works fine from a local file, but not in release mode. Any idea why this would be? I've attached an example (it's just that line above modified from your example) Attachments PhotoGifViewer.zip PhotoGifViewer.zip 99.5 KB · Views: 29
In debug mode it works fine from a local file, but not in release mode. Any idea why this would be? I've attached an example (it's just that line above modified from your example)
H Haris Hafeez Active Member Licensed User Longtime User Jun 14, 2015 #8 Thanks for highlighting this. I have also just checked that this doesn't show anything when the app is built in release mode. I will tinker with things a bit and revert. At the moment, I'm not too sure what's causing this behaviour.
Thanks for highlighting this. I have also just checked that this doesn't show anything when the app is built in release mode. I will tinker with things a bit and revert. At the moment, I'm not too sure what's causing this behaviour.
H Haris Hafeez Active Member Licensed User Longtime User Jun 15, 2015 #10 So I spent a bit of time last night and I've got some good news and bad news. The good news is that I managed to get the animated gif work in a release app when I added a new method to the library. The bad news is that with this method, the gif does not show in debug mode. I think the issue here is that there is a difference between how B4i handles local file paths when it is using a shell app for debugging and when it generates ios app in release. Of course, I'm not a B4i expert and will have to receive some input on this from our boss, Erel I will start a new thread for discussing this issue so we can keep this thread for library updates and usage questions. We can use conditional compilation to use the right method but I will rather try to find a proper solution first so watch this space for updates.
So I spent a bit of time last night and I've got some good news and bad news. The good news is that I managed to get the animated gif work in a release app when I added a new method to the library. The bad news is that with this method, the gif does not show in debug mode. I think the issue here is that there is a difference between how B4i handles local file paths when it is using a shell app for debugging and when it generates ios app in release. Of course, I'm not a B4i expert and will have to receive some input on this from our boss, Erel I will start a new thread for discussing this issue so we can keep this thread for library updates and usage questions. We can use conditional compilation to use the right method but I will rather try to find a proper solution first so watch this space for updates.
A Albi Active Member Licensed User Longtime User Jun 15, 2015 #11 wow, thanks very much. working in release mode and not debug mode is pretty much just good news! I really appreciate your help and time. I'll test it out later today and just edit this to confirm that it has worked for me... edit1: i assume i need to wait for Erel to upload new library files to the hosted builder?
wow, thanks very much. working in release mode and not debug mode is pretty much just good news! I really appreciate your help and time. I'll test it out later today and just edit this to confirm that it has worked for me... edit1: i assume i need to wait for Erel to upload new library files to the hosted builder?
H Haris Hafeez Active Member Licensed User Longtime User Jun 15, 2015 #12 I have updated the first post. The updated library contains another method GetAnimatedGifViewForFile that takes as parameter the name of the local file(without the .gif extension). I have also uploaded an updated sample project that uses conditional compilation to check which method to call based on whether you are working in DEBUG or RELEASE. Note you may not be able to use the library immediately if you're using hosted builder as you will have to wait for Erel(or one of the admins) to upload the updated library files to the hosted builder. You can of course download the lib and set it up if you're using local builder. Have fun!
I have updated the first post. The updated library contains another method GetAnimatedGifViewForFile that takes as parameter the name of the local file(without the .gif extension). I have also uploaded an updated sample project that uses conditional compilation to check which method to call based on whether you are working in DEBUG or RELEASE. Note you may not be able to use the library immediately if you're using hosted builder as you will have to wait for Erel(or one of the admins) to upload the updated library files to the hosted builder. You can of course download the lib and set it up if you're using local builder. Have fun!
A Albi Active Member Licensed User Longtime User Jun 15, 2015 #13 amazing, thanks. I shall wait for an admin to upload the files, (or perhaps send an email asking them to check this thread when they have a chance....) edit: just to confirm for anyone else reading this, the hosted builder is updated and the library works in debug and release modes. woop woop. Last edited: Jun 16, 2015
amazing, thanks. I shall wait for an admin to upload the files, (or perhaps send an email asking them to check this thread when they have a chance....) edit: just to confirm for anyone else reading this, the hosted builder is updated and the library works in debug and release modes. woop woop.