Skip navigation
Currently Being Moderated

iOS and Android Native Scroll in Adobe AIR

Sep 1, 2011 12:07 PM

I think it would be a great idea to implement the smooth scroll present in native iOS and Android applications for use in Adobe AIR projects.


Currently, the only way to obtain smooth scrolling lists with images is using StageWebView to show the image list in HTML format, and then awkwardly implement some JavaScript / AS3 communication functionality so the list in the StageWebView is interactive and can communicate with the main program. This is excessively complicated and very error prone (I've found some inexplicable JavaScript errors that only happen in the iPad, not in Android, and not in the PC!).

 

It would be way better to be able to skip all the StageWebView process altogether and being able to use a simple AS3 API to put any sprite/movieclip into a scrollable canvas which can be moved using the iOS native scroll.

 

Using Flash animation to simulate the scroll in a list with images is too slow in the iPad and gives a bad user experience. iPad users expect the native iPad scroll, not some poor jerky simulation. A native scroll is the only way to go.

 

And even though I talk about the iPad, this should be applicable to the native Android scroll, too.

 

Scrolling is a VERY BASIC action in a tablet, so this should be implemented as soon as possible.

 

Actually, I'm amazed we're already at AIR 3.0 beta, and still after all this time nobody thought of this. All sorts of fancy stuff is being added to AIR (hardware accelerated video, webcam and microphone access, etc...) but still something as basic and important as a smooth scroll, which every tablet user expects, is still not possible in Adobe AIR. We either have to implement some slow Flash animated scroll, or use the extremely complicated StageWebView with JavaScript/AS3 communication approach (I'm using a third party library called StageWebViewBridge for the JS/AS3 interoperations, which is great, but still, it's a far from ideal solution, since it's pretty fiddly and the JavaScript code doesn't always work properly in iOS).

 
Replies 1 2 Previous Next
  • Chris Campbell
    9,456 posts
    May 4, 2010
    Currently Being Moderated
    Sep 1, 2011 4:17 PM   in reply to OMA2k

    Thanks for the suggestion, I agree that this sounds like a nice thing to have.  Would you mind adding this to bugbase.adobe.com and posting back with the URL?  I'd like to encourage others interested to add their votes and comments.

     

    Thanks,

    Chris

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 3, 2011 9:55 PM   in reply to OMA2k

    I too think a Native Scroll is a needed feature.  my experience ...

     

    • I am using Air 2.6, CS5.5  (tried AIR 2.7, however I lost some key features in a particular IOS app that I made and reverted back to 2.6)
    • experimented with a variety of scroll techniques, even the TLF textfield, and found the more smooth, the more cumbersome it was, however none were smooth enough
    • came across your notes on StageWebViewBridge and considered that until I noticed
      • on a new Galaxy Tab 10.1 Android Honeycomb, StageWebView actually jerks. I notice this on my apps and on other people's MarketPlace apps
      • side by side with an IPAD(1), the IPAD/Air 2.6 shows off what the smoothness should be like, the StageWebView in IPAD is flawless and even does the bounce at the top of the page and at the bottom of the page, like both IOS and Android default browsers do.
      • implied is that the default browser in the Galaxy/Android is perfectly smooth.
      • unsure if I'm missing something on this, I tried auto, CPU, GPU, and making StageWebView full screen on my simple app with no difference but like I said I am noticing this fairly modest jerk in another developers apps
      • I hadn't noticed this earlier on a small Dell Streak device because it's so much smaller a screen, but when I look close now, the jerk is there as well
    • as a result I would wonder if the StageWebViewBridge would be equally problematic for me...  bottom line is that I've cancelled smooth scrolling for now, rationalizing also that I find it a bit neurotic (fun but you actually have to work harder at knowing what you've flipped past or towards) and there is already enough of it on the devices and Flash does some cool stuff that I can live without it until it becomes easy to implement.

     

    my2cents!

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 6, 2011 5:34 PM   in reply to OMA2k
    1. did the vote, reiterating some of what you said as you were pretty succinct in your words.
    2. What features are missing in AIR 2.7 that were present in 2.6?
      • this was a while back, regards this forum post where links were behaving erratically on the IPAD. Both the author of the post and myself did our own workarounds. In the time I had, I was not able to make it work in 2.7, but 2.6 was just fine so I stuck with it
    3. It's worth to upgrade to 2.7.1 because of the much improved performance in CPU mode compared to 2.6
      • every time I google the 2.7 features it says improved performance in IOS  only, no mention of Android. My single IOS app works fine at 2.6, just  the StageWebView is not perfect in Android. I use CS5.5 where 2.7 is not  an option in the Player List in order for me to easily jump back and  forth between versions.. i would think that it will be easier to do this, jumping  between versions in CS6..
    4. scroll is perfect    it should behave the same as the original browser
      • hopefully it's something simple at my end.  I would be  really curious though if your Android SWV web page bounces at the top and the bottom showing a significant dark space, per the default browser, since this is a hard-to-miss noticibly  objective difference that I see (and is fine on IOS SWV web page)   do note that I thought my SWV Android scroll was perfect until I did it side by side with the SWV IPAD, and I'm certain most people would never notice unless they critiqued it as well.

     

    again, hopefully something simple here or maybe the 2.7.1 will do the trick.  thanks, your consideration is appreciated

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 7, 2011 12:35 PM   in reply to OMA2k

    I've been doing more comparisons and checking other peoples' scrolls on IOS and Android and I am definitely leaning towards using SWV as a decent workaround to not having a native scroll, and a definite need for a native scroll. At least with IOS IPAD everyone has the same experience but even there I see very, very poor non-SWV (AS3) scrolls, while the SWV scroll on IPAD is forever good.  I'm unsure why you don't see that large dark IPAD type bounce on your Android default browser, but you're right in that all I get on the Android SWV is that blue gradient.  Then again, when I jump over to my Dell Streak, the Android default browser has NO apparent bounce so I kinda throw up my hands on what's going on.  I did notice that we must turn on the hardware acceleration in our Android app [android:hardwareAccelerated="true"] to see Flash in SWV [Honeycomb only - see AS3 reference for SWV] so I tried that thinking that might do the trick to make the browser performances line up, but the performance was the same (though Flash did get enabled). I have to wonder though is there something else, maybe another simple variable, that has to be turned on to make them line up.

     

    Anyways, I've been comparing very busy web pages where the performance lag is obvious... As I do my own simple web page, I'm thinking how it really does look/feel pretty good, especially as I customize the look of my list, and should be fine for now so I think we are pretty much on the same page (thx for 2.7.1 instructions, probably did similar in past but did not document)

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 7, 2011 3:59 PM   in reply to OMA2k

    wow, that video suggests I may be out of the game in CS5.5 except for my workaround,... i'm guessing that a Spark List Control in Flex can smooth scroll although quick googling finds Blackberry developers having a bit of problem with it. being unfamiliar with Flex doesn't help.

     

    definitely an IOS style 1"+ dark grey bounce on my TAB 10.1 default browser

     

    can someone at Adobe point to a similarly perfect app in the Android marketplace (or post an apk file for us to install and test) and the methodology?

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 7, 2011 8:03 AM   in reply to OMA2k

    "The only thing I noticed is the Menu button in Android Honeycomb, which is missing in 2.6 (as far as I can tell)"

     

    This is still an issue in AIR SDK3....unfortunately.  Now I need to add in a menu button for tablet devices, so disappointed this was not caught in QA.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 7, 2011 9:52 AM   in reply to OMA2k

    It is driving me nuts that something so crucial for Android is missing.  If they even tested the few templates they offer in Flash for Android on 2.X and 3.X, they would have discovered it.  One example is actually called "Options Menu".

     

    Wonder if there is a native extension work around for using the real android menu. 

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 7, 2011 10:53 AM   in reply to mola2alex

    I added a swf and fla file for them to ADT compile in different versions.  Been posting everywhere I can.  2.7 didn't have really any features I cared about but 3.0 has a few. 

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 13, 2011 5:48 AM   in reply to mola2alex

    OMA2K: Have you tried:

     

    http://thanksmister.com/2010/10/14/android-as3-scrolling-list/

     

    or for larger data sets:

     

    https://github.com/thanksmister/as3recyclelist

     

    I have got both working and they are pretty well done.  The only issues I am having is updating the list as my array changes.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 5, 2011 2:06 AM   in reply to OMA2k

    This is getting really annoying.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 5, 2011 6:33 AM   in reply to Kipup

    @Kipup - are you referring to the menu button (thread seems to cover a few things).  I did get an answer on that from Adobe and if you want the menu key, you need to target earlier versions of Android in your manifest file.  If you target Android 3.0 or higher API's, there is no menu key anymore so it won't display.   

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 5, 2011 8:54 AM   in reply to mola2alex

    Thanks Mola2Alex. It's the entire thread itself. I've been looking at so many scrollers and can't get anything reasonable. The Flex scroller Renaun showed looks too smooth to be true! Like a special effect as it were. All I need is a scroller! I'm 100% flash-based so no flex at all. What can I do?

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 5, 2011 9:08 AM   in reply to Kipup

    From a list perspective, the one I used a couple posts above worked well for me and I used it in flash pro.  It is pretty smooth on my apps.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 5, 2011 10:40 AM   in reply to mola2alex

    You're amazing Mola2Alex! Please which would you recommend for a list with photos? The text in the scrolling list is device fonts.

    Thanks in advance.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 6, 2011 7:28 AM   in reply to Kipup

    You could try either of them.  You would need to change the cellrenderer to one that contained images but no reason why it shouldn't work.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 8, 2011 2:53 AM   in reply to OMA2k

    OMA2k wrote:

     

    Both setups are ridiculously complex to implement. AIR must be just about the only mobile framework that requires such complex stuff for a really basic action such as scrolling, which in any other framework it's just taken for granted without having to implement anything. There should be an API to implement iOS and Android native scrolls with any DisplayObject. I hope they finally implement it, since this must be the feature request with the most votes:

     

    I love how you put it: "Scrolling is taken for granted on other frameworks". Go figure, Adobe! If you can't scroll then, what else can you do on a mobile app?

     
    |
    Mark as:
  • Chris Campbell
    9,456 posts
    May 4, 2010
    Currently Being Moderated
    Dec 8, 2011 12:58 PM   in reply to Kipup

    I hear you guys on this one.  I'll make sure to bring this up again at our next team meeting.

     

    Chris

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 8, 2011 1:36 PM   in reply to Chris Campbell

    Chris, I couldn't be happier to hear this. Kindly tell them it's priority.

    Thanks for listening.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 13, 2011 6:14 PM   in reply to OMA2k

    i added my vote to the bugbase - more people should do the same. please help us adobe. bad scrolling in a flash app = nobody wanting the flash app...

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 3, 2012 11:06 AM   in reply to Chris Campbell

    Hello, Chris. Any word yet. Jerky scrolling on the iPhone always reminds me of this thread. It's not tasteful.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 3, 2012 1:50 PM   in reply to OMA2k

    Thanks for sharing, OMA2k. At least I know I have to look at my other options for now. I totally understand their point. Let's just hope they do it quickly, get it right and give us an intuitive API to call.

     

    Thanks once again.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 3, 2012 2:04 PM   in reply to Kipup

    Can a native extension work?  I tried the API at the below link and it was really smooth.  It is a bit limited but might be something that can be built on or used for small jobs.  Not sure how much you can customize this native list although I have seen it used and customized in native apps.  It auto rotates and fits nicely so at least a good replacement for any list selection.  Thought I would share.

     

    http://milkmidi.blogspot.com/2011/09/air30-native-extensions-example-p art1.html?m=1

     

    To add, this is more Android though, not sure if IOS has a similar mechanism.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 16, 2012 1:17 AM   in reply to OMA2k

    I feel your pain and I 100% agree. In the mean time, I created a couple of classes to mimic IOS scrolling in AIR. It's not perfect, but this should hold you off until native scrolling is leveraged in AIR.

     

    http://jacksonkr.com/content/ios-scrolling-flash

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 16, 2012 5:59 AM   in reply to OMA2k

    Hey OMA2k, Did you look into it? If you did, how did it perform?

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 30, 2012 2:08 AM   in reply to OMA2k

    I am weighing up using Flash CS5.5 and Air 3.2 for an iPad only project. The app is essentially like a newspaper and will involve scrolling content comprised of text and images.

     

    From reading this thread, it sounds like the scrolling behaviour could be pretty lousy? Can anyone reassure me that Flash and Air combination will perform this functionality to a reasonable standard. Apart from this issue, it would appear the Flash/Air implementation would be perfect for this app.

     

    Any advice appreciated.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 6, 2012 7:11 AM   in reply to OMA2k

    @OMA2k

     

    honestly I don't believe Adobe will manage to implement it soon (and "soon" in this context is rather for years than monthes). I wish I'm wrong.

    Even though your API prototype / usage example in bugbase looks pretty suitable. It's defenitely better then nothing, but still all this "Stage" things being rendered in a separate layers (apart from our DisplayList) could be a bit pinfull... And what about desktops or any other custom solutions that run with any kind of touch surfaces? Those developers also would love to have touch scrolling, but again I can hardly believe those OSs would provide this kind of functionality.

     

    Meanwhile you could try my solution=) It's 99% equal to native iOS scrolling (I've tested side-by-side, same "flick" leads to same time, position and dynamics of the motion). And it's also much more advanced in customization and reusable, unlike one mentioned above for example.

    source: https://github.com/fljot/TouchScrolling

    compiled demos: https://github.com/fljot/TouchScrolling/downloads

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 15, 2012 2:17 AM   in reply to fljot

    That works nice!

    but where   came this Events from?

                        import org.gestouch.events.TapGestureEvent;

                                  import org.gestouch.gestures.TapGesture;

     
    |
    Mark as:
1 2 Previous Next

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points