android custom searchView rounded corners
Just give padding = corner radius
,because corners are hidden by Actual SearchView Background will set it to back ,so padding makes the trick
drawable/bg_white_rounded.xml:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#ffffff"/>
<corners android:radius="8dp"/>
<padding android:left="8dp"
android:bottom="8dp"
android:right="8dp"
android:top="8dp"/>
</shape>
While rajan ks (Thanks!) answer works, it doesn't resemble the design mockup a 100% (the padding naturally increases the SearchView's size while not increasing the contained EditText's size).
The solution I found is this: In the MainActivity.java, change search_edit_frame, search_plate and search_bar:
int searchFrameId = searchView.getContext().getResources().getIdentifier("android:id/search_edit_frame", null, null);
View searchFrame = searchView.findViewById(searchFrameId);
searchFrame.setBackgroundResource(R.drawable.bg_white_rounded);
int searchPlateId = searchView.getContext().getResources().getIdentifier("android:id/search_plate", null, null);
View searchPlate = findViewById(searchPlateId);
searchPlate.setBackgroundResource(R.drawable.bg_white_rounded);
int searchBarId = searchView.getContext().getResources().getIdentifier("android:id/search_bar", null, null);
View searchBar = findViewById(searchBarId);
searchBar.setBackgroundResource(R.drawable.bg_white_rounded);
That results in the SearchView looking exactly like the mockup.