What is the best approach to design a set of "guiding screens" for an android app? - android

I need to design introduction walk-through screens when my app launches. It can be done by simple ViewPager or horizontal scroll view (?) but the additional requirements which are hindering me from using these are
A lot of animations on each screen
Animations will be bound to scroll position (i.e., current stage on an animation will be determined by how much user has scrolled, and it should roll back animation if user scrolls back without finish gesture)
Some items need to animate across different screens (e.g., There is a box on first screen, when user scrolls to the next screen, the box becomes larger without moving and a graph (a part of second screen) also comes into display under it)
I dont know if I explained the scenario well enough so please ask for clarification in comments. I need just a direction to control/approach/library.
Thanks

I'd recommend this library : ShowCase
In this way, you can make interactive tutorial and walkthrough your app.
You can also take this library and add some functionality.

Use viewpager, for each fragment you can use different animation inside that fragment, each fragment is independent from other views/fragments
You can use horizontal scroll view but it will take extra time and difficult to code

Seems like a ViewPager has everything you need.

Related

Android implementation of tutorial screen

I'm planning to implement tutorial screen for Android app.
My plan is that tutorial screen looks like:
There are several screens and you can swipe between than. Every view has custom design. There are dots which represents every screen, and show what page are you watching now. I need good-looking transition with adequate animations.
This screen will be full screen activity.
I have found several Image Galery, but I don't want to slide between images, I need to slide between views.
I do not need exactly code for this. I need instruction in which way this can be done, and what elements I need to use in order to achieve targeted design.
Thanks in advance.
You'll want to use ViewPager in conjunction with Fragments, the instructions are on Android developer's website.

Three listviews in one screen

I have an app on iPhone with cascading design like on the picture, and I'd like to port it to Android. Is there a simple and recommended way to do this?
The section menu on the left (Section A, B,C,D) is the first that the user needs to select, then the user needs to pick a category in the middle (all, popular, pc, xbox,...), then he is presented with a list of articles for chosen category.
I could imagine doing it with three ListViews, but then the app could also listen to a swipe gesture to make the rightmost ListView "full screen", and hide the first two listviews. I could implement a swipe listener for the whole activity and set first two listviews' visibility to hidden, right?
Are my assumptions correct and would this be the right way to do this?
It could definetly work the way you explain it - if the design is good is another discussion. Personally I'm not a fan of throwing in endless amounts of data in one screen, when the space is as limited as it is on most mobile phones (I would probably do it with 3 different screens with a ListView on each)
Implementing the mentioned swipe gesture is doable and you could certainly just hide the two other ListViews with the function setVisibility( View.GONE ).
Hope it helps.
You might want to use the new fragments API, it's specifically built for this kind of thing (and it's compatible all the way down to Android 1.6). Also, as KasperMoerch says, putting all that info on a small screen can get ugly. Using fragments will make it easier for you to gradually increase the amount of information displayed as the screen size increases.
I'm not sure you can just listen for a swipe gesture over an entire activity like that. I think you have to wrap the fragments in a custom view (for example an extended LinearLayout) and do the swipe listening there. However, achieving a finger-tracking animation (i.e. where the rightmost pane follows the finger precisely as it swipes across) is a pretty daunting task (I wouldn't really know where to begin, probably in the custom view though). The best way (I think) to do it is to make a compromise and just start an animation (right-to-left slide) when you detect a swipe. However, the simplest solution is to not animate at all.
You can also take into consideration dropping the swipe gesture altogether and just providing an "expand" button.

How to implement swipe pages [duplicate]

I'd like to make a view in my Android app that flips between multiple views on a swipe/fling. I'd like it to behave more or less like the Android Launcher behaves when flipping between views. In particular,
It should flip views on swipe.
Generally a swipe will flip between one view and the next. It should not fling across all of the views.
If you swipe slowly, you should see the views dragging as you're swiping, eg. the way the Launcher does it.
I tried using a ViewFlipper with a GestureOverlayView as per Romain Guy's blog post here, but there's no indicator to the user as they're swiping. This makes discoverability difficult, which is presumably why Launcher does it the way they do.
I tried using a Gallery object, but when I swipe from left to right, there's a certain amount of momentum that flings the users through all the views rather than just taking them to the next view.
Is there a good way to accomplish what I'm trying to do?
I know this is an old question but ViewPager is created for this exact same purpose. ViewPager is part of android compatibility package and more can be found at http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html
Take a look at HorizontalPager. It's actually based on RealViewSwitcher, which in turn is based on the Android homescreen's code, and supports snap-to paging with drag feedback, as well as nested vertically-scrolling subviews. Gesture support for fast swipes isn't all it should be, but this may get you part of the way there (and I'd welcome contributions back).
EDIT: As of 2012 you're much better off using Google's ViewPager - it's in the compat library.
Check out SwipeView within this project https://github.com/fry15/uk.co.jasonfry.android.tools It does exactly what you want it to do and is super simple to implement.
#CommonsGuy extended ViewFlipper to do it.
https://github.com/commonsguy/cwac-viewswiper
Ihaven't used this one yet so im not sure if it moves with your finger like the launcher if not your going to have to make an OnTochListener to do it for you in me.ACTION_MOVE you will update the view to change its position. I'll post some sample code when I get home if you don't get another answer.

