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

Java null pointer exception while using google maps in Android
Reflection for Finding Classes in Android Application
How to improve memory usage with BitmapFactory.decodebyteArray()?
Send touch screen event to foreground activity (only from APK)
How to auto-pair to another Android device over Bluetooth without prompting for a pin?
I want to download an audio from the server
Can we add our application setting menu to the android device settings menu
Simulate Multi Touch in Android Emulator
Clossing expanded child views in ExpandableListActivity
Is this code Correct ? Send Email Via Android
java.lang.ClassCastException: android.app.Application cannot be cast to greendroid.app.GDApplication
Can I catch Exception in C in android NDK?
how to use Service
Android VideoView repetition
How to read more than one column in database by cursor and fill into a list?
Is there a way to set up an initial orientation for the Android device

Categories

HOME
facebook-oauth
polymer
c++11
ggplot2
ecmascript-6
pagination
numbers
fftw
apiblueprint
bookmarks
settings
accessibility
project
octave
filechannel
endpoint
libusb
parameter-passing
modbus-tcp
entitymanager
esoteric-languages
feathersjs
google-content-api
google-container-registry
identity-management
sigma.js
oledb
springfox
systemtime
interpreter
siri
appirater
delimiter
8051
user-defined-functions
reactjs.net
hunspell
sharding
numpy-broadcasting
imagenet
google-earth-engine
ogc
trigonometry
memory-mapping
vaadin-charts
stylecop
monkey-testing
ovf
term
yii2-api
mongotemplate
arq
payload
rocks
greatest-n-per-group
dup
pre-build-event
swizzling
cfchart
nservicebus5
stream-processing
query-by-example
halcon
linklabel
include-guards
ons-api
page.js
pax-exam
canalyzer
dronekit-android
cwrsync
actionfilterattribute
public-html
appserver
insight.database
parallel-testing
renderer
getopt
sbcl
rfc5322
scriptaculous
scrypt
merb
pagedown
twisted.web
preload
cuda-gdb
thttpd
httponly
jsr286
stress
virtualpathprovider
pinch
workflow-services
fsevents
u2netdk
entitydatasource
socketserver
timertask
undefined-index
dojo-dnd
fdf
cardspace

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