Open kenyee opened 1 year ago
This looks like just a docs issue...doing this works fine and probably should be part of the mavericks-hilt module?
@AndroidEntryPoint
class HiltMavericksLauncherMockActivity : MavericksBaseLauncherActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (savedInstanceState == null) {
MavericksLauncherMockActivity.showNextMockFromActivity(
activity = this,
showView = { mavericksView ->
// Use whatever custom code you want to show your Mavericks View
setFragment(mavericksView as Fragment, commitNow = true)
},
)
}
}
}
From testing w/ a small Compose test app where there's no App theme, this activity can crash with this error:
Fix is to add an app theme but probably should be documented.
Also, when launching a Hilt Fragment MockableMavericksView from MavericksLauncherMockActivity, this happens:
Wrapping the MavericksLauncherMockActivity like this had the same error:
even when launching with "HiltMavericksLauncherMockActivity.show(this)"