Could someone please provide an example of how to create a bar with buttons at the bottom within CoordinatorLayout? My app consists of AppBar (top) that contains buttons invoking application-wide action. However, I'd like to have a view specific buttons placed at the bottom.
I'm not sure if this UI design is still supported/recommended when using the new Disign Library and AppCompat.
Any suggestions will be greatly appreciated.
Thanks.
Related
I'm using Appcelerator's Titanium Alloy to work on an app that features both a tab-group on the bottom of the screen and a toolbar on the top of the screen. These both will appear after login, and won't change until logged out. I have been able to create both the tab-group and the toolbar, but am having trouble having them both on the screen.
The toolbar that I'm going for is something similar to this:
How to create a header bar with buttons in Titanium JS?
Just a guess, but I think the views of the tab-group and the toolbar are getting overlapped with one another. As such, I'm only able to see one at a time, always the one I set second (i.e. it is on top of the other bar).
Any help/ideas are greatly appreciated.
Thank you!
Edit:
I've looked into adjusting the leftNavButton and rightNavButton properties, but to use this method would require each individual tab to be adjusted, instead of the entire tab group. I'd like to find a way to add these buttons universally, as the top and bottom bars do not change with different views.
You can use the rightNavButtons and leftNavButtons properties of the windows to add buttons to the navigationBar that is showing at the top of the screen in a tabgroup.
I need to develop a custom layout for the action bar in Android.
I'm now stuck because I have no clue how to calculate the available space for my custom layout.
In the image, the red part is my custom layout, the blue part is the space occupied by the action buttons.
Clearly I need to know/calculate the size of the red part to be able to correctly position the elements in my custom action bar (for example center the title in the window or make sure not to overflow in the blue part).
How can I achieve this?
I couldn't find useful examples or a clear API in the Android documentation.
I think that anyone using the custom action bar layout must be facing this kind of problem, I'm a bit confused.
Or am I supposed not to use action buttons in this case? Perhaps I'm supposed to replicate the action buttons by myself?
Thanks in advance
Try using ToolBar instead of ActionBar. It will give you a lot more control over ActionBar elements than ActionBar.
Here is a simple tutorial about how to replace ActionBar with ToolBar and how you can customise it.
Material ToolBar
Possibilities are endless with ToolBar but my recommendation is to don't overdo anything.
As per my suggestion try to use the entire action bar by your custom layout. So that you can arrange all the things use it as a fragment inside a framelayout for all your screens so that the code can be reused for all your layouts.
i'm building an app and i really want to align buttons to the left using ABS (action bar sherlock) 4.0
I really like the dropbox interface as shown under this:
So, my question is: How can i align the buttons to the left and how can i jump between views in ViewFlow using buttons?
I've seen that people can add tabs to their ABS, but not with the title like the Dropbox interface.
Thanks.
Also if u need my sourcecode i will add it later if needed.
Regards
Stian Instebø
setCustomView() is the magic method you might be looking for.
To achieve the same layout shown in the Dropbox app, you would first call setDisplayShowHomeEnabled(false) on your ActionBar.
Next, you could define the layout for the buttons somewhere in XML. Once this is done, calling setCustomView(R.layout.my_actionbar_nav) will do the trick. (It will now be positioned on the left-hand side of the ActionBar).
It'll be your responsibility to wire up the appropriate onClick listeners for your layout's inner button Views, but it's not a bad price to pay for setting up custom navigation.
I want to display the Action Bar Vertically in my App.
I have found few examples for the Horizontal One, but not any for the Vertical One.
Can anyone please give me any example for the Vertical Action Bar.
Thanks,
David Brown
There's nothing in the Android UI design guide about a vertical ActionBar. But you might be able to coerce a similar effect by locking the display orientation, and then applying a rotation to the View in the content area. You also might be able to get somewhere by downloading the source code for ActionBarSherlock and implementing your own version of the ActionBar. But I don't recommend either of these solutions. If you're really that intent on putting actions on the side of your screen, I suggest either a small vertical LinearLayout, or implement one of the side navigation solutions as discussed in Android Facebook style slide.
i want to set a navigation bar ( with two buttons and a textview ) common for all activities of my application. I know it can be done by including a common layout file into each activity's layout file. But i have to use slide transition animation when a activity changes to another. Now if i follow the common layout file including process, then the navigation bar will also slide in or out with the activity's view where i want my navigation bar to be fixed when activities view slides in or out. Besides, the two buttons of the navigation bar should be set as i can hide them by using code to some activities. So now i need help badly on the problem, please give me a solution/suggestion/clue on the problem.Thanks in advance .....
Perhaps Fragments may be what you are looking for in this scenario.
Or thinking about it further maybe ViewFlipper with multiple layouts could also help in this case.