Coder Social home page Coder Social logo

fgallery-iphone's People

Contributors

billygist avatar brianantonelli avatar bulusoy avatar caldofran avatar calimarkus avatar gdavis avatar gregwalker avatar langk avatar saturngod avatar zetxek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fgallery-iphone's Issues

Question about using Segues

I'm trying to use segues and storyboards with the FGalleryViewController and i think I'm missing something

I have my TableViewController (which implements and the methods)connected to a View Controller which I've changed to the type FGalleryViewController in the Story Board, and in the

(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
[self performSegueWithIdentifier:@"ShowGallery" sender:self];
}

Then, in my prepareForSegue, I have the following

if ([segue.identifier isEqualToString:@"ShowGallery"]) {
FGalleryViewController *controller = (FGalleryViewController *) segue.destinationViewController;
controller.photoSource=sender;
}

The problem is there's no way to do the "initWithPhotosouce" so I'm setting the photosource after the fact.

Everything seems to work, except that the photos arent showing up.. just black. I'm using the default network images in the example and I debugged so I know they exist and are being set right.

am I missing something?

Last image not loading when previous & next buttons transition is animated

After downloading the zipball and running the example, i felt it would be better-looking to have animation too when pressing next and previous buttons, so i went into ´(void)next´ and {(void)previous´ and set the animated flag to ´YES´ on the ´gotoImageByIndex´ call.

If you then load the local images demo and START moving with the next button until the end, you'll notice that the last image is not loaded. I fixed this by removing the ´if( !animated )´ check on ´gotoImageByIndex´, but maybe it breaks something else, haven't checked yet.

Thanks for the great work!

iOS 6 autorotation problem

In

FGalleryViewController.m

  • (BOOL) shouldAutorotateToInterfaceOrientation

the autorotation-methods for its parent controller have been overridden, which has worked wonderful until the recent release of iOS6.

Unfortunately, the images can no longer be rotated when the supported rotations have been set to, for example, only portrait. It seems like the method does not override this behavior anymore.

Did someone came up with a solution for this?

UINavigationController and UITabBarController Categories

The FGallery categories for UINavigationController and UITabBarController contain a shouldAutorotateToInterfaceOrientation: method.

This is terribly wrong. It took me hours to debug this.

The issue here is that when you import the gallery module sources and have -all_load linker flag this overrides the default behaviour of the nav bar controller and tab bar controller and the shouldAutorotateToInterfaceOrientation: event of the view controllers doesn't get called, the category one overrides it.

If you want to always rotate the gallery screen you should delegate that responsibility to the developer who uses the library.

Kinds regards,
Ivan.

Fullscreen causes image to jump

iOS7, 3.5inch simualtor.

Single tap on the image switches to fullscreen, but the image position jumps. Tapping again to exit fullscreen causes it to jump again.

Compare this behavior to the native photo gallery app.

Crash IOS 7

Hello,

I have a problem since the transition to IOS7, when I click the image I receive the following error:
Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'

I do not get this error when I test my application with IOS6.1.
Everything works correctly in IOS6.1.

Thanks for your help.

Left & Right Arrow get added to view multiple times in FGalleryViewController

Occasionally the FGalleryViewController will add additional left and right arrows into the toolbar each time the view controller is navigated back to ([[self navigationController] popViewControllerAnimated:YES];)

I have looked at the code where the left and right arrows are loading into the view and it does not make sense because the loadView method is not called when the popViewControllerAnimated is called. I have also added:

if([[_toolbar items] count] == 0)
    {
        UIImage *leftIcon = [UIImage imageNamed:@"photo-gallery-left.png"];
        UIImage *rightIcon = [UIImage imageNamed:@"photo-gallery-right.png"];
        _nextButton = [[UIBarButtonItem alloc] initWithImage:rightIcon style:UIBarButtonItemStylePlain target:self action:@selector(next)];
        _prevButton = [[UIBarButtonItem alloc] initWithImage:leftIcon style:UIBarButtonItemStylePlain target:self action:@selector(previous)];

        // add prev next to front of the array
        [_barItems insertObject:_nextButton atIndex:0];
        [_barItems insertObject:_prevButton atIndex:0];

        _prevNextButtonSize = leftIcon.size.width;

        // set buttons on the toolbar.
        [_toolbar setItems:_barItems animated:NO];
    }

which should make certain that only the 2 arrow buttons get added, this also does not fix the issue. Any ideas?

scroll to top

sometimes when I goto one of the galleries (I adapted for 7 local categories) the top row of pictures are offset up by about 30 pixels.
having trouble figuring out where and how to tell the thumbsview scroll to scroll to top.

Is there a way to show images from NSDocumentDirectory ?

NSMutableArray *fullPathImageArray=[[NSMutableArray alloc]init];    

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,     NSUserDomainMask, YES);

