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.
Related
Not sure if I'm fighting an uphill battle but I'm currently struggling with AppBar, Fragments and Bottom Navigation Bars.
I have a MainActivity that's a list view with an AppBar. It's created as a fragment with the intention to add another bottom navigation bar here in the future.
For now, when an item in the list is clicked it navigates to a detail view fragment. Here I still have the AppBar which is what I want however I would like to add a Bottom Navigation Bar. However when I navigate to the next fragment I lose my bottom navigation bar.
Is there a way to keep maintain Bottom Navigation Bars within Fragments? I tried breaking them out into activities but discovered then I lose my AppBar.
Is what I'm doing above feasible in Android?
Ideally I'd like this:
Do you have different nav graphs for different fragments? You need to have the detail view fragment in the same nav graph as the bottom navigation view. You don't need to have another item in bottom navigation but declare fragments that you want with bottom navigation in the same nav graph.
In my app navigation drawer and viewpager are on same activity. I want to hide viewpager on clicking the item on navigation drawer.
I tried to set its visibility as GONE but it didn't work.
Pleaseeee tell me how to hide it thanks..
Tab.setVisibility(ViewPager.GONE); this is the line I wrote in my code
On clicking drawer item fragment containing webview opens
If you want to hide the ViewPager, you need to set it's visibility to View.GONE. Try
myViewPager.setVisibility(View.GONE);
instead. Currently you're setting the visibility on a Tab and not the ViewPager itself. They're 2 completely different things.
Inside my app I am using navigation drawer for my navigation. For each "page" I am using fragments (like showed here: http://developer.android.com/training/implementing-navigation/nav-drawer.html). It works completely fine, but now I want to create swipe tabs. I want to display those tabs only on one of the fragments. Problem is, that tabs are displayed on all fragments, which is ofcourse perfectly normal because tabs are inside action bar. What should I do, to display tabs only on one fragment?
From what I have understood, you are interested in showing action bar only in a particular fragment (not visible when swiping in subsequent fragments). The best way would be to code the action bar in fragment instead of using the action bar in main fragment and then creating swipe views (or sub fragments).
Hope it helps.
I've created SwipingTab with two Fragments. Now I want to add menu on bottom to be fixed, static. When user swipe between tabs, that menu should not moving. Where should I create that menu. I tried on main_layout.xml, but cannot. Any suggestion or idea ??
This is how I would set up the main view with tabs
Then the footermenu would inflate a fragment that will be used as a menu. You can follow this Android Tab Layout with Swipeable Views to add swapeable tabs
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.