jcoleman / JCNotificationBannerPresenter

A library for generic presentation of "banners" (e.g. to present a push notification) from anywhere inside an iOS app.
MIT License
198 stars 46 forks source link

Feature transition3d #4

Closed jcoleman closed 11 years ago

jcoleman commented 11 years ago

This is essentially pull request #3 -- I had to pull it into a new branch on my project to make changes without merging into master.

Original pull request description:

@jcoleman @abram Hello guys!

Thanks for your work on notification banner. I've changed it's behavior to something like banner notification built in iOS. Video: http://www.youtube.com/watch?v=XDoUKR8co80

Can we have this functionality merged? I've based by changes on @abram's customization.

So this is tested in all orientations on iPad 2 (iOS 6) & iPod Touch (iOS 6)

What do you think? I like old implementation (Android-like Toast) too, so maybe we should add argument that selects mode?

Also, because it's not possible (as far as i know) to make a screenshot of statusBar, new banner mode should be used without coverStatusBar.

Anyway, i would like to hear back from you and polish this code, so it can be merged. Cheers!

jcoleman commented 11 years ago

All right, I've done the initial cleanup work to bring the code into convention with the existing project.

I have a few other thoughts/questions, but I'll have to finish those up tomorrow.

I'm liking how this is shaping up though.

jcoleman commented 11 years ago

@psineur Shouldn't the new style use different drawing for the notification view? I mean, I'm assuming the goal is to mimic the iOS native notification. So then it would need to have white rectangle with all four corners rounded.

Also, if we're going to the use the "rotation animation", then shouldn't we remove the slide down animation?

psineur commented 11 years ago

Yes, in the demo app ,there's a custom slider now, when it's on - it gives you that white view.

How about to introduce new parameter, i.e.

typedef enum
{
     kJCNotificationBannerStyleAndroidToast,
     kJCNotificationBannerStyleIOSNative
} JCNotificationBannerStyle
jcoleman commented 11 years ago

Interesting. For some reason when I turn on that slider, I get basically the white background (though it doesn't have rounded corners) but the black slide down style is visible on top of that.

psineur commented 11 years ago

Gonna check this now. You're using 2 space indents?

psineur commented 11 years ago

Just don't remove -drawRect: https://github.com/psineur/JCNotificationBannerPresenter/commit/5db7db72b3d18aaf5af8dad138e4834e58009290

psineur commented 11 years ago

Additional commits: https://github.com/jcoleman/JCNotificationBannerPresenter/pull/5 And now you can push to my fork. :ship: :it:

jcoleman commented 11 years ago

All right, I really like this.

The only real thing I changed other than code cleanup was to reorder the style parameter in commit 080662f8884a14060251b003db1eec3b881ed2da so that the block parameter remains the final argument for code cleanliness sake.

Thanks for the hard work on this!

psineur commented 11 years ago

Cool, I like block as last argument more. Thanks!

jcoleman commented 11 years ago

Incidentally, I think you'll want to make sure you're using the latest master. I move some files into the correct folder structure (the style class you added was in the Demo folder rather than in the Library folder which was messing up CocoaPods.)