NSString *documentsDirectory = [paths objectAtIndex:0];

filePathsArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:documentsDirectory error:NULL];

filePathsArray = [filePathsArray filteredArrayUsingPredicate:
                  [NSPredicate predicateWithFormat:@"pathExtension ==[c] %@", @"jpg"]];


for (int i=0; i<[filePathsArray count]; i++) 
{
    NSString* fullPathToFile = [documentsDirectory stringByAppendingPathComponent:   [filePathsArray objectAtIndex:i]];

    [fullPathImageArray insertObject:fullPathToFile atIndex:i];
 }

When fullPathImageArray is used as PhotoSourceTypeLocal nothing is displayed in the gallery.

ARC version

Does anybody have a FGallery project working with ARC? :)

(not -fno-objc-arc flag for files)

Rotation with FGallery

Hi thereI was wondering why you chose to override rotation in the FGalleryViewController. The comment is

/**

  • This section overrides the auto-rotate methods for UINaviationController and UITabBarController
  • to allow the tab bar to rotate only when a FGalleryController is the visible controller. Sweet.
    */

Just curious.

Analyze code

Analyze code with llvm analyzer. It founds many Dead Store Errors.

iOS 7 compatibility

Hey there,

FGallery seems to have a few issues with iOS 7. As release date of iOS 7 seems to come closer (if you watch the change logs of previous beta releases), I would like to know if there are plans to migrate FGallery to iOS 7.

Issues I found so far:

  • The new translucient bars in iOS 7 (tab bar, navigation bar) do have some effects when using fullscreen mode in FGallery (images move too far to the top beyond the screen).
  • Same for the overview page: thumbnails are being displayed below the navigation bar.
  • When using FGallery and going "back" to a previous view, it crashes with the following error: [FGalleryViewController scrollViewDidScroll:]: message sent to deallocated instance 0x18c53c60

Issue while scrolling below 0 offset of scroll view

Hi,

I have faced an issue in scrolling images when we scroll very fast and scroll view offset becomes -ve, i that case app will crash

Can you please check the code?

I have fixed that in below method
by adding

if(_scroller.contentOffset.x < 0)
return;

  • (void)scrollingHasEnded {

    _isScrolling = NO;
    if(_scroller.contentOffset.x < 0)
    return;
    NSUInteger newIndex = floor( _scroller.contentOffset.x / _scroller.frame.size.width );

    // don't proceed if the user has been scrolling, but didn't really go anywhere.
    if( newIndex == _currentIndex )
    return;

    // clear previous
    [self unloadFullsizeImageWithIndex:_currentIndex];

    _currentIndex = newIndex;
    [self updateCaption];
    [self updateTitle];
    [self updateButtons];
    [self loadFullsizeImageWithIndex:_currentIndex];
    [self preloadThumbnailImages];
    }

If its fine then please update the code so that in future if anyone use this then should not face this issue.

Thanks

crash problem in iOS7 beta3

in iOS6 ,FGallery work perfect,
but in iOS7 beta,when app start to present FGalleryVC to show images,if user click back btn ,app crash.

Setting screen size

Hi there
Sorry for the silly question, how do I set the size of the screen for FGallery ?
I need to restrict the are 'couse I have a custom nav bar in the top.
Any help ?
Tnx
Roberto

rotation resize issue

function layoutViews is not calling from the function - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context

I try to call layoutViews method in the willRotateToInterfaceOrientation delegate but in this case design becime distorted.

"See All" / "Done" rightBarButtonItem button customization

