Hide action bar in overlay mode, in combination with tab strip - android

I have a layout with a custom tabstrip (com.astuetz.PagerSlidingTabStrip) and a ScrollView.
What I want to do is: when the user scrolls down, the action bar should hide (translate up); when the user scrolls up again, the action bar should reappear.
I don't want the ScrollView to slide along with the actionbar. For this I used the Window.FEATURE_ACTION_BAR_OVERLAY flag, placing it under the actionbar. All works nicely this way, except for the fact that my custom tabstrip is initially hidden under the actionbar, only to appear when I scroll down.
Is there any way the tabstrip could be located under the actionbar initially, and slide along up when the actionbar is hidden? The ScrollView should be located under the actionbar at all times.

Related

Programmatically scroll FAB back in

I am using coordinator layout with tabs, some of which (the tabs) contain a recycler view whilst some don't. All the tabs contain a floating action button. On scrolling the recycler view with the in one of the tabs, the floating action button is scrolled off by the coordinator layout. However, when I switch to the tab without the recycler view, and not being able to scroll, the tab remains scrolled off the screen (as it was done in the tab with a recycler).
How do I bring back the floating action button back when there is no way of scrolling in the tab without the recycler or any scroll mechanism?
Turned out to be a simply solution of translating the fab back in. floatingActionButton.setTranslationY(0.0f);

Move top navigation bar along with the screen

I think the way I was going is wrong. I wanted to create a top navigation bar which has 3 items so I created tabs and with a View Pager, I used 3 fragments for each tab. That way I can slide screens between each other, but the tabs are not moving along with the screen.
Can someone suggest me how to make top navigation bar items moving along with the screen is sliding?
This video explains exactly what I want. Please note how the top bar items are moving along with the screen.
https://drive.google.com/file/d/1OzDFR4VT_YyDumEZLOWtGZ-_5BLXAfK4/view

Getting the width of an action bar tab

I want to have an action bar with tabs and a viewPager for the body in order to be able to scroll the tabs.
I also want to have a view to "underline" the selected tab, and have it move when I scroll the viewPager.
Is there a way to get the size of the tab? Since I'm different devices the tabs may be scrollable I can't just divide the size of the screen by the amount of tabs..
I want it to be something like this:

Android action bar slide-out animation with RecyclerView

I want to achieve the following effect:
I have a RecyclerView with
android:fitsSystemWindows="true"
android:clipToPadding="true"
and while scrolling, the actionbar should hide by sliding out of the screen when "hit" by a certain element of my RecyclerView. As if it is being pushed out of the screen by the RecyclerView element. (So simply actionbar.hide() won't do). If the scroll stops with the actionbar having been pushed halfway out, it should hide completely. The actionbar should reappear when scrolling down again.
All in all nearly the same effect of the action bar in the newsstand app.

Hide tabs in viewpager

I am using Actionbarshelock library. I have three tabs. each tab contains a fragment. In my middle tab I have sliding drawer. I want to hide action bar as well as tabs from screen so that i can gain more space for sliding drawer. I hide the action bar using `hide' method but don't know how to hide the tabs and show only that middle fragment in whole screen with sliding drawer open.
I have tried
requestWindowFeature(com.actionbarsherlock.view.Window.FEATURE_ACTION_BAR_OVERLAY);
It hides tabs but it has to be set before adding fragments and setContentView.

Categories

Resources