Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 26    Views: 121

MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
03/12/14 03:44 AM (10 years ago)

Mosaic Plugin iPhone and iPad

I notice that the max size of a mosaic is 4x4, on an iphone it occupies the whole screen, but not on an ipad. meaning that using a menu to work on both iphone and ipad is tricky. It looks good on one, and not as good on another device. Any suggestions? Miguel
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
03/12/14 06:47 AM (10 years ago)
Miguel if you want it to look like the ipad does I'll give you thsi liile snippet to mod go to mosaic view.m find this method - (NSInteger)moduleSizeInPoints{ NSInteger retVal = kModuleSizeInPoints_iPhone; if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad){ //retVal = kModuleSizeInPoints_iPad; //new lines retVal = ((([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortrait) || ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortraitUpsideDown)) ? [[UIScreen mainScreen] bounds].size.width/4 : [[UIScreen mainScreen] bounds].size.height/4); } return retVal; }
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
03/12/14 07:23 AM (10 years ago)
Perfect.... Before I posted this, I posted in the plugin's discussion. I thought it would appear in the forum, apparently not. Did you get ant notification? Here is the post: https://www.buzztouch.com/plugins/discussion.php?tid=F5C5A5A50A9E632EBE7AB07&pid=826723C4A5FC34C3D5BEA25&searchInput=search...&sortColumn=PT.modifiedUTC&sortUpDown=DESC&currentPage=1 Thanks. Miguel
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
03/12/14 07:31 AM (10 years ago)
Nope it doesn't work lol As a side note feel free to tweak with the divisions for the landscape. It doesn't look thes best in landscape maybe set it to 8 and the you will get 2 4 x4's on an ipad screen in in landscape. Just ahve a play with the fours find your perfect pattern
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
03/12/14 08:09 AM (10 years ago)
Yeah I noticed the same thing. Good thing about the Mosaic is the beauty of it being imperfect! I'll try to play the with above tweak bc it would be nice to match the iphone version. Thanks Kittsy.
 
fusionsch
I hate code!
Profile
Posts: 516
Reg: Dec 28, 2010
Montreux Switze...
11,610
like
03/13/14 12:46 AM (10 years ago)
Hi Miguel & Kittsy, Thanks for the thread and the fix, I needed it too! Just tried the fix, it's ok, the iPhone layout is now preserved on the iPad. But (alas)... There's something else... As soon as you turn the iPad upside down, the mosaic disappears and you just see the background image. And it never comes back, you have to reload the config to bring it back. We'll need one more tweak! Thanks and cheers Jack
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
03/13/14 01:17 AM (10 years ago)
That doesn't happen to me.
 
fusionsch
I hate code!
Profile
Posts: 516
Reg: Dec 28, 2010
Montreux Switze...
11,610
like
03/13/14 03:27 AM (10 years ago)
Thanks for the feedback, Miguel. That's quite strange. I've just tested it in another app (a more recent package download, just in case), but I have the same issue. I've tested it on iPad 2, iOS 7.1. Maybe Kittsy will have a clue?
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
03/13/14 03:47 AM (10 years ago)
I don't know what to say, it works on my devices all test devices and simulators. It works for Miguel, GoNorthwest and a few others, It has to be a typo somewhere
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
03/13/14 03:51 AM (10 years ago)
Try it without any code changes.
 
