How to create a image and content slider in Flex? - image

I would like to create a image and content slider in Flex. There are many jquery plugings available
(cfr. Flexslider http://flex.madebymufffin.com/) but i can't find an alternative for Flex.
Can anyone explain me how i can implement this?
Thanks!

Ah it just so happens I already made this... a long time ago so it's Flex 3 but I believe it works as is in Flex 4, I've integrated this with other Flex 4 projects and have since made some performance improvements (mainly opting for Group over Canvas and did some deferred instantation since we decided to use it as the backbone for a pretty complex site).
http://www.shaunhusain.com/ImageSlider/
http://www.shaunhusain.com/ImageSlider/srcview/index.html
Should allow you to drag and snaps to the tile with it's top left corner nearest the top left of the container itself, also can use keyboard navigation left right up down so long as it has focus, and I made those buttons on top that can be used to trigger the movements. Basically I tried to overload that example with all possible options so I can just copy it and strip off what I don't want. It also turns out this translates pretty well to touch screens even though I didn't own one when I wrote it, the snap to nearest thing works alright on an android (even with that version which is totally not optimized for mobile). Oh yeah and you can use - and + on the keyboard or the scroll wheel to zoom, doubt if that's really ever necessary but it seemed like a cool idea at the time.

Related

Adaptive Layout in Xcode 7.0.1

I have an app that displays properly in portrait view but truncates in landscape view:
From the research I have done it looks like I need to understand Size Classes and Adaptive Layout. However, I am only concerned with layout on iPhone 6, not across different devices (eg iPad).
Before jumping into Adaptive Layout and Size Classes, which seems quite a complex topic, I just wanted to ask if there is a simple way to make this app display properly in both portrait and landscape for iPhone 6.
Thanks in advance!
Yes, you can do it without size classes, but it requires a reasonable modification to your UI.
If you think about it then having a picker always visible makes no sense for you. Looking at your image I am puzzled as to which date is currently being adjusted.
What you want to do instead, is to make your picker appear after user clicks on one of the dates. You can make it slide up from the bottom. In addition, you can add a label above it which will clearly indicate which date the user is currently modifying. That label can be placed in the toolbar to make it easy to add "Done" and "Cancel" buttons to the left and to the right.
In my view it would make much more sense and would also solve your problem. The rest of the UI can be put in the scroll view if you don't have enough space on old devices (e.g. 3.5 inch iPhones)

SFML RenderWindow Views and GUI

I dont know how many people have use SFML, but I basically want to draw my GUI and am unsure of how to do so.
To clarify I know how to draw a GUI but I don't know the 'correct' way to do so.
Currently I am drawing a GUI in the same RenderWindow that is used to draw the Game.
I have started to introduce Views into my game, I have a Game View and a GUI View, which take up 75% and 25% of the screens height (respectively).
Now the question is:
Should I render the GUI in the same RenderWindow but in a portion of the 'map' the player is unable to reach and have the GUI View locked on that location displaying the GUI.
Another idea I have thought of (unsure if it is plausible) is to have a second RenderTarget which renders the GUI and is dispalyed in the GUI View.
If there is a method I have not discovered or one that is recommend I am happy to hear about it, I searched but all I have found is the SFML Documentation in which I couldn't find my answer.
Your question is slightly confusing as I do not know whether you are having a design issue, or a technical issue of implementing the UI. In terms of the design issue:
I have started to introduce Views into my game, I have a Game View and a GUI View, which take up 75% and 25% of the screens height (respectively).
I haven't encountered where using multiple views will be needed for an UI. Take this example:
The UI consists of all the images in the black area. The positions' of those images are always updated relative to the position of the game view that follows the player around, nothing more. A second view isn't needed because the components (images) of the UI follow the view around, just as the view follows the player around.
Now, if you are having a technical issue, then please elaborate on the exact issue that has some accompanying code and I will do everything I can to help out.

WP7 how to accelerate animation

I'm using Storyboard with DoubleAnimation to translate Y of a StackPanel from top to bottom.
It works fine. But what I want is to accelerate it when it is about to reach bottom (like the status panel of Android).
I read this tutorial here, but it seems to apply to Silverlight only.
How to do that ?
What your looking for is an easing class.
Easing classes change speed with time. So an animation will start out slow and go fast or the opposite etc.etc.
Here's the documentation on ExponentionalEasing. Its pretty straightforward
http://msdn.microsoft.com/en-us/library/system.windows.media.animation.exponentialease(v=vs.95).aspx
However if you want more fine tuning you'll have to use KeyFrames and set the time difference between them

CALayer flickering when adding a foreground layer to IKImageBrowserView items with garbage collection on

I'm trying to implement a technique similar to the one in the ImageBrowserViewAppearance sample code from Apple (located here: http://developer.apple.com/library/mac/#samplecode/ImageBrowserViewAppearance/Introduction/Intro.html ), where CALayers are generated on top of the items in the IKImageBrowserView to customize the appearances of the objects in the image browser.
However, I'm getting a weird problem when I turn on garbage collection, and I can reproduce it in the Apple sample code. Simply turn on Garbage Collection in the target, and build and launch the ImageBrowserAppearance sample app. Then, add some photos to the image browser using the "Add Photos..." button.
Now, click on an empty portion of the IKImageBrowserView, and click and drag to start selecting multiple items in the browser view. As you drag the selection box around, you should notice that sometimes the pin and gloss overlay for some of the items flicker and briefly appear in the bottom-left corner of the IKImageBrowserView. All of the CALayers seem to do this occasionally, I've seen the white surrounding slide area flicker down into the bottom-left corner as well.
When I mimic the technique in my own code, I (not surprisingly) also can reproduce this badge flickering. However, this problem disappears when garbage collection is off.
Anybody have a clue what could be going wrong here? I'd like to use garbage collection in my app in conjunction with this technique, but the flickering is kind of annoying.
I bookmarked this a while back but Apple's changed the URL and the text. Fortunately I quoted it when I bookmarked it:
The Core Graphics APIs (Quartz 2D) see an approximately 25% reduction in drawing performance for applications compiled to use garbage collection.
That "25% reduction in drawing performance" text has been rewritten into a "slight overhead in code execution" and that was for 10.5. Perhaps Apple fixed it for 10.6. And you're talking Core Animation, not Core Graphics.
Still, Core Animation eventually has to talk to Core Graphics, and perhaps that performance issue hasn't gone away, and you're being bitten by it.
I fooled around with this a bit and can confirm I get the same behavior running the project with GC turned on. In fact, if you're patient enough and slowly change the selection one image at a time using the arrow keys, eventually it'll trigger the behavior and you can see the layers from one image in the view are displayed in the lower left corner instead of on top of the image. I haven't been able to find any sort of pattern as to when it happens, or any relation between which image is selected and which image has its layers missing. I'm assuming that for whatever reason, those layers are getting their frame origin set to {0, 0}, but heck if I know why.

Creating a quick look style zooming effect

I would like to create an effect than an image zooms up from a thumbnail size to full screen.
I am not sure what's the right steps to achieve this. Should I create a transparent full screen window and animate a layer on top of it?
Take a look at this CoreGraphics example. Specifically, take a look at the "grow" and "shrink" animations. That's how Apple does it, and that's what you'll want to do too.
Your solution of a transparent window with a CALayer inside is probably the best supported way to do it.
One thing that seems like it should be a good solution (at least it's the first thing I thought of when I wanted to do this) but isn't is NSView's enterFullScreenMode:withOptions:. If memory serves, it was originally meant to do what you're talking about here, but the animation was taken out and it generally doesn't work that well now.

Resources