Skip to content

Commit

Permalink
DashboardView: Not recreating btns on frame change
Browse files Browse the repository at this point in the history
Formerly, whenever the frame was changed we would recreate every button;
this would cause them to be animated from the upper left corner of the
parent view. By simply calling layoutButtons, we can smoothly animate
the buttons to their new calculated position on orientation / frame
change.
  • Loading branch information
Russ Frank committed Sep 5, 2012
1 parent 5918862 commit be66099
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 2 additions & 1 deletion iphone/Classes/LauncherView.h
Expand Up @@ -71,6 +71,7 @@
- (void)beginEditing;
- (void)endEditing;
- (void)recreateButtons;
- (void)layoutButtons;

- (LauncherItem*)itemForIndex:(NSInteger)index;
- (NSArray*)items;
Expand Down Expand Up @@ -102,4 +103,4 @@

@end

#endif
#endif
5 changes: 1 addition & 4 deletions iphone/Classes/TiUIDashboardView.m
Expand Up @@ -52,10 +52,7 @@ -(void)frameSizeChanged:(CGRect)frame bounds:(CGRect)bounds
if (!CGRectIsEmpty(bounds))
{
[TiUtils setView:launcher positionRect:bounds];
if(launcher.editing == NO)
{
[launcher recreateButtons];
}
[launcher layoutButtons];
}
[super frameSizeChanged:frame bounds:bounds];
}
Expand Down

0 comments on commit be66099

Please sign in to comment.