1

Is there somewhere the code of Google Search in Android? The xml-layout would be enough for me. Or maybe there is a possibility to add a button to the right of the EditText just like adding an icon in the corner? Thanks.enter image description here

John Conde
  • 217,595
  • 99
  • 455
  • 496
lomza
  • 9,412
  • 15
  • 70
  • 85
  • 1
    You can see [my answer **here**](http://stackoverflow.com/a/11093987/1050058). It's easy to change the icon to the right. Try yourself first. I'll add another snippet later with icon in the right – Trung Nguyen Apr 05 '13 at 01:37

2 Answers2

2
 <LinearLayout
        android:id="@+id/mainLayout"  
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/bar"//set back ground for total look
        android:orientation="horizontal" >            
        <EditText 
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:hint="Your hint"
             android:drawableRight="@drawable/search"//give your search icon
             android:id="@+id/editBox"
                         />            
        <Button                 
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:id="@+id/imageSpeak"
             android:background="@drawable/iconSpeak"//icon for speak
           />


</LinearLayout>     
Sanu
  • 455
  • 1
  • 6
  • 17
1

You have a LinearLayout with horizontal orientation where you can have an EditText, an ImageView with the search image and an ImageView for the microphone image. All of them should have the required background images cut in such way in order to seem as one. This is the general notion.

Regarding the source code, I can't help you!

Hope this helps!

Dimitris Makris
  • 5,183
  • 2
  • 34
  • 54