Actionbar Push up relative to screen - android

I have achieved hiding and showing the actionbar on scroll however I have a few problems with it. 1.) when I click on a tab in my application that requires the action bar to be show then return to the screen where the action bar can be hidden, there is a white space that is the exact size of the action bar under the action bar. 2.) There is an annoying flicker sometimes when the action bar is being hidden or unhidden.
I have seen on many google applications and applications such as instagram where the action bar pushes up relative to the position on screen. I have searched for libraries or ideas on how to implement that technique but have not found any? Is there any way I can at least get rid of the actionbar flicker or is there a library where I can implement the actionbar push up on scroll in my application?

Related

What are the different bars (status bar, action bar, navigation bar, tool bar etc.) available in android?

What are the different bars available in android and where are they located? Pics to support each type would be highly appreciated and helpful for beginners.
The status bar is where the clock, battery icon, notification icons, and the like reside. Most of the time, it is at the top of the screen. This is provided by the system; the app does not directly manipulate the contents of this bar.
The action bar (sometimes referred to as the app bar), if it exists for an activity, will be at the top of the activity's content area, typically directly underneath the status bar. Activities control whether there is an action bar and, if so, what it looks and works like.
The navigation or system bar is where the HOME, BACK, etc. buttons are. This is usually on the opposite side of the screen from the status bar, and therefore usually is at the bottom of the screen. This is provided by the system; the app does not directly manipulate the contents of this bar.
Avoid confusion and call them:
status bar
app bar (action bar is also ok)
navigation bar
 
 
Synonyms
action bar, app bar, and title bar all refer to the same thing. A Toolbar is a certain implementation of this bar.
One of the purposes of the status bar is to show notifications. Therefor some call it the notification bar.
The navigation bar is sometimes called the system bar, but the latter name should be avoided. It's too easy to mistakenly think that the system bar contains system information like battery level and network connection, while that's actually the job of the status bar to show these things. The term navigation bar is much clearer. I've also seen it getting called home bar.
Note that iOS also has a navigation bar where it serves a slightly different purpose compared to android - the purpose overlaps with android's navigation and action bars. Moreover, the navigation bar in iOS is typically (always?) located at the top, just below the status bar. See Navigation Bars on developer.apple.com.
 
References
Android bars at material.io (status bar, app bar, navigation bar)
Add the app bar at developer.android.com (app bar, action bar, Toolbar)
#android:style/Theme.NoTitleBar is a theme without an app bar. It was later called action bar in the code, e.g. in #android:style/Theme.Holo.NoActionBar. (title bar, action bar)
Navigation Bars in iOS on developer.apple.com (different purpose of navigation bar in iOS)

center align icons in titanium action bar for android

Is there any possible way to center align the action item icons that are shown in action bar of titanium app for android. I have searched a lot of places for this solution but had no luck. I want the action bar to look like the below image. Also tell me the way to not show app title in the action bar.
This is not a Titanium issue.
As you can read in Google's documentation, you won't be able to center anything in the ActionBar. Default (and expected) behaviour is to align action icons on the right (or left if reversed).
I don't recommend it, as it goes against Google's guidelines, but you will be able to center icons if you create a fake ActionBar:
- Remove native ActionBar from any window in your app
- Create a Titanium View that mimics the ActionBar
- Add icons and bind click events.
That's it, you are done.

Put android tabs in center of action bar

I tried Android action bar with tabs. As you see in this picture:
(source: persiangig.com)
My action bar looks good in phones but in tablets it is not right, the tabs stick left. This picture shows what I mean, how can I put the tabs to center in tablets too?
(source: persiangig.com)
The tabs are aligned left because, in Android, the action bar is used for both navigation and Activity- or Fragment-specific actions. You don't have any in this screenshot, but menu actions that are added to the action bar will be aligned to the right.
If you must have your tabs centered for some reason, you'll have to write your own action bar. I would recommend against this, since it's a lot of work to intentionally go against user expectations. Instead, use Android's built-in action bar layout and design your app to accommodate it.

android action bar with tabs below the screen

For my application , I'm planning to have a design as this:
http://img811.imageshack.us/img811/7045/problemel.png
-Design needs to have a title bar which is indeed the action bar in android. To overcome the compatibility issues, I used the sherlock action bar which is said to support older versions that dont have action bars. I havent tested yet for the older devices however.
-As far as I know, for navigation , we could rather use tabbed or dropdown list methods. I want to have constant tabs for every page in my app to stand below the page. This reflects the tabbed action bar, however I want it below not just under the action bar. I don't know how but youtube application somehow has it in the middle of the screen (if it's not a custom view). So how do we have tabs positioned in the bottom of the page?
-Also I want to have another menu, whose items depend on the page it's on. But the apperance will be the same for every page. In the picture on the left this menu has buttons as "Bt 1" ,"Bt 2". I dont want to repeat the same xml for every activity page, but I'm not sure how to achieve it without repeating. If the action bar allowed using both navigation tabs and the drop down list, I could put the items of this menu in the dropdown list just as the picture on the right (onto the gray button). But I guess it does not?!
Therefore I have to repeat the menu xml code in every page or is there another smart way?
Any advice will be appreciated.
This can be achieved not with tabs but by adding items to a linear_layout with a gravity of bottom but it is a bad practice as #D_Steve595 stated and should be avoided in android designs.
actionBar.setHomeButtonEnabled(false);
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayShowHomeEnabled(false);

Customize system combined bar /navigation bar for Android tablet (bottom)

I would like to override (add more buttons that would take me to several activities/fragments) to the system Navigation Bar on a tablet (according to this android ui-overview it is a "Combined bar" (for tablets)
Is there a way to do this?
I couldn't find a Navigation class in the android.app package, like ActionBar.
If adding buttons to the combined/navigation bar is not possible, I think there are several options, but I'd like to explore this first:
- use the action bar on top instead
- add a bottom bar above the navigation bar (not really fine, since it would be on top of the combined bar), like they are showing here:
Action Bar
Thanks a lot,
Cristian
Is there a way to do this?
No. The only thing you can add to the system bar are Notifications, which are not meant for this sort of navigation.
If adding buttons to the combined/navigation bar is not possible, I think there are several options, but I'd like to explore this first: - use the action bar on top instead - add a bottom bar above the navigation bar (not really fine, since it would be on top of the combined bar), like they are showing here: Action Bar
If you are referring to the section titled "Layout Considerations for Split Action Bars", that is referred to as a "split action bar", and can be enabled on an <activity> via android:uiOptions="splitActionBarWhenNarrow". However, that will only take effect for -small/-normal screens in portrait orientation. Your buttons will automatically be placed in the action bar at the top of the screen in other circumstances.

Categories

Resources