Code Monkey home page Code Monkey logo

asmediafocusmanager's People

Contributors

autresphere avatar bgfriend0 avatar bryant1410 avatar carlosefonseca avatar chavira avatar cijianzy avatar crsantos avatar diogeneshamilton avatar dogo avatar klundberg avatar kmonaghan avatar macbuildserver avatar oseparovic avatar robertodias180 avatar shukob avatar waltflanagan avatar weekwood 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

asmediafocusmanager's Issues

Async images

First of all thank you for this excellent code.
in my scenario i have the situation that the small images are loaded in the tableview.
when i click the small images everything works as it should :)
this code can be extended to asynchronously download an image while showing its lower res one and then replacing it when the download completes...

what do you say? is this something that can be achieved easily using your library?
thanks

How to customise buttons

I implement ASMediaFocusManager in my project but, I don't know how to customise the button, I need a delete and a flash button plus the done button.

is there a way to do this?

Cant play videos

Hi,

I implement MediaFocus and Player and I get this error

`*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UICustomObject 0x1742043d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key currentTimeLabel.'``

ASMediaFocusManager broken with new CocoaPods Project

I am having a hard time getting ASMediaFocusManager to work with Cocoapods.

  1. Create New XCode Project
  2. Add 'pod "ASMediaFocusManager"' to Podfile
  3. Install Pods

This is the error:
Unable to run command 'StripNIB ASMediaFocusController.nib' - this target might include its own product.

Specs:
Xcode 5.0.2 (5A3005)
OSX 10.9 (13A603)
CocoaPods 0.28.0

error

After Zooming in, image loaded from remote URL is duplicated

I found that after zooming in, image loaded from remote URL is duplicated in the view.

You see this behavior in the attached screenshot:-
img_21fa8995a5b3-1

One way of fixing that was to remove line 275 from ASMediaFocusManager.m

viewController.mainImageView.hidden = NO;

enforce UIImageView type for installOnView, or extend functionality to any UIView

The install method is called installOnView, and it allows you install to a view that is not a UIImageView. This is misleading, since things don't actually work unless you install to a UIImageView. Perhaps the method should be called installOnImageView and should throw an error if the type is wrong? Or better yet, enable this to work with any UIView. Cool library, thank you.

Use this in swift??

Hello,
i'm new in iOS development, and i'd like to use this pod in one project, do you have any example or quick guide how to use it with swift??
Thanks.

Video AVPlayerLayer not filling PlayerView

I have a video with 360x480 and am playing it on an iPhone4S, but I can see a bit of the underlying imageview image (mainImageView from ASMediaFocusController). Through debug I removed the image and painted the imageview's background red so you can see better what is happening (notice the vertical red near the edges):

iphone4s_screencap

The PlayerView has the correct frame, but it's layer isn't filling it, we need to set videoGravity = AVLayerVideoGravityResizeAspectFillfor it to fill completely the PlayerView. Something like:

- (void)showPlayerWithURL:(NSURL *)url
{
    self.playerView = [[PlayerView alloc] initWithFrame:self.mainImageView.bounds];
    ((AVPlayerLayer *)(self.playerView.layer)).videoGravity = AVLayerVideoGravityResizeAspectFill;
   ...

Doing that the video fills the entire PlayerView as expected.

(question) support rotate to landscape to show image w/o tapping the imageview on screen.

I am not sure (yet) how to approach this with ASMediaFocusManager (if i stumbled on it i'll post my code).

I show am imageView on screen (much like the example) and tapping that image works great. You can rotate and it rotates like it should - much like the example. However, I'd like to not touch that image. Instead rotate the device and have it go straight into (animated) the rotated view of ASMediaFocusManager (just like if you were to have touched the imageView originally). Any feedback on how to approach that? Is it possible to do with the current version?

Thanks !!

Show the done button on focus

Currently implementation hides the done button as user zooms in the image. Is there any way to still show the button instead of hiding it?

Had to copy XIB resource into my project

There seems to be an issue where CocoaPods (or something else) isn't installing the needed XIB resource into the final binary. It doesn't crash the app, but nothing loads. The screen is only darkened, no images are displayed. This was from a fresh install from CocoaPods.

Image not changing orientation when the device orientation changed

Hi,
thanks for this awesome component. It makes a lot of stuff easier. But there is still some issues:

This is only happening when I have UIViewController inside NavigationController and the supportedInterfaceOrientations is set to UIInterfaceOrientationMaskPortrait

I am testing on iOS 8.3 right now

- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait;
}

The parentViewController is set to self.navigationController

Now when I enlarge the image and change the orientation nothing happens. Although if I would set parentViewController = self it would work.

I dug into code and found out why it is not working:

in ASMediaFocusController in viewDidAppear
the controller subscribes to receive Orientation change notification. When is the parentViewController a navigationController it is simply not being called. I am not sure why it is when in the other case it works perfectly fine.

FullScreen not covering NavigationBar and TabBar

I'm probably doing something wrong, but I did almost exactly like the example code - but still the fullscreen doesn't hide the navigation bar on top and the UITabBar on bottom. Is it because the original view controller on the storyboard has "Under Top Bars" and "Under Bottom Bars"? If so, what can be done?

Thanks
(awesome project...)

weird behaviour when image view mode is scale to fill.

in startfocusingview:

if(imageView.contentMode == UIViewContentModeScaleAspectFill)
    {
        CGSize size;

        size = [self sizeThatFitsInSize:finalImageFrame.size initialSize:imageView.image.size];
        finalImageFrame.size = size;
        finalImageFrame.origin.x = (focusViewController.view.bounds.size.width - size.width)/2;
        finalImageFrame.origin.y = (focusViewController.view.bounds.size.height - size.height)/2;
    }

you also need to check if content mode is scale to fill. worked for me.

Application crashes after initializing ASMediaFocusBasicToolbarController

I installed ASMediaFocusManager using Cocoapods and whenever I try to open an image, the app crashes (throwing memory exception) at ASMediaFocusBasicToolbarController trying to access it's View.
When I tried dragging and dropping the files instead of Cocoapods, it worked just fine. So I assume there's a problem loading ASMediaFocusBasicToolbar.xib file using Cocoapods.

Delete from view?

How to this correctly? I have app with scroll view (reusable views inside). Some of images should be zoomable, some not. How to delete zoom options from view?

"Command /bin/sh failed with exit code 1" on Xcode 7.1 (7B91b)

I recently had this problem, on Xcode 7.1 and simulators 8.4 and 9.1.

The error disappear once I reset the content of the simulator, but came back after a few runs.

Any help is appreciated.

/Pods/ASMediaFocusManager/ASMediaFocusManager/ASMediaFocusController.xib: error: Internal error. Please file a bug at bugreport.apple.com and attach "/var/folders/36/ljppcdpd3xv3qm4kf37rwsqm0000gn/T/IB-agent-diagnostics_2015-11-05_12-20-49_259000 p.m.".
Recovery Suggestion: Please check Console.app for crash reports for "Interface Builder Cocoa Touch Tool" for further information.
Underlying Errors:
Description: Encountered an error communicating with Interface Builder Cocoa Touch Tool.
Failure Reason: Interface Builder Cocoa Touch Tool (15899) failed to launch
Recovery Suggestion: Please check Console.app for crash reports for "Interface Builder Cocoa Touch Tool" for further information.
Underlying Errors:
Description: Failed to launch Interface Builder Cocoa Touch Tool via CoreSimulator spawn
Underlying Errors:
Description: Failed to handshake with platform tool
Failure Reason: Failed to open connection over FIFOs with platform tool
Underlying Errors:
Description:
Recovery Suggestion: Try restarting your computer
Underlying Errors:
Description: Failed to open FIFOs for handshaking with platform tool
Failure Reason: Timed out waiting for FIFOs to open. Most likely Interface Builder Cocoa Touch Tool crashed before it could open the other end.

Load a UIImage?

Is it possible to load just a UIImage object rather than having to reference an image from URL?

Full screen player with swipe

Hi Philippe,

This code is awesome. I love it!
It's by far the photo best photo player out there.
And it would be really cool to have a gallery with full screen swipe to really make it shine.
Any news when it's out ?

Many thanks
Alex

Image not zoomable due to async download of the large image

Hi
I found an issue.

startFocusingView calls focusViewControllerForView
in the above focusViewControllerForView, the large image is loaded asynchronously as follow:
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ [self loadImageFromURL:url onImageView:viewController.mainImageView]; viewController.mainImageView.hidden = NO; });
While the image is downloading, the animation starts, at the end of the animation, the following function is called:
[self.focusViewController focusDidEndWithZoomEnabled:self.zoomEnabled];

This function calls installZoomView which calls displayImage which calls configureForImageSize which calls setMaxMinZoomScalesForCurrentBounds

BUT

If the large image (async loading) is still not loaded from the server, zooming is not possible since setMaxMinZoomScalesForCurrentBounds results in maximumZoomScale = minimumZoomScale = 1.0 (calculation done on low resolution image, since the large image is still loading)

Tests: Unit Test

I'm ready for any suggestion on how to add tests to the project.

Better support for remote images

I am using a UICollectionView to show some thumbnail image from an API endpoint. When tapping on one, I use ASMediaFocusManager to show the full size image. However, it doesn't seem like there is very good remove image loading support, as it kind of loads, but it is blurry.

It seems like a much better solution would be to show a progress indicator on top of the tapped view. Then when the remove media is loaded, THEN show it in the focus manager.

endFocusing

As is mentioned in the main page:

"If you need to focus or defocus a view programmatically, you can call startFocusingView ()as long as the view is focusable) or endFocusing."

I cannot find the 'endFocusing' method or something similar to close the focusing image.

Do I miss something?

I can't make it work with Swift

Hello team,

First of all, thank you for incredible works. I'm trying to apply your lib to my project but I'm getting stuck and cannot make this work. I'm using Swift and Cocoapods.

Enclosed is the project. I would be very appriciate if you can help me take a look at my code and let me know what I was missing.

Thanks & Best Regards
Khanh pham
Test.zip

No keyboard handling can lead to cases where keyboard overlays focusViewController

I'm not sure if there's currently a way to work around this but if you ever trigger a focus gesture on an image while the keyboard is up, the keyboard will remain active and will overlap the focusViewController.

A quick fix I did was simply to add the following:

- (void)handleFocusGesture:(UIGestureRecognizer *)gesture
{
    // ...
    [parentViewController.view endEditing:YES];
    // ...
}

I'm not sure this is the best contribution to the lib though as this might lead to unexpected behaviour on the user's end. Perhaps a BOOL property to hide the keyboard when focusing might better? Thoughts?

jumpy animation with UIImageView (UIViewContentModeScaleAspectFill, clipsToBounds)

First of all, thanks for an awesome project ๐Ÿ’›! I did not find a mailing list or support forum so I'm opening an issue.

I'm using a ASMediaFocusManager on an UIImageView, which has:

imageView.clipsToBounds = YES;
imageView.contentMode = UIViewContentModeScaleAspectFill;

This results in a jumpy animation when focusing in / out of the image. That is because the animation starts with a scaledToFit image. I could probably grab another starting point from the UIImageView in mediaFocusManager:imageForView but I can't change the focus out animation.

Is there something I can do to make the animation start / stop from the actual displayed image?

Thank you for your time.

~0.5-1 second delay before `handleDefocusGesture:` begins

I've noticed that there is a short delay between the doing a single tap gesture on the full screen to dismiss it, and the actual animation occuring. Is there any way that this animation delay can be removed or reduced?

Here is my ASMediaFocusManager initialization code:

self.mediaFocusManager = [[ASMediaFocusManager alloc] init];
self.mediaFocusManager.delegate = self;
self.mediaFocusManager.isDefocusingWithTap = TRUE;
self.mediaFocusManager.animationDuration = 0.3;
self.mediaFocusManager.elasticAnimation = NO;
self.mediaFocusManager.backgroundColor = [UIColor blackColor];

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.