On Twitter for Android there is a bar at the top of the display where the user can swipe left and right between three different screens: Home, Discover and Activity (see image 1).
As they do so, the small blue line moves in real time to underneath the name of the screen that has been selected (see image 2).
When the user scrolls downwards, the entire bar collapses to the size of the blue line and it remains that way until the user scrolls up again.
Can this be achieved in xCode, ideally in Storyboard? If not, what is the best alternative?
Apologies for the massive images...
I have built this as an ios feature before (also an android dev so I know where you are coming from).
Here is the DIY way;
Use a UIScrollView and with the pagingEnabled property set to YES. Typically a UIPageControl is used along with it.
Here is a Library that does it for you;
https://github.com/monsieurje/ICViewPager
Hope this has answered all your problems.
Related
I am not the best at android programming so please correct any errors I make.
According to this developer.android.com.
Android view is:
This class represents the basic building block for user interface
components. A View occupies a rectangular area on the screen and is
responsible for drawing and event handling. View is the base class for
widgets, which are used to create interactive UI components (buttons,
text fields, etc.).
However, I have not found an article about how to get a full view. I mean as in an entire screen as a view. The image I used below is to show what I want to include in that view. I want to include everything on screen. Everything On that Screen. (I can't repeat enough). It includes the chat heads, background, and menu bar. Everything that is on screen.
I can't figure out how to get a view like that from a service or from an activity. Any help is appreciated. I don't have exact code because I don't know how to do this.
Edit:
I know that I am very bad at explaining, so if you are confused, I am going to explain what I want to do with my view.
So basically, I want to make a screen tapper that taps for you so you can king of "cheat" games like cookie clicker. Therefore I need a view that contains the entire screen so then I can fake "touches" on the screen.
Hope this cleared any confusion
So you have a few things to deal with. Generally, the menu bar (and possibly soft-key buttons on the bottom) will remain visible. However, you can hide the menu bar:
hide the top menu bar in my android device & Tablet
You may want gestures to allow users to see it. Or, since it appears you are building a game, you just leave it hidden until they hit "home" or "back" or "exit" or whatever.
The "chat heads" are a horrible idea, but some developers think they are awesome. You can see more about that here:
Creating a system overlay window (always on top)
You might find something like this will work (but if new notifications pop-up, it may not help):
http://goobbe.com/questions/1390940/how-to-close-cancel-dismiss-a-system-dialog-programmatically-android
I'm currently developing an app, I'm almost done but I think the UI is a bit plain, this is how the main menu looks like:
https://dl.dropbox.com/u/12945652/2012-12-28%2014.25.17.png
Select a method:
https://dl.dropbox.com/u/12945652/2012-12-28%2014.34.45.png
Settings:
https://dl.dropbox.com/u/12945652/2012-12-28%2014.34.37.png
Can anyone suggest how I can improve the user interface. I thought about adding 'settings' and 'help' to the action bar but this will make the screen feel more empty with fewer buttons.
Also at the moment, on a tablet the buttons are stretched across the entire screen, is there any UI patterns I should apply for them? I know you know can create a different XML file for higher resolutions but if I move the buttons to one corner there will be a lot of empty space.
At the moment I think the menu looks a bit plain and dull.
Thanks
When it comes to the tablet, try separating some of your Activities into Fragments and lay them side by side on the bigger screen.
As for your phone UI, I don't think it looked terrible. Sometimes simple and clean can be better. If you're going to continue to add functionality to the app you may want the extra space so you don't have to drastically change the UI to fit a couple of more items in.
As topic. Does any one know how to create that snap-settings-view the pulse app uses to its left?
I.e. When you swipe your finger from the left edge, the settings start to show from behind. See the left part of the image below. After a certain amount of movement, the settings menu snaps almost all the way to the right, but still shows the underlying view.
Any help is much appreciated
Regards
You have two options:
you can either do yourself with two fragments (one in front and one behind) and some touch even listener translating the drawer to open and close.
or use a library that is probably doing the same thing I've described. Something like this one: http://www.androidviews.net/2012/11/sliding-menu/
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.
I found a nice feature in Dolphin browser that brings another window from the side on a side-swipe. It's like the window is connected and revealed by swipe. See image below. Anyone knows how it is done?
I might be wrong but my guess would be they use a SlidingDrawer set to a lanscape orientation in a portrait layout (so it comes from the side rather than the top/bottom).
EDIT: Ok, I see now - I was rushing to go to work and didn't pick up on the fact the left hand side is displaced.
I suppose you could use two opposing SlidingDrawer views and force one to be initially open and the other initially closed. If their 'handle' views were identical and overlapped, then the effect would be similar to what you are seeing.
I'm not sure if the 'purists' would approve as the SlidingDrawer is meant to be used in an overlay fashion, i.e., it is meant to cover an existing view rather than to appear to move another out of the way. Then again, I've been coding for many years and often go on the principle that if it works why not use it?
Alternatively, there is some example code on smooth horizontal view scrolling in the answer to this question if it is of use. Horizontal Scrolling with fling gesture - ebook reader