Is there an Android view/layout/widget that allows flinging/swiping between included views?

by E. » Tue, 07 Dec 2010 04:59:53 GMT


Sponsored Links
 I'm looking for a layout that includes different views and allows
switching between them, but unlike the tab view which switches
instantly and uses a large amount of screen real estate, allows the
user to fling/swipe between the views (ideally with small images
indicating how many views are available and which one is the current
one like, forgive me, iPhone apps display).

The HorizontalScrollView view allows flinging, but does not have a
separation between screens.

If there isn't a standard component that does this, is there another
that is often used for this purpose?

I realize I could implement this myself without too much trouble using
gestures, but I'd like to avoid reinventing the wheel (if, that is,
it's already been invented in this case) and defining my own
thresholds for the fling action means my app and other apps that try
to do the same thing do not provide a consistent user experience.



-- 



Re: Is there an Android view/layout/widget that allows flinging/swiping between included views?

by Mark Murphy » Tue, 07 Dec 2010 05:06:21 GMT


 


ViewFlipper, augmented with gesture detection, such as:

https://github.com/commonsguy/cwac-viewswiper

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://github.com/commonsguy 
 http://commonsware.com/blog  |  http://twitter.com/commonsguy 

Android App Developer Books:  http://commonsware.com/books 

-- 


Sponsored Links


RE: Is there an Android view/layout/widget that allows flinging/swiping between included views?

by Tommy » Tue, 07 Dec 2010 05:06:32 GMT


 Take a look at the ViewFlipper
 http://developer.android.com/reference/android/widget/ViewFlipper.html you 
can then impliment your own gesture dection for swipe/fling left/right and
switch the tabs accordingly using the viewflippers next feature.

-----Original Message-----
From: android-developers@googlegroups.com
[mailto:android-develop...@googlegroups.com] On Behalf Of E.
Sent: Monday, December 06, 2010 4:00 PM
To: Android Developers
Subject: [android-developers] Is there an Android view/layout/widget that
allows flinging/swiping between included views?

I'm looking for a layout that includes different views and allows switching
between them, but unlike the tab view which switches instantly and uses a
large amount of screen real estate, allows the user to fling/swipe between
the views (ideally with small images indicating how many views are available
and which one is the current one like, forgive me, iPhone apps display).

The HorizontalScrollView view allows flinging, but does not have a
separation between screens.

If there isn't a standard component that does this, is there another that is
often used for this purpose?

I realize I could implement this myself without too much trouble using
gestures, but I'd like to avoid reinventing the wheel (if, that is, it's
already been invented in this case) and defining my own thresholds for the
fling action means my app and other apps that try to do the same thing do
not provide a consistent user experience.



--


-- 



Other Threads

1. C/C++ Compiler on Android

hi,
i was wondering if there is a C or C++ compiler which could be run ON
the android which would let us compile codes on the phone itself
thanks

--~--~---------~--~----~------------~-------~--~----~

2. Why is my file not accesible at data/data ?

Hello,

I am trying to store an xml file.

When searching for solutions everyone suggests, that the just created
file has to be located at "/data/data/your_project_package_structure/
files/samplefile.txt"

Unfortunately neither on my emulator nor on the real device I can find
my file at this location....

Here is my code:

-------------------------------------------------------------------------------------------------
try {

                        URL u;

                        u = new URL("www.asdf.com");
                        HttpClient httpClient = new DefaultHttpClient();
                        HttpGet httpGet = new HttpGet(u.toString());
                        HttpResponse response = null;
                        response = httpClient.execute(httpGet);
                        HttpEntity entity = null;
                        if (response != null)
                                entity = response.getEntity();



                        InputStream is = entity.getContent();


                        FileOutputStream fos = openFileOutput("test.xml",
                                        Context.MODE_WORLD_WRITEABLE);
                        byte buf[] = new byte[32768];
                        int len;
                        while ((len = is.read(buf)) > 0) {
                                fos.write(buf, 0, len);
                        }
                        fos.close();
                        is.close();

// I can read the file here and put it in a textview, so the file
actually exists......

                } catch (Exception e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                }

-----------------------------------------------------------------------------------




--~--~---------~--~----~------------~-------~--~----~

3. App upgrade (with zipalign) causes force closes/disappearing of app icon

4. MapView Overlays

5. Is there a way for inter task communication

6. protected member variable mScrollX not accessible to subclasses of ViewGroup

7. Android 1.6 on ADP1 Force close