Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 32    Views: 143

PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
01/02/14 04:19 AM (10 years ago)

Thumb Viewer Plugin Issues (Solved)

Hi All, Best wishes for this year! The Thumb Viewer Plugin was having some troubles with iOS7. Until the plugin gets updated in the market please use this solution: Please overwrite FGalleryPhoto.h and FGalleryPhoto.m with the files from the links: https://dl.dropboxusercontent.com/u/3427464/BTA_thumbViewer/update%202014/FGalleryPhoto.h https://dl.dropboxusercontent.com/u/3427464/BTA_thumbViewer/update%202014/FGalleryPhoto.m and make edits in FGalleryViewController.m Look for line 1105 (- 1138) and replace the complete method with this: - (FGalleryPhoto*)createGalleryPhotoForIndex:(NSUInteger)index { FGalleryPhotoSourceType sourceType = [_photoSource photoGallery:self sourceTypeForPhotoAtIndex:index]; FGalleryPhoto *photo; NSString *thumbPath; NSString *fullsizePath; if( sourceType == FGalleryPhotoSourceTypeLocal ) { thumbPath = [_photoSource photoGallery:self filePathForPhotoSize:FGalleryPhotoSizeThumbnail atIndex:index]; fullsizePath = [_photoSource photoGallery:self filePathForPhotoSize:FGalleryPhotoSizeFullsize atIndex:index]; photo = [[FGalleryPhoto alloc] initWithThumbnailPath:thumbPath fullsizePath:fullsizePath theDelegate:self]; } else if( sourceType == FGalleryPhotoSourceTypeNetwork ) { thumbPath = [_photoSource photoGallery:self urlForPhotoSize:FGalleryPhotoSizeThumbnail atIndex:index]; fullsizePath = [_photoSource photoGallery:self urlForPhotoSize:FGalleryPhotoSizeFullsize atIndex:index]; photo = [[FGalleryPhoto alloc] initWithThumbnailUrl:thumbPath fullsizeUrl:fullsizePath theDelegate:self]; [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"This is the fullsizePath: %@", fullsizePath]]; } else { // invalid source type, throw an error. [NSException raise:@"Invalid photo source type" format:@"The specified source type of %d is invalid", sourceType]; } // assign the photo index photo.tag = index; // store it [_photoLoaders setObject:photo forKey: [NSString stringWithFormat:@"%i", index]]; return photo; } Now the Plugin works again!!! Best Regards, Danny
 
aquila198
buzztouch Evangelist
Profile
Posts: 473
Reg: Jul 22, 2011
location unknow...
10,330
like
01/02/14 05:01 AM (10 years ago)
Thanks Danny!
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
01/02/14 05:03 AM (10 years ago)
Thanks a lot!! It's such a great plugin. I hope to see more from you this year :)
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
01/02/14 05:06 AM (10 years ago)
also, just to clarify.. Editing inside the 3.0 core plugin folder correct? Not 2.0? Thanks!
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
01/02/14 05:27 AM (10 years ago)
Thanks all, @mysps: yes you are correct! in 3.0 folder. BTW: The bar at the bottom (fullscreen view) is not as visible as it should. just add next line of code after line 169 in FGalleryViewController.m: _toolbar.barTintColor = [UIColor whiteColor]; Best Regards, Danny
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
01/02/14 05:44 AM (10 years ago)
Which file exactly Danny will we add that code?
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
01/02/14 05:45 AM (10 years ago)
For the last bit of code Danny mentioned, put that in file: FGalleryViewController.m Thank you Danny! David
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
01/02/14 05:45 AM (10 years ago)
cool thanks David
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
01/02/14 05:49 AM (10 years ago)
Updated the post with the color fix!! (thanks David for jumping in) Best Regards, Danny
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
01/02/14 08:37 AM (10 years ago)
Awesome! Hopefully you can contribute these changes to the GitHub repository of the original source code. https://github.com/gdavis/FGallery-iPhone/ Even if the Pull Request does not get accepted, others will use your changes on their iOS 7 apps. -- Niraj
 
SheriDee
Code is Art
Profile
Posts: 1094
Reg: Sep 23, 2011
location unknow...
22,840
like
01/02/14 11:36 AM (10 years ago)
Works Perfectly! Thanks Danny :)
 
nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
like
01/02/14 08:42 PM (10 years ago)
How is that wordpress plugin going?
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
01/03/14 11:14 AM (10 years ago)
Hi nadthevlad, what do you want to know? This script does what it says. Let me know if there is something else you need to know. Best Regards, Danny
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
01/03/14 12:01 PM (10 years ago)
In FGalleryViewController.m file, two changes are needed to eliminate the deprecation warnings for iOS 7 and it will still be compatible with iOS 6 --------------- Line 319 - Old: [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:animated]; Line 319 - New: #if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000 [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:animated]; #else [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:animated]; #endif ---------------- Line 786 - Old: CGSize textSize = [caption sizeWithFont:_caption.font]; Line 786 - New: #if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000 CGSize textSize = [caption sizeWithFont:_caption.font]; #else CGSize textSize = [caption sizeWithAttributes:@{NSFontAttributeName:_caption.font}]; #endif
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
01/03/14 01:32 PM (10 years ago)
Thanks Niraj, For you contribution! Best Regards, Danny
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
01/06/14 12:38 PM (10 years ago)
Hey Danny, my navbar is white as soon as I click "show me the images" so I can't see the text like "1by1" or "see all" anymore, as they are white font too. For sure a 3.0 issue as my other apps work fine and have the navigation colour like the whole app. Where can I manually make this change please?
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
01/06/14 12:45 PM (10 years ago)
Hi Leon, Sorry to hear the trouble but I can't reproduce this. In my apps the navigation bar is white and the text is black (default behaviour). Try to create a new (test)app with only a thumbviewer screen (in a menu) and see if that makes any difference. Best Regards, Danny
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
01/06/14 12:55 PM (10 years ago)
text should be white, that is correct, just the navigation bar that in my case should be green, not white. all fine on the front page of the plugin, just changes the navigation bar to white as soon as I hit "show me the images". Sure I can't tell the plugin manually to change that navbar color?
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
01/06/14 01:06 PM (10 years ago)
Hi Leon, You could do something like this: in FGalleryViewController.m add on line 586 this self.navigationController.navigationBar.barTintColor = [UIColor greenColor]; Should work. Best Regards, Danny
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
01/06/14 04:23 PM (10 years ago)
Bedankt Danny! Works now :-) For anyone who has the same problem and needs RGB Colours, here you go: self.navigationController.navigationBar.barTintColor = [BT_color getColorFromHexString:@"#000000"];
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
01/06/14 04:30 PM (10 years ago)
You're welcome Leon, Glad I could help and your contribution may be a more flexible solution. Best Regards, Danny
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
01/23/14 01:37 PM (10 years ago)
Great. Thanks.
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
02/22/14 10:40 AM (10 years ago)
Was using the ThumbViewer in v2 iOS app fine.. Moved a copy over into my v3 App and made the above changes for iPhone iOS 7 ========================= Now has the following Xcode error below for line 22 of FGalleryPhotoView.h "NSObject <FGalleryPhotoViewDelegate> *photoDelegate;" Error: Existing instance variable 'photoDelegate' for property 'photoDelegate' with assign attribute must be __unsafe_unretained ========================= FGalleryPhotoView.m also has 9 errors- but hoping caused by above. Since it seems to be working for others. Any idea what I did wrong.
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
02/22/14 11:08 AM (10 years ago)
Hi, Soory to hear about your issue. Seems you must have done something wrong. Just replace two files and make the previously described edit. That's it! Best regards, Danny
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
02/22/14 11:48 AM (10 years ago)
OK- It was something weird in Xcode. Working now! Have it up now with a few changes that I had made in the xib. ========== on 1/6 Danny and Leon referred to a line needed to be added added in order to see the text items at bottom of the screen. Need to correct that same issue. self.navigationController.navigationBar.barTintColor = [BT_color getColorFromHexString:@"#000000"]; Can someone show exact location? Does this need to be included in -(void)LayoutViews
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
02/22/14 12:26 PM (10 years ago)
Figured that I would keep it in the same thread... Not able to send email from Thumb Viewer Image Gallery. Everything appears to work up until the point of selecting "Send" on the email screen. running iPhone iOS v7- BTV3 - BT Hosted. Anyone else have it working?
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
02/22/14 12:52 PM (10 years ago)
Hi, Are you trying to mail from the simulator? If so that doesn't work. Only real devices. for the color. As posted in this thread: in FGalleryViewController.m add on line 586 this self.navigationController.navigationBar.barTintColor = [UIColor greenColor]; Or as Leon suggested (instead of my code but still the same linenumber: self.navigationController.navigationBar.barTintColor = [BT_color getColorFromHexString:@"#000000"]; Best regards, Danny
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
02/22/14 01:22 PM (10 years ago)
For the email issue - I am running on iPhone 5s (not simulator) ======== EDITED: Danny's comment below about referring to original code solved the placement issue. I will post a snapshot of bottom background issue behind icons which is really what I was after. (not the Nav Bar.)
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
02/22/14 01:44 PM (10 years ago)
Hi, Sorry not near my computer now. When someone is trying to explain something with line numbers as a reference than you should look at the original code and not your modified version. Once you do that you will find the line. Compare this with your mod and you should be fine. Try to make test app where you can test the unmodified version of the plugin and make the necessary changes as described. See if it works. Best regards, Danny
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
02/22/14 06:48 PM (10 years ago)
Interesting day... Email: The issue was with Gmail- not the plugin. About 1.5 hours after my tests when I sent the emails to myself, they appeared in my inbox. Now subsequent tests are being sent/received no problem...
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
02/22/14 06:50 PM (10 years ago)
Details on my question for the background color/tint behind the icons when viewing a single image from the gallery. https://www.dropbox.com/s/buywci6cblr0nnd/ThumbView%20Screen3.pdf I was looking to find a simple change that could make the background color lighter (light grey). In case anyone else could use... FOUND THE ANSWER: _container.backgroundColor in FGalleryViewController.m :) ======================================== Also realized you can also change the PNG files for the titlebg and icons for different looks.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
02/22/14 07:25 PM (10 years ago)
Never fear Mustang, your "finds" are making the classic plugins get better. That plugin is a lot of code. You may want to checkout the original Github project. I seem to remember there were pending improvements suggested on the bugs and pull requests. Perhaps one or those is exactly what you want. I suggest to start a new post for the color of the icons and the color of the icon bar. That way it does not get lost for future searchers. Once you do find a programmatic solution, try to connect it to a control panel parameter (a new one). Then Danny might be willing to publish an update to the plugin with your improvement. -- Niraj
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
02/22/14 07:54 PM (10 years ago)
Niraj- Good idea. After I dig some more, I will start a new thread with info.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.