Tag: android-toolbar

Correct implementation of SearchView in android toolbar

I have a problem with searchview implementation in android toolbar. The empty space padding is too big. I don’t want to hide other actions, but these actions are overlapped by SearchView. SearchView’s underline is not visible How do i fix issues mentioned above ? menu.xml <?xml version=”1.0″ encoding=”utf-8″?> <menu xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto”> <item android:id=”@+id/action_search” android:title=”@string/car_num” android:icon=”@drawable/ic_search_white_24dp” […]

Toolbar with Immersive Full-Screen Mode

Is it possible to use Immersive Mode on Android KitKat and Lollipop in combination with a Toolbar? Toolbar <android.support.v7.widget.Toolbar xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/toolbar” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:background=”?attr/colorPrimary” android:minHeight=”?attr/actionBarSize” app:popupTheme=”@style/ThemeOverlay.AppCompat.Light” app:theme=”@style/ThemeOverlay.AppCompat.Dark.ActionBar” /> hide Action Bar (Toolbar) // This snippet hides the system bars. // https://developer.android.com/training/system-ui/immersive.html private void hideSystemUI() { // Set the IMMERSIVE flag. // Set the content to […]

Android BottomNavigationView evenly spaced icons

I have a BottomNavigationView with five items. The default behavior is to only show the label of the selected item and the spacing between all five items differs depending on what item is selected. I would like a bottom bar more simular to a UITabBar on iOS. Is this possible with BottomNavigationView or can you […]

What is the proper way to use Toolbar and SwipeRefreshLayout?

I am trying to use a SwipeRefreshLayout and a toolbar but every time I use both the Progress Circle appears over the Toolbar wich is really bad in terms of design. I tried putting the SwipeRefreshLayout under the toolbar but that doesn’t work the progress circle still appears on top of it (above the status […]

Toolbar: IllegalStateException – configure your build for VectorDrawableCompat

I’m using Android Studio 2.1.2. I started a new project with minSdkVersion as 19. My activity extends AppCompatActivity. The project starts with an empty activity using a fragment. When previewing content_main.xml with API 24, all is good. when previewing API 19, I get the following rendering problem: The following classes could not be instantiated: – […]

Android “smoother” hiding of Toolbar when scrolling

I am using a Toolbar inside a ListFragment in Android and can hide/show it during scrolling. I implement AbsListView.OnScrollListener and use this code inside: @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { // Leave this empty } /** * Method to detect if the scroll status changed * * @param listView […]

Android: How to remove line between Toolbar and Statusbar

I am interested in having a uniform coloured toolbar and status bar. If I provide colorPrimary and colorPrimaryDark as the same colour this should be possible. I am getting the desired result using ActionBar but not with Toolbar. I will also be creating a navigation view so i need the status bar as transparent. Code […]

How to center action menu on toolbar

I have an application with a split action bar loading an action menu. I changed the actionbar for the new toolbar and replaced the split actionbar by an other toolbar used in standalone mode : Toolbar toolbarBottom = (Toolbar) findViewById(R.id.toolbarBottom); toolbarBottom.inflateMenu(R.menu.ab_one_cam); As specified in the documentation the action menu is pin to the right of […]

How to specify dark action mode with my theme

I know there are a couple of questions about styling the contextual action bar (ActionMode) piece of the action bar, but they don’t quite seem to address what I’m after. I’m using the Toolbar with a light theme and dark action bar. The Toolbar looks like I want it, but the action mode looks like […]

Collapsing Toolbar Title Disappear

I’m on design support library 23.0.1, and I’m using a Collapsing Toolbar Layout with parallax image. I don’t understand why when the Toolbar is totally collapsed (pinned) if a click on an action button (specifically I refresh its image), the title disappear. After that if I drop down the header to total expansion and reclick […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.