Code Monkey home page Code Monkey logo

Comments (16)

bfeher avatar bfeher commented on June 28, 2024

Hi @ThePantsThief !
I'm open to this idea if it looks better, even though the Google Polymer library does not complete the fade in and growth before fading out. If you try their controls here you can see what I'm talking about. However they are much smoother than the current implementation...I'm working on that in my spare time.

I must have done something wrong when implementing your changes because the circles are not being removed and destroyed. They linger and cause a memory leak:
thepantstheif-fix

Would you mind posting your full code (image, text, or link to your repo) or email me ([email protected]) the file so I can do it properly? I'd like to see it in action :)

Thanks!

from bfpapertableviewcell.

NSExceptional avatar NSExceptional commented on June 28, 2024

Hey! Thanks for the speedy reply :)

Where are you calling (and then nil-ing out) the block I suggested you add? I had that problem at first, but it was because I forgot to actually call the block, haha. Here, take a look at my subclass. Specifically, animationDidStop:finished:, removeBackground, and removeCircle (the finally_ methods are a workaround for calling a super method from within a block; replace them with the original implementations).

I made a few changes to your .h and .m files to modify the behavior of the animations (some of which are unrelated to the issue I filed). By the way, it would be awesome if you could make some of those constants properties of the class so they can be modified without changing your code, haha.

One other thing: in growTapCircle:, it looks like the desired result (if no diameter is specified) is to draw the circle so that it covers the entire cell, right? Choosing the larger of the width and height of the cell won't actually cover the entire cell, even though it may look like it if the cell is a thin rectangle. To cover the entire cell, you have to adjust the diameter so that it reaches all corners of the cell from it's origin, using the Pythagorean theorem. If that is the intended result, take a look at growTapCircle: in the attached zip, I whipped up a fix. Here's a screenshot:

Tanner Bennett

On Jan 20, 2015, at 8:31 PM, Bence Feher [email protected] wrote:

Hi @ThePantsThief https://github.com/ThePantsThief !
I'm open to this idea if it looks better, even though the Google Polymer library does not complete the fade in and growth before fading out. If you try their controls here http://www.polymer-project.org/components/paper-elements/demo.html#paper-item you can see what I'm talking about. However they are much smoother than the current implementation...I'm working on that in my spare time.

I must have done something wrong when implementing your changes because the circles are not being removed and destroyed. They linger and cause a memory leak:
https://cloud.githubusercontent.com/assets/3466708/5830188/81aed1fc-a160-11e4-863f-80fd72937955.gif
Would you mind posting your full code (image, text, link to your repo) or email me ([email protected] mailto:[email protected]) the file so I can do it properly? I'd like to see it in action :)

Thanks!


Reply to this email directly or view it on GitHub #9 (comment).

from bfpapertableviewcell.

bfeher avatar bfeher commented on June 28, 2024

Thank you!
I might be doing github wrong, but I don't see any of your files or screenshots.

Yeah I really should and will change a lot of those constants to properties. When I first started the project I was thinking to myself that I wanted to mimic Google's Polymer controls as closely as possible, so I didn't have much customization in mind. Then it evolved.

About the circle diameter: again, when I first started it seemed that the Polymer controls which were in beta or alpha(?) at the time didn't have a clear set of defined rules. I noticed that every control's circle stopped just a few pixels short of the full frame. I had worked out some rough estimates by zooming in on frames that I recorded as an animated gif. But now it seems that Polymer has changed yet again and the circles are covering it all.

Anyways, I'd love to take a peek at your solutions and implement them into the library (writing your name into the source of course). You are right, I wasn't calling the block hahaha.

from bfpapertableviewcell.

NSExceptional avatar NSExceptional commented on June 28, 2024

Oh, this is a github email. That explains why nothing showed up. I just sent a few attachments from Mail.app.

Tanner Bennett

On Jan 20, 2015, at 11:20 PM, Bence Feher [email protected] wrote:

Thank you!
I might be doing github wrong, but I don't see any of your files or screenshots.

Yeah I really should and will change a lot of those constants to properties. When I first started the project I was thinking to myself that I wanted to mimic Google's Polymer controls as closely as possible, so I didn't have much customization in mind. Then it evolved.

