Olá Marina,
Uma possível solução seria:
Layout (XML):
Atribuir um id ao ImageView e um outro id para o SearchView.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".HomeActivity"
android:orientation="vertical"
android:background="@color/fundo">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@drawable/gradiente"
android:gravity="center_vertical">
<ImageView
android:id="@+id/imagem"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="9dp"
android:layout_marginTop="8.7dp"
android:contentDescription="@string/bem_vindo"
android:src="@drawable/logo_nav"
android:layout_gravity="center_horizontal" />
<SearchView
android:id="@+id/lupa"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8.7dp"
android:layout_marginBottom="8dp"
android:searchIcon="@drawable/ic_search_copy"
android:layout_gravity="end"
app:showAsAction="collapseActionView|ifRoom"
android:theme="@style/MyEditTextTheme.">
</SearchView>
</android.support.v7.widget.Toolbar>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Clique na busca para iniciar."
android:textSize="16sp"/>
</LinearLayout>
</RelativeLayout>
Java:
Recuperar a referência do ImageView e do SearchView, logo após implemente a Listener do SearchClickListener (Para sumir com a imagem) e do CloseListener (Para aparecer com a imagem).
public class TesteActivity extends AppCompatActivity {
private ImageView imagem;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_teste);
imagem = findViewById(R.id.imagem);
SearchView sw = findViewById(R.id.lupa);
sw.setOnSearchClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
imagem.setVisibility(View.INVISIBLE);
Toast.makeText(TesteActivity.this,"ola",Toast.LENGTH_SHORT).show();
}
});
sw.setOnCloseListener(new SearchView.OnCloseListener() {
@Override
public boolean onClose() {
imagem.setVisibility(View.VISIBLE);
return false;
}
});
}
}