Android UI question. Implementation guidance

I'm working on implementing a UI for an Android application, and I wanted to ask if there is already something in the native widgets to accomplish most of what I'm trying to do.
The application that I'm working on performs 15 different tasks that can be divided into 3 different groups. (5 tasks per group) I have 18 icon images (3 for the groups and 15 for the individual tasks) and I want to be able to panel these icons (starting with the groups) like this:
I want the next icon visible below and above (if further down than the first icon) and swipe to go to the next icon
Once an icon is clicked, the panels slide to the side, exposing the next layer (the specific 5 tasks for the selected group) with the selected group still visible on the side:
From there, the user can tell at a glance what group they are in, what the current, next and previous selectable tasks are, and that by swiping right, they can get back to the group selection.
What types of widgets would I need to look into in order to accomplish something like this? Are there already pre-built lists to do these activities?
Thanks for any guidance!
You can get close with a LinearLayout of ImageView widgets and a ScrollView (vertical) or HorizontalScrollView. However, it will not give you the desired "centered image with bits of the previous/next images" effect -- it will be wherever the user positions it.
You can get close with a Gallery. However, it will not give you the vertical orientation, and it will always give you a fixed set of full options to the sides, not the partial images that you seek.
If it's gotta be the way you describe it, you'll have to roll it yourself. Gestures and animations should give you the desired effect.
Have you taken a look at ViewFlipper? http://developer.android.com/reference/android/widget/ViewFlipper.html This will give the side by side effect but you will have to make custom views for each group to populate it with the proper icons.
I'd use a ListActivity for the first 3 top level items. This won't give you the auto centering effect that you'll probably want, but you should be able to look at the Gallery source code, which can be found here, and make some modifications to the ListActivity so that it autocenters.
For the next items, I'd add an onClick and a GestureListener so you can navigate to another activity with another list view. Since you know where you came from (add some data to your Intent) you can set the color rectangle on the left so that it appears that you have just swiped the whole view left.
If you need to customize the animation, you can call this:
overridePendingTransition(R.anim.slide_left_entry, R.anim.slide_left_exit);
To make the yellow icon look good as it animates to the left, I'd change the list bounds (on the first activity) to have no margins, and change the yellow icon to have square right edges - This will make the small yellow rectangle on the next activity appear to be part of the first activity.
It should be relatively easy to mock this up to see if it's going to work properly for you.
Good luck!
EDIT: Ok, so I've made a basic project that does most of what you want.
here is the link to the eclipse project file. I was going to put the source up here, but there's a bit much to display.
What you still have to do:
Tweak animation
Configure the layer lists to display the correct colors
Add information to the top level intent for the sub-activity to be able to configure itself.
Quite a few other small things.
I think I've got the main stuff done. I've also added the gesture listener I talked about, although re-reading your question, you actually didn't ask for that. Since it's cool, I left it in.
Good Luck once again!!
Have you thought of launching Activities with different view configurations? You can switch from one activity to another with a gesture and you can Animate the views. What your UI looks like to me is a bunch of screens with affordances that show the other screens. So one Activity per screen maybe the same in different configurations or something like that.

Fragment animation question

In the Honeycomb sample gallery app, there's a layout that uses a two-fragment setup: one on the left of the screen showing titles, and one on the right showing the selected content. The titles fragment can be hidden with an animation.
During the hiding animation, the app asks the framework to recalculate the layout on every single frame. This way the content-fragment can take up the empty space that the titles-fragment leaves behind while it moves off-screen. This produces a great, dynamic effect, but is terribly inefficient I think.
I have fairly complex layouts, and I'd rather not ask the system to re-layout on every single frame. But I'd like a smooth transition animation like in the sample. Are there any alternative solutions to this problem?
P.s.: Just to be clear, I'm not asking how to do basic fragment-transaction animations. I know those, and AFAIK, those animations can't produce the behaviour found in that sample gallery app (another example would be the Honeycomb Gmail app, it has similar transitions that I'd like to achieve).
You can provide custom animations to the fragment system that do whatever you want. You can move the fragments around, fade them, etc. If these animations do not explicitly or implicitly cause layout (by changing properties that trigger a layout), then you should not get a layout on each animation frame. There maybe still be a layout call at the beginning/end as the fragments are added/removed, but the layout/invalidation process during the animation is up to your animations and what they do.

Categories

Resources