Essentially I'm asking what techniques to use in Eclipse/Android Studio to make a UI that looks like the FaceBook UI withtabs on the bottom and their typical action bar on the top with content in the middle.
I've been kind of dealing with this issue for quite some time now and as I have a project deadline coming up figured it was finally time to get stackoverflow's opinion. What would be the best way of creating a social media app that models FaceBook's user interface. By this I am referring to something with the four tabs on bottom and search/back and profile buttons at the top, with some sort of fragment changing in the middle.
The solutions I have currently tried are using a split actionbar by forcing the top into a custom layout and the bottom into an options menu; however, this resulted in giving the options menu the drop down option instead of tabs (if there's a quick fix for this like setting a custom layout to it please lmk because this is my current setup).
For the main content view I originally tried using fragments and then switching between fragments by using functions and buttons inside the fragment class to switch views; however, this required childfragment manager, and for some reason that never worked properly, so instead I ended up switching activities instead of fragments which was horribly slow.
If you guys have any suggestions on how to do this properly please please either tell me how I would go about this, or better yet please show me some very good examples on how to do these things.
Thanks :)
u can use any proto typing tools to create UI . Some tools include Proto.io , Fluid ui etc
Related
I am new to writing Android apps, I have been using the internet and Android Studio to create an app for my club as a bit of fun and learn along the way. I have been watching videos, using tutorials and walkthroughs and I am getting to learn the basics.
However, I have got stuck. I used a drawer template from Android Studio and added the activities I needed and buttons on the main screen to the activities and they all worked fine, no overlapping. When I tried to link the drawer icons to the activities, rather than use the buttons on the main screen, they work, but the app (visually) puts the next activities content on top of the one before.
I cant find anything on the internet except something called backstacking, but that is described when the back arrow is used, my problem is to do with selecting an activity from the drawer menu. I have attached a picture to show what I mean. It gets worse the more menu items that are selected.
If anyone could help, it would be great!
If you are using XML root layout as a constraint layout maybe your constraints are missing. If you are using constraint layout set both top/bottom and left/right constraint.
If your constraints only top for example it is look good on desing but in device that dont know where to positioning left or right and automatically positioning 0 point to top.
When you click one any one menu item put the visibility of other images as gone like
visibility(View.GONE);
and the one selected to be visible
I have a design for an app that will have a row of buttons below the action bar. Each button will open a different fragment. I am aware of ViewPagers, but I do not want the swipe between fragments functionality. I know that I can disable this functionality, but at that point is it worth using a ViewPager? I know this is a pretty common design paradigm, so how do most apps handle this sort of thing?
It seems like the ViewPager will provide some nice functionality out of the box, like switching between fragments and what not. So, I am leaning towards using one, but was hoping someone could provide some feedback on this approach.
Thanks!
Keep the buttons in the layout of your main activity. Have them call a function lets say loadFragment(Button button) on click.
This function then handles switching of the fragments, and you can change the display of the navigation buttons inside this function itself to highlight the appropriate button or something equivalent.
Google Design is always worth the reading.
Check http://developer.android.com/design/patterns/swipe-views.html for details.
Personally I have used ViewPager with tab layout for swiping purpose and it makes it easy to me to synchronise the transitions ( tabs and pages) where I put a red circle to the tab corresponding to the viewed page. With this approach I got a clean separated code.
I am making my first android application with the ActionBarSherlock.
The application will always have an action bar consisting of 3 tabs (first tab selected by default).
The app could be extended for use with a tablet.
I have been searching the web, and following the android development guides, however I am finding a few things confusing.
The first tab screen will be a list view with a list of items, onitemselected should send the user to a screen which features more details about that item.
When should I use a fragment? Should each tab be a fragment?
Or, should each tab call a new activity, which consists of fragments?
And, if using fragments, should I place them in different classes, or embed them within an activity??
Appreciate any help, thanks.
you should probably read these two links first.
http://android-developers.blogspot.com/2011/09/preparing-for-handsets.html
http://android-developers.blogspot.com/2011/02/android-30-fragments-api.html
If you plan to make an app that work on both phone and tablet. It is a good idea to use a fragment, and then use a shell activity to wrap that fragment.
My experience with Fragments is mostly on ViewPager, so I am not entirely sure if it applies here.
In Android, you should use Fragments as much as possible. As a general rule of thumb, imagine you are translating the UI from phones to tablets, elements that can stay together in the same configuration should be a Fragment.
There is a Fragment subclass called ListFragment, so you might want to look into that for your first tab. (ListFragment is for Fragment like ListActivity is for Activity)
There is also a tutorial I found to deal with fragments. Did not really look into it but I hope it helps.
http://android.codeandmagic.org/2011/07/android-tabs-with-fragments/
As for ActionBar / ActionBarSherlock, I have absolutely no experience withit so someone might want to add to that.
I am trying to build an app in which I want to go to a new page through swipe-say. I have about 10 different pages and I want to go to these pages by swiping. Can I implement these pages as separate activities? Can I swipe from one activity to another? I strongly like to implement these pages in seperate xml files rather than creating everything in a single xml page. But as far as I have searched, there are no proper tutorials or blogs giving an appropriate example of a program implementing swipe. If possible, provide some working codes.
Thanks in advance.
It seems that a FragmentPager is what you want.
Examples and code on the linked page.
If you build for earlier versions of Android, the necessary code is included in the Android Support Package.
In Android, swipe is not identified as a particular gesture.
You can use a OnTouchListener registered on your view, and animate your view if the gesture exeeds a certain threshold.
You can then launch a new activity, or in a simpler way, use a viewFlipper.
Please try the attached link View flow.
I feel it will fit your needs perfectly. You can even create different xmls and inflate them into different view objects and then use the "view flow" to switch between them.
The "view flow" is perfect for handling both simple & complicated views. The flow indicator on the top of the screen is optional.
I hope it helps..
I am looking to create a navigation or menu bar similar to the functionality of the one at the top of the Fox News app. I started to code this myself using a Gallery but I'm not sure how to hide the left and right arrows when they are not needed. I was also wandering if you would have to use images for the menu items or if you could just use TextView or buttons so I could change the text without having to modify an image. I have seen this type of navigation on several apps and I tried all types of searches trying to find code examples but I must not be using the correct name for this type of scrollable menu because I couldn't find anything. If anyone has an example or provide a link to an article I would greatly appreciate it.
Look into HorizontalScrollView. It is a Layout that will handle the smooth scrolling and is likely to be much less of a hassle to work with than Gallery for this operation (I just added one for a similar reason).
To handle the left/right, look into setOnTouchListener. I'm not sure if you can get the current scroll position without making a new child class of HorizontalScrollView to access protected methods. There may be other ways, however - I didn't need to add buttons so I didn't investigate.