fusionsch
I hate code!
Profile
Posts: 516
Reg: Dec 28, 2010
Montreux Switze...
11,610
like
03/13/14 05:31 AM (10 years ago)
I did test it without the tweak... same issue. Same issue in the simulator, even in iOS 6.1 (so it's not related to iOS 7.1). Delete the app on the test device, clean, quit Xcode, relaunch, reinstall... same issue. Nothing special in the output, except this after loading of the menu (before turning upside down): 2014-03-13 12:52:11.389 restomodel[446:60b] objects removed 2014-03-13 12:52:11.392 restomodel[446:60b] the elements( "<MosaicData: 0x1574a3f0> Header", "<MosaicData: 0x15690ca0> Photo 01", etc. The app (and the other one where I tested the plugin) has a tab bar and the appDelegate is modified so as to allow only Portrait and UpsideDown. A conflict with the tab bar or with another plugin??? Cheers Jack
 
fusionsch
I hate code!
Profile
Posts: 516
Reg: Dec 28, 2010
Montreux Switze...
11,610
like
03/13/14 06:22 AM (10 years ago)
One more test: I've re-downloaded the app package to be sure nothing changed in the core... Tried it 'fresh from the BT Vault', without any tweak. Same issue. Yikes!
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
03/13/14 06:37 AM (10 years ago)
ah your using a tab bar, that maybe the issue. I'll take a look when I get home.
 
fusionsch
I hate code!
Profile
Posts: 516
Reg: Dec 28, 2010
Montreux Switze...
11,610
like
03/13/14 08:01 AM (10 years ago)
Great! Thanks in advance!
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
03/13/14 11:30 AM (10 years ago)
Right here is a fix just change this line if you know it's going to be a tab bar -(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{ snapshotAfterRotation = captureSnapshotOfView(mosaicMenuView); snapshotBeforeRotation.alpha = 0.0; [self.view insertSubview:snapshotAfterRotation belowSubview:snapshotBeforeRotation]; mosaicMenuView.hidden = YES; << change this to NO [ivExpand removeFromSuperview]; } like this -(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{ snapshotAfterRotation = captureSnapshotOfView(mosaicMenuView); snapshotBeforeRotation.alpha = 0.0; [self.view insertSubview:snapshotAfterRotation belowSubview:snapshotBeforeRotation]; mosaicMenuView.hidden = NO; [ivExpand removeFromSuperview]; } I haven't noticed any adverse effects, I will add the fix in the impending update
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
03/13/14 11:31 AM (10 years ago)
sorry the code is in AK_mosaicMenu.m And bravo for the spot, and further ammunition to the fact I really hate tab bars
 
fusionsch
I hate code!
Profile
Posts: 516
Reg: Dec 28, 2010
Montreux Switze...
11,610
like
03/13/14 12:46 PM (10 years ago)
... and further ammunition to the fact that a tab bar hater can be a tab bar wizard :-) Thanks a lot, Kittsy, it's quite ok now! Uh... May I ask a stupid question? (I'm a pure monkey with code: I just mimic what others are doing, I can't code from scratch) Is there any snippet of code I could use on line 639 of AK_mosaicMenu.m to have a function that doesn't do anything? Uh... I mean: to be able to deactivate the tap on some tiles. When you tap on this or that tile, nothing happens. No screen loading, no gallery, no share... Just the transparency effect on tap, but no action. Yes, I know, I have strange ideas sometimes... But your transparency effect on tap gives me ideas... It's your fault! Thanks and cheers Jack
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
03/13/14 12:56 PM (10 years ago)
yup just set it to custom 1,2 or 3 in control panel it will flash and do nothing. You actually asked your own question if there is no code it will do nothing lol
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
03/13/14 12:57 PM (10 years ago)
or do you mean tap the image and the image disappears all together. like to make tiles disappear covering a background picture
 
fusionsch
I hate code!
Profile
Posts: 516
Reg: Dec 28, 2010
Montreux Switze...
11,610
like
03/13/14 02:57 PM (10 years ago)
I did try before asking you... Saw something flashing, but it seemed different of the 'normal' flash... Have to try again... Hey! You give me one more idea! My idea was playing with the background, that's right... And your idea of a disappearing tile, revealing the background... Could do funny things with this... OK, I stop now... Thank you and good night!
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
03/13/14 03:02 PM (10 years ago)
It will still flash, if you don't want the flash and want to make a kind of place holder image. This will be in the update go to MosaicDataView.m goto line 156 isn change this if (self.mosaicView.selectedDataView != self){ to this if (self.mosaicView.selectedDataView != self && module.mosaicType != 7){ presuming that you have used custom1 as the button type it will no longer flash and just appear as an image/color tile
 
fusionsch
I hate code!
Profile
Posts: 516
Reg: Dec 28, 2010
Montreux Switze...
11,610
like
03/13/14 03:22 PM (10 years ago)
I'll try this tomorrow! Thanks again (and again)
 
fusionsch
I hate code!
Profile
Posts: 516
Reg: Dec 28, 2010
Montreux Switze...
11,610
like
03/14/14 06:33 AM (10 years ago)
Hi Kittsy, I did try the 'no flash' code snippet, it's perfect! I'm currently playing with the image gallery setting, it's a very good alternative to the MacImage Gallery. I've spotted a little issue when you share an image by e-mail: there should be a double line break to separate the Share Message data and the Share URL data in the e-mail. (The URL is just displayed at the end of the message.) Just a little suggestion, if not too complicated to implement: it would be nice to have the data 'Share Header Title' as object of the message (as when you use the Email Share setting). BTW, it would sometimes be useful to be able to deactivate totally the share functions when using this image gallery setting, e.g. when you just wish to show the photo in the app, without allowing to send it or post it somewhere easily. (But maybe such a setting would be to complicated to implement!) Many thanks for the plugin and the tweaks, you've done an amazing job!!! Cheers Jack
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
03/14/14 06:34 AM (10 years ago)
Nothing is too complicated, I should really post a wish list before I release this update
 
fusionsch
I hate code!
Profile
Posts: 516
Reg: Dec 28, 2010
Montreux Switze...
11,610
like
03/14/14 09:46 AM (10 years ago)
May be useful, if 2,000 people tell you 'please make this and please make that'... ;-)
 
Uelsimon
Lost but trying
Profile
Posts: 272
Reg: Mar 25, 2012
NYC
4,470
like
03/22/14 12:04 PM (10 years ago)
loving this thread
 
Uelsimon
Lost but trying
Profile
Posts: 272
Reg: Mar 25, 2012
NYC
4,470
like
03/27/14 10:13 PM (10 years ago)
ok..adding onto this… Where should I put my [Flurry logEvent:]; call to track analytics on which items on the menu are being pressed? unfortunately, I didn’t see anything i recognized to indicate where to drop it. I would want it to record the "Tile Title” or the screen that the touch would be calling. thanks €
 

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.