views:

116

answers:

2

I want to create a search box with the search button directly on the right of the EditText, without any spacing. Looks like the address bar on the internal Browser application.

Is it possible or do I need to create it myself?

 ________________________________________
(_________EditText______________|_Button_)

alt text

+1  A: 

Use Hierarchy Viewer to get the view from the Internal Browser

Pentium10
+1  A: 

I think it'll take a bit of customization; you can look at the source here in the open source tree:

http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/res/res/layout/search_bar.xml

The relevant bits are:

<view ...
  ...
  android:background="@drawable/textfield_search"
  ...
/>

<Button 
  ...
  android:background="@drawable/btn_search_dialog"
  ...
/>

As you can see, it's using custom drawables (i.e. not @android:drawable...).

And yes, this can all be found using Hierarchy Viewer, as per Pentium10's response.

Roman Nurik