How to make a large Android toolbar with advanced features?

I want to put the search in the application toolbar. Thus, the user has a default toolbar with a search action icon. When you click on it, the toolbar should resize and increase or more alternative slides on top. It should display a search field and other controls in it. When you exit the search, the toolbar will resize to the default or pop up.

Google Maps uses something similar (not really, maybe it's not a toolbar at all, but it looks like) when you click on the blue float button:

Google Maps Navigation

Is there any best practice for this? How to do it?

+4
source share
1 answer

Create your own toolbar and add buttons, images, text image to it and add them to your actions.

<?xml version="1.0" encoding="utf-8"?>
   <android.support.v7.widget.Toolbar
   android:layout_height="150dp"
   android:layout_width="match_parent"
   android:background="@color/ColorPrimary"
   android:elevation="0dp"
   android:theme="@style/Base.ThemeOverlay.AppCompat.Dark"
   xmlns:android="http://schemas.android.com/apk/res/android" >
</android.support.v7.widget.Toolbar> 

and inside your business

Toolbar mToolbar = (Toolbar) findViewById(R.id.tool_bar);
this.setSupportActionBar(mToolbar);
+1
source

Source: https://habr.com/ru/post/1623233/


All Articles