Skip to content

Commit 9caa80d

Browse files
committedMar 7, 2021
Fixed a issue with the frameworks SearchView not getting created by the fallbackViewCreator
1 parent d288110 commit 9caa80d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
 

‎viewpump/src/main/java/dev/b3nedikt/viewpump/ViewPumpAppCompatDelegate.kt

+7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import android.util.Log
99
import android.view.LayoutInflater
1010
import android.view.View
1111
import android.webkit.WebView
12+
import android.widget.SearchView
1213
import androidx.core.view.LayoutInflaterCompat
1314
import dev.b3nedikt.viewpump.InflateRequest
1415
import dev.b3nedikt.viewpump.InflateResult
@@ -73,6 +74,12 @@ class ViewPumpAppCompatDelegate @JvmOverloads constructor(
7374
view = WebView(baseDelegate.attachBaseContext2(context), attrs)
7475
}
7576

77+
// The framework SearchView needs to be inflated manually,
78+
// as it is not inflated by the AppCompatViewInflater
79+
if (name == "SearchView") {
80+
view = SearchView(context, attrs)
81+
}
82+
7683
view
7784
}
7885
)

0 commit comments

Comments
 (0)
Please sign in to comment.