Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 6    Views: 100

Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
01/17/13 10:25 AM (13 years ago)

Buzz_carousel iPad support

Hi guys, a small feature was accidentally omitted from the Buzz Carousel plugin. Some may have noticed that the images aren't very big on the iPad. I have submitted an update to Susan so it should be added soon. For those of you who have already integrated it into your source code you can make the following changes. remove the methods //viewForItemAtIndex with reflection... (lines 385 - 414) and //carouselItemWidth... (lines 417 - 428) replace them with //viewForItemAtIndex with reflection... -(UIView*)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(ReflectionView *)view{ [BT_debugger showIt:self:@"viewForItemAtIndex"]; UIImageView *button; if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { //return a standard UIImageView object with the image from the array of images... view = [[[ReflectionView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 200.0f, 200.0f)] autorelease]; button = [[[UIImageView alloc]initWithFrame:CGRectMake(0.0f, 0.0f, 200.0f, 200.0f)] autorelease]; }else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad){ //return a standard UIImageView object with the image from the array of images... view = [[[ReflectionView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 400.0f, 400.0f)] autorelease]; button = [[[UIImageView alloc]initWithFrame:CGRectMake(0.0f, 0.0f, 400.0f, 400.0f)] autorelease]; } [view addSubview:button]; button.image= [UIImage imageNamed:[AKAlbums objectAtIndex:index]]; if (aCarousel.vertical == 1 | aCarousel.type == iCarouselTypeWheel | aCarousel.type == iCarouselTypeInvertedWheel | aCarousel.type == iCarouselTypeInvertedRotary) { view.reflectionAlpha = 0; view.reflectionScale = 0; }else{ view.reflectionGap = [[BT_strings getJsonPropertyValue:screenData.jsonVars:@"AKGap":@"4"]floatValue]; view.reflectionAlpha = [[BT_strings getJsonPropertyValue:screenData.jsonVars:@"AKOpacity":@"0.5"]floatValue]; view.reflectionScale = [[BT_strings getJsonPropertyValue:screenData.jsonVars:@"AKScale":@"0.5"]floatValue]; } [view update]; return view; } ///// and ///// //carouselItemWidth... -(CGFloat)carouselItemWidth:(iCarousel *)carousel{ //[BT_debugger showIt:self:@"carouselItemWidth"]; //This needs to be wider than the image or the items have no space between them. //That might be a desirable effect in some instances. int imagewidth; if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone){ imagewidth = [[BT_strings getJsonPropertyValue:self.screenData.jsonVars:@"iCarouselImageWidth":@"200"]intValue]; } else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad){ imagewidth = ([[BT_strings getJsonPropertyValue:self.screenData.jsonVars:@"iCarouselImageWidth":@"200"]intValue]*2); } return imagewidth; } I apologize sincerely for this oversight, my quest perfection of these plugins has failed me. lol
 
KozmoWeb
Aspiring developer
Profile
Posts: 342
Reg: Dec 08, 2012
Sarasota, FL
8,520
like
01/17/13 10:42 AM (13 years ago)
Thanks for the info @Kittsy. For existing projects, When the updated code is available in the control panel, will we just need to re-download our app source to use the revised plugin?
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
01/17/13 10:53 AM (13 years ago)
No just do that fix, for current apps you have downloaded the source code. it saves an api call. When the plugin is officially updated (just spoke to susan could be here tonight or the next few days) I will let you know, then you just need to update your plugin in self hosted, then download the package again for NEW projects. It auto resizes in the plugin, so no update to control panel.
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
01/17/13 11:25 AM (13 years ago)
Thanks! Also, perhaps it could be a good idea to add the option to control size in the control panel - especially for those who don't like to bother with code. I find that size 300-350px is great for the default iPad size. Im glad for this fix!
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
01/17/13 11:38 AM (13 years ago)
I'm working on a few new features, so I may include that with the next big update. Messing around with the sizes can cause the plugin to be temperamental depending on which carousel is used.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
01/18/13 09:50 PM (13 years ago)
Thanks for the heads up Kittsy. One thing I noticed with the iPad is if it's in landscape mode the labels are hidden. (I think they go below the screen real estate).
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
01/18/13 09:52 PM (13 years ago)
Also, another feature that would be nice to have is a differentiation of offsets for iPhone and iPad. An offset that looks good on iPhone doesn't necessarily do so for iPad.
 

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.