Navigation Drawer is blank, buttons work - android

So i was trying Navigation Drawer and Toolbar (Lollipop) for my first time and i've came a cross a problem that i'm struggling to find a solution.
I've managed to put it to work with Action Bar, but after i configured the new ToolBar to work with my app (and consequently taking action bar off), my navigation drawer is showing nothing but a white panel. Also, it seems that its buttons are working, because when i click a spot in the blank area, the navdrawer immediately closes.
layout_toolbar.xml
activity_homepage.xml
(Resume of) ActivityHomePage.java
The problem itself
Edit: Variables definition

Change in setAdapter(... this to getActivity().getBaseContext()

Related

Android bottom navigation bar hiding AdMob adverts

I've got an odd bug here with Xamarin Forms on my droid project. The bottom navigation bar (i.e the one with the home, back etc buttons) is hiding the AdMob adverts. If I choose to hide it by double tapping the circle (on the navigation bar), the advert appears, and when I double tap the circle again to make the navigation bar re-appear the ads display. But unless I hide the navigation bar, you would never know the advert is there!
I've tried setting various options under the SystemUIVisility and nothing is working. I even got the app into full screen mode and set the navigation bar to hidden but the adverts still did not appear.
Has anyone else had this issue and found a fix?
I'm using Forms 3.3.0.912540, Xamarin.Firebase.Ads 60.1142.1, Xamarin.GooglelayServices.Ads 60.1142.1
Maybe you can try this:
add property to your theme:
<item name="android:windowDrawsSystemBarBackgrounds">false</item>

Android Airbnb like Tabs

I am trying to figure out how airbnb has implemented its Tab Bar, it either seems they have hidden their actionbar and everything has been shifted onto a tab bar but then the right most user icon opens the navigation drawer which should be ideally on actionbar, Or everything is on action bar itself but then how can those 3 tabs/icons on left be implemented on actionbar. (Kindly refer attached image)
Can somebody put some light on how this can be implemented. How to go about it? Also are those 3 icons fragments or separate activities?
Here, is a library which makes your life simpler to implement TabBarView for actionbar tabs.
https://github.com/Mirkoddd/TabBarView
This should give you insight about how to use it for your app.

Nav Drawer on lollipop shows up behind system bar

On Lollipop, in the Gmail app, the nav drawer opens up behind the top status bar. My nav drawer layout is match_parent, but it stops below the status bar. Any idea how to accomplish this?
FYI I am using the new Toolbar...
Got this image off the internet, don't mind the image on the right..
Please see this answer:
https://stackoverflow.com/a/26440880/961759
Here's a nice open source example on how to accomplish the desired behaviour
https://github.com/kanytu/android-material-drawer-template

Setting Navigation Icon on Android ActionBar

So I'm working on adding ActionBarSherlock and the Navigation Drawer to a project that previously implemented a custom (very poorly written) "action bar". Instead of using fragments and a backstack of activities for navigation, some activities show and hide different layouts. (That is, suppose I am in a list mode and then select a button to go into an edit screen. The app currently hides the list layout and shows another layout.).
So I've added actionbar sherlock and a navigation drawer to all the activities. I want to be able to programmatically switch the navigation icon from the 3 lines to the arrow when certain buttons are pressed.
I can't figure out how to do this though. Any ideas?
Thanks!
The solution to this problem is to use the method:
setDrawerIndicatorEnabled(boolean enable)
inside the ActionBarDrawerToggle class.
After:
drawer.setDrawerListener(toggle);
Use this code:
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setHomeAsUpIndicator(R.drawable.select);
It depends how wedded you are to built-in actionbar artifacts. You can always redraw the current actionbar by inflating a layout of your choosing, then calling
getSherlockActivity().getSupportActionBar().setDisplayShowTitleEnabled(false);
getSherlockActivity().getSupportActionBar().setDisplayShowHomeEnabled(false);
getSherlockActivity().getSupportActionBar().setDisplayShowCustomEnabled(true);
// Inflate and do whatever you need to your view...
getSherlockActivity().getSupportActionBar().setCustomView(abView);
getSherlockActivity().getSupportActionBar().show();
When you want to go back to your standard (assuming you're using a DrawerLayout to do your navigation drawer), you can just set make a call to setDisplayShowCustomEnabled(false) (re-enable showHome and showTitle as you please).
As far as I know, customization of the back button can only be done via themes. Besides, swapping the drawer icon for the back icon (within the same Activity) doesn't make sense, since users would still be able to access the navigation drawer by sliding the left most edge to the right. It just wouldn't make sense.
If you absolutely need the back icon, then it would make the most sense to make that screen a new Activity since you would indeed be adding another "level" to the stack, which is what the back icon represents.

Can we implement a list on ActionBar using Sherlock Library in Android?

I am using Action Bar in my application to implement Tab Fragments. I am successful in it. But getting a small problem. I am in a need of a drop-down list at the Right Corner of the action bar and a search button. Please see the image:
You can see the red marked buttons that i need to show in Action bar and below the actionbar we have tab fragments. I am successful in generating the Fragments but getting problem in showing these buttons on Actionbar. Please help me
The overflow button is automatically generated but if you have a phone with hardware button it wont show up. You shouldn't try to force it to show up as it goes against ussual behaviour for people with phones that have a hardware button.

Categories

Resources