Или, может быть, это и есть
<img src="path" onclick="this.src='path'">
В то время как ответ rajan ks (Спасибо!) работает, он не похож на макет дизайна на 100% (заполнение естественно увеличивает размер SearchView, не увеличивая размер файла EditText).
Решение Я нашел следующее: В MainActivity.java измените search_edit_frame, search_plate и 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);
Это приводит к тому, что SearchView выглядит точно так же, как макет.
Просто дайте padding = corner radius
, потому что углы скрыты с помощью Actual SearchView Background, который установит его назад, поэтому добавление делает трюк
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>