android


How to show SearchView Outside/Below toolbar


LIKE THIS SCREENSHOT - the SearchBar outside/below-toolbar in snapdeal, flipkart app...
How to add searchbar below or outside the toolbar.. Please suggest with a layout...
This is most likely a custom component, you can use a button and switch it to an EditText with the icons you prefer or use a button directly to launch the search view:
For example to achieve this you can:
1) Have a drawable with radius of 2dp and use it as the background of your component
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#android:color/white" />
<corners android:radius="2dp" />
</shape>
2)Use it within your Button/EditText along with your two icons/mipmaps
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context="com.jsosa.myapplication.MainActivity">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/corners"
android:drawableBottom="12dp"
android:drawableEnd="#mipmap/ic_camera_alt_black_24dp"
android:drawablePadding="22dp"
android:drawableStart="#mipmap/ic_search_black_24dp"
android:gravity="left|center"
android:hint="Find your dil ki deal!"
android:padding="16dp" />
</RelativeLayout>
And you will get:
Then implement your business flow/logic on onClickListener etc
Hope it helps.
See if this works,
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="#style/AppTheme.PopupOverlay">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</android.support.v7.widget.Toolbar>
If it is over the toolbar then add margin top to your edittext to keep it below the toolbar title.

Related Links

Unable to find some resources on updating the compileSdkVersion to 24
Using Google Fit API to get steps with and without Fit App installed and possible working offline
how to adjust the size of app name in action bar?
How to get information about whether user deleted event from the inside Calendar or not
Cannot find module ‘gulp’
Customize seeekbar enpoints
Unable to save screenshot in gallery
How to add Fragment into Activity in Android
I have written code for uploading pdf, its working api level 17 but not on 23?
Android : 414 Request-URL too long when trying to send image to server
ViewDragHelper doesn't work properly
Draw paint over image not blank space using canvas
error 24 13 android studio faild to resolve
Disable “Save to inbox” dialog when sharing to Google Inbox via share intent
jni/Android.mk:8:curlLib/packages/Android/Android.mk: No such file or directory
ActionBar icon is not showing if setDisplayHomeEnabled is false

Categories

HOME
sonarqube
cobalt
dns
pyqt
powerpoint
obfuscation
devise
pclxl
replace
database-normalization
entity-framework-core
soa
polling
nstableheaderview
32bit-64bit
radgridview
pybossa
screen-readers
sar
displaytag
shared
mat
google-earth
constexpr
angularjs-material
r-grid
erb
github3.py
sql-delete
least-squares
protege4
docfx
imagenet
hackintosh
naming
apache-spark-dataset
stylecop
uiimage
gitlist
posixct
azure-cli
truezip
check-mk
baidu
pocketsphinx-android
rmongo
visual-studio-2008-sp1
cronexpression
custom-lists
actor-platform
preprocessor
neon
appscale
embedding
nservicebus5
lua-telegram-bot
query-by-example
sklearn-pandas
html-to-pdf
dynatree
poppler
zscript
jsvc
apache-commons-daemon
pseudo-class
cuba
rcaller
dct
dot42
terminate
accesscontrolexception
rolify
time.h
onload-event
fragmenttransaction
monotouch.dialog
faye
jsr286
apache-commons-dbutils
jquery-tools
google-floodlight
commerceserver2007
scrollbars
escrow
lemmatization
online-storage

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App