I'm curious about this:

On Sun, Aug 19, 2012 at 9:17 AM, rmz76 <jeremy.de...@gmail.com> wrote:

> I'll give an example of such a feature: Horizontal view swiping. From the
> official Android Play store to the CNN App, this is probably the most
> common navigation we're seeing for dealing with menus on Android. It's
> beautiful, it's also a pain in ass to implement. After much searching I
> found an article on this on the official site
>
>
> http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html


> I can open the source example and understand what's going on but my
> question is why does it take pages and pages of foundation code to
> implement something that should be core?


There is literally 15 lines of code in that article, with another 3 lines
of XML.  Is that really pages and pages of foundation code?  The code is
implementing a FragmentPagerAdapter subclass with two methods, one to
report how many pages there are, and the second to generate the pages.  I'm
not sure how this could be simpler...?

It is true that for each page you do need to implement a Fragment subclass
that contains your UI, so there is a little more code for that.  But it's
not huge.  And if you really don't want to use fragments, that document
also shows that you can actually pretty easily implement a custom
PagerAdapter that generates raw views for the pages.

There must be something I am missing here...?


> View transitions are another good example. Let's say I want my view to
> fade in or out or that I want it to rotate in 3D (just do a simple flip or
> slide in and out). I don't understand why the developer has to go so low
> level to accomplish these sort of task. I'm hoping perhaps I missed
> something and that there are wrappers for common transforms, etc...
>

Fwiw view transitions are a lot easier starting with 3.0's new animation
framework.

-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to