About the circle diameter: again, when I first started it seemed that the Polymer controls which were in beta or alpha(?) at the time didn't have a clear set of defined rules. I noticed that every control's circle stopped just a few pixels short of the full frame. I had worked out some rough estimates by zooming in on frames that I recorded as an animated gif. But now it seems that Polymer has changed yet again and the circles are covering it all.

Anyways, I'd love to take a peek at your solutions and implement them into the library (writing your name into the source of course). You are right, I wasn't calling the block hahaha.


Reply to this email directly or view it on GitHub.

from bfpapertableviewcell.

NSExceptional avatar NSExceptional commented on June 28, 2024

I'm away from my computer, I'll resent them through github when I get a chance. Or I can forward the original message to another address if you'd prefer

Tanner Bennett

On Jan 20, 2015, at 11:20 PM, Bence Feher [email protected] wrote:

Thank you!
I might be doing github wrong, but I don't see any of your files or screenshots.

Yeah I really should and will change a lot of those constants to properties. When I first started the project I was thinking to myself that I wanted to mimic Google's Polymer controls as closely as possible, so I didn't have much customization in mind. Then it evolved.

About the circle diameter: again, when I first started it seemed that the Polymer controls which were in beta or alpha(?) at the time didn't have a clear set of defined rules. I noticed that every control's circle stopped just a few pixels short of the full frame. I had worked out some rough estimates by zooming in on frames that I recorded as an animated gif. But now it seems that Polymer has changed yet again and the circles are covering it all.

Anyways, I'd love to take a peek at your solutions and implement them into the library (writing your name into the source of course). You are right, I wasn't calling the block hahaha.


Reply to this email directly or view it on GitHub.

from bfpapertableviewcell.

bfeher avatar bfeher commented on June 28, 2024

If you could forward them [email protected] that would be nice. I can wait though. Whichever is easiest for you.

Thanks!

from bfpapertableviewcell.

bfeher avatar bfeher commented on June 28, 2024

Whew its been a while. Updated to version 2.1.16
Ok, I added the property BOOL alwaysCompleteFullAnimation which is YES by default. This runs your code with the blocks to always complete the animation. It can be disabled by setting the property to NO. It includes bursting the circle just incase your circle isn't taking up the full view.

I also added your code to calculate a tap-circle diameter which will cover the view perfectly. You can set the tapCircleDiameter = bfPaperTableViewCell_tapCircleDiameterFull to automatically get this new effect. Thanks a lot!

Along with those additions, the circle and background drawing and animations have been revamped with the same code as my other BFPaper components. The animations now pick up where they left off and run much smoother, using nothing but CALayers and CAShapeLayers.

Thanks a lot for your help. Take a look and let me know if you find any more bugs or have any more feature requests. By the way, I didn't make the tapGestureRecognizer public yet ;p You will have to do that yourself again sorry.

from bfpapertableviewcell.

bfeher avatar bfeher commented on June 28, 2024

Oh also you are written in the source code in two places, as well as in the git commit logs for the commit which added your features. Thanks!

from bfpapertableviewcell.

NSExceptional avatar NSExceptional commented on June 28, 2024

Thanks so much :D Nice work!

Tanner Bennett

On Jan 30, 2015, at 1:13 AM, Bence Feher [email protected] wrote:

Whew its been a while. Ok, I added the property BOOL alwaysCompleteFullAnimation which is YES by default. This runs your code with the blocks to always complete the animation. It can be disabled by setting the property to NO. It includes bursting the circle just incase your circle isn't taking up the full view.

I also added your code to calculate a tap-circle diameter which will cover the view perfectly. You can set the tapCircleDiameter = bfPaperTableViewCell_tapCircleDiameterFull to automatically get this new effect. Thanks a lot!

Along with those additions, the circle and background drawing and animations have been revamped with the same code as my other BFPaper components. The animations now pick up where they left off and run much smoother, using nothing but CALayers and CAShapeLayers.

Thanks a lot for your help. Take a look and let me know if you find any more bugs or have any more feature requests. By the way, I didn't make the tapGestureRecognizer public yet ;p You will have to do that yourself again sorry.


Reply to this email directly or view it on GitHub.

from bfpapertableviewcell.

NSExceptional avatar NSExceptional commented on June 28, 2024