Would be good to have a consistent way to customize initial state of the library, with ability to start in both photo & thumbnail views (hiding the button in thumbnail view would be cool as well :). Not as hard to workaround these, but would be nice to have support for these kind of things directly within the library.

remove image doesn't work/update properly

Using the removeImageAtIndex: method, it removes the image but doesn't update the photo view properly. It just presents a black background - if you then thumb left or right the image indexing seems all messed up (wrong photos come up, doesn't show some). I'm only testing with between five to ten images and only in fullscreen, not using thumbnails at all. I'm loading all images from the files system.

Took a look at the method implementation for removeImageAtIndex and I don't see it doing anything to adjust or check _currentIndex (against the [_photoSource numberOfPhotosForPhotoGallery:self] upper boundary. Also the moveScrollerToCurrentIndexWithAnimation: call from layoutViews: is using the _currentIndex but I couldn't figure out exactly what it was doing with the scroller frame calculations.

Arc problem with UINavigationController

Following code is working but there is no NavigationBar

promoGallery* gallery = [[promoGallery alloc] init];
gallery.imageArray = self.fullImageArray;

FGalleryViewController* pVC = [[FGalleryViewController alloc] initWithPhotoSource:gallery];
pVC.currentIndex = btn.tag;


[self presentModalViewController:pVC animated:YES];

So, I put navigation controller like below and it crash

promoGallery* gallery = [[promoGallery alloc] init];
gallery.imageArray = self.fullImageArray;

FGalleryViewController* pVC = [[FGalleryViewController alloc] initWithPhotoSource:gallery];
pVC.currentIndex = btn.tag;

UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:pVC];

[self presentModalViewController:navController animated:YES];

I check the code and it's problem in

- (void)updateScrollSize
{
float contentWidth = _scroller.frame.size.width * [_photoSource numberOfPhotosForPhotoGallery:self];
[_scroller setContentSize:CGSizeMake(contentWidth, _scroller.frame.size.height)];
}

there is no _photoSource after init with UINavigationBar

iOS6 Autorotation

Hi, im a real newbie, and don't know how to override plist and allow this to rotate, whilst all other views not rotating. Can anyone give me some help, i can't seem to get it working. Many thanks.

The caption height is incorrect

It looks like on some occasions the caption height will not be calculated properly. A simpler and safer way to calculate the size of the caption is to use [_caption sizeThatFits...]

in update caption I use this and all works fine:

           float captionWidth = _container.frame.size.width-kCaptionPadding*2;

            _caption.numberOfLines = 0;
            _caption.text = caption;
            CGSize adjustedSize = [_caption sizeThatFits:CGSizeMake(captionWidth, _container.frame.size.height)];

            NSInteger containerHeight = adjustedSize.height+kCaptionPadding*2;
            _captionContainer.frame = CGRectMake(0, -containerHeight, _container.frame.size.width, containerHeight );
            _caption.frame = CGRectMake(kCaptionPadding, kCaptionPadding, captionWidth, adjustedSize.height );

            // show caption bar
            _captionContainer.hidden = NO;

Start in thumbnail view

Is there a proper way to start in thumbnail view? Instead of the default view and then pressing show all.

How to implement AutoRotate?

Hi,

I see that the gallery's supported autorotating quite well. But I failed to implement this for the Root View Controller. Can you give me some help?

Thanks in advance!

Memory warnings & crashes

So, I loaded 180 images (about 500Kb each). And after I viewed about 15 app crashed (: Memory level is not normal (63%).).

I guess the memory handling is not done in a right way.

Using files from Documents folder?

Hello,

I've been trying tou use FGallery (nice lib, btw) with some jpegs from my local app Documents directory, but no cigar.

Photo source array includes all paths for images, but they just don't show up, when i'm pushing the gallery in the stack.

Any suggestions on how to make it work with local Documents folder?

Cheers!

Pawel

FGallery on a Tab

Hey there again

I have the FGallery on a tab somewhat working and I've created a repository for it at https://github.com/jmattos/GalleryOnATab. The only problem is that I dont know how to prevent the gallery from taking over the whole screen, I'd obviously like it to know that it lives on a tab and take up everything but the (49 pixels?) for the tab.

Take a look and let me know what you think!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.