Is there a way to prevent the cells from animating when you're scrolling? I've been fiddling with this for a few hours and I can't find a way to make it not animate if the table is scrolling when your finger touches down.

Tanner Bennett

On Jan 30, 2015, at 7:35 AM, Tanner Bennett [email protected] wrote:

Thanks so much :D Nice work!

Tanner Bennett

On Jan 30, 2015, at 1:13 AM, Bence Feher [email protected] wrote:

Whew its been a while. Ok, I added the property BOOL alwaysCompleteFullAnimation which is YES by default. This runs your code with the blocks to always complete the animation. It can be disabled by setting the property to NO. It includes bursting the circle just incase your circle isn't taking up the full view.

I also added your code to calculate a tap-circle diameter which will cover the view perfectly. You can set the tapCircleDiameter = bfPaperTableViewCell_tapCircleDiameterFull to automatically get this new effect. Thanks a lot!

Along with those additions, the circle and background drawing and animations have been revamped with the same code as my other BFPaper components. The animations now pick up where they left off and run much smoother, using nothing but CALayers and CAShapeLayers.

Thanks a lot for your help. Take a look and let me know if you find any more bugs or have any more feature requests. By the way, I didn't make the tapGestureRecognizer public yet ;p You will have to do that yourself again sorry.


Reply to this email directly or view it on GitHub.

from bfpapertableviewcell.

bfeher avatar bfeher commented on June 28, 2024

Hmm I'm not sure. I know that if you move the table then
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
Gets called. You could maybe kill all animations there?

Sorry ill take a better look on Monday.

from bfpapertableviewcell.

NSExceptional avatar NSExceptional commented on June 28, 2024

I got off my computer after sending that but just before I did, I had an idea of maybe delaying the animation until the touches weren't canceled, like how selection works when you have tableView.delaysContentTouches enabled.

Tanner Bennett

On Feb 15, 2015, at 1:33 AM, Bence Feher [email protected] wrote:

Hmm I'm not sure. I know that if you move the table then

  • (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
    Gets called. You could maybe kill all animations there?

Sorry ill take a better look on Monday.


Reply to this email directly or view it on GitHub.

from bfpapertableviewcell.

NSExceptional avatar NSExceptional commented on June 28, 2024

A few other things I noticed, while I'm here!

  1. beganHighlight and beganSelection are unused (private) properties
  2. Possible bug I encountered while testing some modifications to the class to delay the animation:

tapCircle will be nil if self.rippleAnimationQueue is empty, so rearranging the code to this should make sure you never try to add a nil object to self.deathRowForCircleLayers:

Tanner Bennett

On Feb 15, 2015, at 1:33 AM, Bence Feher [email protected] wrote:

Hmm I'm not sure. I know that if you move the table then

  • (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
    Gets called. You could maybe kill all animations there?

Sorry ill take a better look on Monday.


Reply to this email directly or view it on GitHub #9 (comment).

from bfpapertableviewcell.

bfeher avatar bfeher commented on June 28, 2024

Thanks for the heads up! I'll fix those next.

As for the tap circles not appearing when you just scroll through:
Have you made any progress? All I can think of would be to just use a LongPressGestureRecognizer instead to capture the touches. This way we can delay it. The delay can even be a public property with a default value.

from bfpapertableviewcell.

bfeher avatar bfeher commented on June 28, 2024

I pushed version 2.2.1 which removed some vestigial code as well as added a new public property: CGFloat tapDelay. The default value is 0.1f and this should prevent cells from animating while just scrolling through.

Thanks again and as always, I appreciate any help or bugs you find :)

from bfpapertableviewcell.

NSExceptional avatar NSExceptional commented on June 28, 2024

Huh, cool. Thanks again yourself! :) Sorry I never got back to you, it's exam week

Tanner Bennett

On Feb 18, 2015, at 9:58 PM, Bence Feher [email protected] wrote:

I pushed version 2.2.1 which removed some vestigial code as well as added a new public property: CGFloat tapDelay. The default value is 0.1f and this should prevent cells from animating while just scrolling through.

Thanks again and as always, I appreciate any help or bugs you find :)


Reply to this email directly or view it on GitHub.

from bfpapertableviewcell.

Related Issues (12)

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.